* Updated haiku signal definitions to reflect changes made in Haiku

after alpha release 3.

git-svn-id: trunk@20683 -
This commit is contained in:
olivier 2012-04-01 08:03:12 +00:00
parent a75e298088
commit 76602008b5
3 changed files with 37 additions and 18 deletions

View File

@ -16,7 +16,7 @@
**********************************************************************} **********************************************************************}
procedure SignalToRunerror(sig : longint; SigContext: PSigContextRec; uContext: Pvregs);public name '_FPC_DEFAULTSIGHANDLER';cdecl; procedure SignalToRunerror(sig : longint; SigContext: PSigInfo; uContext: PSigContext);public name '_FPC_DEFAULTSIGHANDLER';cdecl;
var var
res,fpustate : word; res,fpustate : word;
begin begin
@ -53,10 +53,10 @@ begin
end; end;
SysResetFPU; SysResetFPU;
end; end;
(* SIGBUS: {Same as SIGSEGV under BeOS} SIGBUS:
begin begin
res:=214; res:=214;
end; *) end;
SIGILL: SIGILL:
begin begin
if sse_check then if sse_check then

View File

@ -17,7 +17,7 @@ Const { For sending a signal }
SA_NOCLDSTOP = $01; SA_NOCLDSTOP = $01;
SA_NOCLDWAIT = $02; SA_NOCLDWAIT = $02;
SA_RESETHAND = $03; SA_RESETHAND = $04;
SA_NODEFER = $08; SA_NODEFER = $08;
SA_RESTART = $10; SA_RESTART = $10;
SA_ONSTACK = $20; SA_ONSTACK = $20;
@ -78,8 +78,9 @@ Const { For sending a signal }
SIGVTALRM = 27; SIGVTALRM = 27;
SIGXCPU = 28; SIGXCPU = 28;
SIGXFSZ = 29; SIGXFSZ = 29;
SIGBUS = 30;
SIGBUS = SIGSEGV; SIGRESERVED1 = 31;
SIGRESERVED2 = 32;
{ {
Signal numbers 23-32 are currently free but may be used in future Signal numbers 23-32 are currently free but may be used in future
@ -234,7 +235,9 @@ type
Pvregs = ^vregs; Pvregs = ^vregs;
sigset_t = array[0..0] of Longint; sigset_t = array[0..1] of Cardinal;
PSigContext = ^vregs;
PSigContextRec = ^SigContextRec; PSigContextRec = ^SigContextRec;
SigContextRec = record SigContextRec = record
@ -278,20 +281,36 @@ type
fpr_pad : array[0..63] of char; fpr_pad : array[0..63] of char;
end; end;
Sigval = Record
Case Boolean OF
{ Members as suggested by Annex C of POSIX 1003.1b. }
false : (sigval_int : Longint);
True : (sigval_ptr : Pointer);
End;
PSigInfo = ^SigInfo_t;
PSigInfo_t = ^SigInfo_t;
SigInfo_t = packed record
si_signo, { signal number }
si_code, { signal code }
si_errno, { errno association }
si_pid : pid_t; { sending process }
si_uid : uid_t; { sender's ruid }
si_addr : Pointer; { faulting instruction }
si_status : Longint; { exit value }
si_band : Cardinal; { band event for SIGPOLL }
si_value : SigVal; { signal value }
end;
TSigInfo = SigInfo_t;
TSigInfo_t = TSigInfo;
SignalHandler = Procedure(Sig : Longint);cdecl; SignalHandler = Procedure(Sig : Longint);cdecl;
PSignalHandler = ^SignalHandler; PSignalHandler = ^SignalHandler;
SignalRestorer = Procedure;cdecl; SignalRestorer = Procedure;cdecl;
PSignalRestorer = ^SignalRestorer; PSignalRestorer = ^SignalRestorer;
{$WARNING TODO : check with signal.h} sigActionHandler = procedure(Sig: Longint; SigInfo: PSigInfo; uContext : PSigContext);cdecl;
{ Note: As of R1alpha3, sa_handler still was of SignalHandler type, with one parameter,
but the Signal stack has a second parameter that is set to zero
and a third that is of type pvregs }
sigActionHandler = procedure(Sig: Longint; SigContext: PSigContextRec; uContext : Pvregs);cdecl;
{ Add those type definition to obtain same declaration as for other unix targets
but do not forget the PSigInfo field is currently nil for Haiku as of R1alpha3. }
PSigInfo = PSigContextRec;
PSigContext = Pvregs;
Sigset=sigset_t; Sigset=sigset_t;
TSigset=sigset_t; TSigset=sigset_t;
@ -314,7 +333,7 @@ type
{$PACKRECORDS C} {$PACKRECORDS C}
pstack_t = ^stack_t; pstack_t = ^stack_t;
stack_t = record stack_t = packed record
ss_sp: pChar; {* signal stack base *} ss_sp: pChar; {* signal stack base *}
ss_size: size_t; {* signal stack length *} ss_size: size_t; {* signal stack length *}
ss_flags: cInt; {* SS_DISABLE and/or SS_ONSTACK *} ss_flags: cInt; {* SS_DISABLE and/or SS_ONSTACK *}

View File

@ -322,7 +322,7 @@ end;
//int sigaltstack(const stack_t *ss, stack_t *oss); //int sigaltstack(const stack_t *ss, stack_t *oss);
procedure set_signal_stack(ptr : pointer; size : size_t); cdecl; external 'root' name 'set_signal_stack'; procedure set_signal_stack(ptr : pointer; size : size_t); cdecl; external 'root' name 'set_signal_stack';
function sigaltstack(const ss : pstack_t; oss : pstack_t) : integer; cdecl; external 'root' name 'sigaltstack'; function sigaltstack(const stack : pstack_t; oldStack : pstack_t) : integer; cdecl; external 'root' name 'sigaltstack';
type type
{$PACKRECORDS C} {$PACKRECORDS C}