int io_mmap ( resmgr_context_t *ctp,
io_mmap_t *msg,
RESMGR_OCB_T *ocb )
Classification: I/O
Default handler: iofunc_mmap_default()
Helper functions: iofunc_mmap()
Client functions: mmap(), munmap(), mmap_device_io(), mmap_device_memory()
Messages: _IO_MMAP
Data structure:
struct _io_mmap {
uint16_t type;
uint16_t combine_len;
uint32_t prot;
uint64_t offset;
struct _msg_info info;
uint32_t required_prot;
uint32_t zero [5];
};
struct _io_mmap_reply {
uint32_t zero;
uint32_t allowed_prot;
uint64_t offset;
int32_t coid;
int32_t fd;
};
typedef union {
struct _io_mmap i;
struct _io_mmap_reply o;
} io_mmap_t;
Description: Allows the process manager to mmap() files from your resource manager. Generally, you should not code this function yourself (use the defaults provided by iofunc_func_init()—the default handler), unless you specifically wish to disable the functionality (for example, a serial port driver could choose to return ENOSYS, because it doesn't make sense to support this operation).
Only the process manager will call this resource manager function.
Note that a side effect of the process manager's calling this function is that an OCB will be created (i.e., iofunc_ocb_calloc() will be called), but this should have no consequences to a properly implemented resource manager.
Returns: The status via the helper macro _RESMGR_STATUS().