From owner-freebsd-hackers Thu Sep 13 12:23:57 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from snark.rinet.ru (snark.rinet.ru [195.54.192.73]) by hub.freebsd.org (Postfix) with ESMTP id A070037B403 for ; Thu, 13 Sep 2001 12:23:54 -0700 (PDT) Received: (from yar@localhost) by snark.rinet.ru (8.11.6/8.11.6) id f8DJNrN24260 for hackers@freebsd.org; Thu, 13 Sep 2001 23:23:53 +0400 (MSD) (envelope-from yar) Date: Thu, 13 Sep 2001 23:23:52 +0400 From: Yar Tikhiy To: hackers@freebsd.org Subject: Driver structures & alignment Message-ID: <20010913232352.A23874@snark.rinet.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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