Re: Natural alignment used on NetBSD/m68k
Anders Magnusson <[email protected]> Sat, 8 Feb 2025 13:29:26 +0100
| Newsgroups | gmane.os.netbsd.ports.m68k |
|---|---|
| Message-ID | <[email protected]> |
>> Do you happen to know whether NetBSD has always used four bytes or >> did that >> change in the past? > > AFAIK, it's always been four bytes, at least since the switch to ELF. Looking at hp300/include/param.h rev. 1.1 from 1993: http://cvsweb.netbsd.org/bsdweb.cgi/~checkout~/src/sys/arch/hp300/include/param.h?rev=1.1;content-type=text%2Fx-chdr /* * Round p (pointer or byte index) up to a correctly-aligned value * for all data types (int, long, ...). The result is u_int and * must be cast to any desired pointer type. */ #define ALIGN(p) (((u_int)(p) + (sizeof(int) - 1)) &~ (sizeof(int) - 1)) So, it seems as it has always been 4 bytes. Side-note: Even VAX has always (since 32V in 1979) used 4-bytes alignment (even if it didn't have to). -- R