-/* $OpenBSD: hilreg.h,v 1.2 1997/01/12 15:12:44 downsj Exp $ */
-/* $NetBSD: hilreg.h,v 1.5 1994/10/26 07:24:15 cgd Exp $ */
+/* $OpenBSD: hilreg.h,v 1.3 1997/02/04 06:21:24 downsj Exp $ */
+/* $NetBSD: hilreg.h,v 1.6 1997/02/02 09:39:21 thorpej Exp $ */
/*
* Copyright (c) 1988 University of Utah.
#define WRITEHILCMD(x, y) ((x)->hil_cmd = ((y) << 24))
#endif
-#ifdef hp300
-#define splhil() spl1()
-#else
-extern int hilspl;
-#define splhil() splx(hilspl)
-#endif
-
#define HIL_BUSY 0x02
#define HIL_DATA_RDY 0x01
-/* $OpenBSD: ite.c,v 1.7 1997/02/03 04:47:38 downsj Exp $ */
-/* $NetBSD: ite.c,v 1.35 1997/01/30 09:18:56 thorpej Exp $ */
+/* $OpenBSD: ite.c,v 1.8 1997/02/04 06:21:26 downsj Exp $ */
+/* $NetBSD: ite.c,v 1.37 1997/02/02 09:40:31 thorpej Exp $ */
/*
* Copyright (c) 1996 Jason R. Thorpe. All rights reserved.
#define set_attr(ip, attr) ((ip)->attribute |= (attr))
#define clr_attr(ip, attr) ((ip)->attribute &= ~(attr))
-/*
- * No need to raise SPL above the HIL (the only thing that can
- * affect our state.
- */
-#include <hp300/dev/hilreg.h>
-#define splite() splhil()
-
/*
* # of chars are output in a single itestart() call.
* If this is too big, user processes will be blocked out for
return;
}
bzero(ite->sc_data, sizeof(struct ite_data));
+ ite->sc_data->flags = ITE_ALIVE;
}
/*
sc = ite_cd.cd_devs[ITEUNIT(tp->t_dev)];
ip = sc->sc_data;
- /*
- * (Potentially) lower priority. We only need to protect ourselves
- * from keyboard interrupts since that is all that can affect the
- * state of our tty (kernel printf doesn't go through this routine).
- */
- s = splite();
+ s = splkbd();
if (tp->t_state & (TS_TIMEOUT|TS_BUSY|TS_TTSTOP)) {
splx(s);
return;
-/* $OpenBSD: genassym.c,v 1.5 1997/01/12 15:13:16 downsj Exp $ */
-/* $NetBSD: genassym.c,v 1.21 1996/10/05 07:11:44 thorpej Exp $ */
+/* $OpenBSD: genassym.c,v 1.6 1997/02/04 06:21:29 downsj Exp $ */
+/* $NetBSD: genassym.c,v 1.22 1997/02/02 07:53:16 thorpej Exp $ */
/*
* Copyright (c) 1982, 1990, 1993
#define _VA_LIST_ _BSD_VA_LIST_
#define _PTRDIFF_T_ _BSD_PTRDIFF_T_
+#undef _KERNEL /* XXX for errno declaration */
+#include <errno.h>
+#define _KERNEL
+
#include <sys/param.h>
#include <sys/buf.h>
#include <sys/map.h>
#include <hp300/hp300/led.h>
#endif
-#include <errno.h>
#include <stdio.h>
#include <stddef.h>
#include <string.h>
-extern int errno;
-
void
def(what, val)
char *what;
def("CPU_68030", CPU_68030);
def("CPU_68040", CPU_68040);
+ /* FPU types */
+ def("FPU_NONE", FPU_NONE);
+ def("FPU_68881", FPU_68881);
+ def("FPU_68882", FPU_68882);
+ def("FPU_68040", FPU_68040);
+ def("FPU_68060", FPU_68060);
+ def("FPU_UNKNOWN", FPU_UNKNOWN);
+
/* values for machineid */
def("HP_320", HP_320);
def("HP_330", HP_330);
-/* $OpenBSD: machdep.c,v 1.14 1997/02/03 15:54:45 deraadt Exp $ */
+/* $OpenBSD: machdep.c,v 1.15 1997/02/04 06:21:30 downsj Exp $ */
/* $NetBSD: machdep.c,v 1.77 1996/12/11 16:49:23 thorpej Exp $ */
/*
*/
struct hpuxsigframe {
int hsf_signum;
- int hsf_code;
struct sigcontext *hsf_scp;
int hsf_nothing;
struct hpuxsigcontext hsf_sc;
hkfp = (struct hpuxsigframe *)&kfp[1];
hkfp->hsf_signum = bsdtohpuxsig(kfp->sf_signum);
- hkfp->hsf_code = kfp->sf_code;
hkfp->hsf_scp = (struct sigcontext *)
&((struct hpuxsigframe *)(&fp[1]))->hsf_sc;
hkfp->hsf_sc.hsc_syscall = 0; /* XXX */
-/* $OpenBSD: trap.c,v 1.5 1997/02/03 04:47:59 downsj Exp $ */
+/* $OpenBSD: trap.c,v 1.6 1997/02/04 06:21:32 downsj Exp $ */
/* $NetBSD: trap.c,v 1.47 1996/10/14 20:06:31 thorpej Exp $ */
/*
i = SIGILL;
ucode = frame.f_format; /* XXX was ILL_RESAD_FAULT */
typ = ILL_COPROC;
+ v = frame.f_pc;
break;
#ifdef FPCOPROC
typ = FPE_FLTRES;
ucode = code;
i = SIGFPE;
+ v = frame.f_pc;
break;
#endif
/* XXX need to FRESTORE */
typ = FPE_FLTINV;
i = SIGFPE;
+ v = frame.f_pc;
break;
#endif
ucode = frame.f_format; /* XXX was ILL_PRIVIN_FAULT */
typ = ILL_ILLOPC;
i = SIGILL;
+ v = frame.f_pc;
break;
+
case T_PRIVINST|T_USER: /* privileged instruction fault */
#ifdef COMPAT_HPUX
if (p->p_emul == &emul_hpux)
ucode = frame.f_format; /* XXX was ILL_PRIVIN_FAULT */
typ = ILL_PRVOPC;
i = SIGILL;
+ v = frame.f_pc;
break;
case T_ZERODIV|T_USER: /* Divide by zero */
ucode = frame.f_format; /* XXX was FPE_INTDIV_TRAP */
typ = FPE_INTDIV;
i = SIGFPE;
+ v = frame.f_pc;
break;
case T_CHKINST|T_USER: /* CHK instruction trap */
ucode = frame.f_format; /* XXX was FPE_SUBRNG_TRAP */
typ = FPE_FLTSUB;
i = SIGFPE;
+ v = frame.f_pc;
break;
case T_TRAPVINST|T_USER: /* TRAPV instruction trap */
}
#endif
ucode = frame.f_format; /* XXX was FPE_INTOVF_TRAP */
- typ = FPE_FLTOVF;
- i = SIGFPE;
+ typ = ILL_ILLTRP;
+ i = SIGILL;
+ v = frame.f_pc;
break;
/*
-/* $OpenBSD: param.h,v 1.5 1997/01/12 15:13:38 downsj Exp $ */
-/* $NetBSD: param.h,v 1.27 1996/12/09 03:04:48 thorpej Exp $ */
+/* $OpenBSD: param.h,v 1.6 1997/02/04 06:21:33 downsj Exp $ */
+/* $NetBSD: param.h,v 1.28 1997/02/02 09:34:26 thorpej Exp $ */
/*
* Copyright (c) 1988 University of Utah.
_spl_r; \
})
+#define _splraise(s) \
+({ \
+ register int _spl_r; \
+\
+ __asm __volatile ("clrl %0; movew sr,%0;" : "&=d" (_spl_r) : ); \
+ if ((_spl_r & PSL_IPL) < ((s) & PSL_IPL)) \
+ __asm __volatile ("movew %0,sr;" : : "di" (s)); \
+ _spl_r; \
+})
+
/* spl0 requires checking for software interrupts */
#define spl1() _spl(PSL_S|PSL_IPL1)
#define spl2() _spl(PSL_S|PSL_IPL2)
extern unsigned short hp300_impipl;
#endif /* _KERNEL && !_LOCORE */
+/* These spl calls are _not_ to be used by machine-independent code. */
+#define splhil() _splraise(PSL_S|PSL_IPL1)
+#define splkbd() splhil()
+
+/* These spl calls are used by machine-independent code. */
#define splsoftclock() spl1()
#define splsoftnet() spl1()
-#define splbio() _spl(hp300_bioipl)
-#define splnet() _spl(hp300_netipl)
-#define spltty() _spl(hp300_ttyipl)
-#define splimp() _spl(hp300_impipl)
+#define splbio() _splraise(hp300_bioipl)
+#define splnet() _splraise(hp300_netipl)
+#define spltty() _splraise(hp300_ttyipl)
+#define splimp() _splraise(hp300_impipl)
#define splclock() spl6()
#define splstatclock() spl6()
#define splvm() spl6()