MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / _lwp_shminfo

Function _lwp_shminfo

components/lwp/lwp_shm.c:416–430  ·  view source on GitHub ↗

Get the virtual address of a shared memory in kernel. */

Source from the content-addressed store, hash-verified

414
415/* Get the virtual address of a shared memory in kernel. */
416void *_lwp_shminfo(int id)
417{
418 struct lwp_avl_struct *node_key = RT_NULL;
419 struct lwp_shm_struct *p = RT_NULL;
420
421 /* the share memory is in use only if it exsits in the binary tree */
422 node_key = shm_id_to_node(id);
423 if (!node_key)
424 {
425 return RT_NULL;
426 }
427 p = (struct lwp_shm_struct *)node_key->data; /* p = _shm_ary[id]; */
428
429 return (void *)((char *)p->addr - PV_OFFSET); /* get the virtual address */
430}
431
432/* A wrapping function: get the virtual address of a shared memory. */
433void *lwp_shminfo(int id)

Callers 1

lwp_shminfoFunction · 0.85

Calls 1

shm_id_to_nodeFunction · 0.85

Tested by

no test coverage detected