machine/param.h Leak of non-standard methods to Application Space

Joel Sherrill joel at
Wed Oct 17 15:04:42 UTC 2018


We are updating the port of a large third party framework and ran
into an issue where what I would think are BSD kernel methods
leak into application space. All but one of the methods is used
by rtems-libbsd code.

I think the following in <machine/param.h> needs to be protected by
an _KERNEL ifdef.

Does that sound OK?

 * Mach derived conversion macros
#define round_page(x)           (((unsigned long)(x) + PAGE_MASK) &
#define trunc_page(x)           ((unsigned long)(x) & ~PAGE_MASK)

#define atop(x)                 ((unsigned long)(x) >> PAGE_SHIFT)
#define ptoa(x)                 ((unsigned long)(x) << PAGE_SHIFT)

#define pgtok(x)                ((unsigned long)(x) * (PAGE_SIZE / 1024))

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the devel mailing list