lx_signal.h revision 6ff14d8c34ba24afb23f87d044c08da8245f3c84
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_LX_SIGNAL_H
#define _SYS_LX_SIGNAL_H
#pragma ident "%Z%%M% %I% %E% SMI"
#if !defined(_ASM)
#include <sys/lx_types.h>
#include <lx_signum.h>
#endif /* !defined(_ASM) */
#ifdef __cplusplus
extern "C" {
#endif
/*
* Linux sigaction flags
*/
#define LX_SA_NOCLDSTOP 0x00000001
#define LX_SA_NOCLDWAIT 0x00000002
#define LX_SA_SIGINFO 0x00000004
#define LX_SA_RESTORER 0x04000000
#define LX_SA_ONSTACK 0x08000000
#define LX_SA_RESTART 0x10000000
#define LX_SA_NODEFER 0x40000000
#define LX_SA_RESETHAND 0x80000000
#define LX_SA_NOMASK LX_SA_NODEFER
#define LX_SA_ONESHOT LX_SA_RESETHAND
#define LX_SIG_BLOCK 0
#define LX_SIG_UNBLOCK 1
#define LX_SIG_SETMASK 2
#define LX_MINSIGSTKSZ 2048
#define LX_SS_ONSTACK 1
#define LX_SS_DISABLE 2
#define LX_SIGRT_MAGIC 0xdeadf00d
#if !defined(_ASM)
/*
* NOTE: Linux uses different definitions for sigset_ts and sigaction_ts
* depending on whether the definition is for user space or the kernel.
*
* The definitions below MUST correspond to the Linux kernel versions,
* as glibc will do the necessary translation from the Linux user
* versions.
*/
typedef struct {
} lx_sigset_t;
typedef struct lx_sigaction {
void (*lxsa_handler)();
int lxsa_flags;
void (*lxsa_restorer)(void);
typedef uint32_t lx_osigset_t;
/*
* Flag settings to determine whether common routines should operate on
* lx_sigset_ts or lx_osigset_ts.
*/
#define USE_OSIGSET 0
#define USE_SIGSET 1
typedef struct lx_osigaction {
void (*lxsa_handler)();
int lxsa_flags;
void (*lxsa_restorer)(void);
#define LX_SI_MAX_SIZE 128
typedef struct lx_siginfo {
int lsi_signo;
int lsi_errno;
int lsi_code;
union {
int _pad[LX_SI_PAD_SIZE];
struct {
} _kill;
struct {
} _timer;
struct {
} _rt;
struct {
int _status; /* exit code */
} _sigchld;
struct {
} _sigfault;
struct {
int _band; /* POLL_IN,POLL_OUT,POLL_MSG */
int _fd;
} _sigpoll;
} _sifields;
} lx_siginfo_t;
/*
* lx_siginfo_t lsi_code values
*
* LX_SI_ASYNCNL: Sent by asynch name lookup completion
* LX_SI_TKILL: Sent by tkill
* LX_SI_SIGIO: Sent by queued SIGIO
* LX_SI_ASYNCIO: Sent by asynchronous I/O completion
* LX_SI_MESGQ: Sent by real time message queue state change
* LX_SI_TIMER: Sent by timer expiration
* LX_SI_QUEUE: Sent by sigqueue
* LX_SI_USER: Sent by kill, sigsend, raise, etc.
* LX_SI_KERNEL: Sent by kernel
*
* At present, LX_SI_ASYNCNL and LX_SI_SIGIO are unused by BrandZ.
*/
#define LX_SI_ASYNCNL (-60)
#define LX_SI_TKILL (-6)
#define LX_SI_SIGIO (-5)
#define LX_SI_ASYNCIO (-4)
#define LX_SI_MESGQ (-3)
#define LX_SI_TIMER (-2)
#define LX_SI_QUEUE (-1)
#define LX_SI_USER (0)
#define LX_SI_KERNEL (0x80)
typedef struct lx_sighandlers {
typedef struct lx_sigaltstack {
void *ss_sp;
int ss_flags;
} lx_stack_t;
struct lx_fpreg {
};
struct lx_fpxreg {
};
struct lx_xmmreg {
};
#define LX_X86_FXSR_MAGIC 0x0000
#define LX_X86_FXSR_NONE 0xffff
typedef struct lx_fpstate {
/* Regular FPU environment */
/* FXSR FPU environment */
} lx_fpstate_t;
typedef struct lx_sigcontext {
typedef struct lx_ucontext {
struct lx_ucontext *uc_link;
#define LX_SI_MAX_SIZE 128
extern const int ltos_signo[];
extern const int stol_signo[];
extern void setsigacthandler(void (*)(int, siginfo_t *, void *),
void (**)(int, siginfo_t *, void *));
extern int lx_siginit(void);
extern void lx_sigreturn_tolibc(uintptr_t);
void (*)(), uintptr_t);
#endif /* !defined(_ASM) */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_LX_SIGNAL_H */