Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 13 Sep 2001 23:23:52 +0400
From:      Yar Tikhiy <yar@freebsd.org>
To:        hackers@freebsd.org
Subject:   Driver structures & alignment
Message-ID:  <20010913232352.A23874@snark.rinet.ru>

next in thread | raw e-mail | index | archive | help
Hi there,

Is there a single blessed way to define packed structures
for use in drivers?  I suspect that using "#pragma pack(1)"
will lead to alignment errors in non-Intel architectures.
Should char arrays be used for all multi-byte elements to
avoid alignment problems?

And is it OK to rely on specially crafted structures, like
"struct fs" in /sys/ufs/ffs/fs.h where multi-byte elements
are pre-aligned by the structure's design, being contiguous?

-- 
Yar

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010913232352.A23874>