|
@@ -123,171 +123,14 @@ Const
|
|
|
const
|
|
|
SI_PAD_SIZE = ((128 div sizeof(longint)) - 3);
|
|
|
|
|
|
+
|
|
|
type
|
|
|
- tfpreg = record
|
|
|
- significand: array[0..3] of word;
|
|
|
- exponent: word;
|
|
|
- end;
|
|
|
-
|
|
|
- pfpstate = ^tfpstate;
|
|
|
- tfpstate = record
|
|
|
- cw, sw, tag, ipoff, cssel, dataoff, datasel: cardinal;
|
|
|
- st: array[0..7] of tfpreg;
|
|
|
- status: cardinal;
|
|
|
- end;
|
|
|
-
|
|
|
SigSet = array[0..wordsinsigset-1] of cint;
|
|
|
sigset_t= SigSet;
|
|
|
PSigSet = ^SigSet;
|
|
|
psigset_t=psigset;
|
|
|
TSigSet = SigSet;
|
|
|
-
|
|
|
-
|
|
|
-{$ifdef cpui386}
|
|
|
- PSigContextRec = ^SigContextRec;
|
|
|
- SigContextRec = record
|
|
|
- gs, __gsh: word;
|
|
|
- fs, __fsh: word;
|
|
|
- es, __esh: word;
|
|
|
- ds, __dsh: word;
|
|
|
- edi: cardinal;
|
|
|
- esi: cardinal;
|
|
|
- ebp: cardinal;
|
|
|
- esp: cardinal;
|
|
|
- ebx: cardinal;
|
|
|
- edx: cardinal;
|
|
|
- ecx: cardinal;
|
|
|
- eax: cardinal;
|
|
|
- trapno: cardinal;
|
|
|
- err: cardinal;
|
|
|
- eip: cardinal;
|
|
|
- cs, __csh: word;
|
|
|
- eflags: cardinal;
|
|
|
- esp_at_signal: cardinal;
|
|
|
- ss, __ssh: word;
|
|
|
- fpstate: pfpstate;
|
|
|
- oldmask: cardinal;
|
|
|
- cr2: cardinal;
|
|
|
- end;
|
|
|
-{$endif cpui386}
|
|
|
-
|
|
|
-
|
|
|
-{$Ifdef cpum68k}
|
|
|
- PSigContextRec = ^SigContextRec;
|
|
|
- SigContextRec = record
|
|
|
- { dummy for now PM }
|
|
|
- end;
|
|
|
-{$endif cpum68k}
|
|
|
-
|
|
|
-
|
|
|
-{$ifdef cpupowerpc}
|
|
|
- { from include/ppc/ptrace.h }
|
|
|
- pptregs = ^tptregs;
|
|
|
- tptregs = record
|
|
|
- gpr: array[0..31] of cardinal;
|
|
|
- nip: cardinal;
|
|
|
- msr: cardinal;
|
|
|
- orig_gpr3: cardinal; { Used for restarting system calls }
|
|
|
- ctr: cardinal;
|
|
|
- link: cardinal;
|
|
|
- xer: cardinal;
|
|
|
- ccr: cardinal;
|
|
|
- mq: cardinal; { 601 only (not used at present) }
|
|
|
- { Used on APUS to hold IPL value. }
|
|
|
- trap: cardinal; { Reason for being here }
|
|
|
- dar: cardinal; { Fault registers }
|
|
|
- dsisr: cardinal;
|
|
|
- result: cardinal; { Result of a system call }
|
|
|
- end;
|
|
|
-
|
|
|
- { from include/asm/ppc/siginfo.h }
|
|
|
- psiginfo = ^tsiginfo;
|
|
|
- tsiginfo = record
|
|
|
- si_signo : longint;
|
|
|
- si_errno : longint;
|
|
|
- si_code : longint;
|
|
|
- _sifields : record
|
|
|
- case longint of
|
|
|
- 0 : ( _pad : array[0..(SI_PAD_SIZE)-1] of longint );
|
|
|
- 1 : ( _kill : record
|
|
|
- _pid : pid_t;
|
|
|
- _uid : uid_t;
|
|
|
- end );
|
|
|
- 2 : ( _timer : record
|
|
|
- _timer1 : dword;
|
|
|
- _timer2 : dword;
|
|
|
- end );
|
|
|
- 3 : ( _rt : record
|
|
|
- _pid : pid_t;
|
|
|
- _uid : uid_t;
|
|
|
- _sigval : pointer;
|
|
|
- end );
|
|
|
- 4 : ( _sigchld : record
|
|
|
- _pid : pid_t;
|
|
|
- _uid : uid_t;
|
|
|
- _status : longint;
|
|
|
- _utime : clock_t;
|
|
|
- _stime : clock_t;
|
|
|
- end );
|
|
|
- 5 : ( _sigfault : record
|
|
|
- _addr : pointer;
|
|
|
- end );
|
|
|
- 6 : ( _sigpoll : record
|
|
|
- _band : longint;
|
|
|
- _fd : longint;
|
|
|
- end );
|
|
|
- end;
|
|
|
- end;
|
|
|
-
|
|
|
-
|
|
|
- { from include/asm-ppc/signal.h }
|
|
|
- stack_t = record
|
|
|
- ss_sp: pointer;
|
|
|
- ss_flags: longint;
|
|
|
- ss_size: size_t;
|
|
|
- end;
|
|
|
-
|
|
|
- { from include/asm-ppc/sigcontext.h }
|
|
|
- tsigcontext_struct = record
|
|
|
- _unused: array[0..3] of dword;
|
|
|
- signal: longint;
|
|
|
- handler: dword;
|
|
|
- oldmask: dword;
|
|
|
- pt_regs: pptregs;
|
|
|
- end;
|
|
|
-
|
|
|
- { from include/asm-ppc/ucontext.h }
|
|
|
- pucontext = ^tucontext;
|
|
|
- tucontext = record
|
|
|
- uc_flags : dword;
|
|
|
- uc_link : pucontext;
|
|
|
- uc_stack : stack_t;
|
|
|
- uc_mcontext : tsigcontext_struct;
|
|
|
- uc_sigmask : sigset_t;
|
|
|
- end;
|
|
|
-
|
|
|
-
|
|
|
- { from arch/ppc/kernel/signal.c, the type of the actual parameter passed }
|
|
|
- { to the sigaction handler }
|
|
|
- t_rt_sigframe = record
|
|
|
- _unused: array[0..1] of cardinal;
|
|
|
- pinfo: psiginfo;
|
|
|
- puc: pointer;
|
|
|
- siginfo: tsiginfo;
|
|
|
- uc: tucontext;
|
|
|
- end;
|
|
|
-
|
|
|
- PSigContextRec = ^SigContextRec;
|
|
|
- SigContextRec = tsigcontext_struct;
|
|
|
-{$endif cpupowerpc}
|
|
|
-
|
|
|
-
|
|
|
-{$ifdef cpusparc}
|
|
|
- PSigContextRec = ^SigContextRec;
|
|
|
- SigContextRec = record
|
|
|
- { dummy for now PM }
|
|
|
- end;
|
|
|
-
|
|
|
+
|
|
|
psiginfo = ^tsiginfo;
|
|
|
tsiginfo = record
|
|
|
si_signo : longint;
|
|
@@ -325,152 +168,16 @@ type
|
|
|
end );
|
|
|
end;
|
|
|
end;
|
|
|
-{$endif cpusparc}
|
|
|
|
|
|
-{$ifdef cpux86_64}
|
|
|
- p_fpstate = ^_fpstate;
|
|
|
- _fpstate = packed record
|
|
|
- cwd,
|
|
|
- swd,
|
|
|
- twd, // Note this is not the same as the 32bit/x87/FSAVE twd
|
|
|
- fop : word;
|
|
|
- rip,
|
|
|
- rdp : qword;
|
|
|
- mxcsr,
|
|
|
- mxcsr_mask : dword;
|
|
|
- st_space : array[0..31] of dword; // 8*16 bytes for each FP-reg
|
|
|
- xmm_space : array[0..63] of dword; // 16*16 bytes for each XMM-reg
|
|
|
- reserved2 : array[0..23] of dword;
|
|
|
- end;
|
|
|
-
|
|
|
- PSigContextRec = ^SigContextRec;
|
|
|
- SigContextRec = packed record
|
|
|
- __pad00 : array[0..4] of qword;
|
|
|
- r8,
|
|
|
- r9,
|
|
|
- r10,
|
|
|
- r11,
|
|
|
- r12,
|
|
|
- r13,
|
|
|
- r14,
|
|
|
- r15,
|
|
|
- rdi,
|
|
|
- rsi,
|
|
|
- rbp,
|
|
|
- rbx,
|
|
|
- rdx,
|
|
|
- rax,
|
|
|
- rcx,
|
|
|
- rsp,
|
|
|
- rip,
|
|
|
- eflags : qword;
|
|
|
- cs,
|
|
|
- gs,
|
|
|
- fs,
|
|
|
- __pad0 : word;
|
|
|
- err,
|
|
|
- trapno,
|
|
|
- oldmask,
|
|
|
- cr2 : qword;
|
|
|
- fpstate : p_fpstate; // zero when no FPU context */
|
|
|
- reserved1 : array[0..7] of qword;
|
|
|
- end;
|
|
|
-{$endif cpux86_64}
|
|
|
-
|
|
|
-{$ifdef cpuarm}
|
|
|
- PSigContextRec = ^SigContextRec;
|
|
|
- SigContextRec = record
|
|
|
- trap_no : dword;
|
|
|
- error_code : dword;
|
|
|
- oldmask : dword;
|
|
|
- arm_r0 : dword;
|
|
|
- arm_r1 : dword;
|
|
|
- arm_r2 : dword;
|
|
|
- arm_r3 : dword;
|
|
|
- arm_r4 : dword;
|
|
|
- arm_r5 : dword;
|
|
|
- arm_r6 : dword;
|
|
|
- arm_r7 : dword;
|
|
|
- arm_r8 : dword;
|
|
|
- arm_r9 : dword;
|
|
|
- arm_r10 : dword;
|
|
|
- arm_fp : dword;
|
|
|
- arm_ip : dword;
|
|
|
- arm_sp : dword;
|
|
|
- arm_lr : dword;
|
|
|
- arm_pc : dword;
|
|
|
- arm_cpsr : dword;
|
|
|
- fault_address : dword;
|
|
|
- end;
|
|
|
-
|
|
|
- { from include/asm-ppc/signal.h }
|
|
|
- stack_t = record
|
|
|
- ss_sp: pointer;
|
|
|
- ss_flags: longint;
|
|
|
- ss_size: size_t;
|
|
|
- end;
|
|
|
-
|
|
|
- { from include/asm-arm/ucontext.h }
|
|
|
- pucontext = ^tucontext;
|
|
|
- tucontext = record
|
|
|
- uc_flags : dword;
|
|
|
- uc_link : pucontext;
|
|
|
- uc_stack : stack_t;
|
|
|
- uc_mcontext : SigContextRec;
|
|
|
- uc_sigmask : sigset_t;
|
|
|
- end;
|
|
|
-{$endif cpuarm}
|
|
|
-
|
|
|
- PSigInfoRec = ^SigInfoRec;
|
|
|
- SigInfoRec = record
|
|
|
- si_signo: longint;
|
|
|
- si_errno: longint;
|
|
|
- si_code: longint;
|
|
|
-
|
|
|
- case longint of
|
|
|
- 0:
|
|
|
- (pad: array[0..SI_PAD_SIZE-1] of longint);
|
|
|
- 1: { kill }
|
|
|
- ( kill: record
|
|
|
- pid: longint; { sender's pid }
|
|
|
- uid : longint; { sender's uid }
|
|
|
- end );
|
|
|
- 2: { POSIX.1b timers }
|
|
|
- ( timer : record
|
|
|
- timer1 : cardinal;
|
|
|
- timer2 : cardinal;
|
|
|
- end );
|
|
|
- 3: { POSIX.1b signals }
|
|
|
- ( rt : record
|
|
|
- pid : longint; { sender's pid }
|
|
|
- uid : longint; { sender's uid }
|
|
|
- sigval : longint;
|
|
|
- end );
|
|
|
- 4: { SIGCHLD }
|
|
|
- ( sigchld : record
|
|
|
- pid : longint; { which child }
|
|
|
- uid : longint; { sender's uid }
|
|
|
- status : longint; { exit code }
|
|
|
- utime : timeval;
|
|
|
- stime : timeval;
|
|
|
- end );
|
|
|
- 5: { SIGILL, SIGFPE, SIGSEGV, SIGBUS }
|
|
|
- ( sigfault : record
|
|
|
- addr : pointer;{ faulting insn/memory ref. }
|
|
|
- end );
|
|
|
- 6:
|
|
|
- ( sigpoll : record
|
|
|
- band : longint; { POLL_IN, POLL_OUT, POLL_MSG }
|
|
|
- fd : longint;
|
|
|
- end );
|
|
|
- end;
|
|
|
+{ CPU dependent TSigContext }
|
|
|
+{$i sighndh.inc}
|
|
|
|
|
|
+type
|
|
|
SignalHandler = Procedure(Sig : Longint);cdecl;
|
|
|
PSignalHandler = ^SignalHandler;
|
|
|
SignalRestorer = Procedure;cdecl;
|
|
|
PSignalRestorer = ^SignalRestorer;
|
|
|
- TSigAction = procedure(Sig: Longint; SigContext: SigContextRec);cdecl;
|
|
|
-
|
|
|
+ SigActionHandler = procedure(sig : longint; SigInfo: PSigInfo; SigContext: PSigContext);cdecl;
|
|
|
|
|
|
{$ifdef CPUARM}
|
|
|
{$define NEWSIGNAL}
|
|
@@ -481,15 +188,7 @@ type
|
|
|
{$endif CPUx86_64}
|
|
|
|
|
|
SigActionRec = packed record // this is temporary for the migration
|
|
|
- {$ifdef posixworkaround}
|
|
|
- sa_handler : signalhandler;
|
|
|
- {$else}
|
|
|
- Handler : record
|
|
|
- case byte of
|
|
|
- 0: (Sh: SignalHandler);
|
|
|
- 1: (Sa: TSigAction);
|
|
|
- end;
|
|
|
- {$endif}
|
|
|
+ sa_handler : SigActionHandler;
|
|
|
{$ifdef NEWSIGNAL}
|
|
|
Sa_Flags : cuint;
|
|
|
Sa_restorer : SignalRestorer; { Obsolete - Don't use }
|
|
@@ -505,7 +204,12 @@ type
|
|
|
|
|
|
{
|
|
|
$Log$
|
|
|
- Revision 1.22 2004-08-04 19:27:10 florian
|
|
|
+ Revision 1.23 2005-01-30 18:01:15 peter
|
|
|
+ * signal cleanup for linux
|
|
|
+ * sigactionhandler instead of tsigaction for bsds
|
|
|
+ * sigcontext moved to cpu dir
|
|
|
+
|
|
|
+ Revision 1.22 2004/08/04 19:27:10 florian
|
|
|
* fixed floating point and integer exception handling on sparc/linux
|
|
|
|
|
|
Revision 1.21 2004/05/31 09:08:14 peter
|