summaryrefslogtreecommitdiffstats
path: root/sys/alpha/include
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2001-02-10 02:20:34 +0000
committerjhb <jhb@FreeBSD.org>2001-02-10 02:20:34 +0000
commita9c84e00da6824d43126b1e221e6e6e95cc276c8 (patch)
tree2ffe447aaa792aff3416e8c400ea31e67ab643b7 /sys/alpha/include
parentefcbded13731a03d5149d347fa46611d5ff0ffff (diff)
downloadFreeBSD-src-a9c84e00da6824d43126b1e221e6e6e95cc276c8.zip
FreeBSD-src-a9c84e00da6824d43126b1e221e6e6e95cc276c8.tar.gz
- Make astpending and need_resched process attributes rather than CPU
attributes. This is needed for AST's to be properly posted in a preemptive kernel. They are backed by two new flags in p_sflag: PS_ASTPENDING and PS_NEEDRESCHED. They are still accesssed by their old macros: aston(), astoff(), etc. For completeness, an astpending() macro has been added to check for a pending AST, and clear_resched() has been added to clear need_resched(). - Rename syscall2() on the x86 back to syscall() to be consistent with other architectures.
Diffstat (limited to 'sys/alpha/include')
-rw-r--r--sys/alpha/include/cpu.h42
-rw-r--r--sys/alpha/include/globaldata.h1
-rw-r--r--sys/alpha/include/pcpu.h1
3 files changed, 13 insertions, 31 deletions
diff --git a/sys/alpha/include/cpu.h b/sys/alpha/include/cpu.h
index 8ecaaf3..3e0696f 100644
--- a/sys/alpha/include/cpu.h
+++ b/sys/alpha/include/cpu.h
@@ -62,45 +62,29 @@
struct clockframe {
struct trapframe cf_tf;
};
-#define CLKF_USERMODE(framep) \
- (((framep)->cf_tf.tf_regs[FRAME_PS] & ALPHA_PSL_USERMODE) != 0)
-#define CLKF_PC(framep) ((framep)->cf_tf.tf_regs[FRAME_PC])
-#define CLKF_INTR(framep) (curproc->p_intr_nesting_level >= 2)
-
-/*
- * Preempt the current process if in interrupt from user mode,
- * or after the current trap/syscall if in system mode.
- */
-#define need_resched() do { want_resched = 1; aston(); } while (0)
+#define TRAPF_USERMODE(framep) \
+ (((framep)->tf_regs[FRAME_PS] & ALPHA_PSL_USERMODE) != 0)
+#define TRAPF_PC(framep) ((framep)->tf_regs[FRAME_PC])
-#define resched_wanted() want_resched
+#define CLKF_USERMODE(framep) TRAPF_USERMODE(&(framep)->cf_tf)
+#define CLKF_PC(framep) TRAPF_PC(&(framep)->cf_tf)
+#define CLKF_INTR(framep) (curproc->p_intr_nesting_level >= 2)
/*
- * Give a profiling tick to the current process when the user profiling
- * buffer pages are invalid. On the hp300, request an ast to send us
- * through trap, marking the proc as needing a profiling tick.
+ * Arrange to handle pending profiling ticks before returning to user mode.
+ *
+ * XXX this is now poorly named and implemented. It used to handle only a
+ * single tick and the PS_OWEUPC flag served as a counter. Now there is a
+ * counter in the proc table and flag isn't really necessary.
*/
#define need_proftick(p) do { \
- mtx_lock_spin(&sched_lock); \
+ mtx_lock_spin(&sched_lock); \
(p)->p_sflag |= PS_OWEUPC; \
- mtx_unlock_spin(&sched_lock); \
aston(); \
+ mtx_unlock_spin(&sched_lock); \
} while (0)
/*
- * Notify the current process (p) that it has a signal pending,
- * process as soon as possible.
- */
-#define signotify(p) aston()
-
-#define aston() PCPU_SET(astpending, 1)
-
-#ifdef _KERNEL
-extern u_int32_t want_resched; /* resched() was called */
-#endif
-
-
-/*
* CTL_MACHDEP definitions.
*/
#define CPU_CONSDEV 1 /* dev_t: console terminal device */
diff --git a/sys/alpha/include/globaldata.h b/sys/alpha/include/globaldata.h
index 84dbf34..8e6cfbe 100644
--- a/sys/alpha/include/globaldata.h
+++ b/sys/alpha/include/globaldata.h
@@ -57,7 +57,6 @@ struct globaldata {
u_int32_t gd_next_asn; /* next ASN to allocate */
u_int32_t gd_current_asngen; /* ASN rollover check */
- u_int gd_astpending;
SLIST_ENTRY(globaldata) gd_allcpu;
int gd_witness_spin_check;
#ifdef KTR_PERCPU
diff --git a/sys/alpha/include/pcpu.h b/sys/alpha/include/pcpu.h
index 84dbf34..8e6cfbe 100644
--- a/sys/alpha/include/pcpu.h
+++ b/sys/alpha/include/pcpu.h
@@ -57,7 +57,6 @@ struct globaldata {
u_int32_t gd_next_asn; /* next ASN to allocate */
u_int32_t gd_current_asngen; /* ASN rollover check */
- u_int gd_astpending;
SLIST_ENTRY(globaldata) gd_allcpu;
int gd_witness_spin_check;
#ifdef KTR_PERCPU
OpenPOWER on IntegriCloud