|
|
1.1 root 1: /*
2: * Mach Operating System
3: * Copyright (c) 1991,1990,1989,1988,1987 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.
11: *
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.
15: *
16: * Carnegie Mellon requests users of this software to return to
17: *
18: * Software Distribution Coordinator or [email protected]
19: * School of Computer Science
20: * Carnegie Mellon University
21: * Pittsburgh PA 15213-3890
22: *
23: * any improvements or extensions that they make and grant Carnegie Mellon
24: * the rights to redistribute these changes.
25: */
26: /*
27: * File: mach/error.h
28: * Purpose:
29: * error module definitions
30: *
31: */
32:
33: #ifndef _MACH_ERROR_H_
34: #define _MACH_ERROR_H_
35: #include <mach/kern_return.h>
36:
37: /*
38: * error number layout as follows:
39: *
40: * hi lo
41: * | system(6) | subsystem(12) | code(14) |
42: */
43:
44:
45: #define err_none (mach_error_t)0
46: #define ERR_SUCCESS (mach_error_t)0
47: #define ERR_ROUTINE_NIL (mach_error_fn_t)0
48:
49:
50: #define err_system(x) (((x)&0x3f)<<26)
51: #define err_sub(x) (((x)&0xfff)<<14)
52:
53: #define err_get_system(err) (((err)>>26)&0x3f)
54: #define err_get_sub(err) (((err)>>14)&0xfff)
55: #define err_get_code(err) ((err)&0x3fff)
56:
57: #define system_emask (err_system(0x3f))
58: #define sub_emask (err_sub(0xfff))
59: #define code_emask (0x3fff)
60:
61:
62: /* Mach error systems */
63: #define err_kern err_system(0x0) /* kernel */
64: #define err_us err_system(0x1) /* user space library */
65: #define err_server err_system(0x2) /* user space servers */
66: #define err_ipc err_system(0x3) /* old ipc errors */
67: #define err_mach_ipc err_system(0x4) /* mach-ipc errors */
68: #define err_bootstrap err_system(0x5) /* bootstrap errors */
69: #define err_hurd err_system(0x10) /* GNU Hurd server errors */
70: #define err_local err_system(0x3e) /* user defined errors */
71: #define err_ipc_compat err_system(0x3f) /* (compatibility) mach-ipc errors */
72:
73: #define err_max_system 0x3f
74:
75:
76: /* special old "subsystems" that don't really follow the above rules */
77: #define err_mig -300
78: #define err_exec 6000
79:
80: /* unix errors get lumped into one subsystem */
81: #define err_unix (err_kern|err_sub(3))
82: #define unix_err(errno) (err_kern|err_sub(3)|errno)
83:
84: /* MS-DOS extended error codes */
85: #define err_dos (err_kern|err_sub(0xd05))
86:
87: /* Flux OS error systems */
88: #define err_fluke err_system(0x20) /* Fluke API */
89:
90: #ifndef ASSEMBLER
91: typedef kern_return_t mach_error_t;
92: typedef mach_error_t (* mach_error_fn_t)();
93: #endif /* ASSEMBLER */
94:
95: #endif /* _MACH_ERROR_H_ */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.