(CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4.
[glibc.git] / mach / mach / error.h
blob70f189f65e1d5b6372fe437ca305b2672745b111
1 /* err_hurd added by roland@gnu.ai.mit.edu for GNU Hurd.
3 * Mach Operating System
4 * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University
5 * All Rights Reserved.
7 * Permission to use, copy, modify and distribute this software and its
8 * documentation is hereby granted, provided that both the copyright
9 * notice and this permission notice appear in all copies of the
10 * software, derivative works or modified versions, and any portions
11 * thereof, and that both notices appear in supporting documentation.
13 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
14 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
15 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
17 * Carnegie Mellon requests users of this software to return to
19 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
20 * School of Computer Science
21 * Carnegie Mellon University
22 * Pittsburgh PA 15213-3890
24 * any improvements or extensions that they make and grant Carnegie Mellon
25 * the rights to redistribute these changes.
28 * HISTORY
29 * $Log$
30 * Revision 1.3 1997/03/16 17:43:08 drepper
31 * (mach_error_fn_t): Comment out declaration; it appears to be entirely
32 * unused dead code.
34 * Revision 1.3 1997/03/14 15:27:35 thomas
35 * Wed Mar 5 10:40:05 1997 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu>
37 * * mach/mach/mach_traps.h: Include <mach/kern_return.h>.
39 * * mach/mach/error.h (mach_error_fn_t): Comment out declaration; it
40 * appears to be entirely unused dead code.
42 * Revision 1.2 1996/12/20 01:32:36 drepper
43 * Update from main archive 961219
45 * Revision 1.2 1996/12/19 20:23:56 drepper
46 * Spelling corrections.
48 * Revision 1.1 1993/12/17 21:40:28 roland
49 * entered into RCS
51 * Revision 2.6 93/01/14 17:41:31 danner
52 * Standardized include symbol name.
53 * [92/06/10 pds]
55 * Revision 2.5 92/03/31 15:18:11 rpd
56 * Added err_bootstrap for bootstrap errors.
57 * [92/03/09 rpd]
59 * Revision 2.4 91/05/14 16:51:24 mrt
60 * Correcting copyright
62 * Revision 2.3 91/02/05 17:31:48 mrt
63 * Changed to new Mach copyright
64 * [91/02/01 17:16:50 mrt]
66 * Revision 2.2 90/06/02 14:57:47 rpd
67 * Added err_mach_ipc for new IPC.
68 * [90/03/26 22:28:42 rpd]
70 * Revision 2.1 89/08/03 16:02:07 rwd
71 * Created.
73 * Revision 2.4 89/02/25 18:13:18 gm0w
74 * Changes for cleanup.
76 * Revision 2.3 89/02/07 00:51:57 mwyoung
77 * Relocated from sys/error.h
79 * Revision 2.2 88/10/18 00:37:31 mwyoung
80 * Added {system,sub and code}_emask
81 * [88/10/17 17:06:58 mrt]
83 * Added {system,sub and code}_emask
85 * 12-May-88 Mary Thompson (mrt) at Carnegie Mellon
86 * Changed mach_error_t from unsigned int to kern_return_t
87 * which is a 32 bit integer regardless of machine type.
88 * unsigned int was incompatible with old usages of mach_error.
90 * 10-May-88 Douglas Orr (dorr) at Carnegie-Mellon University
91 * Missing endif replaced
93 * 5-May-88 Mary Thompson (mrt) at Carnegie Mellon
94 * Changed typedef of mach_error_t from long to unsigned int
95 * to keep our Camelot users happy. Also moved the nonkernel
96 * function declarations from here to mach_error.h.
98 * 10-Feb-88 Douglas Orr (dorr) at Carnegie-Mellon University
99 * Created.
103 * File: mach/error.h
104 * Purpose:
105 * error module definitions
109 #ifndef _MACH_ERROR_H_
110 #define _MACH_ERROR_H_
111 #include <mach/kern_return.h>
114 * error number layout as follows:
116 * hi lo
117 * | system(6) | subsystem(12) | code(14) |
121 #define err_none (mach_error_t)0
122 #define ERR_SUCCESS (mach_error_t)0
123 #define ERR_ROUTINE_NIL (mach_error_fn_t)0
126 #define err_system(x) (((x)&0x3f)<<26)
127 #define err_sub(x) (((x)&0xfff)<<14)
129 #define err_get_system(err) (((err)>>26)&0x3f)
130 #define err_get_sub(err) (((err)>>14)&0xfff)
131 #define err_get_code(err) ((err)&0x3fff)
133 #define system_emask (err_system(0x3f))
134 #define sub_emask (err_sub(0xfff))
135 #define code_emask (0x3fff)
138 /* major error systems */
139 #define err_kern err_system(0x0) /* kernel */
140 #define err_us err_system(0x1) /* user space library */
141 #define err_server err_system(0x2) /* user space servers */
142 #define err_ipc err_system(0x3) /* old ipc errors */
143 #define err_mach_ipc err_system(0x4) /* mach-ipc errors */
144 #define err_bootstrap err_system(0x5) /* bootstrap errors */
145 #define err_hurd err_system(0x10) /* GNU Hurd server errors */
146 #define err_local err_system(0x3e) /* user defined errors */
147 #define err_ipc_compat err_system(0x3f) /* (compatibility) mach-ipc errors */
149 #define err_max_system 0x3f
152 /* unix errors get lumped into one subsystem */
153 #define unix_err(errno) (err_kern|err_sub(3)|errno)
155 typedef kern_return_t mach_error_t;
156 /* typedef mach_error_t (* mach_error_fn_t)(); */
158 #endif /* _MACH_ERROR_H_ */