summaryrefslogtreecommitdiffstats
path: root/sys/amd64/include/signal.h
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2003-05-01 01:05:25 +0000
committerpeter <peter@FreeBSD.org>2003-05-01 01:05:25 +0000
commit45949ccde13fb04ed597a5aef80b678ba16bcab7 (patch)
treedd665cefeba0e426ad2b212b76851de96f1ad18b /sys/amd64/include/signal.h
parent1fd7bc609e9a5249f7b7b558405e1c39aca79796 (diff)
downloadFreeBSD-src-45949ccde13fb04ed597a5aef80b678ba16bcab7.zip
FreeBSD-src-45949ccde13fb04ed597a5aef80b678ba16bcab7.tar.gz
Commit MD parts of a loosely functional AMD64 port. This is based on
a heavily stripped down FreeBSD/i386 (brutally stripped down actually) to attempt to get a stable base to start from. There is a lot missing still. Worth noting: - The kernel runs at 1GB in order to cheat with the pmap code. pmap uses a variation of the PAE code in order to avoid having to worry about 4 levels of page tables yet. - It boots in 64 bit "long mode" with a tiny trampoline embedded in the i386 loader. This simplifies locore.s greatly. - There are still quite a few fragments of i386-specific code that have not been translated yet, and some that I cheated and wrote dumb C versions of (bcopy etc). - It has both int 0x80 for syscalls (but using registers for argument passing, as is native on the amd64 ABI), and the 'syscall' instruction for syscalls. int 0x80 preserves all registers, 'syscall' does not. - I have tried to minimize looking at the NetBSD code, except in a couple of places (eg: to find which register they use to replace the trashed %rcx register in the syscall instruction). As a result, there is not a lot of similarity. I did look at NetBSD a few times while debugging to get some ideas about what I might have done wrong in my first attempt.
Diffstat (limited to 'sys/amd64/include/signal.h')
-rw-r--r--sys/amd64/include/signal.h90
1 files changed, 30 insertions, 60 deletions
diff --git a/sys/amd64/include/signal.h b/sys/amd64/include/signal.h
index fb2d82c..baa0c4e 100644
--- a/sys/amd64/include/signal.h
+++ b/sys/amd64/include/signal.h
@@ -44,7 +44,7 @@
* Machine-dependent signal definitions
*/
-typedef int sig_atomic_t;
+typedef long sig_atomic_t;
#if __XSI_VISIBLE
/*
@@ -60,7 +60,6 @@ typedef int sig_atomic_t;
/*
* Only the kernel should need these old type definitions.
*/
-#if defined(_KERNEL) && defined(COMPAT_43)
/*
* Information pushed on stack when a signal is delivered.
* This is used by the kernel to restore state following
@@ -68,75 +67,46 @@ typedef int sig_atomic_t;
* to the handler to allow it to restore state properly if
* a non-standard exit is performed.
*/
-struct osigcontext {
- int sc_onstack; /* sigstack state to restore */
- osigset_t sc_mask; /* signal mask to restore */
- int sc_esp; /* machine state follows: */
- int sc_ebp;
- int sc_isp;
- int sc_eip;
- int sc_efl;
- int sc_es;
- int sc_ds;
- int sc_cs;
- int sc_ss;
- int sc_edi;
- int sc_esi;
- int sc_ebx;
- int sc_edx;
- int sc_ecx;
- int sc_eax;
- int sc_gs;
- int sc_fs;
- int sc_trapno;
- int sc_err;
-};
-#endif
-
/*
* The sequence of the fields/registers in struct sigcontext should match
* those in mcontext_t.
*/
struct sigcontext {
struct __sigset sc_mask; /* signal mask to restore */
- int sc_onstack; /* sigstack state to restore */
- int sc_gs; /* machine state (struct trapframe) */
- int sc_fs;
- int sc_es;
- int sc_ds;
- int sc_edi;
- int sc_esi;
- int sc_ebp;
- int sc_isp;
- int sc_ebx;
- int sc_edx;
- int sc_ecx;
- int sc_eax;
- int sc_trapno;
- int sc_err;
- int sc_eip;
- int sc_cs;
- int sc_efl;
- int sc_esp;
- int sc_ss;
- int sc_len; /* sizeof(mcontext_t) */
+ long sc_onstack; /* sigstack state to restore */
+ long sc_r15; /* machine state (struct trapframe) */
+ long sc_r14;
+ long sc_r13;
+ long sc_r12;
+ long sc_r11;
+ long sc_r10;
+ long sc_r9;
+ long sc_r8;
+ long sc_rdi;
+ long sc_rsi;
+ long sc_rbp;
+ long sc_rbx;
+ long sc_rdx;
+ long sc_rcx;
+ long sc_rax;
+ long sc_trapno;
+ long sc_err;
+ long sc_rip;
+ long sc_cs;
+ long sc_rflags;
+ long sc_rsp;
+ long sc_ss;
+ long sc_len; /* sizeof(mcontext_t) */
/*
* XXX - See <machine/ucontext.h> and <machine/npx.h> for
* the following fields.
*/
- int sc_fpformat;
- int sc_ownedfp;
- int sc_spare1[1];
- int sc_fpstate[128] __aligned(16);
- int sc_spare2[8];
+ long sc_fpformat;
+ long sc_ownedfp;
+ long sc_spare1[1];
+ long sc_fpstate[128] __aligned(16);
+ long sc_spare2[8];
};
-
-#define sc_sp sc_esp
-#define sc_fp sc_ebp
-#define sc_pc sc_eip
-#define sc_ps sc_efl
-#define sc_eflags sc_efl
-
#endif /* __BSD_VISIBLE */
#endif /* !_MACHINE_SIGNAL_H_ */
OpenPOWER on IntegriCloud