Hi,
On Fri, Mar 20, 2015 at 01:34:29PM +0100, Pascal Brand wrote: [...]
+struct tee_shm *tee_shm_alloc(struct tee_device *teedev, size_t size,
u32 flags)+{
struct tee_shm *shm;void *ret;struct mutex *mutex;struct list_head *list_shm;if (!(flags & TEE_SHM_MAPPED)) {dev_err(teedev->dev, "only mapped allocationssupported\n");
return ERR_PTR(-EINVAL);}if ((flags & ~(TEE_SHM_MAPPED|TEE_SHM_GLOBAL_DMA_BUF))) {dev_err(teedev->dev, "invalid shm flags 0x%x", flags);return ERR_PTR(-EINVAL);}shm = kzalloc(sizeof(struct tee_shm), GFP_KERNEL);if (!shm) {dev_err(teedev->dev, "failed to allocate structtee_shm\n");
return ERR_PTR(-ENOMEM);}shm->flags = flags;if (flags & TEE_SHM_GLOBAL_DMA_BUF) {int order = get_order(size);shm->size = (1 << order) << PAGE_SHIFT;Should we save the original size (the requested one)?
Let's wait with that until we need it. I'd like to keep everything as lean as possible in the first version.
+int tee_shm_va2pa(struct tee_shm *smh, void *va, dma_addr_t *pa)
shm. same below
Ah, thanks.
+/**
- tee_register() - Register a specific TEE driver
- @dev:
- @ops: Operations on a specific TEE device
Wrong list of arguments.
Will fix.
- Once the specific driver has been probed it registers in the generic
- driver with this function.
- @returns a pointer to struct tee_device
- */
+struct tee_device *tee_register(const struct tee_desc *teedesc,
struct device *dev, void *driver_data);
-- Regards, Jens