diff options
author | phk <phk@FreeBSD.org> | 2003-04-21 20:40:41 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2003-04-21 20:40:41 +0000 |
commit | 957f9f42023eee8afdb35e014a612a0dacd3d1fa (patch) | |
tree | d45b26ea73b78956475900a626d8bfb431d8261d /sys/sys/sun_disklabel.h | |
parent | ea17f6289aaaecd4efc6b4bc4e8d538f12e2cb73 (diff) | |
download | FreeBSD-src-957f9f42023eee8afdb35e014a612a0dacd3d1fa.zip FreeBSD-src-957f9f42023eee8afdb35e014a612a0dacd3d1fa.tar.gz |
Now that all uses of this file use explicit encoding/decoding, remove
all the bits we do not need, and drop the attempt at "disk-image"
structure definition.
Add idempotency (sp?) #ifdef
Diffstat (limited to 'sys/sys/sun_disklabel.h')
-rw-r--r-- | sys/sys/sun_disklabel.h | 48 |
1 files changed, 12 insertions, 36 deletions
diff --git a/sys/sys/sun_disklabel.h b/sys/sys/sun_disklabel.h index 5c6a0a0..e97ad27e 100644 --- a/sys/sys/sun_disklabel.h +++ b/sys/sys/sun_disklabel.h @@ -45,8 +45,15 @@ * $FreeBSD$ */ +#ifndef _SYS_SUN_DISKLABEL_H_ +#define _SYS_SUN_DISKLABEL_H_ + /* - * SunOS disk label layout (only relevant portions discovered here). + * SunOS/Solaris disk label layout (partial). + * + * Suns disk label format contains a lot of historical baggage which we + * ignore entirely. The structure below contains the relevant bits and the + * _enc/_dec functions encode/decode only these fields. */ #define SUN_DKMAGIC 55998 @@ -54,58 +61,27 @@ #define SUN_RAWPART 2 #define SUN_SIZE 512 -/* geometry info */ -struct sun_dkgeom { - u_short sdkc_ncylinders; /* data cylinders */ - u_short sdkc_acylinders; /* alternate cylinders */ - u_short sdkc_xxx1; - u_short sdkc_ntracks; /* tracks per cylinder */ - u_short sdkc_xxx2; - u_short sdkc_nsectors; /* sectors per track */ - u_short sdkc_interleave; /* interleave factor */ - u_short sdkc_xxx3; - u_short sdkc_xxx4; - u_short sdkc_sparespercyl; /* spare sectors per cylinder */ - u_short sdkc_rpm; /* rotational speed */ - u_short sdkc_pcylinders; /* physical cylinders */ - u_short sdkc_xxx5[7]; -}; - -/* controller info */ -struct sun_dkctlr { - int sdkc_addr; /* controller address */ - short sdkc_unit; /* unit (slave) address */ - short sdkc_type; /* controller type */ - short sdkc_flags; /* flags */ -}; - /* partition info */ struct sun_dkpart { u_int32_t sdkp_cyloffset; /* starting cylinder */ u_int32_t sdkp_nsectors; /* number of sectors */ }; -struct sun_disklabel { /* total size = 512 bytes */ +struct sun_disklabel { char sl_text[128]; - char sl_xxx1[292]; - u_int16_t sl_rpm; /* rotational speed */ + u_int16_t sl_rpm; /* rotational speed */ u_int16_t sl_pcylinders; /* number of physical cyls */ u_int16_t sl_sparespercyl; /* spare sectors per cylinder */ - char sl_xxx3[4]; u_int16_t sl_interleave; /* interleave factor */ u_int16_t sl_ncylinders; /* data cylinders */ u_int16_t sl_acylinders; /* alternate cylinders */ u_int16_t sl_ntracks; /* tracks per cylinder */ u_int16_t sl_nsectors; /* sectors per track */ - char sl_xxx4[4]; struct sun_dkpart sl_part[SUN_NPART]; /* partition layout */ u_int16_t sl_magic; /* == SUN_DKMAGIC */ - u_int16_t sl_cksum; /* xor checksum of all shorts */ }; -#ifdef CTASSERT -CTASSERT(sizeof (struct sun_disklabel) == 512); -#endif - int sunlabel_dec(void const *pp, struct sun_disklabel *sl); void sunlabel_enc(void *pp, struct sun_disklabel *sl); + +#endif /* _SYS_SUN_DISKLABEL_H_ */ |