Partially fixed up tree after merge from HEAD. More to do.
[reactos.git] / reactos / boot / freeldr / freeldr / windows / conversion.c
index a42184b..7848dc4 100644 (file)
 
 #include <freeldr.h>
 
+#ifdef _M_PPC
+#include <of.h>
+#include <mmu.h>
+#endif
 //#include <ndk/ldrtypes.h>
 
 #define NDEBUG
 PVOID
 VaToPa(PVOID Va)
 {
+#ifdef _M_IX86
        return (PVOID)((ULONG_PTR)Va & ~KSEG0_BASE);
+#elif defined(_M_PPC)
+       return (PVOID)PpcVirt2phys((ULONG_PTR)Va,0);
+#endif
 }
 
 PVOID
 PaToVa(PVOID Pa)
 {
+#ifdef _M_IX86
        return (PVOID)((ULONG_PTR)Pa | KSEG0_BASE);
+#elif defined(_M_PPC)
+       return (PVOID)ofw_phys2virt(mmu_handle,0,(ULONG_PTR)Pa,0);
+#endif
 }
 
 VOID