Get the virtual address of a shared memory in kernel. */
| 414 | |
| 415 | /* Get the virtual address of a shared memory in kernel. */ |
| 416 | void *_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. */ |
| 433 | void *lwp_shminfo(int id) |
no test coverage detected