summaryrefslogtreecommitdiffstats
path: root/sys/alpha/include
diff options
context:
space:
mode:
authordeischen <deischen@FreeBSD.org>2002-11-16 06:35:53 +0000
committerdeischen <deischen@FreeBSD.org>2002-11-16 06:35:53 +0000
commit31ea801074585bde84b74ea76bbedd715ad2f3a4 (patch)
tree7153d8e405a5cd14ef74512c9e674270132975b7 /sys/alpha/include
parenta858c2cb5c0438dd0886b2672ecba35cc82bf1dc (diff)
downloadFreeBSD-src-31ea801074585bde84b74ea76bbedd715ad2f3a4.zip
FreeBSD-src-31ea801074585bde84b74ea76bbedd715ad2f3a4.tar.gz
Add getcontext, setcontext, and swapcontext as system calls.
Previously these were libc functions but were requested to be made into system calls for atomicity and to coalesce what might be two entrances into the kernel (signal mask setting and floating point trap) into one. A few style nits and comments from bde are also included. Tested on alpha by: gallatin
Diffstat (limited to 'sys/alpha/include')
-rw-r--r--sys/alpha/include/cpu.h8
-rw-r--r--sys/alpha/include/fpu.h4
-rw-r--r--sys/alpha/include/signal.h7
-rw-r--r--sys/alpha/include/ucontext.h9
4 files changed, 14 insertions, 14 deletions
diff --git a/sys/alpha/include/cpu.h b/sys/alpha/include/cpu.h
index 9d05765..0e39182 100644
--- a/sys/alpha/include/cpu.h
+++ b/sys/alpha/include/cpu.h
@@ -115,11 +115,11 @@ void XentRestart(void); /* MAGIC */
void XentSys(u_int64_t, u_int64_t, u_int64_t); /* MAGIC */
void XentUna(u_int64_t, u_int64_t, u_int64_t); /* MAGIC */
void alpha_init(u_long, u_long, u_long, u_long, u_long);
+void alpha_fpstate_check(struct thread *td);
+void alpha_fpstate_drop(struct thread *td);
+void alpha_fpstate_save(struct thread *td, int write);
+void alpha_fpstate_switch(struct thread *td);
int alpha_pa_access(u_long);
-void alpha_fpstate_check(struct thread *p);
-void alpha_fpstate_save(struct thread *p, int write);
-void alpha_fpstate_drop(struct thread *p);
-void alpha_fpstate_switch(struct thread *p);
int badaddr (void *, size_t);
int badaddr_read(void *, size_t, void *);
u_int64_t console_restart(u_int64_t, u_int64_t, u_int64_t);
diff --git a/sys/alpha/include/fpu.h b/sys/alpha/include/fpu.h
index 712a1f9..9f4800f 100644
--- a/sys/alpha/include/fpu.h
+++ b/sys/alpha/include/fpu.h
@@ -116,9 +116,7 @@
__asm__("trapb")
#ifdef _KERNEL
-
-extern int fp_software_completion(u_int64_t regmask, struct thread *p);
-
+extern int fp_software_completion(u_int64_t regmask, struct thread *td);
#endif
#endif /* ! _MACHINE_FPU_H_ */
diff --git a/sys/alpha/include/signal.h b/sys/alpha/include/signal.h
index 2a1f17b..37a969e 100644
--- a/sys/alpha/include/signal.h
+++ b/sys/alpha/include/signal.h
@@ -94,10 +94,9 @@ struct sigcontext {
unsigned long sc_fpregs[32]; /* FP register set (see above) */
unsigned long sc_fpcr; /* FP control register (see above) */
unsigned long sc_fp_control; /* FP software control word */
- long sc_ownedfp; /* fp has been used */
- long sc_xxx1[2]; /* sc_ssize, sc_sbase on DUX */
- long sc_xxx2[3]; /* sc_fp_trap_pc, sc_fp_trigger_sum, sc_fp_trigger_inst */
- long sc_reserved[2]; /* XXX */
+ long sc_ownedfp; /* fp has been used; see mcontext_t */
+ long sc_format; /* see mcontext_t */
+ long sc_spare[6]; /* XXX */
};
#define sc_sp sc_regs[R_SP]
diff --git a/sys/alpha/include/ucontext.h b/sys/alpha/include/ucontext.h
index bfc18df..2c3ed70 100644
--- a/sys/alpha/include/ucontext.h
+++ b/sys/alpha/include/ucontext.h
@@ -43,11 +43,14 @@ typedef struct __mcontext {
unsigned long mc_fpregs[32];
unsigned long mc_fpcr;
unsigned long mc_fp_control;
+#define _MC_FPOWNED_NONE 0 /* FP state not used */
+#define _MC_FPOWNED_FPU 1 /* FP state came from FPU */
+#define _MC_FPOWNED_PCB 2 /* FP state came from PCB */
long mc_ownedfp;
-#define __UC_REV0_SIGFRAME 1 /* context is a signal frame */
-#define __UC_REV0_TRAPFRAME 2 /* context is a trap frame */
+#define _MC_REV0_SIGFRAME 1 /* context is a signal frame */
+#define _MC_REV0_TRAPFRAME 2 /* context is a trap frame */
long mc_format;
- long __spare__[6];
+ long mc_spare[6];
} mcontext_t;
#if defined(_KERNEL) && defined(COMPAT_FREEBSD4)
OpenPOWER on IntegriCloud