loader - Use PTOV() to convert physical addresses to virtual addresses.
authorAntonio Huete Jimenez <tuxillo@quantumachine.net>
Sat, 7 Aug 2010 19:37:37 +0000 (21:37 +0200)
committerAntonio Huete Jimenez <tuxillo@quantumachine.net>
Sun, 8 Aug 2010 13:56:21 +0000 (15:56 +0200)
Dragonfly-bug: <http://bugs.dragonflybsd.org/issue1683>
Submitted-by: Sascha Wildner <swildner@>
Obtained-from: FreeBSD

sys/boot/pc32/libi386/biosacpi.c

index 87d8902..8ac95d2 100644 (file)
@@ -30,6 +30,8 @@
 #include <stand.h>
 #include <machine/stdarg.h>
 #include <bootstrap.h>
+#include <btxv86.h>
+#include "libi386.h"
 
 #include "acdragonfly.h"
 #include "acconfig.h"
@@ -93,7 +95,7 @@ biosacpi_find_rsdp(void)
     uint16_t           *addr;
 
     /* EBDA is the 1 KB addressed by the 16 bit pointer at 0x40E. */
-    addr = (uint16_t *)0x40E;
+    addr = (uint16_t *)PTOV(0x40E);
     if ((rsdp = biosacpi_search_rsdp((char *)(*addr << 4), 0x400)) != NULL)
        return (rsdp);
 
@@ -113,7 +115,7 @@ biosacpi_search_rsdp(char *base, int length)
 
     /* search on 16-byte boundaries */
     for (ofs = 0; ofs < length; ofs += 16) {
-       rsdp = (ACPI_TABLE_RSDP *)(base + ofs);
+       rsdp = (ACPI_TABLE_RSDP *)PTOV(base + ofs);
 
        /* compare signature, validate checksum */
        if (!strncmp(rsdp->Signature, ACPI_SIG_RSDP, strlen(ACPI_SIG_RSDP))) {