<br><br><div class="gmail_quote">2011/7/11 Peter Dufault <span dir="ltr"><<a href="mailto:dufault@hda.com">dufault@hda.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div style="word-wrap:break-word">Hi Quanming.  I know I already reviewed it, but here is a note and a few things I didn't point out.<div><br></div><div>- You should make it clear that the rtems_mprot_alut structure is opaque, and though the user is returned the structure pointer the user doesn't have rights to poke around in it.</div>
</div></blockquote><div>Yes .  I should mention that. <br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div style="word-wrap: break-word;">
<div>- Anyplace that you can you should declare that the pointed-to object is "const".  For example, all "get_" functions should be const. <br></div></div></blockquote><div>I didnot take care of the things like differences between "//" and "/**/", using two spaces instead of tabs for the indentation and so on.<br>
 I will clean up the code later , follow the instruction in <a href="http://www.rtems.com/wiki/index.php/Coding_Conventions">http://www.rtems.com/wiki/index.php/Coding_Conventions</a><br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div style="word-wrap: break-word;"><div>- The sizes should be "size_t" and not "unsigned int".</div></div></blockquote><div> " size_t "  is defined in newlib library,  included from <inttypes.h><br>
<br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div style="word-wrap: break-word;"><div>- Did you mean to leave a mixture of "_memp_" and "_mprot_" in the functions and data structures, or did you plan to change everything to "rtems_mprot"_?  If you intended to have the two prefixes then what is the difference?</div>
</div></blockquote><div>Sorry , I forgot to check this again. I already update all of the prefix to  "rtems_mprot_", as you mentioned, "memp" looks like memory partition.<br>So the function name should be like :<br>
<br>rtems_status_code rtems_mprot_alut_init ( void );<br>rtems_status_code<br>rtems_mprot_alut_create_entry(char* start_addr, size_t size, rtems_mprot_access_attr attr, rtems_mprot_alut_entry **p_ret);<br>

rtems_status_code<br>rtems_mprot_delete_entry(rtems_mprot_alut *p_ret);<br><div><div>rtems_status_code rtems_mprot_alut_search(char *addr, rtems_mprot_alut **p_ret);<br></div>rtems_status_code<br>rtems_mprot_alut_set_attr(rtems_mprot_alut *p_ret,  rtems_mprot_access_attr* new_attribute);<br>


rtems_status_code<br>rtems_mprot_get_attr(rtems_mprot_alut *p_ret, rtems_mprot_access_attr*  attr);<br>rtems_status_code<br>rtems_mprot_alut_set_size(rtems_mprot_alut *p_ret,  unsigned int* new_size);<br>rtems_status_code<br>


rtems_mprot_alut_get_size(rtems_mprot_alut *p_ret,  unsigned int* size);<br><div>rtems_mprot_access_attr  rtems_mprot_get_default_attr();<br>rtems_status_code rtems_mprot_set_default_attr(rtems_mprot_access_attr* attr);<br>

</div></div><br></div><br></div>-- <br>Best regards<br><br>Quanming Shi<br><br>