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