From: Sepherosa Ziehau Date: Wed, 4 May 2011 05:20:59 +0000 (+0800) Subject: i386/ioapic: Use pmap_mapdev_uncacheable() to map I/O APIC X-Git-Tag: v2.12.0~685 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/5ffb2e13a2da96c424ee2204c5084e2c2db00659 i386/ioapic: Use pmap_mapdev_uncacheable() to map I/O APIC --- diff --git a/sys/platform/pc32/i386/mp_machdep.c b/sys/platform/pc32/i386/mp_machdep.c index 6d70f22a07..613625bc16 100644 --- a/sys/platform/pc32/i386/mp_machdep.c +++ b/sys/platform/pc32/i386/mp_machdep.c @@ -301,7 +301,6 @@ extern pt_entry_t *KPTphys; (SMP_MAXCPU * sizeof(struct privatespace) / PAGE_SIZE) extern pt_entry_t *SMPpt; -static int SMPpt_alloc_index = IO_MAPPING_START_INDEX; struct pcb stoppcbs[MAXCPU]; @@ -868,44 +867,11 @@ processor_entry(const struct PROCENTRY *entry, int cpu) return 0; } -/* - * Map a physical memory address representing I/O into KVA. The I/O - * block is assumed not to cross a page boundary. - */ void * ioapic_map(vm_paddr_t pa) { - vm_offset_t vaddr; - int pgeflag; - int i; - KKASSERT(pa < 0x100000000LL); - - pgeflag = 0; /* not used for SMP yet */ - - /* - * If the requested physical address has already been incidently - * mapped, just use the existing mapping. Otherwise create a new - * mapping. - */ - for (i = IO_MAPPING_START_INDEX; i < SMPpt_alloc_index; ++i) { - if (((vm_offset_t)SMPpt[i] & PG_FRAME) == - ((vm_offset_t)pa & PG_FRAME)) { - break; - } - } - if (i == SMPpt_alloc_index) { - if (i == NPTEPG - 2) { - panic("permanent_io_mapping: We ran out of space" - " in SMPpt[]!"); - } - SMPpt[i] = (pt_entry_t)(PG_V | PG_RW | PG_N | pgeflag | - ((vm_offset_t)pa & PG_FRAME)); - ++SMPpt_alloc_index; - } - vaddr = (vm_offset_t)CPU_prvspace + (i * PAGE_SIZE) + - ((vm_offset_t)pa & PAGE_MASK); - return ((void *)vaddr); + return pmap_mapdev_uncacheable(pa, PAGE_SIZE); } /*