Signals implemented
git-svn-id: svn://svn.cc65.org/cc65/trunk@2020 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
parent
7e4ac2c687
commit
13ff905946
2 changed files with 14 additions and 16 deletions
|
@ -34,9 +34,7 @@
|
||||||
|
|
||||||
|
|
||||||
; Standard signal handling functions
|
; Standard signal handling functions
|
||||||
SIG_ERR = $FFFF
|
SIG_ERR = $0000
|
||||||
SIG_IGN = $0000
|
|
||||||
SIG_DFL = $0001
|
|
||||||
|
|
||||||
; Signal numbers
|
; Signal numbers
|
||||||
SIGABRT = 0
|
SIGABRT = 0
|
||||||
|
@ -45,19 +43,15 @@ SIGILL = 2
|
||||||
SIGINT = 3
|
SIGINT = 3
|
||||||
SIGSEGV = 4
|
SIGSEGV = 4
|
||||||
SIGTERM = 5
|
SIGTERM = 5
|
||||||
SIGCOUNT = 6 ; Number of signals (maximum: 8)
|
SIGCOUNT = 6 ; Number of signals
|
||||||
|
|
||||||
; Signal masks
|
; Table with signal handlers (asm code only)
|
||||||
SIGMASK_ABRT = (1 .SHL SIGABRT)
|
.global sigtable
|
||||||
SIGMASK_FPE = (1 .SHL SIGFPE)
|
|
||||||
SIGMASK_ILL = (1 .SHL SIGILL)
|
|
||||||
SIGMASK_INT = (1 .SHL SIGINT)
|
|
||||||
SIGMASK_SEGV = (1 .SHL SIGSEGV)
|
|
||||||
SIGMASK_TERM = (1 .SHL SIGTERM)
|
|
||||||
|
|
||||||
; Function declarations
|
; Function declarations
|
||||||
|
.global __sig_ign
|
||||||
|
.global __sig_dfl
|
||||||
.global _signal
|
.global _signal
|
||||||
.global _raise
|
.global _raise
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -42,12 +42,16 @@
|
||||||
typedef unsigned char sig_atomic_t;
|
typedef unsigned char sig_atomic_t;
|
||||||
|
|
||||||
/* Type of a signal handler */
|
/* Type of a signal handler */
|
||||||
typedef void (*__sigfunc) (int);
|
typedef void __fastcall__ (*__sigfunc) (int);
|
||||||
|
|
||||||
|
/* Functions that implement SIG_IGN and SIG_DFL */
|
||||||
|
void _sig_ign (int);
|
||||||
|
void _sig_dfl (int);
|
||||||
|
|
||||||
/* Standard signal handling functions */
|
/* Standard signal handling functions */
|
||||||
#define SIG_IGN ((__sigfunc) 0x0000)
|
#define SIG_DFL _sig_dfl
|
||||||
#define SIG_ERR ((__sigfunc) 0xFFFF)
|
#define SIG_IGN _sig_ign
|
||||||
#define SIG_DFL ((__sigfunc) 0xFFFE)
|
#define SIG_ERR ((__sigfunc) 0x0000)
|
||||||
|
|
||||||
/* Signal numbers */
|
/* Signal numbers */
|
||||||
#define SIGABRT 0
|
#define SIGABRT 0
|
||||||
|
|
Loading…
Add table
Reference in a new issue