(CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4.
[glibc.git] / mach / error_compat.c
blobe874dd43d48647758e225ae1994bda612a2178e2
1 /*
2 * Mach Operating System
3 * Copyright (c) 1991,1990,1989 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 /* This file was broken out from:
28 $Log$
29 Revision 1.2 1997/03/16 17:41:36 drepper
30 (__mach_error_map_compat): Give full prototype.
32 Revision 1.2 1997/03/14 15:26:28 thomas
33 Wed Mar 5 10:40:05 1997 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu>
35 * mach/mach_error.c (mach_error_string_int): Give full prototype.
36 * mach/errstring.c (mach_error_string_int): Likewise.
37 * mach/error_compat.c (__mach_error_map_compat): Likewise.
39 * mach/spin-solid.c: Include <mach/mach_traps.h>.
40 * mach/spin-solid.c (__spin_lock_solid): Provide arg to
41 swtch_pri.
43 * mach/mach_init.c: Include <mach/mig_support.h>.
45 * mach/mach_error.h (mach_error_string, mach_error,
46 mach_error_type): Always provide prototypes.
48 Revision 1.1 1993/11/30 17:35:24 roland
49 entered into RCS
51 Revision 2.3 92/04/01 19:38:18 rpd
52 The static do_compat function is renamed to be globally accessible.
55 #include <mach/error.h>
56 #include <mach_error.h>
57 #include <errorlib.h>
60 void
61 __mach_error_map_compat(mach_error_t *org_err)
63 mach_error_t err = *org_err;
65 /*
66 * map old error numbers to
67 * to new error sys & subsystem
70 if ((-200 < err) && (err <= -100))
71 err = -(err + 100) | IPC_SEND_MOD;
72 else if ((-300 < err) && (err <= -200))
73 err = -(err + 200) | IPC_RCV_MOD;
74 else if ((-400 < err) && (err <= -300))
75 err = -(err + 300) | MACH_IPC_MIG_MOD;
76 else if ((1000 <= err) && (err < 1100))
77 err = (err - 1000) | SERV_NETNAME_MOD;
78 else if ((1600 <= err) && (err < 1700))
79 err = (err - 1600) | SERV_ENV_MOD;
80 else if ((27600 <= err) && (err < 27700))
81 err = (err - 27600) | SERV_EXECD_MOD;
82 else if ((2500 <= err) && (err < 2600))
83 err = (err - 2500) | KERN_DEVICE_MOD;
84 else if ((5000 <= err) && (err < 5100))
85 err = (err - 5000) | BOOTSTRAP_FS_MOD;
87 *org_err = err;