diff options
| author | Poul-Henning Kamp <phk@FreeBSD.org> | 2003-04-21 20:40:41 +0000 |
|---|---|---|
| committer | Poul-Henning Kamp <phk@FreeBSD.org> | 2003-04-21 20:40:41 +0000 |
| commit | 18fdae6bd803e51551904d8f19573fb410c96987 (patch) | |
| tree | d45b26ea73b78956475900a626d8bfb431d8261d | |
| parent | 6ad44047caa5f5339fe3c011230822234b7e6094 (diff) | |
Notes
| -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 5c6a0a0056612..e97ad27eb668c 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_ */ |
