Lines Matching refs:shared_memory

208 			TEEC_SharedMemory *shared_memory)  in TEEC_AllocateSharedMemory()  argument
213 context->devname, context->fd, shared_memory->size); in TEEC_AllocateSharedMemory()
215 if ((context == NULL) || (shared_memory == NULL)) { in TEEC_AllocateSharedMemory()
220 if (shared_memory->flags != 0) { in TEEC_AllocateSharedMemory()
225 shared_memory->buffer = NULL; in TEEC_AllocateSharedMemory()
226 shared_memory->alloc_buffer = 0; in TEEC_AllocateSharedMemory()
229 shared_memory->size, shared_memory->flags); in TEEC_AllocateSharedMemory()
231 shared_memory->buffer = OpteeClientMemAlloc(shared_memory->size); in TEEC_AllocateSharedMemory()
232 if (shared_memory->buffer == NULL) { in TEEC_AllocateSharedMemory()
237 shared_memory->alloc_buffer = shared_memory->buffer; in TEEC_AllocateSharedMemory()
250 void TEEC_ReleaseSharedMemory(TEEC_SharedMemory *shared_memory) in TEEC_ReleaseSharedMemory() argument
253 shared_memory->size); in TEEC_ReleaseSharedMemory()
255 if (shared_memory == NULL) in TEEC_ReleaseSharedMemory()
258 if (shared_memory->buffer == NULL) in TEEC_ReleaseSharedMemory()
261 if (shared_memory->alloc_buffer != 0) { in TEEC_ReleaseSharedMemory()
262 OpteeClientMemFree(shared_memory->alloc_buffer); in TEEC_ReleaseSharedMemory()
263 shared_memory->alloc_buffer = 0; in TEEC_ReleaseSharedMemory()
266 shared_memory->buffer = NULL; in TEEC_ReleaseSharedMemory()
267 shared_memory->size = 0; in TEEC_ReleaseSharedMemory()
280 TEEC_SharedMemory *shared_memory) in TEEC_RegisterSharedMemory() argument
284 if ((context == NULL) || (shared_memory == NULL)) { in TEEC_RegisterSharedMemory()
289 if (shared_memory->buffer == NULL) { in TEEC_RegisterSharedMemory()
294 shared_memory->alloc_buffer = 0; in TEEC_RegisterSharedMemory()
296 phys_addr_t start = (phys_addr_t) shared_memory->buffer; in TEEC_RegisterSharedMemory()
300 TempSharedMemory.size = shared_memory->size; in TEEC_RegisterSharedMemory()
301 TempSharedMemory.flags = shared_memory->flags; in TEEC_RegisterSharedMemory()
309 shared_memory->alloc_buffer = TempSharedMemory.alloc_buffer; in TEEC_RegisterSharedMemory()