amd64: Change the way I/O APIC's are mapped.
authorJordan Gordeev <jgordeev@dir.bg>
Sat, 4 Jul 2009 19:38:53 +0000 (22:38 +0300)
committerJordan Gordeev <jgordeev@dir.bg>
Mon, 6 Jul 2009 12:55:50 +0000 (15:55 +0300)
sys/platform/pc64/amd64/mp_machdep.c

index 64e31cf..3155e0c 100644 (file)
@@ -2042,37 +2042,9 @@ default_mp_table(int type)
 void *
 permanent_io_mapping(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 | 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);
 }
 
 /*