diff options
author | Ralf Baechle <ralf@linux-mips.org> | 1998-08-25 09:12:35 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 1998-08-25 09:12:35 +0000 |
commit | c7fc24dc4420057f103afe8fc64524ebc25c5d37 (patch) | |
tree | 3682407a599b8f9f03fc096298134cafba1c9b2f /arch/i386/mm/ioremap.c | |
parent | 1d793fade8b063fde3cf275bf1a5c2d381292cd9 (diff) |
o Merge with Linux 2.1.116.
o New Newport console code.
o New G364 console code.
Diffstat (limited to 'arch/i386/mm/ioremap.c')
-rw-r--r-- | arch/i386/mm/ioremap.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/arch/i386/mm/ioremap.c b/arch/i386/mm/ioremap.c index b3fd2bdc5..740f4551f 100644 --- a/arch/i386/mm/ioremap.c +++ b/arch/i386/mm/ioremap.c @@ -90,13 +90,34 @@ void * __ioremap(unsigned long phys_addr, unsigned long size, unsigned long flag void * addr; struct vm_struct * area; - if (phys_addr < virt_to_phys(high_memory)) + /* + * Don't remap the low PCI/ISA area, it's always mapped.. + */ + if (phys_addr >= 0xA0000 && (phys_addr+size) <= 0x100000) return phys_to_virt(phys_addr); + + /* + * Don't allow anybody to remap normal RAM that we're using.. + */ + if (phys_addr < virt_to_phys(high_memory)) + return NULL; + + /* + * Mappings have to be page-aligned + */ if (phys_addr & ~PAGE_MASK) return NULL; size = PAGE_ALIGN(size); + + /* + * Don't allow mappings that wrap.. + */ if (!size || size > phys_addr + size) return NULL; + + /* + * Ok, go for it.. + */ area = get_vm_area(size); if (!area) return NULL; |