tech-kern archive   Possible incorrect usage of STACKALIGN in
kern_exec  Hello there,  I am currently working on a NetBSD port
for the FriendlyARM MINI2440, and have run into a situation
where the arguments to user space programs is garbled. I've
noticed it for the init-process and for the getty process.
Booting with rc_configured=NO in /etc/rc.conf, mounting procfs,
and issuing a cat /proc/1/cmdline will yields "init" followed by
"garbage". Always 0x5C 0xEF 0xFF 0xBF 0x02  Digging a bit around
the kernel, I have noticed that line 796 in kern_exec.c
(execve1) has a special case for ARM only (as far as I can  len
= STACKALIGN(len); /* make the stack "safely" aligned */
STACKALIGN aligns is implemented in arch/arm/include/param.h:
96 /* ARM-specific macro to align a stack pointer (downwards).
*/    97 #define STACKALIGNBYTES         (8 - 1)    98 #define
STACKALIGN(p)           ((u_int)(p) &~ STACKALIGNBYTES)  So it's
basically truncates to proper alignment, rounding down to an
aligned number. Rounding dow