[GSOC]Progress Report of MMU support project

Quanming Shi shiquanming10 at gmail.com
Mon Jul 11 12:54:52 UTC 2011


2011/7/11 Peter Dufault <dufault at hda.com>

> Hi Quanming.  I know I already reviewed it, but here is a note and a few
> things I didn't point out.
>
> - 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.
>
Yes .  I should mention that.

> - Anyplace that you can you should declare that the pointed-to object is
> "const".  For example, all "get_" functions should be const.
>
I didnot take care of the things like differences between "//" and "/**/",
using two spaces instead of tabs for the indentation and so on.
 I will clean up the code later , follow the instruction in
http://www.rtems.com/wiki/index.php/Coding_Conventions

> - The sizes should be "size_t" and not "unsigned int".
>
 " size_t "  is defined in newlib library,  included from <inttypes.h>

- 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?
>
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.
So the function name should be like :

rtems_status_code rtems_mprot_alut_init ( void );
rtems_status_code
rtems_mprot_alut_create_entry(char* start_addr, size_t size,
rtems_mprot_access_attr attr, rtems_mprot_alut_entry **p_ret);
rtems_status_code
rtems_mprot_delete_entry(rtems_mprot_alut *p_ret);
rtems_status_code rtems_mprot_alut_search(char *addr, rtems_mprot_alut
**p_ret);
rtems_status_code
rtems_mprot_alut_set_attr(rtems_mprot_alut *p_ret,  rtems_mprot_access_attr*
new_attribute);
rtems_status_code
rtems_mprot_get_attr(rtems_mprot_alut *p_ret, rtems_mprot_access_attr*
attr);
rtems_status_code
rtems_mprot_alut_set_size(rtems_mprot_alut *p_ret,  unsigned int* new_size);
rtems_status_code
rtems_mprot_alut_get_size(rtems_mprot_alut *p_ret,  unsigned int* size);
rtems_mprot_access_attr  rtems_mprot_get_default_attr();
rtems_status_code rtems_mprot_set_default_attr(rtems_mprot_access_attr*
attr);


-- 
Best regards

Quanming Shi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/users/attachments/20110711/c893739d/attachment-0001.html>


More information about the users mailing list