--- Gnu-Mach/i386/i386at/mem.c 2020/09/02 04:49:24 1.1.1.2 +++ Gnu-Mach/i386/i386at/mem.c 2020/09/02 04:55:40 1.1.1.3 @@ -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) + + /* + * 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 if (off >= 0x100000 && off < phys_last_addr) - return -1; - else - return i386_btop(off); + } + +out: + return i386_btop(off); }