PERFORCE change 116212 for review
Oleksandr Tymoshenko
gonzo at FreeBSD.org
Tue Mar 20 16:25:50 UTC 2007
http://perforce.freebsd.org/chv.cgi?CH=116212
Change 116212 by gonzo at gonzo_jeeves on 2007/03/20 16:24:51
o Implement TRAPF_USERMODE, TRAPF_PC macroses.
o Implement cpu_getstack and cpu_setstack macroses.
Affected files ...
.. //depot/projects/mips2/src/sys/mips/include/cpu.h#5 edit
Differences ...
==== //depot/projects/mips2/src/sys/mips/include/cpu.h#5 (text+ko) ====
@@ -36,6 +36,8 @@
#ifndef _MACHINE_CPU_H_
#define _MACHINE_CPU_H_
+#include <machine/frame.h>
+
/*
* definitions of cpu-dependent requirements
* referenced in generic code
@@ -44,28 +46,13 @@
#define cpu_exec(p) /* nothing */
#define cpu_swapin(p) /* nothing */
-/*
- * XXXMIPS: Change those once we'll bring header files from NetBSD.
- */
-#if 0
-#define cpu_getstack(td) ((td)->td_frame->tf_rsp)
-#define cpu_setstack(td, ap) ((td)->td_frame->tf_rsp = (ap))
-#define cpu_spinwait() /* ia32_pause() */
-#endif
-#define cpu_getstack(td) (0)
-#define cpu_setstack(td, ap) (0)
-#define cpu_spinwait()
+#define cpu_getstack(td) ((td)->td_frame->tf_regs[TF_SP])
+#define cpu_setstack(td, ap) ((td)->td_frame->tf_regs[TF_SP] = (ap))
+#define cpu_spinwait() /* XXXMIPS */
-/*
- * XXXMIPS: Change those once we'll bring header files from NetBSD.
- */
-#if 0
#define TRAPF_USERMODE(framep) \
- (ISPL((framep)->tf_cs) == SEL_UPL)
-#define TRAPF_PC(framep) ((framep)->tf_rip)
-#endif
-#define TRAPF_USERMODE(framep) (0)
-#define TRAPF_PC(framep) (0)
+ (((framep)->tf_regs[TF_SR] & MIPS_SR_KSU_USER) != 0)
+#define TRAPF_PC(framep) ((framep)->tf_regs[TF_EPC])
/*
* CTL_MACHDEP definitions.
More information about the p4-projects
mailing list