mirror of
https://github.com/reactos/reactos.git
synced 2024-10-31 11:56:26 +00:00
4f0b8d3db0
svn path=/branches/ntvdm/; revision=59241
24 lines
609 B
C
24 lines
609 B
C
#include "ppcmmu/mmu.h"
|
|
#include "ppcmmu/mmuutil.h"
|
|
#include "mmuobject.h"
|
|
|
|
int mmunitest()
|
|
{
|
|
int ret;
|
|
int (*fun)(int ret) = (void *)0x80000000;
|
|
ppc_map_info_t info = { 0 };
|
|
volatile int oldmsr, msr = 0x2030;
|
|
__asm__("mfmsr 0\n\tstw 0,0(%0)" : : "r" (&oldmsr));
|
|
mmusetvsid(8, 9, 0);
|
|
info.flags = MMU_ALL_RW;
|
|
info.proc = 0;
|
|
info.addr = (vaddr_t)fun;
|
|
mmuaddpage(&info, 1);
|
|
__asm__("mtmsr %0" : : "r" (msr));
|
|
__asm__("mtsdr1 %0" : : "r" (HTABORG));
|
|
*((int *)fun) = 0x4e800020;
|
|
ret = fun(3);
|
|
__asm__("mtmsr %0" : : "r" (oldmsr));
|
|
return ret != 3;
|
|
}
|