disklabel.h revision 14478
1252190Srpaulo/* 2252190Srpaulo * Copyright (c) 1987, 1988, 1993 3252190Srpaulo * The Regents of the University of California. All rights reserved. 4252190Srpaulo * 5252190Srpaulo * Redistribution and use in source and binary forms, with or without 6252190Srpaulo * modification, are permitted provided that the following conditions 7252190Srpaulo * are met: 8252190Srpaulo * 1. Redistributions of source code must retain the above copyright 9252190Srpaulo * notice, this list of conditions and the following disclaimer. 10252190Srpaulo * 2. Redistributions in binary form must reproduce the above copyright 11252190Srpaulo * notice, this list of conditions and the following disclaimer in the 12252190Srpaulo * documentation and/or other materials provided with the distribution. 13252190Srpaulo * 3. All advertising materials mentioning features or use of this software 14252190Srpaulo * must display the following acknowledgement: 15252190Srpaulo * This product includes software developed by the University of 16252190Srpaulo * California, Berkeley and its contributors. 17252190Srpaulo * 4. Neither the name of the University nor the names of its contributors 18252190Srpaulo * may be used to endorse or promote products derived from this software 19252190Srpaulo * without specific prior written permission. 20252190Srpaulo * 21252190Srpaulo * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 22252190Srpaulo * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23252190Srpaulo * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24252190Srpaulo * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 25252190Srpaulo * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26252190Srpaulo * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27252190Srpaulo * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28252190Srpaulo * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29252190Srpaulo * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30252190Srpaulo * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31252190Srpaulo * SUCH DAMAGE. 32252190Srpaulo * 33252190Srpaulo * @(#)disklabel.h 8.2 (Berkeley) 7/10/94 34252190Srpaulo * $Id: disklabel.h,v 1.20 1996/02/24 05:21:50 hsu Exp $ 35252190Srpaulo */ 36252190Srpaulo 37252190Srpaulo#ifndef _SYS_DISKLABEL_H_ 38252190Srpaulo#define _SYS_DISKLABEL_H_ 39252190Srpaulo 40252190Srpaulo/* 41252190Srpaulo * Disk description table, see disktab(5) 42252190Srpaulo */ 43252190Srpaulo#define _PATH_DISKTAB "/etc/disktab" 44252190Srpaulo#define DISKTAB "/etc/disktab" /* deprecated */ 45252190Srpaulo 46252190Srpaulo/* 47252190Srpaulo * Each disk has a label which includes information about the hardware 48252190Srpaulo * disk geometry, filesystem partitions, and drive specific information. 49252190Srpaulo * The label is in block 0 or 1, possibly offset from the beginning 50252190Srpaulo * to leave room for a bootstrap, etc. 51252190Srpaulo */ 52252190Srpaulo 53252190Srpaulo/* XXX these should be defined per controller (or drive) elsewhere, not here! */ 54252190Srpaulo#ifdef __i386__ 55252190Srpaulo#define LABELSECTOR 1 /* sector containing label */ 56252190Srpaulo#define LABELOFFSET 0 /* offset of label in sector */ 57252190Srpaulo#endif 58252190Srpaulo 59252190Srpaulo#ifndef LABELSECTOR 60252190Srpaulo#define LABELSECTOR 0 /* sector containing label */ 61252190Srpaulo#endif 62252190Srpaulo 63252190Srpaulo#ifndef LABELOFFSET 64252190Srpaulo#define LABELOFFSET 64 /* offset of label in sector */ 65252190Srpaulo#endif 66252190Srpaulo 67252190Srpaulo#define DISKMAGIC ((u_int32_t)0x82564557) /* The disk magic number */ 68252190Srpaulo#ifndef MAXPARTITIONS 69252190Srpaulo#define MAXPARTITIONS 8 70252190Srpaulo#endif 71252190Srpaulo 72252190Srpaulo#define LABEL_PART 2 /* partition containing label */ 73252190Srpaulo#define RAW_PART 2 /* partition containing whole disk */ 74252190Srpaulo#define SWAP_PART 1 /* partition normally containing swap */ 75252190Srpaulo 76252190Srpaulo#ifndef LOCORE 77252190Srpaulostruct disklabel { 78252190Srpaulo u_int32_t d_magic; /* the magic number */ 79252190Srpaulo u_int16_t d_type; /* drive type */ 80252190Srpaulo u_int16_t d_subtype; /* controller/d_type specific */ 81252190Srpaulo char d_typename[16]; /* type name, e.g. "eagle" */ 82252190Srpaulo 83252190Srpaulo /* 84252190Srpaulo * d_packname contains the pack identifier and is returned when 85252190Srpaulo * the disklabel is read off the disk or in-core copy. 86252190Srpaulo * d_boot0 and d_boot1 are the (optional) names of the 87252190Srpaulo * primary (block 0) and secondary (block 1-15) bootstraps 88252190Srpaulo * as found in /usr/mdec. These are returned when using 89252190Srpaulo * getdiskbyname(3) to retrieve the values from /etc/disktab. 90252190Srpaulo */ 91252190Srpaulo#if defined(KERNEL) || defined(STANDALONE) 92252190Srpaulo char d_packname[16]; /* pack identifier */ 93252190Srpaulo#else 94252190Srpaulo union { 95252190Srpaulo char un_d_packname[16]; /* pack identifier */ 96252190Srpaulo struct { 97252190Srpaulo char *un_d_boot0; /* primary bootstrap name */ 98252190Srpaulo char *un_d_boot1; /* secondary bootstrap name */ 99252190Srpaulo } un_b; 100252190Srpaulo } d_un; 101252190Srpaulo#define d_packname d_un.un_d_packname 102252190Srpaulo#define d_boot0 d_un.un_b.un_d_boot0 103252190Srpaulo#define d_boot1 d_un.un_b.un_d_boot1 104252190Srpaulo#endif /* ! KERNEL or STANDALONE */ 105252190Srpaulo 106252190Srpaulo /* disk geometry: */ 107252190Srpaulo u_int32_t d_secsize; /* # of bytes per sector */ 108252190Srpaulo u_int32_t d_nsectors; /* # of data sectors per track */ 109252190Srpaulo u_int32_t d_ntracks; /* # of tracks per cylinder */ 110252190Srpaulo u_int32_t d_ncylinders; /* # of data cylinders per unit */ 111252190Srpaulo u_int32_t d_secpercyl; /* # of data sectors per cylinder */ 112252190Srpaulo u_int32_t d_secperunit; /* # of data sectors per unit */ 113252190Srpaulo 114252190Srpaulo /* 115252190Srpaulo * Spares (bad sector replacements) below are not counted in 116252190Srpaulo * d_nsectors or d_secpercyl. Spare sectors are assumed to 117252190Srpaulo * be physical sectors which occupy space at the end of each 118252190Srpaulo * track and/or cylinder. 119252190Srpaulo */ 120252190Srpaulo u_int16_t d_sparespertrack; /* # of spare sectors per track */ 121252190Srpaulo u_int16_t d_sparespercyl; /* # of spare sectors per cylinder */ 122252190Srpaulo /* 123252190Srpaulo * Alternate cylinders include maintenance, replacement, configuration 124252190Srpaulo * description areas, etc. 125252190Srpaulo */ 126252190Srpaulo u_int32_t d_acylinders; /* # of alt. cylinders per unit */ 127252190Srpaulo 128252190Srpaulo /* hardware characteristics: */ 129252190Srpaulo /* 130252190Srpaulo * d_interleave, d_trackskew and d_cylskew describe perturbations 131252190Srpaulo * in the media format used to compensate for a slow controller. 132252190Srpaulo * Interleave is physical sector interleave, set up by the 133252190Srpaulo * formatter or controller when formatting. When interleaving is 134252190Srpaulo * in use, logically adjacent sectors are not physically 135252190Srpaulo * contiguous, but instead are separated by some number of 136252190Srpaulo * sectors. It is specified as the ratio of physical sectors 137252190Srpaulo * traversed per logical sector. Thus an interleave of 1:1 138252190Srpaulo * implies contiguous layout, while 2:1 implies that logical 139252190Srpaulo * sector 0 is separated by one sector from logical sector 1. 140252190Srpaulo * d_trackskew is the offset of sector 0 on track N relative to 141252190Srpaulo * sector 0 on track N-1 on the same cylinder. Finally, d_cylskew 142252190Srpaulo * is the offset of sector 0 on cylinder N relative to sector 0 143252190Srpaulo * on cylinder N-1. 144252190Srpaulo */ 145252190Srpaulo u_int16_t d_rpm; /* rotational speed */ 146252190Srpaulo u_int16_t d_interleave; /* hardware sector interleave */ 147252190Srpaulo u_int16_t d_trackskew; /* sector 0 skew, per track */ 148252190Srpaulo u_int16_t d_cylskew; /* sector 0 skew, per cylinder */ 149252190Srpaulo u_int32_t d_headswitch; /* head switch time, usec */ 150252190Srpaulo u_int32_t d_trkseek; /* track-to-track seek, usec */ 151252190Srpaulo u_int32_t d_flags; /* generic flags */ 152252190Srpaulo#define NDDATA 5 153252190Srpaulo u_int32_t d_drivedata[NDDATA]; /* drive-type specific information */ 154252190Srpaulo#define NSPARE 5 155252190Srpaulo u_int32_t d_spare[NSPARE]; /* reserved for future use */ 156252190Srpaulo u_int32_t d_magic2; /* the magic number (again) */ 157252190Srpaulo u_int16_t d_checksum; /* xor of data incl. partitions */ 158252190Srpaulo 159252190Srpaulo /* filesystem and partition information: */ 160252190Srpaulo u_int16_t d_npartitions; /* number of partitions in following */ 161252190Srpaulo u_int32_t d_bbsize; /* size of boot area at sn0, bytes */ 162252190Srpaulo u_int32_t d_sbsize; /* max size of fs superblock, bytes */ 163252190Srpaulo struct partition { /* the partition table */ 164252190Srpaulo u_int32_t p_size; /* number of sectors in partition */ 165252190Srpaulo u_int32_t p_offset; /* starting sector */ 166252190Srpaulo u_int32_t p_fsize; /* filesystem basic fragment size */ 167252190Srpaulo u_int8_t p_fstype; /* filesystem type, see below */ 168252190Srpaulo u_int8_t p_frag; /* filesystem fragments per block */ 169252190Srpaulo union { 170252190Srpaulo u_int16_t cpg; /* UFS: FS cylinders per group */ 171252190Srpaulo u_int16_t sgs; /* LFS: FS segment shift */ 172252190Srpaulo } __partition_u1; 173252190Srpaulo#define p_cpg __partition_u1.cpg 174252190Srpaulo#define p_sgs __partition_u1.sgs 175252190Srpaulo } d_partitions[MAXPARTITIONS]; /* actually may be more */ 176252190Srpaulo}; 177252190Srpaulo#else /* LOCORE */ 178252190Srpaulo /* 179252190Srpaulo * offsets for asm boot files. 180252190Srpaulo */ 181252190Srpaulo .set d_secsize,40 182252190Srpaulo .set d_nsectors,44 183252190Srpaulo .set d_ntracks,48 184252190Srpaulo .set d_ncylinders,52 185252190Srpaulo .set d_secpercyl,56 186252190Srpaulo .set d_secperunit,60 187252190Srpaulo .set d_end_,276 /* size of disk label */ 188252190Srpaulo#endif /* LOCORE */ 189252190Srpaulo 190252190Srpaulo/* d_type values: */ 191252190Srpaulo#define DTYPE_SMD 1 /* SMD, XSMD; VAX hp/up */ 192252190Srpaulo#define DTYPE_MSCP 2 /* MSCP */ 193252190Srpaulo#define DTYPE_DEC 3 /* other DEC (rk, rl) */ 194252190Srpaulo#define DTYPE_SCSI 4 /* SCSI */ 195252190Srpaulo#define DTYPE_ESDI 5 /* ESDI interface */ 196252190Srpaulo#define DTYPE_ST506 6 /* ST506 etc. */ 197252190Srpaulo#define DTYPE_HPIB 7 /* CS/80 on HP-IB */ 198252190Srpaulo#define DTYPE_HPFL 8 /* HP Fiber-link */ 199252190Srpaulo#define DTYPE_FLOPPY 10 /* floppy */ 200252190Srpaulo 201252190Srpaulo#ifdef DKTYPENAMES 202252190Srpaulostatic char *dktypenames[] = { 203252190Srpaulo "unknown", 204252190Srpaulo "SMD", 205252190Srpaulo "MSCP", 206252190Srpaulo "old DEC", 207252190Srpaulo "SCSI", 208252190Srpaulo "ESDI", 209252190Srpaulo "ST506", 210252190Srpaulo "HP-IB", 211252190Srpaulo "HP-FL", 212252190Srpaulo "type 9", 213252190Srpaulo "floppy", 214252190Srpaulo NULL 215252190Srpaulo}; 216252190Srpaulo#define DKMAXTYPES (sizeof(dktypenames) / sizeof(dktypenames[0]) - 1) 217252190Srpaulo#endif 218252190Srpaulo 219252190Srpaulo/* 220252190Srpaulo * Filesystem type and version. 221252190Srpaulo * Used to interpret other filesystem-specific 222252190Srpaulo * per-partition information. 223252190Srpaulo */ 224252190Srpaulo#define FS_UNUSED 0 /* unused */ 225252190Srpaulo#define FS_SWAP 1 /* swap */ 226252190Srpaulo#define FS_V6 2 /* Sixth Edition */ 227252190Srpaulo#define FS_V7 3 /* Seventh Edition */ 228252190Srpaulo#define FS_SYSV 4 /* System V */ 229252190Srpaulo#define FS_V71K 5 /* V7 with 1K blocks (4.1, 2.9) */ 230252190Srpaulo#define FS_V8 6 /* Eighth Edition, 4K blocks */ 231252190Srpaulo#define FS_BSDFFS 7 /* 4.2BSD fast file system */ 232252190Srpaulo#define FS_MSDOS 8 /* MSDOS file system */ 233252190Srpaulo#define FS_BSDLFS 9 /* 4.4BSD log-structured file system */ 234252190Srpaulo#define FS_OTHER 10 /* in use, but unknown/unsupported */ 235252190Srpaulo#define FS_HPFS 11 /* OS/2 high-performance file system */ 236252190Srpaulo#define FS_ISO9660 12 /* ISO 9660, normally CD-ROM */ 237252190Srpaulo#define FS_BOOT 13 /* partition contains bootstrap */ 238252190Srpaulo 239252190Srpaulo#ifdef DKTYPENAMES 240252190Srpaulostatic char *fstypenames[] = { 241252190Srpaulo "unused", 242252190Srpaulo "swap", 243252190Srpaulo "Version 6", 244252190Srpaulo "Version 7", 245252190Srpaulo "System V", 246252190Srpaulo "4.1BSD", 247252190Srpaulo "Eighth Edition", 248252190Srpaulo "4.2BSD", 249252190Srpaulo "MSDOS", 250252190Srpaulo "4.4LFS", 251252190Srpaulo "unknown", 252252190Srpaulo "HPFS", 253252190Srpaulo "ISO9660", 254252190Srpaulo "boot", 255252190Srpaulo NULL 256252190Srpaulo}; 257252190Srpaulo#define FSMAXTYPES (sizeof(fstypenames) / sizeof(fstypenames[0]) - 1) 258252190Srpaulo#endif 259252190Srpaulo 260252190Srpaulo/* 261252190Srpaulo * flags shared by various drives: 262252190Srpaulo */ 263252190Srpaulo#define D_REMOVABLE 0x01 /* removable media */ 264252190Srpaulo#define D_ECC 0x02 /* supports ECC */ 265252190Srpaulo#define D_BADSECT 0x04 /* supports bad sector forw. */ 266252190Srpaulo#define D_RAMDISK 0x08 /* disk emulator */ 267252190Srpaulo#define D_CHAIN 0x10 /* can do back-back transfers */ 268252190Srpaulo 269252190Srpaulo/* 270252190Srpaulo * Drive data for SMD. 271252190Srpaulo */ 272252190Srpaulo#define d_smdflags d_drivedata[0] 273252190Srpaulo#define D_SSE 0x1 /* supports skip sectoring */ 274252190Srpaulo#define d_mindist d_drivedata[1] 275252190Srpaulo#define d_maxdist d_drivedata[2] 276252190Srpaulo#define d_sdist d_drivedata[3] 277252190Srpaulo 278252190Srpaulo/* 279252190Srpaulo * Drive data for ST506. 280252190Srpaulo */ 281252190Srpaulo#define d_precompcyl d_drivedata[0] 282252190Srpaulo#define d_gap3 d_drivedata[1] /* used only when formatting */ 283252190Srpaulo 284252190Srpaulo/* 285252190Srpaulo * Drive data for SCSI. 286252190Srpaulo */ 287252190Srpaulo#define d_blind d_drivedata[0] 288252190Srpaulo 289252190Srpaulo#ifndef LOCORE 290252190Srpaulo/* 291252190Srpaulo * Structure used to perform a format or other raw operation, returning 292252190Srpaulo * data and/or register values. Register identification and format 293252190Srpaulo * are device- and driver-dependent. 294252190Srpaulo */ 295252190Srpaulostruct format_op { 296252190Srpaulo char *df_buf; 297252190Srpaulo int df_count; /* value-result */ 298252190Srpaulo daddr_t df_startblk; 299252190Srpaulo int df_reg[8]; /* result */ 300252190Srpaulo}; 301252190Srpaulo 302252190Srpaulo/* 303252190Srpaulo * Structure used internally to retrieve information about a partition 304252190Srpaulo * on a disk. 305252190Srpaulo */ 306252190Srpaulostruct partinfo { 307252190Srpaulo struct disklabel *disklab; 308252190Srpaulo struct partition *part; 309252190Srpaulo}; 310252190Srpaulo 311252190Srpaulo/* DOS partition table -- located in boot block */ 312252190Srpaulo 313252190Srpaulo#define DOSBBSECTOR 0 /* DOS boot block relative sector number */ 314252190Srpaulo#define DOSPARTOFF 446 315252190Srpaulo#define NDOSPART 4 316252190Srpaulo#define DOSPTYP_386BSD 0xa5 /* 386BSD partition type */ 317252190Srpaulo 318252190Srpaulostruct dos_partition { 319252190Srpaulo unsigned char dp_flag; /* bootstrap flags */ 320252190Srpaulo unsigned char dp_shd; /* starting head */ 321252190Srpaulo unsigned char dp_ssect; /* starting sector */ 322252190Srpaulo unsigned char dp_scyl; /* starting cylinder */ 323252190Srpaulo unsigned char dp_typ; /* partition type */ 324252190Srpaulo unsigned char dp_ehd; /* end head */ 325252190Srpaulo unsigned char dp_esect; /* end sector */ 326252190Srpaulo unsigned char dp_ecyl; /* end cylinder */ 327252190Srpaulo unsigned long dp_start; /* absolute starting sector number */ 328252190Srpaulo unsigned long dp_size; /* partition size in sectors */ 329252190Srpaulo}; 330252190Srpaulo 331252190Srpaulo#define DPSECT(s) ((s) & 0x3f) /* isolate relevant bits of sector */ 332252190Srpaulo#define DPCYL(c, s) ((c) + (((s) & 0xc0)<<2)) /* and those that are cylinder */ 333252190Srpaulo 334252190Srpaulo/* 335252190Srpaulo * Disk-specific ioctls. 336252190Srpaulo */ 337252190Srpaulo /* get and set disklabel; DIOCGPART used internally */ 338252190Srpaulo#define DIOCGDINFO _IOR('d', 101, struct disklabel)/* get */ 339252190Srpaulo#define DIOCSDINFO _IOW('d', 102, struct disklabel)/* set */ 340252190Srpaulo#define DIOCWDINFO _IOW('d', 103, struct disklabel)/* set, update disk */ 341252190Srpaulo#define DIOCGPART _IOW('d', 104, struct partinfo) /* get partition */ 342252190Srpaulo 343252190Srpaulo/* do format operation, read or write */ 344252190Srpaulo#define DIOCRFORMAT _IOWR('d', 105, struct format_op) 345252190Srpaulo#define DIOCWFORMAT _IOWR('d', 106, struct format_op) 346252190Srpaulo 347252190Srpaulo#define DIOCSSTEP _IOW('d', 107, int) /* set step rate */ 348252190Srpaulo#define DIOCSRETRIES _IOW('d', 108, int) /* set # of retries */ 349252190Srpaulo#define DIOCWLABEL _IOW('d', 109, int) /* write en/disable label */ 350252190Srpaulo 351252190Srpaulo#define DIOCSBAD _IOW('d', 110, struct dkbad) /* set kernel dkbad */ 352252190Srpaulo#define DIOCSBADSCAN _IOW('d', 111, int) /* set badscan mode */ 353252190Srpaulo 354252190Srpaulo/* 355252190Srpaulo * XXX encoding of disk minor numbers, should be elsewhere. 356252190Srpaulo * 357252190Srpaulo * See <sys/reboot.h> for a possibly better encoding. 358252190Srpaulo * 359252190Srpaulo * "cpio -H newc" can be used to back up device files with large minor 360252190Srpaulo * numbers (but not ones >= 2^31). Old cpio formats and all tar formats 361252190Srpaulo * don't have enough bits, and cpio and tar don't notice the lossage. 362252190Srpaulo * There are also some sign extension bugs. 363252190Srpaulo */ 364252190Srpaulo 365252190Srpaulo/* 366252190Srpaulo 3 2 1 0 367252190Srpaulo 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 368252190Srpaulo _________________________________________________________________ 369252190Srpaulo | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 370252190Srpaulo ----------------------------------------------------------------- 371252190Srpaulo | TYPE | SLICE | MAJOR? | UNIT |PART | 372252190Srpaulo ----------------------------------------------------------------- 373252190Srpaulo | TYPE |PART2| SLICE | MAJOR? | UNIT |PART | <-soon 374252190Srpaulo ----------------------------------------------------------------- 375252190Srpaulo 376252190Srpaulo I want 3 more part bits (taken from 'TYPE' (useless as it is) (JRE) 377252190Srpaulo*/ 378252190Srpaulo#define dkmakeminor(unit, slice, part) \ 379252190Srpaulo (((slice) << 16) | ((unit) << 3) | (part)) 380252190Srpaulo#define dkmodpart(dev, part) (((dev) & ~(dev_t)7) | (part)) 381252190Srpaulo#define dkmodslice(dev, slice) (((dev) & ~(dev_t)0x1f0000) | ((slice) << 16)) 382252190Srpaulo#define dkpart(dev) (minor(dev) & 7) 383252190Srpaulo#define dkslice(dev) ((minor(dev) >> 16) & 0x1f) 384252190Srpaulo#define dktype(dev) ((minor(dev) >> 21) & 0x7ff) 385252190Srpaulo#define dkunit(dev) ((minor(dev) >> 3) & 0x1f) 386252190Srpaulo 387252190Srpaulo#ifdef KERNEL 388252190Srpaulo/* 389252190Srpaulo * We're not ready to use <sys/disk.h>. 390252190Srpaulo */ 391252190Srpaulo#include <sys/conf.h> 392252190Srpaulo 393252190Srpaulostruct buf_queue_head; 394252190Srpaulo 395252190Srpauloint bounds_check_with_label __P((struct buf *bp, struct disklabel *lp, 396252190Srpaulo int wlabel)); 397252190Srpaulovoid diskerr __P((struct buf *bp, char *dname, char *what, int pri, 398252190Srpaulo int blkdone, struct disklabel *lp)); 399252190Srpaulovoid disksort __P((struct buf *ap, struct buf *bp)); 400252190Srpaulou_int dkcksum __P((struct disklabel *lp)); 401252190Srpaulochar *readdisklabel __P((dev_t dev, d_strategy_t *strat, 402252190Srpaulo struct disklabel *lp)); 403252190Srpaulovoid tqdisksort __P((struct buf_queue_head *ap, struct buf *bp)); 404252190Srpauloint setdisklabel __P((struct disklabel *olp, struct disklabel *nlp, 405252190Srpaulo u_long openmask)); 406252190Srpauloint writedisklabel __P((dev_t dev, d_strategy_t *strat, 407252190Srpaulo struct disklabel *lp)); 408252190Srpaulo 409252190Srpaulo#endif /* KERNEL */ 410252190Srpaulo 411252190Srpaulo#endif /* LOCORE */ 412252190Srpaulo 413252190Srpaulo#if !defined(KERNEL) && !defined(LOCORE) 414252190Srpaulo 415252190Srpaulo#include <sys/cdefs.h> 416252190Srpaulo 417252190Srpaulo__BEGIN_DECLS 418252190Srpaulostruct disklabel *getdiskbyname __P((const char *)); 419252190Srpaulo__END_DECLS 420252190Srpaulo 421252190Srpaulo#endif 422252190Srpaulo 423252190Srpaulo#endif /* !_SYS_DISKLABEL_H_ */ 424252190Srpaulo