Tweak the clockframe structure a bit so we are able to save a few cycles
at interrupt time. (From Gordon Ross).
This commit is contained in:
parent
d7fc46850e
commit
421158437b
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: locore.s,v 1.27 1996/11/17 13:47:09 leo Exp $ */
|
||||
/* $NetBSD: locore.s,v 1.28 1996/12/18 12:35:19 leo Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1988 University of Utah.
|
||||
|
@ -573,8 +573,7 @@ _spurintr:
|
|||
/* MFP timer A handler --- System clock --- */
|
||||
mfp_tima:
|
||||
moveml d0-d1/a0-a1,sp@- | save scratch registers
|
||||
lea sp@(16),a1 | get pointer to PS
|
||||
movl a1,sp@- | push pointer to PS, PC
|
||||
movl sp,sp@- | push pointer to clockframe
|
||||
jbsr _hardclock | call generic clock int routine
|
||||
addql #4,sp | pop params
|
||||
addql #1,_intrcnt+4 | add another system clock interrupt
|
||||
|
@ -586,10 +585,7 @@ mfp_tima:
|
|||
/* MFP timer C handler --- Stat/Prof clock --- */
|
||||
mfp_timc:
|
||||
moveml d0-d1/a0-a1,sp@- | save scratch registers
|
||||
lea sp@(16),a1 | get pointer to PS
|
||||
movl a1,sp@- | push pointer to PS, PC
|
||||
jbsr _statintr | call statistics clock handler
|
||||
addql #4,sp | pop params
|
||||
addql #1,_intrcnt+36 | add another stat clock interrupt
|
||||
moveml sp@+,d0-d1/a0-a1 | restore scratch regs
|
||||
addql #1,_cnt+V_INTR | chalk up another interrupt
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: clock.c,v 1.15 1996/12/16 22:03:23 leo Exp $ */
|
||||
/* $NetBSD: clock.c,v 1.16 1996/12/18 12:35:31 leo Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1988 University of Utah.
|
||||
|
@ -102,7 +102,7 @@ struct cfdriver clock_cd = {
|
|||
NULL, "clock", DV_DULL, NULL, 0
|
||||
};
|
||||
|
||||
void statintr __P((struct clockframe *));
|
||||
void statintr __P((struct clockframe));
|
||||
|
||||
static u_long gettod __P((void));
|
||||
static int twodigits __P((char *, int));
|
||||
|
@ -230,7 +230,7 @@ setstatclockrate(newhz)
|
|||
#ifdef STATCLOCK
|
||||
void
|
||||
statintr(frame)
|
||||
register struct clockframe *frame;
|
||||
struct clockframe frame;
|
||||
{
|
||||
register int var, r;
|
||||
|
||||
|
@ -248,7 +248,7 @@ statintr(frame)
|
|||
*/
|
||||
MFP->mf_tcdr = clk2min + r;
|
||||
|
||||
statclock(frame);
|
||||
statclock(&frame);
|
||||
}
|
||||
#endif /* STATCLOCK */
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: hdfd.c,v 1.3 1996/12/14 13:47:12 leo Exp $ */
|
||||
/* $NetBSD: hdfd.c,v 1.4 1996/12/18 12:35:34 leo Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1996 Leo Weppelman
|
||||
|
@ -253,7 +253,7 @@ void fd_motor_off __P((void *arg));
|
|||
void fd_motor_on __P((void *arg));
|
||||
int fdcresult __P((struct fdc_softc *fdc));
|
||||
int out_fdc __P((u_char x));
|
||||
void fdc_ctrl_intr __P((struct clockframe *));
|
||||
void fdc_ctrl_intr __P((struct clockframe));
|
||||
void fdcstart __P((struct fdc_softc *fdc));
|
||||
void fdcstatus __P((struct device *dv, int n, char *s));
|
||||
void fdctimeout __P((void *arg));
|
||||
|
@ -495,7 +495,7 @@ fdattach(parent, self, aux)
|
|||
*/
|
||||
void
|
||||
fdc_ctrl_intr(frame)
|
||||
register struct clockframe *frame;
|
||||
struct clockframe frame;
|
||||
{
|
||||
int s;
|
||||
|
||||
|
@ -511,7 +511,7 @@ fdc_ctrl_intr(frame)
|
|||
*/
|
||||
fddmalen = 0;
|
||||
|
||||
if (!BASEPRI(frame->sr)) {
|
||||
if (!BASEPRI(frame.cf_sr)) {
|
||||
/*
|
||||
* We don't want to stay on ipl6.....
|
||||
*/
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: hdfd_intr.s,v 1.2 1996/12/14 13:47:13 leo Exp $
|
||||
/* $NetBSD: hdfd_intr.s,v 1.3 1996/12/18 12:35:36 leo Exp $
|
||||
|
||||
/*
|
||||
* Copyright (c) 1996 Leo Weppelman.
|
||||
|
@ -133,10 +133,7 @@ hdfdc_xit:
|
|||
* stuff.
|
||||
*/
|
||||
hdfdc_norm:
|
||||
lea sp@(16),a0 | push pointer to trap-frame
|
||||
movl a0,sp@-
|
||||
jbsr _fdc_ctrl_intr | handle interrupt
|
||||
addql #4,sp | pop trap-frame pointer
|
||||
moveml sp@+,d0-d1/a0-a1 | and saved registers
|
||||
addql #1,_cnt+V_INTR | chalk up another interrupt
|
||||
jra rei
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: cpu.h,v 1.16 1996/10/25 20:02:34 leo Exp $ */
|
||||
/* $NetBSD: cpu.h,v 1.17 1996/12/18 12:35:45 leo Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1988 University of Utah.
|
||||
|
@ -69,17 +69,18 @@
|
|||
* what the hardware pushes on an interrupt (frame format 0).
|
||||
*/
|
||||
struct clockframe {
|
||||
u_short sr; /* sr at time of interrupt */
|
||||
u_long pc; /* pc at time of interrupt */
|
||||
u_short vo; /* vector offset (4-word frame) */
|
||||
u_int cf_regs[4]; /* d0,d1,a0,a1 (see locore.s) */
|
||||
u_short cf_sr; /* sr at time of interrupt */
|
||||
u_long cf_pc; /* pc at time of interrupt */
|
||||
u_short cf_vo; /* vector offset (4-word frame) */
|
||||
};
|
||||
|
||||
#define CLKF_USERMODE(framep) (((framep)->sr & PSL_S) == 0)
|
||||
#define CLKF_BASEPRI(framep) (((framep)->sr & PSL_IPL) == 0)
|
||||
#define CLKF_PC(framep) ((framep)->pc)
|
||||
#define CLKF_USERMODE(framep) (((framep)->cf_sr & PSL_S) == 0)
|
||||
#define CLKF_BASEPRI(framep) (((framep)->cf_sr & PSL_IPL) == 0)
|
||||
#define CLKF_PC(framep) ((framep)->cf_pc)
|
||||
#if 0
|
||||
/* We would like to do it this way... */
|
||||
#define CLKF_INTR(framep) (((framep)->sr & PSL_M) == 0)
|
||||
#define CLKF_INTR(framep) (((framep)->cf_sr & PSL_M) == 0)
|
||||
#else
|
||||
/* but until we start using PSL_M, we have to do this instead */
|
||||
#define CLKF_INTR(framep) (0) /* XXX */
|
||||
|
|
Loading…
Reference in New Issue