[GSoC2012] Problem with understanding low-level mmu

Hesham Moustafa heshamelmatary at gmail.com
Sun Jun 17 22:06:18 UTC 2012


I have created initial implementation for two interfaces of Arena manager
that make use of mmu, my project will depend on ARM architecture, but
currently i am working on high-level stage only and wanna test my
high-level code. A previous MMU project implemented low-level code for MMU
support for powerpc but i have no experience with powerpc and i need a
little help.

i wanna understand this piece of code which reside at

 83 static int translate_access_attr(uint32_t attr, int * wimg, int * pp){
 84   int temp;
 85   temp = attr&0x0f;
 86   if(  temp  == 0x05 )
 88   else if( temp == 0x0c )
 90   else if( temp == 0x0d )
 92   else if( temp == 0x0f )
 93     *pp= _PPC_MMU_ACCESS_NO_PROT;
 95   temp = (attr&0xff00)>8;
 96   *wimg = ((temp&1)<2) | ((temp&2)<2) | ((temp&4)>1) |((temp&8)>3) ;
 98   return 0;
 99 }

I think the low-byte of attr is only have value and the rest are zeros (
because permissions are uint8_t )

so that like is confusing me
temp = (attr&0xff00)>8;

how attr bits are represented and wimg ??
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20120618/5f773ac1/attachment.html>

More information about the devel mailing list