Segment Register problem on PSIM
Quanming Shi
shiquanming10 at gmail.com
Wed Aug 17 17:38:54 UTC 2011
I am working on the MMU protect project of GSOC2011 using the PSIM
environment(Powerpc 6xx).
When I try to set the Ks and Kp bit of SR(segment register), the value never
changed successfully.
I use the functions defined in spr.h like:
_write_SR(0, 0x60000000) ;/*I want to set the Ks and Kp bit*/
_read_SR(0x51000) ;
the asm actually used is
/*write*/
asm volatile("mtsrin %0,%1" : : "r"(val), "r" (va): "memory");
/*read*/
asm volatile("mfsrin %0,%1" : "=r" (val): "r" (va));
when I use these SR functions , the MSR value is 0xa072 (or 0x2042), the
MSR[PR] bit which control the Privilege level is 0, as expected.
But the return of _read_SR is always 0. Is there anything I should notice
when change or get the SR value?
Any feedback will be welcome
Thank you
--
Best regards
Quanming Shi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/users/attachments/20110818/2736028f/attachment.html>
More information about the users
mailing list