xref: /illumos-gate/usr/src/cmd/format/startup.h (revision 63f91fbc3c024870d86dc3332a4a0080fb29bc40)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 
23 /*
24  * Copyright (c) 1991-2001 by Sun Microsystems, Inc.
25  */
26 
27 #ifndef	_STARTUP_H
28 #define	_STARTUP_H
29 
30 #ifdef	__cplusplus
31 extern "C" {
32 #endif
33 
34 /*
35  * This file contains declarations pertaining to reading the data file.
36  */
37 /*
38  * The definitions are the token types that the data file parser recognizes.
39  */
40 #define	SUP_EOF			-1		/* eof token */
41 #define	SUP_STRING		0		/* string token */
42 #define	SUP_EQL			1		/* equals token */
43 #define	SUP_COMMA		2		/* comma token */
44 #define	SUP_COLON		3		/* colon token */
45 #define	SUP_EOL			4		/* newline token */
46 #define	SUP_OR			5		/* vertical bar */
47 #define	SUP_AND			6		/* ampersand */
48 #define	SUP_TILDE		7		/* tilde */
49 
50 /*
51  * These definitions are flags for the legal keywords in the data file.
52  * They are used to keep track of what parameters appear on the current
53  * line in the file.
54  */
55 #define	SUP_CTLR		0x00000001	/* set ctlr */
56 #define	SUP_DISK		0x00000002	/* set disk */
57 #define	SUP_NCYL		0x00000004	/* set ncyl */
58 #define	SUP_ACYL		0x00000008	/* set acyl */
59 #define	SUP_PCYL		0x00000010	/* set pcyl */
60 #define	SUP_NHEAD		0x00000020	/* set nhead */
61 #define	SUP_NSECT		0x00000040	/* set nsect */
62 #define	SUP_RPM			0x00000080	/* set rpm */
63 #define	SUP_BPT			0x00000100	/* set bytes/track */
64 #define	SUP_BPS			0x00000200	/* set bytes/sector */
65 #define	SUP_DRTYPE		0x00000400	/* set drive type */
66 
67 #define	SUP_READ_RETRIES	0x00000800	/* set read retries */
68 #define	SUP_WRITE_RETRIES	0x00001000	/* set write retries */
69 
70 #define	SUP_TRKS_ZONE		0x00002000	/* set tracks/zone */
71 #define	SUP_ATRKS		0x00004000	/* set alt. tracks */
72 #define	SUP_ASECT		0x00008000	/* set sectors/zone */
73 #define	SUP_CACHE		0x00010000	/* set cache size */
74 #define	SUP_PREFETCH		0x00020000	/* set prefetch threshold */
75 #define	SUP_CACHE_MIN		0x00040000	/* set min. prefetch */
76 #define	SUP_CACHE_MAX		0x00080000	/* set max. prefetch */
77 #define	SUP_PSECT		0x00100000	/* set physical sectors */
78 #define	SUP_PHEAD		0x00200000	/* set physical heads */
79 #define	SUP_FMTTIME		0x00400000	/* set format time */
80 #define	SUP_CYLSKEW		0x00800000	/* set cylinder skew */
81 #define	SUP_TRKSKEW		0x01000000	/* set track skew */
82 
83 
84 /*
85  * The define the minimum set of parameters necessary to declare a disk
86  * and a partition map in the data file.  Depending on the ctlr type,
87  * more info than this may be necessary for declaring disks.
88  */
89 #define	SUP_MIN_DRIVE   (SUP_CTLR | SUP_RPM | SUP_PCYL | \
90 			SUP_NCYL | SUP_ACYL | SUP_NHEAD | SUP_NSECT)
91 
92 #define	SUP_MIN_PART	0x0003			/* for maps */
93 
94 
95 /*
96  *	Prototypes for ANSI C compilers
97  */
98 int	do_options(int argc, char *argv[]);
99 void	sup_init(void);
100 int	open_disk(char *diskname, int flags);
101 void	do_search(char *arglist[]);
102 int	dtype_match(struct dk_label *label, struct disk_type *dtype);
103 int	parts_match(struct dk_label *label, struct partition_info *pinfo);
104 int	diskname_match(char *name, struct disk_info *disk);
105 
106 
107 
108 #ifdef	__cplusplus
109 }
110 #endif
111 
112 #endif	/* _STARTUP_H */
113