View topic - mmap(), giving error "Not supported"

mmap(), giving error "Not supported"

anything that doesn't fit to other groups.

mmap(), giving error "Not supported"

Postby collin » Wed Jul 16, 2003 3:05 pm

Hi,

I have implemented a resource manager for a device with the basic functions (open, close, etc) and io_mmap(). The problem is that when i issue an mmap() call the return value say "Not supported". However I can map the physical memory using mmap_device_memory() instead. This is how my code looks like in main()

/* Register mmap() handler function */
io_funcs.mmap = io_mmap;

the function handler is declared as follows

int io_mmap(resmgr_context_t *ctp, io_mmap_t *msg, RESMGR_OCB_T *ocb);

I am using the following code to call the resource manager after open()

BT_UINT memorySize = 0x10000;

lpbase[cardnum] = (BT_U16BIT*) mmap((void*)0, memorySize, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);

if(lpbase[cardnum] == (BT_U16BIT*) -1) {
perror("mmap() failed");
close(fd);
return NULL;
}

Please could somebody tell me what i'm doing wrong.

//collin
collin
New Member
 
Posts: 3
Joined: Wed Jul 09, 2003 3:11 pm

Postby cdm » Wed Jul 16, 2003 7:10 pm

Are you doing your own io_mmap() handler? The defaults handlers in the clib all return ENOSYS.
cdm
QNX Master
 
Posts: 789
Joined: Fri Jul 05, 2002 9:38 am

Postby collin » Thu Jul 17, 2003 7:21 am

Thanks for the reponse. Yes, i'm doing my own io_mmap() handler (declared as in above post). It looks like the mmap() calls are not passed to my own handler, instead to the defaults.
collin
New Member
 
Posts: 3
Joined: Wed Jul 09, 2003 3:11 pm


Return to General Programming

Who is online

Users browsing this forum: No registered users and 1 guest