57 #define MMUCODE 0x10000 58 #define HTABORG 0x20000 59 #define HTABSIZ 0x10000 60 #define PAGETAB 0x30000 62 #define PpcHashedPTE ((ppc_pteg_t*)(HTABORG)) 63 #define PpcPageTable ((ppc_map_t*)(PAGETAB)) 65 #define PPC_PAGE_ADDR(x) ((x) << 12) 66 #define PPC_PAGE_NUMBER(x) ((x) >> 12) 67 #define PPC_VSID_MASK 0xffffff 68 #define PPC_PAGE_MASK 0xfff 80 #define MMU_PAGE_ACCESS 0x40000000 81 #define MMU_PAGE_DIRTY 0x80000000 114 unsigned long long fpr[32];
125 int i, batu, batl, usebat[2] = { 0, 1 }, gotbat = 0, pc,
mask;
130 "mflr %0\n\t" :
"=r" (pc));
132 for(
i = 0, gotbat = 0;
i < 4;
i++)
149 mask = ~(0x1ffff | ((batu & 0xffc)>>2)<<17);
150 if(!(batu & 2) || ((batu &
mask) != (pc &
mask)))
151 usebat[gotbat++] =
i;
153 mask = ~(0x1ffff | (batl << 17));
154 if(!(batl & 0x40) || ((batu &
mask) != (pc &
mask)))
155 usebat[gotbat++] =
i;
162 SetBat(usebat[0], 0, batu, batl);
163 SetBat(usebat[0], 1, batu, batl);
166 SetBat(usebat[1], 0, batu, batl);
167 SetBat(usebat[1], 1, batu, batl);
177 #define MmuInit() _MmuInit(&_binary_mmucode_start, &_binary_mmucode_end) 224 return PPCMMU(0x106, 0, 0, 0);
244 return (
void *)
PPCMMU(0x10a, (
void *)vsid, (
void *)
mask, 0);
254 return PPCMMU(0x10c, 0,0,0);
267 static inline void MmuDbgInit(
int deviceType,
int devicePort)
269 PPCMMU(0x200, (
void *)deviceType, (
void *)devicePort, 0);
static void MmuCallbackRet()
struct _ppc_pte_t ppc_pte_t
static void MmuDbgInit(int deviceType, int devicePort)
char _binary_mmucode_start[]
GLuint GLuint GLsizei count
static void _MmuInit(void *_start, void *_end)
static void MmuRevokeVsid(int vsid, int mask)
unsigned long long fpr[32]
int(* MmuTrapHandler)(int trapid, ppc_trap_frame_t *trap)
void SetBat(int bat, int inst, int batHi, int batLo)
GLuint GLuint GLuint GLuint GLuint GLuint GLuint arg2
static MmuTrapHandler MmuSetTrapHandler(int trap, MmuTrapHandler cb)
char _binary_mmucode_end[]
__asm__("\t.globl GetPhys\n" "GetPhys:\t\n" "mflr 0\n\t" "stwu 0,-16(1)\n\t" "mfmsr 5\n\t" "andi. 6,5,0xffef\n\t" "mtmsr 6\n\t" "isync\n\t" "sync\n\t" "lwz 3,0(3)\n\t" "mtmsr 5\n\t" "isync\n\t" "sync\n\t" "lwz 0,0(1)\n\t" "addi 1,1,16\n\t" "mtlr 0\n\t" "blr")
GLuint GLuint GLuint GLuint arg1
struct _ppc_map_info_t ppc_map_info_t
struct _ppc_trap_frame_t ppc_trap_frame_t
static void MmuSetMemorySize(paddr_t size)
void GetBat(int bat, int inst, int *batHi, int *batLo)
static void MmuUnmapPage(ppc_map_info_t *info, int count)
GLuint GLuint GLuint GLuint GLuint GLuint GLuint GLuint GLuint GLuint arg3
static int PPCMMU(int action, void *arg1, void *arg2, void *arg3)
static void * MmuAllocVsid(int vsid, int mask)
struct _ppc_pteg_t ppc_pteg_t
#define memcpy(s1, s2, n)
struct _ppc_map_t ppc_map_t
static int MmuMapPage(ppc_map_info_t *info, int count)
static void MmuInqPage(ppc_map_info_t *info, int count)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
INT copy(TCHAR source[MAX_PATH], TCHAR dest[MAX_PATH], INT append, DWORD lpdwFlags, BOOL bTouch)
static HMODULE MODULEINFO DWORD cb
static int MmuTurnOn(void *fun, void *arg)
static paddr_t MmuGetPage()
static void MmuSetVsid(int start, int end, int vsid)
static void MmuDbgEnter(int signal)
void SetPhys(ULONG Addr, ULONG Data)
static paddr_t MmuGetFirstPage()
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *