Module Name: src Committed By: rin Date: Sun Feb 26 11:48:55 UTC 2017
Modified Files: src/sys/sys: disklabel_rdb.h Log Message: Include <sys/types.h> and replace u_long with uint32_t in preparation to be used from LP64 environments. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/sys/disklabel_rdb.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/sys/disklabel_rdb.h diff -u src/sys/sys/disklabel_rdb.h:1.2 src/sys/sys/disklabel_rdb.h:1.3 --- src/sys/sys/disklabel_rdb.h:1.2 Sat Jun 19 08:45:25 2010 +++ src/sys/sys/disklabel_rdb.h Sun Feb 26 11:48:55 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: disklabel_rdb.h,v 1.2 2010/06/19 08:45:25 kiyohara Exp $ */ +/* $NetBSD: disklabel_rdb.h,v 1.3 2017/02/26 11:48:55 rin Exp $ */ /* * Copyright (c) 1994 Christian E. Hopps @@ -32,11 +32,13 @@ #ifndef _SYS_DISKLABEL_RDB_H_ #define _SYS_DISKLABEL_RDB_H_ +#include <sys/types.h> + /* * describes ados Rigid Disk Blocks * which are used to partition a drive */ -#define RDBNULL ((u_long)0xffffffff) +#define RDBNULL ((uint32_t)0xffffffff) /* * you will find rdblock somewhere in [0, RDBMAXBLOCKS) @@ -44,34 +46,34 @@ #define RDB_MAXBLOCKS 16 struct rdblock { - u_long id; /* 'RDSK' */ - u_long nsumlong; /* number of longs in check sum */ - u_long chksum; /* simple additive with wrap checksum */ - u_long hostid; /* scsi target of host */ - u_long nbytes; /* size of disk blocks */ - u_long flags; - u_long badbhead; /* linked list of badblocks */ - u_long partbhead; /* linked list of partblocks */ - u_long fsbhead; /* " " of fsblocks */ - u_long driveinit; - u_long resv1[6]; /* RDBNULL */ - u_long ncylinders; /* number of cylinders on drive */ - u_long nsectors; /* number of sectors per track */ - u_long nheads; /* number of tracks per cylinder */ - u_long interleave; - u_long park; /* only used with st506 i.e. not */ - u_long resv2[3]; - u_long wprecomp; /* start cyl for write precomp */ - u_long reducedwrite; /* start cyl for reduced write current */ - u_long steprate; /* driver step rate in ?s */ - u_long resv3[5]; - u_long rdblowb; /* lowblock of range for rdb's */ - u_long rdbhighb; /* high block of range for rdb's */ - u_long lowcyl; /* low cylinder of partition area */ - u_long highcyl; /* upper cylinder of partition area */ - u_long secpercyl; /* number of sectors per cylinder */ - u_long parkseconds; /* zero if no park needed */ - u_long resv4[2]; + uint32_t id; /* 'RDSK' */ + uint32_t nsumlong; /* number of long words in check sum */ + uint32_t chksum; /* simple additive with wrap checksum */ + uint32_t hostid; /* scsi target of host */ + uint32_t nbytes; /* size of disk blocks */ + uint32_t flags; + uint32_t badbhead; /* linked list of badblocks */ + uint32_t partbhead; /* linked list of partblocks */ + uint32_t fsbhead; /* " " of fsblocks */ + uint32_t driveinit; + uint32_t resv1[6]; /* RDBNULL */ + uint32_t ncylinders; /* number of cylinders on drive */ + uint32_t nsectors; /* number of sectors per track */ + uint32_t nheads; /* number of tracks per cylinder */ + uint32_t interleave; + uint32_t park; /* only used with st506 i.e. not */ + uint32_t resv2[3]; + uint32_t wprecomp; /* start cyl for write precomp */ + uint32_t reducedwrite; /* start cyl for reduced write current */ + uint32_t steprate; /* driver step rate in ?s */ + uint32_t resv3[5]; + uint32_t rdblowb; /* lowblock of range for rdb's */ + uint32_t rdbhighb; /* high block of range for rdb's */ + uint32_t lowcyl; /* low cylinder of partition area */ + uint32_t highcyl; /* upper cylinder of partition area */ + uint32_t secpercyl; /* number of sectors per cylinder */ + uint32_t parkseconds; /* zero if no park needed */ + uint32_t resv4[2]; char diskvendor[8]; /* inquiry stuff */ char diskproduct[16]; /* inquiry stuff */ char diskrevision[4]; /* inquiry stuff */ @@ -79,7 +81,7 @@ struct rdblock { char contproduct[16]; /* inquiry stuff */ char contrevision[4]; /* inquiry stuff */ #if never_use_secsize - u_long resv5[0]; + uint32_t resv5[0]; #endif }; @@ -93,44 +95,44 @@ struct rdblock { #define RDBF_SYNC 0x40 /* drive supports SCSI synchronous mode */ struct ados_environ { - u_long tabsize; /* 0: environ table size */ - u_long sizeblock; /* 1: n long words in a block */ - u_long secorg; /* 2: not used must be zero */ - u_long numheads; /* 3: number of surfaces */ - u_long secperblk; /* 4: must be 1 */ - u_long secpertrk; /* 5: blocks per track */ - u_long resvblocks; /* 6: reserved blocks at start */ - u_long prefac; /* 7: must be 0 */ - u_long interleave; /* 8: normally 1 */ - u_long lowcyl; /* 9: low cylinder of partition */ - u_long highcyl; /* 10: upper cylinder of partition */ - u_long numbufs; /* 11: ados: number of buffers */ - u_long membuftype; /* 12: ados: type of bufmem */ - u_long maxtrans; /* 13: maxtrans the ctrlr supports */ - u_long mask; /* 14: mask for valid address */ - u_long bootpri; /* 15: boot priority for autoboot */ - u_long dostype; /* 16: filesystem type */ - u_long baud; /* 17: serial handler baud rate */ - u_long control; /* 18: control word for fs */ - u_long bootblocks; /* 19: blocks containing boot code */ - u_long fsize; /* 20: file system block size */ - u_long frag; /* 21: allowable frags per block */ - u_long cpg; /* 22: cylinders per group */ + uint32_t tabsize; /* 0: environ table size */ + uint32_t sizeblock; /* 1: n long words in a block */ + uint32_t secorg; /* 2: not used must be zero */ + uint32_t numheads; /* 3: number of surfaces */ + uint32_t secperblk; /* 4: must be 1 */ + uint32_t secpertrk; /* 5: blocks per track */ + uint32_t resvblocks; /* 6: reserved blocks at start */ + uint32_t prefac; /* 7: must be 0 */ + uint32_t interleave; /* 8: normally 1 */ + uint32_t lowcyl; /* 9: low cylinder of partition */ + uint32_t highcyl; /* 10: upper cylinder of partition */ + uint32_t numbufs; /* 11: ados: number of buffers */ + uint32_t membuftype; /* 12: ados: type of bufmem */ + uint32_t maxtrans; /* 13: maxtrans the ctrlr supports */ + uint32_t mask; /* 14: mask for valid address */ + uint32_t bootpri; /* 15: boot priority for autoboot */ + uint32_t dostype; /* 16: filesystem type */ + uint32_t baud; /* 17: serial handler baud rate */ + uint32_t control; /* 18: control word for fs */ + uint32_t bootblocks; /* 19: blocks containing boot code */ + uint32_t fsize; /* 20: file system block size */ + uint32_t frag; /* 21: allowable frags per block */ + uint32_t cpg; /* 22: cylinders per group */ }; struct partblock { - u_long id; /* 'PART' */ - u_long nsumlong; /* number of longs in check sum */ - u_long chksum; /* simple additive with wrap checksum */ - u_long hostid; /* scsi target of host */ - u_long next; /* next in chain */ - u_long flags; /* see below */ - u_long resv1[3]; + uint32_t id; /* 'PART' */ + uint32_t nsumlong; /* number of long words in check sum */ + uint32_t chksum; /* simple additive with wrap checksum */ + uint32_t hostid; /* scsi target of host */ + uint32_t next; /* next in chain */ + uint32_t flags; /* see below */ + uint32_t resv1[3]; u_char partname[32]; /* (BCPL) part name (may not be unique) */ - u_long resv2[15]; + uint32_t resv2[15]; struct ados_environ e; #if never_use_secsize - u_long extra[9]; /* 8 for extra added to environ */ + uint32_t extra[9]; /* 8 for extra added to environ */ #endif }; @@ -138,50 +140,50 @@ struct partblock { #define PBF_NOMOUNT 0x2 /* partition should be mounted */ struct badblock { - u_long id; /* 'BADB' */ - u_long nsumlong; /* number of longs in check sum */ - u_long chksum; /* simple additive with wrap checksum */ - u_long hostid; /* scsi target of host */ - u_long next; /* next in chain */ - u_long resv; + uint32_t id; /* 'BADB' */ + uint32_t nsumlong; /* number of long words in check sum */ + uint32_t chksum; /* simple additive with wrap checksum */ + uint32_t hostid; /* scsi target of host */ + uint32_t next; /* next in chain */ + uint32_t resv; struct badblockent { - u_long badblock; - u_long goodblock; + uint32_t badblock; + uint32_t goodblock; } badtab[0]; /* 61 for secsize == 512 */ }; struct fsblock { - u_long id; /* 'FSHD' */ - u_long nsumlong; /* number of longs in check sum */ - u_long chksum; /* simple additive with wrap checksum */ - u_long hostid; /* scsi target of host */ - u_long next; /* next in chain */ - u_long flags; - u_long resv1[2]; - u_long dostype; /* this is a file system for this type */ - u_long version; /* version of this fs */ - u_long patchflags; /* describes which functions to replace */ - u_long type; /* zero */ - u_long task; /* zero */ - u_long lock; /* zero */ - u_long handler; /* zero */ - u_long stacksize; /* to use when loading handler */ - u_long priority; /* to run the fs at. */ - u_long startup; /* zero */ - u_long lsegblocks; /* linked list of lsegblocks of fs code */ - u_long globalvec; /* bcpl vector not used mostly */ + uint32_t id; /* 'FSHD' */ + uint32_t nsumlong; /* number of long words in check sum */ + uint32_t chksum; /* simple additive with wrap checksum */ + uint32_t hostid; /* scsi target of host */ + uint32_t next; /* next in chain */ + uint32_t flags; + uint32_t resv1[2]; + uint32_t dostype; /* this is a file system for this type */ + uint32_t version; /* version of this fs */ + uint32_t patchflags; /* describes which functions to replace */ + uint32_t type; /* zero */ + uint32_t task; /* zero */ + uint32_t lock; /* zero */ + uint32_t handler; /* zero */ + uint32_t stacksize; /* to use when loading handler */ + uint32_t priority; /* to run the fs at. */ + uint32_t startup; /* zero */ + uint32_t lsegblocks; /* linked list of lsegblocks of fs code */ + uint32_t globalvec; /* bcpl vector not used mostly */ #if never_use_secsize - u_long resv2[44]; + uint32_t resv2[44]; #endif }; struct lsegblock { - u_long id; /* 'LSEG' */ - u_long nsumlong; /* number of longs in check sum */ - u_long chksum; /* simple additive with wrap checksum */ - u_long hostid; /* scsi target of host */ - u_long next; /* next in chain */ - u_long loaddata[0]; /* load segment data, 123 for secsize == 512 */ + uint32_t id; /* 'LSEG' */ + uint32_t nsumlong; /* number of long words in check sum */ + uint32_t chksum; /* simple additive with wrap checksum */ + uint32_t hostid; /* scsi target of host */ + uint32_t next; /* next in chain */ + uint32_t loaddata[0]; /* load segment data, 123 for secsize == 512 */ }; #define RDBLOCK_ID 0x5244534b /* 'RDSK' */