diff options
Diffstat (limited to 'i386/i386at/mem.c')
-rw-r--r-- | i386/i386at/mem.c | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/i386/i386at/mem.c b/i386/i386at/mem.c index f239afac..eac2549f 100644 --- a/i386/i386at/mem.c +++ b/i386/i386at/mem.c @@ -36,12 +36,24 @@ dev_t dev; vm_offset_t off; vm_prot_t prot; { + struct vm_page *p; + if (off == 0) return 0; - else if (off < 0xa0000) - return -1; - else if (off >= 0x100000 && off < phys_last_addr) + + /* + * The legacy device mappings are included in the page tables and + * need their own test. + */ + if (off >= 0xa0000 && off < 0x100000) + goto out; + + p = vm_page_lookup_pa(off); + + if (p != NULL) { return -1; - else - return i386_btop(off); + } + +out: + return i386_btop(off); } |