]> git.saurik.com Git - apple/xnu.git/blob - bsd/ppc/signal.h
xnu-201.42.3.tar.gz
[apple/xnu.git] / bsd / ppc / signal.h
1 /*
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
11 *
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
18 * under the License.
19 *
20 * @APPLE_LICENSE_HEADER_END@
21 */
22 /*
23 * Copyright (c) 1992, 1993 NeXT Computer, Inc.
24 *
25 * HISTORY
26 *
27 * Machine specific signal information.
28 *
29 * HISTORY
30 * 25-MAR-97 Umesh Vaishampayan (umeshv@NeXT.com)
31 * Ported from m98k and hppa.
32 *
33 * 13-Jan-92 Peter King (king) at NeXT Computer, Inc.
34 * Filled out struct sigcontext to hold all registers.
35 * Added regs_saved_t to specify which regs stored in the
36 * sigcontext are valid.
37 *
38 * 09-Nov-92 Ben Fathi (benf) at NeXT, Inc.
39 * Ported to m98k.
40 *
41 * 09-May-91 Mike DeMoney (mike) at NeXT, Inc.
42 * Ported to m88k.
43 */
44
45 #ifndef _PPC_SIGNAL_
46 #define _PPC_SIGNAL_ 1
47
48 typedef int sig_atomic_t;
49
50 /*
51 * Machine-dependant flags used in sigvec call.
52 */
53 #define SV_SAVE_REGS 0x1000 /* Save all regs in sigcontext */
54
55 /*
56 * regs_saved_t -- Describes which registers beyond what the kernel cares
57 * about are saved to and restored from this sigcontext.
58 *
59 * The default is REGS_SAVED_CALLER, only the caller saved registers
60 * are saved. If the SV_SAVE_REGS flag was set when the signal
61 * handler was registered with sigvec() then all the registers will be
62 * saved in the sigcontext, and REGS_SAVED_ALL will be set. The C
63 * library uses REGS_SAVED_NONE in order to quickly restore kernel
64 * state during a longjmp().
65 */
66 typedef enum {
67 REGS_SAVED_NONE, /* Only kernel managed regs restored */
68 REGS_SAVED_CALLER, /* "Caller saved" regs: rpc, a0-a7,
69 t0-t4, at, lk0-lk1, xt1-xt20,
70 xr0-xr1 */
71 REGS_SAVED_ALL /* All registers */
72 } regs_saved_t;
73
74
75 /*
76 * Information pushed on stack when a signal is delivered.
77 * This is used by the kernel to restore state following
78 * execution of the signal handler. It is also made available
79 * to the handler to allow it to properly restore state if
80 * a non-standard exit is performed.
81 */
82 struct sigcontext {
83 int sc_onstack; /* sigstack state to restore */
84 int sc_mask; /* signal mask to restore */
85 int sc_ir; /* pc */
86 int sc_psw; /* processor status word */
87 int sc_sp; /* stack pointer if sc_regs == NULL */
88 void *sc_regs; /* (kernel private) saved state */
89 };
90
91 #endif /* _PPC_SIGNAL_ */
92