<div dir="ltr">hi,<div><br></div><div>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. </div>
<div><br></div><div>i wanna understand this piece of code which reside at libcpu/powerpc/mpc6xx/mmu/pagetable_.c</div><div><br></div><div> </div><div> 83 static int translate_access_attr(uint32_t attr, int * wimg, int * pp){</div>
<div> 84   int temp;</div><div> 85   temp = attr&0x0f;</div><div> 86   if(  temp  == 0x05 )</div><div> 87     *pp= _PPC_MMU_ACCESS_READ_ONLY;</div><div> 88   else if( temp == 0x0c )</div><div> 89     *pp= _PPC_MMU_ACCESS_SUPERVISOR_ONLY;</div>
<div> 90   else if( temp == 0x0d )</div><div> 91     *pp= _PPC_MMU_ACCESS_SUPERVISOR_WRITE_ONLY;</div><div> 92   else if( temp == 0x0f )</div><div> 93     *pp= _PPC_MMU_ACCESS_NO_PROT;</div><div> 94 </div><div> 95   temp = (attr&0xff00)>8;</div>
<div> 96   *wimg = ((temp&1)<2) | ((temp&2)<2) | ((temp&4)>1) |((temp&8)>3) ;</div><div> 97 </div><div> 98   return 0;</div><div> 99 }</div><div>  </div><div><br></div><div><br></div><div>I think the low-byte of attr is only have value and the rest are zeros ( because permissions are uint8_t ) </div>
<div><br></div><div>so that like is confusing me </div><div>temp = (attr&0xff00)>8;</div><div><br></div><div>how attr bits are represented and wimg ?? </div><div>thanks,</div><div>Hesham<br><br></div></div>