diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2005-06-24 23:39:19 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2005-06-24 23:39:19 +0000 |
commit | 7645d8719066da9c93c15efccca524202a95a8b4 (patch) | |
tree | 8fab41a6993214960cec155127577949db580f81 /sys/scsi/scsiconf.h | |
parent | 629efbaa10eb82b87a75346532c01ca6ca93321b (diff) |
Fix botch introduced in r1.12. reduced_geometry.sectors is a 5 byte
field, with reduced_geometry.sectors[0] not being sectors/track. Add
_5btol() to correctly parse entire field. From NetBSD.
Diffstat (limited to 'sys/scsi/scsiconf.h')
-rw-r--r-- | sys/scsi/scsiconf.h | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/sys/scsi/scsiconf.h b/sys/scsi/scsiconf.h index b593faaefe8..0a998bbc536 100644 --- a/sys/scsi/scsiconf.h +++ b/sys/scsi/scsiconf.h @@ -1,4 +1,4 @@ -/* $OpenBSD: scsiconf.h,v 1.59 2005/06/23 00:31:44 krw Exp $ */ +/* $OpenBSD: scsiconf.h,v 1.60 2005/06/24 23:39:18 krw Exp $ */ /* $NetBSD: scsiconf.h,v 1.35 1997/04/02 02:29:38 mycroft Exp $ */ /* @@ -367,6 +367,7 @@ static __inline void _lto8b(u_int64_t val, u_int8_t *bytes); static __inline u_int32_t _2btol(u_int8_t *bytes); static __inline u_int32_t _3btol(u_int8_t *bytes); static __inline u_int32_t _4btol(u_int8_t *bytes); +static __inline u_int64_t _5btol(u_int8_t *bytes); static __inline u_int64_t _8btol(u_int8_t *bytes); static __inline void _lto2l(u_int32_t val, u_int8_t *bytes); @@ -457,6 +458,20 @@ _4btol(bytes) } static __inline u_int64_t +_5btol(bytes) + u_int8_t *bytes; +{ + u_int64_t rv; + + rv = ((u_int64_t)bytes[0] << 32) | + ((u_int64_t)bytes[1] << 24) | + ((u_int64_t)bytes[2] << 16) | + ((u_int64_t)bytes[3] << 8) | + (u_int64_t)bytes[4]; + return (rv); +} + +static __inline u_int64_t _8btol(bytes) u_int8_t *bytes; { |