From owner-freebsd-arch Mon Dec 9 12:55:44 2002 Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 389F237B401 for ; Mon, 9 Dec 2002 12:55:43 -0800 (PST) Received: from harmony.village.org (rover.bsdimp.com [204.144.255.66]) by mx1.FreeBSD.org (Postfix) with ESMTP id 582D043EC2 for ; Mon, 9 Dec 2002 12:55:42 -0800 (PST) (envelope-from imp@bsdimp.com) Received: from localhost (warner@rover2.village.org [10.0.0.1]) by harmony.village.org (8.12.6/8.12.3) with ESMTP id gB9KtZuB057929 for ; Mon, 9 Dec 2002 13:55:36 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Mon, 09 Dec 2002 13:53:07 -0700 (MST) Message-Id: <20021209.135307.87742013.imp@bsdimp.com> To: arch@freebsd.org Subject: Re: le??toh, etc in userland From: "M. Warner Losh" In-Reply-To: <76088.1039466169@critter.freebsd.dk> References: <20021209203442.GB27086@elvis.mu.org> <76088.1039466169@critter.freebsd.dk> X-Mailer: Mew version 2.1 on Emacs 21.2 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG In message: <76088.1039466169@critter.freebsd.dk> phk@freebsd.org writes: : In message <20021209203442.GB27086@elvis.mu.org>, Maxime Henrion writes: : : >> Already present in CAM (sys/cam/ssi_all.h): : >> static __inline void scsi_ulto2b(u_int32_t val, u_int8_t *bytes); : >> static __inline void scsi_ulto3b(u_int32_t val, u_int8_t *bytes); : >> static __inline void scsi_ulto4b(u_int32_t val, u_int8_t *bytes); : >> static __inline u_int32_t scsi_2btoul(u_int8_t *bytes); : >> static __inline u_int32_t scsi_3btoul(u_int8_t *bytes); : >> static __inline int32_t scsi_3btol(u_int8_t *bytes); : >> static __inline u_int32_t scsi_4btoul(u_int8_t *bytes); : >> : >> I would love to have a 64 bit version and map these to a generic host : >> version. It should use u_int8_t instead of u_char though. : > : >It should even use uintXX_t instead of u_intXX_t, since the former is : >the standard C99 types. : : I think the ones in sys/geom/geom_enc.c does the right thing, apart : from the "g_" prefix. Any reason we can't just put it in endian.h and get {net,open}bsd to adopt it? There's a BSD-api mailing list we should use to talk about this. I'll post a strawman here and once we agree I'll post it to the bsd-api list. Warner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message