Macros | |
#define | mpshm_unmap(shm) mpshm_detach(shm); |
Functions | |
int | mpshm_init (mpshm_t *shm, key_t key, size_t size) |
int | mpshm_destroy (mpshm_t *shm) |
void * | mpshm_attach (mpshm_t *shm, int shmflg) |
int | mpshm_detach (mpshm_t *shm) |
int | mpshm_control (mpshm_t *shm, int cmd, void *buf) |
uintptr_t | mpshm_virt2phys (mpshm_t *shm, void *vaddr) |
void * | mpshm_phys2virt (mpshm_t *shm, uintptr_t paddr) |
int | mpshm_remap (mpshm_t *shm, void *vaddr) |
#define mpshm_unmap | ( | shm | ) | mpshm_detach(shm); |
Unmap mapped memory
It's just an alias of mpshm_detach().
int mpshm_init | ( | mpshm_t * | shm, |
key_t | key, | ||
size_t | size | ||
) |
Initialize MP shared memory
mpshm_init() initialize MP shared memory object and allocate actual shared memory area.
[in,out] | shm | MP shared memory object |
[in] | key | Unique object ID |
[in] | size | Size of shared memory |
-EINVAL | Invalid argument |
-ENOMEM | No memory space left |
int mpshm_destroy | ( | mpshm_t * | shm | ) |
Destroy MP shared memory
[in,out] | shm | MP shared memory object |
-EINVAL | Invalid argument |
void * mpshm_attach | ( | mpshm_t * | shm, |
int | shmflg | ||
) |
Attach MP shared memory
mpshm_attach() is map shared memory to virtual address. User must be call this function to use allocated shared memory.
[in,out] | shm | MP shared memory object |
[in] | shmflg | Flags |
int mpshm_detach | ( | mpshm_t * | shm | ) |
Detach MP shared memory
[in,out] | shm | MP shared memory object |
-EINVAL | Invalid argument |
int mpshm_control | ( | mpshm_t * | shm, |
int | cmd, | ||
void * | buf | ||
) |
MP shared memory control
mpshm_control() now provides RAM power control for managed memory area. User can be control power mode to on, off and retention. ASMP framework performs power control automatically, so typically user unnecessary to power control manually.
[in,out] | shm | MP shared memory object |
[in] | cmd | Command |
[in,out] | buf | Arguments for cmd |
-ENOTTY | Unknown command |
uintptr_t mpshm_virt2phys | ( | mpshm_t * | shm, |
void * | vaddr | ||
) |
Convert virtual address to physical address
[in,out] | shm | MP shared memory object |
[in] | vaddr | Virtual address |
void * mpshm_phys2virt | ( | mpshm_t * | shm, |
uintptr_t | paddr | ||
) |
Convert physical address to virtial address
[in,out] | shm | MP shared memory object |
[in] | paddr | Physical address |
int mpshm_remap | ( | mpshm_t * | shm, |
void * | vaddr | ||
) |
Map allocated memory into specified virtual address
[in,out] | shm | MP shared memory object |
[in] | vaddr | Virtual address |
-EINVAL | Invalid argument |
-ENOENT | Virtual space is in use |