diff options
author | jhb <jhb@FreeBSD.org> | 2000-10-06 02:20:21 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2000-10-06 02:20:21 +0000 |
commit | fd275a78bd168fffc26552c4b2debf6f105a43ed (patch) | |
tree | 4da054c14beb1594089f5d38bd0b743156b65897 /sys/alpha | |
parent | e638f1a0983968d7993bba04b23cd203d45680ce (diff) | |
download | FreeBSD-src-fd275a78bd168fffc26552c4b2debf6f105a43ed.zip FreeBSD-src-fd275a78bd168fffc26552c4b2debf6f105a43ed.tar.gz |
- Change fast interrupts on x86 to push a full interrupt frame and to
return through doreti to handle ast's. This is necessary for the
clock interrupts to work properly.
- Change the clock interrupts on the x86 to be fast instead of threaded.
This is needed because both hardclock() and statclock() need to run in
the context of the current process, not in a separate thread context.
- Kill the prevproc hack as it is no longer needed.
- We really need Giant when we call psignal(), but we don't want to block
during the clock interrupt. Instead, use two p_flag's in the proc struct
to mark the current process as having a pending SIGVTALRM or a SIGPROF
and let them be delivered during ast() when hardclock() has finished
running.
- Remove CLKF_BASEPRI, which was #ifdef'd out on the x86 anyways. It was
broken on the x86 if it was turned on since cpl is gone. It's only use
was to bogusly run softclock() directly during hardclock() rather than
scheduling an SWI.
- Remove the COM_LOCK simplelock and replace it with a clock_lock spin
mutex. Since the spin mutex already handles disabling/restoring
interrupts appropriately, this also lets us axe all the *_intr() fu.
- Back out the hacks in the APIC_IO x86 cpu_initclocks() code to use
temporary fast interrupts for the APIC trial.
- Add two new process flags P_ALRMPEND and P_PROFPEND to mark the pending
signals in hardclock() that are to be delivered in ast().
Submitted by: jakeb (making statclock safe in a fast interrupt)
Submitted by: cp (concept of delaying signals until ast())
Diffstat (limited to 'sys/alpha')
-rw-r--r-- | sys/alpha/alpha/trap.c | 13 | ||||
-rw-r--r-- | sys/alpha/include/cpu.h | 2 | ||||
-rw-r--r-- | sys/alpha/include/globals.h | 1 |
3 files changed, 13 insertions, 3 deletions
diff --git a/sys/alpha/alpha/trap.c b/sys/alpha/alpha/trap.c index 3e773d3..79019bd 100644 --- a/sys/alpha/alpha/trap.c +++ b/sys/alpha/alpha/trap.c @@ -784,6 +784,11 @@ ast(framep) sticks = p->p_sticks; p->p_md.md_tf = framep; + /* + * XXX - is this still correct? What about a clock interrupt + * that runs hardclock() and triggers a delayed SIGVTALRM or + * SIGPROF? + */ if ((framep->tf_regs[FRAME_PS] & ALPHA_PSL_USERMODE) == 0) panic("ast and not user"); @@ -795,6 +800,14 @@ ast(framep) addupc_task(p, p->p_stats->p_prof.pr_addr, p->p_stats->p_prof.pr_ticks); } + if (p->p_flag & P_ALRMPEND) { + p->p_flag &= ~P_ALRMPEND; + psignal(p, SIGVTALRM); + } + if (p->p_flag & P_PROFPEND) { + p->p_flag &= ~P_PROFPEND; + psignal(p, SIGPROF); + } userret(p, framep->tf_regs[FRAME_PC], sticks, 1); diff --git a/sys/alpha/include/cpu.h b/sys/alpha/include/cpu.h index cd60cc6..a45b4d1 100644 --- a/sys/alpha/include/cpu.h +++ b/sys/alpha/include/cpu.h @@ -62,8 +62,6 @@ struct clockframe { }; #define CLKF_USERMODE(framep) \ (((framep)->cf_tf.tf_regs[FRAME_PS] & ALPHA_PSL_USERMODE) != 0) -#define CLKF_BASEPRI(framep) \ - (((framep)->cf_tf.tf_regs[FRAME_PS] & ALPHA_PSL_IPL_MASK) == 0) #define CLKF_PC(framep) ((framep)->cf_tf.tf_regs[FRAME_PC]) #define CLKF_INTR(framep) (PCPU_GET(intr_nesting_level) >= 2) diff --git a/sys/alpha/include/globals.h b/sys/alpha/include/globals.h index 303efdf..f85a67c 100644 --- a/sys/alpha/include/globals.h +++ b/sys/alpha/include/globals.h @@ -56,7 +56,6 @@ register struct globaldata *globalp __asm__("$8"); #define switchtime PCPU_GET(switchtime) #define switchticks PCPU_GET(switchticks) #define cpuid PCPU_GET(cpuno) -#define prevproc PCPU_GET(curproc) /* XXX - until ithreads */ #endif /* _KERNEL */ |