Merge branch 'master' of git://github.com/illumos/illumos-gate
[unleashed.git] / usr / src / grub / grub-0.97 / stage2 / defs.h
blobaac9207c08eb62c573bd606e485acae4ac2a418a
1 /*
2 * Mach Operating System
3 * Copyright (c) 1991,1990 Carnegie Mellon University
4 * All Rights Reserved.
5 *
6 * Permission to use, copy, modify and distribute this software and its
7 * documentation is hereby granted, provided that both the copyright
8 * notice and this permission notice appear in all copies of the
9 * software, derivative works or modified versions, and any portions
10 * thereof, and that both notices appear in supporting documentation.
12 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
13 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
14 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
16 * Carnegie Mellon requests users of this software to return to
18 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
19 * School of Computer Science
20 * Carnegie Mellon University
21 * Pittsburgh PA 15213-3890
23 * any improvements or extensions that they make and grant Carnegie Mellon
24 * the rights to redistribute these changes.
27 * Common definitions for Berkeley Fast File System.
31 * Compatibility definitions for disk IO.
35 * Disk devices do all IO in 512-byte blocks.
37 #define DEV_BSIZE 512
40 * Conversion between bytes and disk blocks.
42 #define btodb(byte_offset) ((byte_offset) >> 9)
43 #define dbtob(block_number) ((block_number) << 9)
46 * Compatibility definitions for old type names.
49 typedef unsigned char u_char; /* unsigned char */
50 typedef unsigned short u_short; /* unsigned short */
51 typedef unsigned int u_int; /* unsigned int */
53 #if !defined(__sun) || !defined(GRUB_UTIL)
54 typedef struct _quad_
56 unsigned int val[2]; /* 2 int values make... */
58 quad; /* an 8-byte item */
59 #endif /* !__sun || !GRUB_UTIL */
61 typedef unsigned int mach_time_t; /* an unsigned int */
62 typedef unsigned int mach_daddr_t; /* an unsigned int */
63 typedef unsigned int mach_off_t; /* another unsigned int */
65 typedef unsigned short mach_uid_t;
66 typedef unsigned short mach_gid_t;
67 typedef unsigned int mach_ino_t;
69 #ifndef NBBY
70 #define NBBY 8
71 #endif
74 * The file system is made out of blocks of at most MAXBSIZE units,
75 * with smaller units (fragments) only in the last direct block.
76 * MAXBSIZE primarily determines the size of buffers in the buffer
77 * pool. It may be made larger without any effect on existing
78 * file systems; however, making it smaller may make some file
79 * systems unmountable.
81 * Note that the disk devices are assumed to have DEV_BSIZE "sectors"
82 * and that fragments must be some multiple of this size.
84 #define MAXBSIZE 8192
85 #define MAXFRAG 8
88 * MAXPATHLEN defines the longest permissible path length
89 * after expanding symbolic links.
91 * MAXSYMLINKS defines the maximum number of symbolic links
92 * that may be expanded in a path name. It should be set
93 * high enough to allow all legitimate uses, but halt infinite
94 * loops reasonably quickly.
97 #define MAXPATHLEN 1024
98 #define MAXSYMLINKS 8