diskmbr.h (1541) | diskmbr.h (1549) |
---|---|
1/* 2 * Copyright (c) 1987, 1988, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 150 unchanged lines hidden (view full) --- 159 union { 160 u_short cpg; /* UFS: FS cylinders per group */ 161 u_short sgs; /* LFS: FS segment shift */ 162 } __partition_u1; 163#define p_cpg __partition_u1.cpg 164#define p_sgs __partition_u1.sgs 165 } d_partitions[MAXPARTITIONS]; /* actually may be more */ 166}; | 1/* 2 * Copyright (c) 1987, 1988, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 150 unchanged lines hidden (view full) --- 159 union { 160 u_short cpg; /* UFS: FS cylinders per group */ 161 u_short sgs; /* LFS: FS segment shift */ 162 } __partition_u1; 163#define p_cpg __partition_u1.cpg 164#define p_sgs __partition_u1.sgs 165 } d_partitions[MAXPARTITIONS]; /* actually may be more */ 166}; |
167struct cpu_disklabel { 168}; |
|
167#else /* LOCORE */ 168 /* 169 * offsets for asm boot files. 170 */ 171 .set d_secsize,40 172 .set d_nsectors,44 173 .set d_ntracks,48 174 .set d_ncylinders,52 --- 8 unchanged lines hidden (view full) --- 183#define DTYPE_DEC 3 /* other DEC (rk, rl) */ 184#define DTYPE_SCSI 4 /* SCSI */ 185#define DTYPE_ESDI 5 /* ESDI interface */ 186#define DTYPE_ST506 6 /* ST506 etc. */ 187#define DTYPE_HPIB 7 /* CS/80 on HP-IB */ 188#define DTYPE_HPFL 8 /* HP Fiber-link */ 189#define DTYPE_FLOPPY 10 /* floppy */ 190 | 169#else /* LOCORE */ 170 /* 171 * offsets for asm boot files. 172 */ 173 .set d_secsize,40 174 .set d_nsectors,44 175 .set d_ntracks,48 176 .set d_ncylinders,52 --- 8 unchanged lines hidden (view full) --- 185#define DTYPE_DEC 3 /* other DEC (rk, rl) */ 186#define DTYPE_SCSI 4 /* SCSI */ 187#define DTYPE_ESDI 5 /* ESDI interface */ 188#define DTYPE_ST506 6 /* ST506 etc. */ 189#define DTYPE_HPIB 7 /* CS/80 on HP-IB */ 190#define DTYPE_HPFL 8 /* HP Fiber-link */ 191#define DTYPE_FLOPPY 10 /* floppy */ 192 |
193/* d_subtype values: */ 194#define DSTYPE_INDOSPART 0x8 /* is inside dos partition */ 195#define DSTYPE_DOSPART(s) ((s) & 3) /* dos partition number */ 196#define DSTYPE_GEOMETRY 0x10 /* drive params in label */ 197 |
|
191#ifdef DKTYPENAMES 192static char *dktypenames[] = { 193 "unknown", 194 "SMD", 195 "MSCP", 196 "old DEC", 197 "SCSI", 198 "ESDI", --- 96 unchanged lines hidden (view full) --- 295 * Structure used internally to retrieve 296 * information about a partition on a disk. 297 */ 298struct partinfo { 299 struct disklabel *disklab; 300 struct partition *part; 301}; 302 | 198#ifdef DKTYPENAMES 199static char *dktypenames[] = { 200 "unknown", 201 "SMD", 202 "MSCP", 203 "old DEC", 204 "SCSI", 205 "ESDI", --- 96 unchanged lines hidden (view full) --- 302 * Structure used internally to retrieve 303 * information about a partition on a disk. 304 */ 305struct partinfo { 306 struct disklabel *disklab; 307 struct partition *part; 308}; 309 |
310/* DOS partition table -- located in boot block */ 311 312#define DOSBBSECTOR 0 /* DOS boot block relative sector number */ 313#define DOSPARTOFF 446 314#define NDOSPART 4 315 316struct dos_partition { 317 unsigned char dp_flag; /* bootstrap flags */ 318 unsigned char dp_shd; /* starting head */ 319 unsigned char dp_ssect; /* starting sector */ 320 unsigned char dp_scyl; /* starting cylinder */ 321 unsigned char dp_typ; /* partition type */ 322#define DOSPTYP_386BSD 0xa5 /* 386BSD partition type */ 323 unsigned char dp_ehd; /* end head */ 324 unsigned char dp_esect; /* end sector */ 325 unsigned char dp_ecyl; /* end cylinder */ 326 unsigned long dp_start; /* absolute starting sector number */ 327 unsigned long dp_size; /* partition size in sectors */ 328}; 329 330extern struct dos_partition dos_partitions[NDOSPART]; 331 332#define DPSECT(s) ((s) & 0x3f) /* isolate relevant bits of sector */ 333#define DPCYL(c, s) ((c) + (((s) & 0xc0)<<2)) /* and those that are cylinder */ 334 |
|
303/* 304 * Disk-specific ioctls. 305 */ 306 /* get and set disklabel; DIOCGPART used internally */ 307#define DIOCGDINFO _IOR('d', 101, struct disklabel)/* get */ 308#define DIOCSDINFO _IOW('d', 102, struct disklabel)/* set */ 309#define DIOCWDINFO _IOW('d', 103, struct disklabel)/* set, update disk */ 310#define DIOCGPART _IOW('d', 104, struct partinfo) /* get partition */ --- 22 unchanged lines hidden --- | 335/* 336 * Disk-specific ioctls. 337 */ 338 /* get and set disklabel; DIOCGPART used internally */ 339#define DIOCGDINFO _IOR('d', 101, struct disklabel)/* get */ 340#define DIOCSDINFO _IOW('d', 102, struct disklabel)/* set */ 341#define DIOCWDINFO _IOW('d', 103, struct disklabel)/* set, update disk */ 342#define DIOCGPART _IOW('d', 104, struct partinfo) /* get partition */ --- 22 unchanged lines hidden --- |