<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Feb 8, 2021 at 2:45 PM Gedare Bloom <<a href="mailto:gedare@rtems.org">gedare@rtems.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Feb 8, 2021 at 2:04 PM Chris Johns <<a href="mailto:chrisj@rtems.org" target="_blank">chrisj@rtems.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 9/2/21 5:18 am, Gedare Bloom wrote:<br>
> If you put this on master/6, you can switch that align to use<br>
> RTEMS_ALIGN_UP(addr, PAGE_SIZE) -- not PAGE_MASK<br>
<br>
Sorry, I had already pushed the patch.<br>
<br>
A quick grep shows there are a few of these ...<br>
<br>
 $ grep -r PAGE_MASK *<br>
0001-bsp-motorola_powerp-Print-RTEMS_VERSION-from-the-boo.patch: #define<br>
PAGE_ALIGN(addr)       (((addr) + PAGE_MASK) & ~PAGE_MASK)<br>
0002-bsp-motorola_powerp-Print-RTEMS_VERSION-from-the-boo.patch: #define<br>
PAGE_ALIGN(addr)       (((addr) + PAGE_MASK) & ~PAGE_MASK)<br>
bsps/powerpc/motorola_powerpc/bootloader/mm.c:#define PAGE_ALIGN(addr)  (((addr)<br>
+ PAGE_MASK) & ~PAGE_MASK)<br>
bsps/powerpc/motorola_powerpc/bootloader/mm.c:                  rpn =<br>
(vaddr&PAGE_MASK)-area->base+area->firstpte;<br>
bsps/powerpc/motorola_powerpc/bootloader/mm.c:  if (mask&PAGE_MASK) {<br>
bsps/powerpc/motorola_powerpc/bootloader/misc.c:#define PAGE_ALIGN(addr)<br>
(((addr) + PAGE_MASK) & ~PAGE_MASK)<br>
bsps/powerpc/include/libcpu/pgtable.h:#define _PAGE_CHG_MASK    (PAGE_MASK |<br>
_PAGE_ACCESSED | _PAGE_DIRTY)<br></blockquote></div></div></blockquote><div>This is suspect. PAGE_MASK coming through newlib is 0xFFF. the ORs are redundant.</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
bsps/powerpc/shared/start/pgtbl_setup.c:#define PAGE_ALIGN(addr)        (((addr)<br>
+ PAGE_MASK) & ~PAGE_MASK)<br>
cpukit/libnetworking/vm/vm_param.h:     ((vm_offset_t)((((vm_offset_t)(x)) +<br>
PAGE_MASK) >> PAGE_SHIFT))<br></blockquote></div></div></blockquote><div>ignore networking</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
cpukit/posix/src/mmap.c:    if ((uintptr_t)addr & PAGE_MASK) { </blockquote></div></div></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Do all these needs to be looked at as well?<br>
<br></blockquote><div>Probably should. This is only for 6+ version, to help with consistency. Some of those appear to be actual PAGE_MASK uses, but the alignment macros should use the shared RTEMS_ALIGN* for easier validation.</div><div> </div></div></div></blockquote><div><br></div><div>FWIW, we also have round_page() defined in newlib.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Chris<br>
</blockquote></div></div>
</blockquote></div></div>