osVirtualToPhysical.c (281B)
1 #include "libultra_internal.h" 2 #include "PR/R4300.h" 3 4 uintptr_t osVirtualToPhysical(void *addr) { 5 if (IS_KSEG0(addr)) { 6 return K0_TO_PHYS(addr); 7 } else if (IS_KSEG1(addr)) { 8 return (K1_TO_PHYS(addr)); 9 } else { 10 return __osProbeTLB(addr); 11 } 12 }