~ubuntu-branches/ubuntu/dapper/fpc/dapper

« back to all changes in this revision

Viewing changes to rtl/darwin/powerpc/sig_cpu.inc

  • Committer: Bazaar Package Importer
  • Author(s): Carlos Laviola
  • Date: 2004-08-12 16:29:37 UTC
  • mfrom: (1.2.1 upstream) (2.1.1 warty)
  • Revision ID: james.westby@ubuntu.com-20040812162937-moo8ulvysp1ln771
Tags: 1.9.4-5
fp-compiler: needs ld, adding dependency on binutils.  (Closes: #265265)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
  {
 
2
     $Id: sig_cpu.inc,v 1.2 2004/01/08 21:52:34 jonas Exp $
 
3
     Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
 
4
 
 
5
     @APPLE_LICENSE_HEADER_START@
 
6
 
 
7
     The contents of this file constitute Original Code as defined in and
 
8
     are subject to the Apple Public Source License Version 1.1 (the
 
9
     "License").  You may not use this file except in compliance with the
 
10
     License.  Please obtain a copy of the License at
 
11
     http://www.apple.com/publicsource and read it before using this file.
 
12
 
 
13
     This Original Code and all software distributed under the License are
 
14
     distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
 
15
     EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
 
16
     INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
 
17
     FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT.  Please see the
 
18
     License for the specific language governing rights and limitations
 
19
     under the License.
 
20
 
 
21
     @APPLE_LICENSE_HEADER_END@
 
22
    }
 
23
  {
 
24
     Copyright (c) 1992, 1993 NeXT Computer, Inc.
 
25
 
 
26
     HISTORY
 
27
 
 
28
        Machine specific signal information.
 
29
 
 
30
     HISTORY
 
31
     25-MAR-97  Umesh Vaishampayan (umeshv@NeXT.com)
 
32
        Ported from m98k and hppa.
 
33
 
 
34
     13-Jan-92  Peter King (king) at NeXT Computer, Inc.
 
35
        Filled out struct sigcontext to hold all registers.
 
36
        Added regs_saved_t to specify which regs stored in the
 
37
        sigcontext are valid.
 
38
 
 
39
     09-Nov-92  Ben Fathi (benf) at NeXT, Inc.
 
40
        Ported to m98k.
 
41
 
 
42
     09-May-91  Mike DeMoney (mike) at NeXT, Inc.
 
43
        Ported to m88k.
 
44
    }
 
45
 
 
46
{$packrecords C}
 
47
 
 
48
  const
 
49
     _PPC_SIGNAL_ = 1;
 
50
 
 
51
  type
 
52
 
 
53
     sig_atomic_t = longint;
 
54
  {
 
55
     Machine-dependant flags used in sigvec call.
 
56
    }
 
57
  { Save all regs in sigcontext  }
 
58
 
 
59
  const
 
60
     SV_SAVE_REGS = $1000;
 
61
  {
 
62
     regs_saved_t -- Describes which registers beyond what the kernel cares
 
63
                   about are saved to and restored from this sigcontext.
 
64
 
 
65
     The default is REGS_SAVED_CALLER, only the caller saved registers
 
66
     are saved.  If the SV_SAVE_REGS flag was set when the signal
 
67
     handler was registered with sigvec() then all the registers will be
 
68
     saved in the sigcontext, and REGS_SAVED_ALL will be set.  The C
 
69
     library uses REGS_SAVED_NONE in order to quickly restore kernel
 
70
     state during a longjmp().
 
71
    }
 
72
  { Only kernel managed regs restored  }
 
73
  { "Caller saved" regs: rpc, a0-a7,
 
74
                                           t0-t4, at, lk0-lk1, xt1-xt20,
 
75
                                           xr0-xr1  }
 
76
  { All registers  }
 
77
 
 
78
  type
 
79
 
 
80
  { Structure used in sigstack call. }
 
81
    tdarwin_stack_t = record
 
82
        ss_sp    : pchar;        { signal stack base }
 
83
        ss_size  : cint;         { signal stack length }
 
84
        ss_flags : cint;         { SA_DISABLE and/or SA_ONSTACK }
 
85
    end;
 
86
 
 
87
     ppc_thread_state = record
 
88
  { Instruction address register (PC)  }
 
89
          srr0 : dword;
 
90
  { Machine state register (supervisor)  }
 
91
          srr1 : dword;
 
92
          r0 : dword;
 
93
          r1 : dword;
 
94
          r2 : dword;
 
95
          r3 : dword;
 
96
          r4 : dword;
 
97
          r5 : dword;
 
98
          r6 : dword;
 
99
          r7 : dword;
 
100
          r8 : dword;
 
101
          r9 : dword;
 
102
          r10 : dword;
 
103
          r11 : dword;
 
104
          r12 : dword;
 
105
          r13 : dword;
 
106
          r14 : dword;
 
107
          r15 : dword;
 
108
          r16 : dword;
 
109
          r17 : dword;
 
110
          r18 : dword;
 
111
          r19 : dword;
 
112
          r20 : dword;
 
113
          r21 : dword;
 
114
          r22 : dword;
 
115
          r23 : dword;
 
116
          r24 : dword;
 
117
          r25 : dword;
 
118
          r26 : dword;
 
119
          r27 : dword;
 
120
          r28 : dword;
 
121
          r29 : dword;
 
122
          r30 : dword;
 
123
          r31 : dword;
 
124
  { Condition register  }
 
125
          cr : dword;
 
126
  { User's integer exception register  }
 
127
          xer : dword;
 
128
  { Link register  }
 
129
          lr : dword;
 
130
  { Count register  }
 
131
          ctr : dword;
 
132
  { MQ register (601 only)  }
 
133
          mq : dword;
 
134
  { Vector Save Register  }
 
135
          vrsave : dword;
 
136
       end;
 
137
     ppc_thread_state_t = ppc_thread_state;
 
138
 
 
139
{$packrecords 4}
 
140
     ppc_thread_state64 = record
 
141
          srr0 : qword;
 
142
          srr1 : qword;
 
143
          r0 : qword;
 
144
          r1 : qword;
 
145
          r2 : qword;
 
146
          r3 : qword;
 
147
          r4 : qword;
 
148
          r5 : qword;
 
149
          r6 : qword;
 
150
          r7 : qword;
 
151
          r8 : qword;
 
152
          r9 : qword;
 
153
          r10 : qword;
 
154
          r11 : qword;
 
155
          r12 : qword;
 
156
          r13 : qword;
 
157
          r14 : qword;
 
158
          r15 : qword;
 
159
          r16 : qword;
 
160
          r17 : qword;
 
161
          r18 : qword;
 
162
          r19 : qword;
 
163
          r20 : qword;
 
164
          r21 : qword;
 
165
          r22 : qword;
 
166
          r23 : qword;
 
167
          r24 : qword;
 
168
          r25 : qword;
 
169
          r26 : qword;
 
170
          r27 : qword;
 
171
          r28 : qword;
 
172
          r29 : qword;
 
173
          r30 : qword;
 
174
          r31 : qword;
 
175
          cr : dword;
 
176
          xer : qword;
 
177
          lr : qword;
 
178
          ctr : qword;
 
179
          vrsave : dword;
 
180
       end;
 
181
     ppc_thread_state64_t = ppc_thread_state64;
 
182
 
 
183
{$packrecords C}
 
184
 
 
185
  { This structure should be double-word aligned for performance  }
 
186
  type
 
187
 
 
188
     ppc_float_state = record
 
189
          fpregs : array[0..31] of double;
 
190
  { fpscr is 64 bits, 32 bits of rubbish  }
 
191
          fpscr_pad : dword;
 
192
  { floating point status register  }
 
193
          fpscr : dword;
 
194
       end;
 
195
     ppc_float_state_t = ppc_float_state;
 
196
 
 
197
  { VRs that have been saved  }
 
198
     ppc_vector_state = record
 
199
          save_vr : array[0..31] of array[0..3] of dword;
 
200
          save_vscr : array[0..3] of dword;
 
201
          save_pad5 : array[0..3] of dword;
 
202
          save_vrvalid : dword;
 
203
          save_pad6 : array[0..6] of dword;
 
204
       end;
 
205
     ppc_vector_state_t = ppc_vector_state;
 
206
 
 
207
  {
 
208
     ppc_exception_state
 
209
    
 
210
     This structure corresponds to some additional state of the user
 
211
     registers as saved in the PCB upon kernel entry. They are only
 
212
     available if an exception is passed out of the kernel, and even
 
213
     then not all are guaranteed to be updated.
 
214
    
 
215
     Some padding is included in this structure which allows space for
 
216
     servers to store temporary values if need be, to maintain binary
 
217
     compatiblity.
 
218
    }
 
219
 
 
220
  type
 
221
 
 
222
     ppc_exception_state = record
 
223
  { Fault registers for coredump  }
 
224
          dar : dword;
 
225
          dsisr : dword;
 
226
  { number of powerpc exception taken  }
 
227
          exception : dword;
 
228
  { align to 16 bytes  }
 
229
          pad0 : dword;
 
230
  { space in PCB "just in case"  }
 
231
          pad1 : array[0..3] of dword;
 
232
       end;
 
233
     ppc_exception_state_t = ppc_exception_state;
 
234
 
 
235
{$packrecords 4}
 
236
 
 
237
  type
 
238
 
 
239
     ppc_exception_state64 = record
 
240
  { Fault registers for coredump  }
 
241
          dar : qword;
 
242
          dsisr : dword;
 
243
  { number of powerpc exception taken  }
 
244
          exception : dword;
 
245
  { space in PCB "just in case"  }
 
246
          pad1 : array[0..3] of dword;
 
247
       end;
 
248
     ppc_exception_state64_t = ppc_exception_state64;
 
249
 
 
250
{$packrecords C}
 
251
 
 
252
     mcontext_t = record
 
253
        es: ppc_exception_state_t;
 
254
        ss: ppc_thread_state_t;
 
255
        fs: ppc_float_state_t;
 
256
        vs: ppc_vector_state_t;
 
257
     end;
 
258
 
 
259
     psigcontextrec = ^sigcontextrec;
 
260
     sigcontextrec = record
 
261
        uc_onstack : cint;
 
262
        uc_sigmask : sigset_t;        { signal mask used by this context }
 
263
        uc_stack   : tdarwin_stack_t; { stack used by this context }
 
264
        uc_link    : psigcontextrec;  { pointer to resuming context }
 
265
        uc_mcsize  : size_t;          { size of the machine context passed in }
 
266
        uc_mcontext: ^mcontext_t;      { machine specific context }
 
267
     end;
 
268
 
 
269
{
 
270
  $Log: sig_cpu.inc,v $
 
271
  Revision 1.2  2004/01/08 21:52:34  jonas
 
272
    * fixed signal handling under 10.3.2, still have to verify whether it's
 
273
      backwards compatible
 
274
 
 
275
  Revision 1.1  2004/01/04 20:05:38  jonas
 
276
    * first working version of the Darwin/Mac OS X (for PowerPC) RTL
 
277
      Several non-essential units are still missing, but make cycle works
 
278
 
 
279
  Revision 1.1  2002/09/08 09:01:48  jonas
 
280
    + initial revision
 
281
 
 
282
}
 
 
b'\\ No newline at end of file'