コード例 #1
0
ファイル: tee_api_objects.c プロジェクト: AIdrifter/optee_os
TEE_Result TEE_WriteObjectData(TEE_ObjectHandle object, void *buffer,
			       uint32_t size)
{
	TEE_Result res;

	if (object == TEE_HANDLE_NULL) {
		res = TEE_ERROR_BAD_PARAMETERS;
		goto out;
	}

	if (size > TEE_DATA_MAX_POSITION) {
		res = TEE_ERROR_OVERFLOW;
		goto out;
	}

	res = utee_storage_obj_write((unsigned long)object, buffer, size);

out:
	if (res != TEE_SUCCESS &&
	    res != TEE_ERROR_STORAGE_NO_SPACE &&
	    res != TEE_ERROR_OVERFLOW &&
	    res != TEE_ERROR_CORRUPT_OBJECT &&
	    res != TEE_ERROR_STORAGE_NOT_AVAILABLE)
		TEE_Panic(0);

	return res;
}
コード例 #2
0
ファイル: tee_api_objects.c プロジェクト: hsibert/optee_os
TEE_Result TEE_WriteObjectData(TEE_ObjectHandle object, void *buffer,
                               size_t size)
{
    TEE_Result res;

    if (object == TEE_HANDLE_NULL)
        TEE_Panic(0);

    res = utee_storage_obj_write(object, buffer, size);

    if (res != TEE_SUCCESS && res != TEE_ERROR_STORAGE_NO_SPACE)
        TEE_Panic(0);

    return res;
}