Messages in this thread | | | Date | Sun, 10 Oct 1999 22:53:16 -0400 | From | root <> | Subject | mmapping of page 0xfffff000 impossible ? |
| |
why isn't it possible to mmap the very last page in 32bit address space ?
strace output for 2.2.12 of the small sample program below: open("/dev/mem", O_RDWR) = 3 mmap(NULL, 61440, PROT_READ, MAP_SHARED, 3, 0xffff0000) = 0x4011b000 mmap(NULL, 61441, PROT_READ, MAP_SHARED, 3, 0xffff0000) = -1 EINVAL (Invalid argument)
------------------------------------------------------------------------------- #include <unistd.h> #include <sys/mman.h> #include <fcntl.h> main() { int f; void *p;
f = open("/dev/mem", O_RDWR);
/* this will work ... */ p = mmap(NULL, 0xf000, PROT_READ, MAP_SHARED, f, 0xffff0000);
/* this one won't :-( */ p = mmap(NULL, 0xf001, PROT_READ, MAP_SHARED, f, 0xffff0000); } -------------------------------------------------------------------------------
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |