Marking this as __packed was needed to get the alignment and offset of

members right.  However, it also said it was aligned(1), which meant
that gcc generated really bad code.  Mark this as aligned(4).  This
makes things a little faster on arm (a couple percent), but also saves
about 30k on the size of the kernel for arm.

I talked about doing this with bde, but didn't check with him before
the commit, so I'm hesitant say 'reviewed by: bde'.
This commit is contained in:
Warner Losh 2007-01-12 07:23:31 +00:00
parent 1c0ee39e74
commit 0befead1e0
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=165966

View File

@ -65,7 +65,7 @@ struct ip {
u_char ip_p; /* protocol */
u_short ip_sum; /* checksum */
struct in_addr ip_src,ip_dst; /* source and dest address */
} __packed;
} __packed __aligned(4);
#ifdef CTASSERT
CTASSERT(sizeof (struct ip) == 20);