ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

mmutest.c
Go to the documentation of this file.
00001 #include "ppcmmu/mmu.h"
00002 #include "ppcmmu/mmuutil.h"
00003 #include "mmuobject.h"
00004 
00005 int mmunitest()
00006 {
00007     int ret;
00008     int (*fun)(int ret) = (void *)0x80000000;
00009     ppc_map_info_t info = { 0 };
00010     volatile int oldmsr, msr = 0x2030;
00011     __asm__("mfmsr 0\n\tstw 0,0(%0)" : : "r" (&oldmsr));
00012     mmusetvsid(8, 9, 0);
00013     info.flags = MMU_ALL_RW;
00014     info.proc = 0;
00015     info.addr = (vaddr_t)fun;
00016     mmuaddpage(&info, 1);
00017     __asm__("mtmsr %0" : : "r" (msr));
00018     __asm__("mtsdr1 %0" : : "r" (HTABORG));
00019     *((int *)fun) = 0x4e800020;
00020     ret = fun(3);
00021     __asm__("mtmsr %0" : : "r" (oldmsr));
00022     return ret != 3;
00023 }

Generated on Sat May 26 2012 04:35:16 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.