speaker upgraded to the current.
some changes to the VM stuff (ie kern_thread.c added and so).
-# $NetBSD: Makefile,v 1.8 1994/10/27 04:14:23 cgd Exp $
+# $NetBSD: Makefile,v 1.6 1996/02/01 22:31:28 mycroft Exp $
# @(#)Makefile 7.3 (Berkeley) 6/9/91
# Makefile for i386 tags file and boot blocks
-# $NetBSD: Makefile.i386,v 1.59 1995/10/10 05:58:00 mycroft Exp $
+# $NetBSD: Makefile.i386,v 1.64 1996/02/09 02:21:25 mycroft Exp $
+# Makefile for NetBSD
+#
# This makefile is constructed from a machine description:
# config machineid
# Most changes should be made in the machine description
# /sys/arch/i386/conf/``machineid''
# after which you should do
-# config machineid
-# Generic makefile changes should be made in
+# config machineid
+# Machine generic makefile changes should be made in
# /sys/arch/i386/conf/Makefile.i386
# after which config should be rerun for all machines of that type.
#
#
# -DTRACE compile in kernel tracing hooks
# -DQUOTA compile in file system quotas
-#
-# DEBUG is set to -g by config if debugging is requested (config -g).
-# PROF is set to -pg by config if profiling is requested (config -p).
-AS= as ${DEBUG}
+# DEBUG is set to -g if debugging.
+# PROF is set to -pg if profiling.
+
+AS= as
AWK= awk
-CC= cc ${DEBUG}
+CC= cc
CPP= cpp
LD= ld
+STRIP= strip -d
TOUCH= touch -f -c
# source tree is located via $S relative to the compilation directory
S= ../../../..
I386= ../..
-INCLUDES= -I. -I$S/arch -I$S -I$S/sys
-COPTS= ${INCLUDES} ${IDENT} -D_KERNEL -Di386
-CFLAGS= -O6 -fno-strength-reduce -Werror ${COPTS}
-LOAD_ADDRESS= F8100000
+INCLUDES= -I. -I$S/arch -I$S
+CPPFLAGS= ${INCLUDES} ${IDENT} -D_KERNEL -Di386
+CFLAGS= ${DEBUG} -O2 -Werror
+AFLAGS= -x assembler-with-cpp -traditional-cpp -D_LOCORE
+LINKFLAGS= -z -Ttext F8100000 -e start
### find out what to use for libkern
.include "$S/lib/libkern/Makefile.inc"
# capitalized (e.g. C for a .c file), and CONFIG_DEP is _C if the file
# is marked as config-dependent.
-NORMAL_C= ${CC} -c ${CFLAGS} ${PROF} $<
-NORMAL_C_C= ${CC} -c ${CFLAGS} ${PROF} ${PARAM} $<
-
-DRIVER_C= ${CC} -c ${CFLAGS} ${PROF} $<
-DRIVER_C_C= ${CC} -c ${CFLAGS} ${PROF} ${PARAM} $<
+NORMAL_C= ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c $<
+NORMAL_C_C= ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} ${PARAM} -c $<
-PROFILE_C= ${CC} -S -c ${CFLAGS} $< ; \
- sed -e s/_mcount/mcount/ -e s/subrmcount/subr_mcount/ <$*.s | \
- ${AS} -o $@; \
- rm -f $*.s
+DRIVER_C= ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c $<
+DRIVER_C_C= ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} ${PARAM} -c $<
-NORMAL_S= ${CPP} -DLOCORE ${COPTS} $< | ${AS} -o $@
-NORMAL_S_C= ${CPP} -DLOCORE ${COPTS} ${PARAM} $< | ${AS} -o $@
+NORMAL_S= ${CC} ${AFLAGS} ${CPPFLAGS} -c $<
+NORMAL_S_C= ${CC} ${AFLAGS} ${CPPFLAGS} ${PARAM} -c $<
%OBJS
%CFILES
+%SFILES
+
# load lines for config "xxx" will be emitted as:
# xxx: ${SYSTEM_DEP} swapxxx.o
# ${SYSTEM_LD_HEAD}
# ${SYSTEM_LD} swapxxx.o
# ${SYSTEM_LD_TAIL}
-SYSTEM_OBJ= locore.o vnode_if.o ${OBJS} param.o ioconf.o ${LIBKERN} \
- ${LIBCOMPAT}
+SYSTEM_OBJ= locore.o \
+ vnode_if.o param.o ioconf.o ${OBJS} ${LIBKERN} ${LIBCOMPAT}
SYSTEM_DEP= Makefile ${SYSTEM_OBJ}
SYSTEM_LD_HEAD= rm -f $@
-SYSTEM_LD= @if [ X${DEBUG} = X-g ]; then \
- strip=-X; \
- else \
- strip=-x; \
- fi; \
- echo ${LD} $$strip -z -T ${LOAD_ADDRESS} -o $@ -e start '$${SYSTEM_OBJ}' vers.o; \
- ${LD} $$strip -z -T ${LOAD_ADDRESS} -o $@ -e start ${SYSTEM_OBJ} vers.o
-SYSTEM_LD_TAIL= @size $@; chmod 755 $@; \
- if [ X${DEBUG} = X-g ]; then \
- echo cp $@ $@.gdb; rm -f $@.gdb; cp $@ $@.gdb; \
- echo strip -d $@; strip -d $@; \
- fi
+SYSTEM_LD= @echo ${LD} ${LINKFLAGS} -o $@ '$${SYSTEM_OBJ}' vers.o; \
+ ${LD} ${LINKFLAGS} -o $@ ${SYSTEM_OBJ} vers.o
+SYSTEM_LD_TAIL= @size $@; chmod 755 $@
+
+DEBUG?=
+.if ${DEBUG} == "-g"
+LINKFLAGS+= -X
+SYSTEM_LD_TAIL+=; \
+ echo cp $@ $@.gdb; rm -f $@.gdb; cp $@ $@.gdb; \
+ echo ${STRIP} $@; ${STRIP} $@
+.else
+LINKFLAGS+= -x
+.endif
%LOAD
-newvers: vers.o
+assym.h: genassym
+ ./genassym >assym.h
-vers.o: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP}
- sh $S/conf/newvers.sh
- ${CC} ${CFLAGS} -c vers.c
+genassym: genassym.o
+ ${CC} -o $@ genassym.o
-clean::
- rm -f eddep bsd bsd.gdb tags vnode_if.[ch] *.o locore.i \
- [a-z]*.s [Ee]rrs linterrs makelinks genassym
+genassym.o: ${I386}/i386/genassym.c
+ ${NORMAL_C_C}
-lint: /tmp param.c
- @lint -hbxn -DGENERIC -Dvolatile= ${COPTS} ${PARAM} -UKGDB \
- ${I386}/i386/Locore.c ${CFILES} ${I386}/i386/swapgeneric.c \
- ioconf.c param.c | \
- grep -v 'struct/union .* never defined' | \
- grep -v 'possible pointer alignment problem'
-
-locore.o: assym.s ${I386}/i386/locore.s machine/trap.h machine/psl.h
-locore.o: machine/pte.h ${I386}/isa/vector.s ${I386}/isa/icu.s
-locore.o: $S/sys/errno.h machine/specialreg.h ${I386}/isa/debug.h
-locore.o: ${I386}/isa/icu.h $S/dev/isa/isareg.h $S/net/netisr.h
- ${CPP} -DLOCORE ${COPTS} ${I386}/i386/locore.s | ${AS} -o locore.o
+vnode_if.c vnode_if.h: $S/kern/vnode_if.sh $S/kern/vnode_if.src
+ AWK="${AWK}" sh $S/kern/vnode_if.sh $S/kern/vnode_if.src
-# the following is necessary because autoconf.o depends on #if GENERIC
-autoconf.o: Makefile
+param.c: $S/conf/param.c
+ rm -f param.c
+ cp $S/conf/param.c .
-# the following are necessary because the files depend on the types of
-# cpu's included in the system configuration
-locore.o machdep.o: Makefile
+param.o: param.c Makefile
+ ${NORMAL_C_C}
-# depend on network or filesystem configuration
-uipc_proto.o vfs_conf.o locore.o: Makefile
+ioconf.o: ioconf.c
+ ${NORMAL_C}
-# depend on maxusers
-assym.s: Makefile
+newvers: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP}
+ sh $S/conf/newvers.sh
+ ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c
-# depends on KDB (cons.o also depends on GENERIC)
-trap.o cons.o: Makefile
-assym.s: genassym
- ./genassym >assym.s
+clean::
+ rm -f eddep *netbsd netbsd.gdb tags vnode_if.[ch] *.[io] [a-z]*.s \
+ [Ee]rrs linterrs makelinks genassym genassym.o assym.h
-genassym: ${I386}/i386/genassym.c
- ${CC} ${INCLUDES} ${IDENT} ${PARAM} -Di386 -o genassym \
- ${I386}/i386/genassym.c
+lint:
+ @lint -hbxncez -DGENERIC -Dvolatile= ${CPPFLAGS} ${PARAM} -UKGDB \
+ ${I386}/i386/Locore.c ${CFILES} ${I386}/i386/swapgeneric.c \
+ ioconf.c param.c | \
+ grep -v 'static function .* unused'
-depend: assym.s param.c vnode_if.h
- mkdep ${COPTS} ${CFILES} ioconf.c param.c
- mkdep -a -p ${INCLUDES} ${IDENT} ${PARAM} ${I386}/i386/genassym.c
+tags:
+ @echo "see $S/kern/Makefile for tags"
links:
egrep '#if' ${CFILES} | sed -f $S/conf/defines | \
sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink
echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \
sort -u | comm -23 - dontlink | \
- sed 's,../.*/\(.*.o\),rm -f \1;ln -s ../GENERIC/\1 \1,' > makelinks
+ sed 's,../.*/\(.*.o\),rm -f \1; ln -s ../GENERIC/\1 \1,' > makelinks
sh makelinks && rm -f dontlink
-tags:
- @echo "see $S/kern/Makefile for tags"
+SRCS= ${I386}/i386/locore.s \
+ vnode_if.c param.c ioconf.c ${CFILES} ${SFILES}
+depend: .depend
+.depend: ${SRCS} assym.h vnode_if.h param.c
+ mkdep ${AFLAGS} ${CPPFLAGS} ${I386}/i386/locore.s
+ mkdep -a ${CFLAGS} ${CPPFLAGS} vnode_if.c param.c ioconf.c ${CFILES}
+ mkdep -a ${AFLAGS} ${CPPFLAGS} ${SFILES}
+ mkdep -a ${CFLAGS} ${CPPFLAGS} ${PARAM} ${I386}/i386/genassym.c
-ioconf.o: ioconf.c
- ${CC} -c ${CFLAGS} ioconf.c
-param.c: $S/conf/param.c
- rm -f param.c
- cp $S/conf/param.c .
+# depend on root or device configuration
+autoconf.o conf.o: Makefile
+
+# depend on network or filesystem configuration
+uipc_proto.o vfs_conf.o: Makefile
-param.o: param.c Makefile
- ${CC} -c ${CFLAGS} ${PARAM} param.c
+# depend on maxusers
+genassym.o machdep.o: Makefile
-vnode_if.c vnode_if.h: $S/kern/vnode_if.sh $S/kern/vnode_if.src
- AWK="${AWK}" sh $S/kern/vnode_if.sh $S/kern/vnode_if.src
+# depend on CPU configuration
+locore.o machdep.o: Makefile
+
+
+locore.o: ${I386}/i386/locore.s assym.h
+ ${NORMAL_S}
%RULES
-# $OpenBSD: files.i386,v 1.7 1996/02/27 11:13:00 niklas Exp $
# $NetBSD: files.i386,v 1.61 1996/01/08 13:51:30 mycroft Exp $
#
# new style config file for i386 architecture
device npx at isa
file arch/i386/isa/npx.c npx needs-flag
+# attribute used to represent the "keyboard controller"
+# XXX should be a real device
+define pckbd { [irq = -1], [port = -1] }
+
# PC console support a la "pccons"
-device pc at isa: tty
+device pc at isa: tty, pckbd
file arch/i386/isa/pccons.c pc needs-flag
# PC console support a la "pcvt"
-device vt at isa: tty
+device vt at isa: tty, pckbd
file arch/i386/isa/pcvt/pcvt_drv.c vt needs-flag
file arch/i386/isa/pcvt/pcvt_ext.c vt needs-flag
file arch/i386/isa/pcvt/pcvt_kbd.c vt needs-flag
major {fd = 2}
# PC speaker
-device spkr at isa: tty
+device spkr at pckbd: tty
file arch/i386/isa/spkr.c spkr needs-flag
# AMD am7990 (Lance) -based boards
*/
configure()
{
+
+ startrtclock();
+
config_rootfound("isa", NULL);
config_rootfound("eisa", NULL);
config_rootfound("pci", NULL);
-/* $OpenBSD: conf.c,v 1.8 1996/02/28 14:38:38 mickey Exp $ */
+/* $NetBSD: conf.c,v 1.68 1995/12/09 05:53:00 mycroft Exp $ */
/*
* Copyright (c) 1994, 1995 Charles M. Hannum. All rights reserved.
-/* $OpenBSD: db_disasm.c,v 1.3 1996/03/11 11:16:40 mickey Exp $ */
+/* $NetBSD: db_disasm.c,v 1.10 1996/02/02 18:05:58 mycroft Exp $ */
/*
* Mach Operating System
-/* $OpenBSD: dkbad.c,v 1.2 1996/02/28 14:38:41 mickey Exp $ */
+/* $NetBSD: dkbad.c,v 1.4 1996/02/02 18:05:59 mycroft Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
-/* $OpenBSD: gdt.c,v 1.4 1996/03/11 11:16:46 mickey Exp $ */
-/* $NetBSD: gdt.c,v 1.5 1995/11/17 06:47:27 jtc Exp $ */
+/* $NetBSD: gdt.c,v 1.6 1996/01/30 12:18:26 mycroft Exp $ */
/*
* Copyright (c) 1995 Charles M. Hannum. All rights reserved.
int slot = NGDT, oslot;
for (p = allproc.lh_first; p != 0; p = p->p_list.le_next) {
+ PHOLD(p);
pcb = &p->p_addr->u_pcb;
oslot = IDXSEL(pcb->pcb_tss_sel);
if (oslot >= gdt_count) {
dynamic_gdt[oslot].gd.gd_type = SDT_SYSNULL;
pcb->pcb_ldt_sel = GSEL(slot, SEL_KPL);
}
+ PRELE(p);
}
for (; slot < gdt_count; slot++)
if (dynamic_gdt[slot].gd.gd_type == SDT_SYSNULL)
-/* $NetBSD: genassym.c,v 1.45 1995/10/11 04:19:38 mycroft Exp $ */
+/* $NetBSD: genassym.c,v 1.46 1996/02/02 19:42:43 mycroft Exp $ */
/*-
* Copyright (c) 1995 Charles M. Hannum. All rights reserved.
* @(#)genassym.c 5.11 (Berkeley) 5/10/91
*/
-#define _KERNEL
-
#include <sys/param.h>
#include <sys/proc.h>
#include <sys/resourcevar.h>
#include <sys/device.h>
-#include <vm/vm.h>
#include <sys/user.h>
+#include <vm/vm.h>
+
#include <machine/trap.h>
#include <machine/pmap.h>
#include <machine/vmparam.h>
-/* $NetBSD: locore.s,v 1.142 1996/01/07 03:59:28 mycroft Exp $ */
+/* $NetBSD: locore.s,v 1.143 1996/02/02 02:36:40 mycroft Exp $ */
#undef DIAGNOSTIC
#define DIAGNOSTIC
*/
#include "npx.h"
-#include "assym.s"
+#include "assym.h"
#include <sys/errno.h>
#include <sys/syscall.h>
* If an error is detected during trap, syscall, or interrupt exit, trap() will
* change %eip to point to one of these labels. We clean up the stack, if
* necessary, and resume as if we were handling a general protection fault.
- * This will cause the process to get a SIGSEGV.
+ * This will cause the process to get a SIGBUS.
*/
ENTRY(resume_iret)
ZTRAP(T_PROTFLT)
-/* $OpenBSD: math_emulate.c,v 1.2 1996/02/28 14:38:43 mickey Exp $ */
+/* $OpenBSD: math_emulate.c,v 1.3 1996/03/19 21:09:19 mickey Exp $ */
+/* $NetBSD: math_emulate.c,v 1.16 1996/02/02 18:06:01 mycroft Exp $ */
/*
* expediant "port" of linux 8087 emulator to 386BSD, with apologies -wfj
* temporary real division routine.
*/
+#include <i386/i386/math_emu.h>
+
static void shift_left(int * c)
{
__asm__ __volatile__("movl (%0),%%eax ; addl %%eax,(%0)\n\t"
-/* $OpenBSD: microtime.s,v 1.3 1996/02/28 14:38:45 mickey Exp $ */
+/* $OpenBSD: microtime.s,v 1.4 1996/03/19 21:09:20 mickey Exp $ */
+/* $NetBSD: microtime.s,v 1.16 1995/04/17 12:06:47 cgd Exp $ */
/*-
* Copyright (c) 1993 The Regents of the University of California.
-/* $OpenBSD: ns_cksum.c,v 1.2 1996/02/28 14:38:46 mickey Exp $ */
+/* $OpenBSD: ns_cksum.c,v 1.3 1996/03/19 21:09:21 mickey Exp $ */
+/* $NetBSD: ns_cksum.c,v 1.4 1996/02/02 18:06:03 mycroft Exp $ */
/*
* Copyright (c) 1982, 1988 Regents of the University of California.
-/* $NetBSD: pmap.c,v 1.33 1995/06/26 05:21:58 cgd Exp $ */
+/* $NetBSD: pmap.c,v 1.34 1995/12/09 07:39:02 mycroft Exp $ */
/*
* Copyright (c) 1993, 1994, 1995 Charles M. Hannum. All rights reserved.
-/* $NetBSD: pmap.c,v 1.33 1995/06/26 05:21:58 cgd Exp $ */
+/* $NetBSD: pmap.c,v 1.34 1995/12/09 07:39:02 mycroft Exp $ */
/*
* Copyright (c) 1993, 1994, 1995 Charles M. Hannum. All rights reserved.
-/* $OpenBSD: trap.c,v 1.5 1996/02/28 14:38:46 mickey Exp $ */
+/* $OpenBSD: trap.c,v 1.6 1996/03/19 21:09:23 mickey Exp $ */
+/* $NetBSD: trap.c,v 1.92 1996/01/08 13:51:38 mycroft Exp $ */
#undef DEBUG
#define DEBUG
-/* $OpenBSD: vm_machdep.c,v 1.6 1996/02/28 14:38:47 mickey Exp $ */
+/* $OpenBSD: vm_machdep.c,v 1.7 1996/03/19 21:09:24 mickey Exp $ */
+/* $NetBSD: vm_machdep.c,v 1.58 1996/02/05 02:00:35 christos Exp $ */
/*-
* Copyright (c) 1995 Charles M. Hannum. All rights reserved.
-/* $NetBSD: param.h,v 1.26 1995/06/26 06:55:58 cgd Exp $ */
+/* $NetBSD: param.h,v 1.27 1996/02/01 22:30:47 mycroft Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
*/
#ifdef _KERNEL
-#ifdef LOCORE
+#ifdef _LOCORE
#include <machine/psl.h>
#else
#include <machine/cpu.h>
-/* $NetBSD: pccons.h,v 1.3 1995/03/28 18:17:02 jtc Exp $ */
+/* $NetBSD: pccons.h,v 1.4 1996/02/02 18:06:06 mycroft Exp $ */
/*
* pccons.h -- pccons ioctl definitions
#ifndef _PCCONS_H_
#define _PCCONS_H_
-#ifndef _KERNEL
#include <sys/ioctl.h>
-#else
-#include "ioctl.h"
-#endif
#define CONSOLE_X_MODE_ON _IO('t',121)
#define CONSOLE_X_MODE_OFF _IO('t',122)
-/* $OpenBSD: pmap.h,v 1.2 1996/02/28 15:03:41 mickey Exp $ */
+/* $OpenBSD: pmap.h,v 1.3 1996/03/19 21:09:27 mickey Exp $ */
+/* $NetBSD: pmap.h,v 1.22 1996/02/12 21:12:29 christos Exp $ */
/*
* Copyright (c) 1995 Charles M. Hannum. All rights reserved.
void pmap_bootstrap __P((vm_offset_t start));
boolean_t pmap_testbit __P((vm_offset_t, int));
void pmap_changebit __P((vm_offset_t, int, int));
-__pure int pmap_page_index __P((vm_offset_t));
#endif
/*
-/* $OpenBSD: pmap.old.h,v 1.2 1996/02/28 15:03:41 mickey Exp $ */
+/* $OpenBSD: pmap.old.h,v 1.3 1996/03/19 21:09:27 mickey Exp $ */
+/* $NetBSD: pmap.h,v 1.22 1996/02/12 21:12:29 christos Exp $ */
/*
* Copyright (c) 1995 Charles M. Hannum. All rights reserved.
void pmap_bootstrap __P((vm_offset_t start));
boolean_t pmap_testbit __P((vm_offset_t, int));
void pmap_changebit __P((vm_offset_t, int, int));
-__pure int pmap_page_index __P((vm_offset_t));
#endif
/*
-/* $NetBSD: psl.h,v 1.26 1996/01/07 21:48:35 mycroft Exp $ */
+/* $NetBSD: psl.h,v 1.27 1996/02/01 22:30:56 mycroft Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
#define SIR_TTYMASK ((1 << SIR_TTY) | SIR_CLOCKMASK)
#define SIR_ALLMASK (SIR_CLOCKMASK | SIR_NETMASK | SIR_TTYMASK)
-#ifndef LOCORE
-
-/*
- * Interrupt handler chains. isa_intr_establish() inserts a handler into
- * the list. The handler is called with its (single) argument.
- */
-
-struct intrhand {
- int (*ih_fun)();
- void *ih_arg;
- u_long ih_count;
- struct intrhand *ih_next;
- int ih_level;
- int ih_irq;
- char *ih_what;
-};
+#ifndef _LOCORE
volatile int cpl, ipending, astpending;
int imask[5];
#define setsoftnet() softintr(1 << SIR_NET)
#define setsofttty() softintr(1 << SIR_TTY)
-#endif /* !LOCORE */
+#endif /* !_LOCORE */
#endif /* _KERNEL */
#endif /* !_I386_PSL_H_ */
-/* $NetBSD: pte.h,v 1.8 1995/03/28 18:17:15 jtc Exp $ */
+/* $NetBSD: pte.h,v 1.9 1996/02/01 22:30:59 mycroft Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
#define PDOFSET (NBPD-1) /* byte offset into page dir */
#define NPTEPD (NBPD / NBPG)
-#ifndef LOCORE
+#ifndef _LOCORE
typedef int pd_entry_t; /* page directory entry */
typedef int pt_entry_t; /* Mach page table entry */
#endif
#define PGEX_W 0x02 /* during a Write cycle */
#define PGEX_U 0x04 /* access from User mode (UPL) */
-#ifndef LOCORE
+#ifndef _LOCORE
#ifdef _KERNEL
/* utilities defined in pmap.c */
extern pt_entry_t *Sysmap;
-/* $NetBSD: segments.h,v 1.22 1995/12/20 18:09:24 mycroft Exp $ */
+/* $NetBSD: segments.h,v 1.23 1996/02/01 22:31:03 mycroft Exp $ */
/*-
* Copyright (c) 1995 Charles M. Hannum. All rights reserved.
#define KERNELMODE(c, f) (ISPL(c) == SEL_KPL)
#endif
-#ifndef LOCORE
+#ifndef _LOCORE
#if __GNUC__ == 2 && __GNUC_MINOR__ < 7
#pragma pack(1)
int, int));
#endif /* _KERNEL */
-#endif /* !LOCORE */
+#endif /* !_LOCORE */
/* system segments and gate types */
#define SDT_SYSNULL 0 /* system null */
-/* $NetBSD: clock.c,v 1.34 1995/08/13 04:06:29 mycroft Exp $ */
+/* $NetBSD: clock.c,v 1.35 1995/12/24 02:30:07 mycroft Exp $ */
/*-
* Copyright (c) 1993, 1994 Charles Hannum.
* XXX If you're doing strange things with multiple clocks, you might
* want to keep track of clock handlers.
*/
- (void)isa_intr_establish(0, IST_PULSE, IPL_CLOCK, clockintr, 0, "clock");
+ (void)isa_intr_establish(0, IST_PULSE, IPL_CLOCK, clockintr, 0);
}
void
isa_establish(&fdc->sc_id, &fdc->sc_dev);
#endif
fdc->sc_ih = isa_intr_establish(ia->ia_irq, IST_EDGE, IPL_BIO, fdcintr,
- fdc, fdc->sc_dev.dv_xname);
+ fdc);
/*
* The NVRAM info only tells us about the first two disks on the
at_dma(read, bp->b_data + fd->sc_skip, fd->sc_nbytes,
fdc->sc_drq);
#else
- isadma_start(bp->b_data + fd->sc_skip, fd->sc_nbytes,
- fdc->sc_drq, read ? ISADMA_START_READ : ISADMA_START_WRITE);
+ isa_dmastart(read, bp->b_data + fd->sc_skip, fd->sc_nbytes,
+ fdc->sc_drq);
#endif
outb(iobase + fdctl, type->rate);
#ifdef FD_DEBUG
#ifdef NEWCONFIG
at_dma_abort(fdc->sc_drq);
#else
- isadma_abort(fdc->sc_drq);
+ isa_dmaabort(fdc->sc_drq);
#endif
case SEEKTIMEDOUT:
case RECALTIMEDOUT:
#ifdef NEWCONFIG
at_dma_abort(fdc->sc_drq);
#else
- isadma_abort(fdc->sc_drq);
+ isa_dmaabort(fdc->sc_drq);
#endif
#ifdef FD_DEBUG
fdcstatus(&fd->sc_dev, 7, bp->b_flags & B_READ ?
#ifdef NEWCONFIG
at_dma_terminate(fdc->sc_drq);
#else
- isadma_done(fdc->sc_drq);
+ read = bp->b_flags & B_READ;
+ isa_dmadone(read, bp->b_data + fd->sc_skip, fd->sc_nbytes,
+ fdc->sc_drq);
#endif
if (fdc->sc_errors) {
diskerr(bp, "fd", "soft error", LOG_PRINTF,
#define FDC_BSIZE 512
#define FDC_NPORT 8
-#define FDC_MAXIOSIZE MAXBSIZE
+#define FDC_MAXIOSIZE NBPG /* XXX should be MAXBSIZE */
-/* $NetBSD: icu.h,v 1.18 1996/01/07 02:03:20 mycroft Exp $ */
+/* $NetBSD: icu.h,v 1.19 1996/02/01 22:31:21 mycroft Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
#ifndef _I386_ISA_ICU_H_
#define _I386_ISA_ICU_H_
-#ifndef LOCORE
+#ifndef _LOCORE
/*
* Interrupt "level" mechanism variables, masks, and macros
#define SET_ICUS() (outb(IO_ICU1 + 1, imen), outb(IO_ICU2 + 1, imen >> 8))
-#endif /* !LOCORE */
+#endif /* !_LOCORE */
/*
* Interrupt enable bits -- in order of priority
-/* $NetBSD: isa_machdep.c,v 1.8 1995/10/09 06:34:47 mycroft Exp $ */
+/* $NetBSD: isa_machdep.c,v 1.10 1996/02/09 02:26:00 mycroft Exp $ */
/*-
* Copyright (c) 1993, 1994 Charles Hannum.
return(0);
}
-int intrstray[ICU_LEN];
-
/*
* Caught a stray interrupt, notify
*/
isa_strayintr(irq)
int irq;
{
+ static u_long strays;
+
/*
* Stray interrupts on irq 7 occur when an interrupt line is raised
* and then lowered before the CPU acknowledges it. This generally
* means either the device is screwed or something is cli'ing too
* long and it's timing out.
*/
- if (intrstray[irq]++ <= 5)
+ if (++strays <= 5)
log(LOG_ERR, "stray interrupt %d%s\n", irq,
- intrstray[irq] > 5 ? "; stopped logging" : "");
+ strays >= 5 ? "; stopped logging" : "");
}
int fastvec;
imask[level] = irqs | SIR_ALLMASK;
}
-#include "sl.h"
-#include "ppp.h"
-#if NSL > 0 || NPPP > 0
- /* In the presence of SLIP or PPP, imp > tty. */
- imask[IPL_IMP] |= imask[IPL_TTY];
-#endif
+ /*
+ * There are tty, network and disk drivers that use free() at interrupt
+ * time, so imp > (tty | net | bio).
+ */
+ imask[IPL_IMP] |= imask[IPL_TTY] | imask[IPL_NET] | imask[IPL_BIO];
/*
- * There are network and disk drivers that use free() at interrupt
- * time, so imp > (net | bio).
+ * Enforce a hierarchy that gives slow devices a better chance at not
+ * dropping data.
*/
- imask[IPL_IMP] |= imask[IPL_NET] | imask[IPL_BIO];
+ imask[IPL_TTY] |= imask[IPL_NET] | imask[IPL_BIO];
+ imask[IPL_NET] |= imask[IPL_BIO];
/* And eventually calculate the complete masks. */
for (irq = 0; irq < ICU_LEN; irq++) {
* XXX PRONE TO RACE CONDITIONS, UGLY, 'INTERESTING' INSERTION ALGORITHM.
*/
void *
-isa_intr_establish(irq, type, level, ih_fun, ih_arg, ih_what)
+isa_intr_establish(irq, type, level, ih_fun, ih_arg)
int irq;
int type;
int level;
int (*ih_fun) __P((void *));
void *ih_arg;
- char *ih_what;
{
struct intrhand **p, *q, *ih;
static struct intrhand fakehand = {fakeintr};
ih->ih_next = NULL;
ih->ih_level = level;
ih->ih_irq = irq;
- ih->ih_what = ih_what;
*p = ih;
return (ih);
#define IOPHYSMEM 0xA0000
+/*
+ * Interrupt handler chains. isa_intr_establish() inserts a handler into
+ * the list. The handler is called with its (single) argument.
+ */
+
+struct intrhand {
+ int (*ih_fun)();
+ void *ih_arg;
+ u_long ih_count;
+ struct intrhand *ih_next;
+ int ih_level;
+ int ih_irq;
+};
+
+
/*
* ISA DMA bounce buffers.
* XXX should be made partially machine- and bus-mapping-independent.
-/* $NetBSD: lms.c,v 1.20 1995/10/05 22:06:47 mycroft Exp $ */
+/* $NetBSD: lms.c,v 1.21 1995/12/24 02:30:17 mycroft Exp $ */
/*-
* Copyright (c) 1993, 1994 Charles Hannum.
sc->sc_state = 0;
sc->sc_ih = isa_intr_establish(ia->ia_irq, IST_PULSE, IPL_TTY, lmsintr,
- sc, sc->sc_dev.dv_xname);
+ sc);
}
int
-/* $NetBSD: mms.c,v 1.19 1995/10/05 22:06:51 mycroft Exp $ */
+/* $NetBSD: mms.c,v 1.20 1995/12/24 02:30:19 mycroft Exp $ */
/*-
* Copyright (c) 1993, 1994 Charles Hannum.
sc->sc_state = 0;
sc->sc_ih = isa_intr_establish(ia->ia_irq, IST_PULSE, IPL_TTY, mmsintr,
- sc, sc->sc_dev.dv_xname);
+ sc);
}
int
printf("\n");
lcr0(rcr0() & ~CR0_NE);
sc->sc_ih = isa_intr_establish(ia->ia_irq, IST_EDGE, IPL_NONE,
- npxintr, 0, "npx");
+ npxintr, 0);
break;
case NPX_EXCEPTION:
printf(": using exception 16\n");
-/* $NetBSD: pccons.c,v 1.90 1995/10/11 04:20:33 mycroft Exp $ */
+/* $NetBSD: pccons.c,v 1.91 1995/12/24 02:30:25 mycroft Exp $ */
/*-
* Copyright (c) 1993, 1994, 1995 Charles Hannum. All rights reserved.
do_async_update(1);
sc->sc_ih = isa_intr_establish(ia->ia_irq, IST_EDGE, IPL_TTY, pcintr,
- sc, sc->sc_dev.dv_xname);
+ sc);
}
int
* The author may be reached unter <joerg_wunsch@uriah.sax.de>
*
* $Log: vgaio.h,v $
- * Revision 1.1.1.1 1995/10/18 08:50:49 deraadt
- * initial import of NetBSD tree
+ * Revision 1.2 1996/03/19 21:09:52 mickey
+ * Merging w/ NetBSD 021796.
+ * speaker upgraded to the current.
+ * some changes to the VM stuff (ie kern_thread.c added and so).
+ *
+ * Revision 1.1.1.1 1996/02/16 18:59:24 niklas
+ * Checkin of the NetBSD src/, supped 960203
*
* Revision 1.3 1995/10/07 21:46:02 jtc
* Overlay our pcvt with pcvt 3.32 sources. All of our fixes have been
#endif
#if !defined PCVT_PRETTYSCRNS /* ---------- DEFAULT: OFF ------------ */
-# define PCVT_PRETTYSCRNS 0 /* for the cost of some microseconds of */
+# define PCVT_PRETTYSCRNS 1 /* for the cost of some microseconds of */
#elif PCVT_PRETTYSCRNS != 0 /* cpu time this adds a more "pretty" */
# undef PCVT_PRETTYSCRNS /* version to the screensaver, an "*" */
# define PCVT_PRETTYSCRNS 1 /* in random locations of the display. */
#define COLOR_KERNEL_FG FG_LIGHTGREY /* kernel messages, foreground */
#endif
#if !defined COLOR_KERNEL_BG
-#define COLOR_KERNEL_BG BG_RED /* kernel messages, background */
+#define COLOR_KERNEL_BG BG_BLUE /* kernel messages, background */
#endif
#if !defined MONO_KERNEL_FG /* monochrome displays */
#if PCVT_NETBSD > 101
sc->sc_ih = isa_intr_establish(ia->ia_irq, IST_EDGE, IPL_TTY, pcintr,
- (void *)0, sc->sc_dev.dv_xname);
+ (void *)0);
#else /* PCVT_NETBSD > 100 */
vthand.ih_fun = pcrint;
vthand.ih_arg = 0;
#define PCVT_REL "3.32" /* driver attach announcement */
/* see also: pcvt_ioctl.h */
-#if PCVT_FREEBSD >= 200
-
#include <sys/param.h>
#include <sys/conf.h>
#include <sys/ioctl.h>
#include <sys/malloc.h>
#include <sys/time.h>
-#else /* ! PCVT_FREEBSD >= 200 */
-
-#include "param.h"
-#include "conf.h"
-#include "ioctl.h"
-#include "proc.h"
-#include "user.h"
-#include "tty.h"
-#include "uio.h"
-#include "callout.h"
-#include "systm.h"
-#include "kernel.h"
-#include "syslog.h"
-#include "malloc.h"
-#include "time.h"
-
-#endif /* PCVT_FREEBSD >= 200 */
-
#include "pcvt_conf.h"
#if PCVT_NETBSD > 9
-#include "device.h"
+#include <sys/device.h>
#endif
#if PCVT_NETBSD > 9
#if PCVT_NETBSD > 101
-#include "i386/isa/isa_machdep.h"
-#include "dev/isa/isavar.h"
+#include <i386/isa/isa_machdep.h>
+#include <dev/isa/isavar.h>
#else
-#include "i386/isa/isavar.h"
+#include <i386/isa/isavar.h>
#endif
-
-#include "i386/cpufunc.h"
-#elif PCVT_FREEBSD >= 200
-#include <i386/isa/isa_device.h>
+#include <machine/cpufunc.h>
#else
-#include "i386/isa/isa_device.h"
+#include <i386/isa/isa_device.h>
#endif
-#if PCVT_FREEBSD >= 200
#include <i386/isa/icu.h>
-#else
-#include "i386/isa/icu.h"
-#endif
#if PCVT_NETBSD > 100
#if PCVT_NETBSD > 101
-#include "dev/isa/isareg.h"
+#include <dev/isa/isareg.h>
#else
-#include "i386/isa/isareg.h"
+#include <i386/isa/isareg.h>
#endif
-#elif PCVT_FREEBSD >= 200
-#include <i386/isa/isa.h>
#else
-#include "i386/isa/isa.h"
+#include <i386/isa/isa.h>
#endif
#if PCVT_NETBSD > 9
-#include "dev/cons.h"
+#include <dev/cons.h>
#if PCVT_NETBSD > 100
-#include "dev/ic/mc146818reg.h"
-#include "i386/isa/nvram.h"
+#include <dev/ic/mc146818reg.h>
+#include <i386/isa/nvram.h>
#endif
-#elif PCVT_FREEBSD >= 200
-#include <i386/i386/cons.h>
#else
-#include "i386/i386/cons.h"
+#include <i386/i386/cons.h>
#endif
#if PCVT_NETBSD <= 9
-#if PCVT_FREEBSD >= 200
#include <machine/psl.h>
#include <machine/frame.h>
-#else /* ! PCVT_FREEBSD >= 200 */
-#include "machine/psl.h"
-#include "machine/frame.h"
-#endif /* PCVT_FREEBSD >= 200 */
#endif /* PCVT_NETBSD <= 9 */
-#if PCVT_FREEBSD >= 200
#include <machine/stdarg.h>
-#else
-#include "machine/stdarg.h"
-#endif
#if PCVT_NETBSD > 9
#include "pcvt_ioctl.h"
-#elif PCVT_FREEBSD >= 200
-#include <machine/pcvt_ioctl.h>
#else
-#include "machine/pcvt_ioctl.h"
+#include <machine/pcvt_ioctl.h>
#endif
-#if PCVT_FREEBSD >= 200
#include <machine/pc/display.h>
#if PCVT_FREEBSD > 200
#include <machine/clock.h>
#include <machine/md_var.h>
#endif
#include <vm/vm_kern.h>
-#else /* PCVT_FREEBSD >= 200 */
-#include "machine/pc/display.h"
-#include "vm/vm_kern.h"
-#endif /* PCVT_FREEBSD >= 200 */
#if PCVT_FREEBSD > 205
#include <sys/devconf.h>
#if PCVT_NETBSD
#if PCVT_NETBSD == 9
-#include "machine/cpufunc.h" /* NetBSD 0.9 [...and earlier -currents] */
+#include <machine/cpufunc.h> /* NetBSD 0.9 [...and earlier -currents] */
#else
-#include "machine/pio.h" /* recent NetBSD -currents */
+#include <machine/pio.h> /* recent NetBSD -currents */
#define NEW_AVERUNNABLE /* averunnable changes for younger currents */
#endif /* PCVT_NETBSD == 9 */
#endif /* PCVT_NETBSD */
#if !PCVT_EMU_MOUSE
-#if PCVT_NETBSD > 100
-/* nothing */
-#elif PCVT_NETBSD
+#if PCVT_NETBSD
EXTERN struct tty *pc_tty[PCVT_NSCREENS];
#elif !(PCVT_FREEBSD > 110 && PCVT_FREEBSD < 200)
EXTERN struct tty pccons[PCVT_NSCREENS];
#else /* PCVT_EMU_MOUSE */
-#if PCVT_NETBSD > 100
-/* nothing */
-#elif PCVT_NETBSD
+#if PCVT_NETBSD
EXTERN struct tty *pc_tty[PCVT_NSCREENS + 1];
#elif !(PCVT_FREEBSD > 110 && PCVT_FREEBSD < 200)
EXTERN struct tty pccons[PCVT_NSCREENS + 1];
#define PCVTIDMAJOR 3 /* driver id - major release */
#define PCVTIDMINOR 32 /* driver id - minor release */
-#if defined(KERNEL) || defined(_KERNEL)
-#include "ioctl.h"
-#else
#include <sys/ioctl.h>
+#if !defined(KERNEL) && !defined(_KERNEL)
#include <sys/types.h>
#endif
* less than half a second
*/
now = time;
+
+#if PCVT_NETBSD > 100
+ timersub(&now,&mouse.lastmove,&now);
+#else
timevalsub(&now, &mouse.lastmove);
+#endif
+
mouse.lastmove = time;
accel = (now.tv_sec == 0
&& now.tv_usec
-/* $NetBSD: pms.c,v 1.23 1995/10/05 22:06:54 mycroft Exp $ */
+/* $NetBSD: pms.c,v 1.24 1995/12/24 02:30:28 mycroft Exp $ */
/*-
* Copyright (c) 1994 Charles Hannum.
sc->sc_state = 0;
sc->sc_ih = isa_intr_establish(ia->ia_irq, IST_EDGE, IPL_TTY, pmsintr,
- sc, sc->sc_dev.dv_xname);
+ sc);
}
int
-/* $NetBSD: spkr.c,v 1.18 1996/02/22 05:53:28 scottr Exp $ */
+/* $NetBSD: spkr.c,v 1.22 1996/03/18 01:26:12 jtk Exp $ */
/*
* spkr.c -- device driver for console speaker on 80386
#include "spkr.h"
#if NSPKR > 0
+#if NSPKR > 1
+#error only one speaker device per system
+#endif
#include <sys/param.h>
#include <sys/kernel.h>
static int spkr_active; /* exclusion flag */
static struct buf *spkr_inbuf; /* incoming buf */
-int spkrprobe (struct device *parent, void *match, void *aux)
+int spkrprobe (parent, match, aux)
+ struct device *parent;
+ void *match;
+ void *aux;
{
- struct isa_attach_args *ia = aux;
-
- ia->ia_iosize = 0;
- return 1;
+ register struct isa_attach_args *ia = aux;
+ struct cfdata *cf = match;
+ /*
+ * We only attach to the keyboard controller via
+ * the console drivers. (We really wish we could be the
+ * child of a real keyboard controller driver.)
+ */
+ if ((parent == NULL) ||
+ ((strcmp(parent->dv_cfdata->cf_driver->cd_name, "pc") != 0) &&
+ (strcmp(parent->dv_cfdata->cf_driver->cd_name, "vt") != 0)))
+ return (0);
+ if (cf->cf_loc[1] != PITAUX_PORT)
+ return (0);
+
+ return (1);
}
-void spkrattach (struct device *parent, struct device *self, void *aux)
+static int spkr_attached = 0;
+
+void
+spkrattach(parent, self, aux)
+ struct device *parent;
+ struct device *self;
+ void *aux;
{
- printf("\n");
+ printf(" port 0x%x\n", self->dv_cfdata->cf_loc[1]);
+ spkr_attached = 1;
}
int spkropen(dev)
printf("spkropen: entering with dev = %x\n", dev);
#endif /* DEBUG */
- if (minor(dev) != 0)
+ if (minor(dev) != 0 || !spkr_attached)
return(ENXIO);
else if (spkr_active)
return(EBUSY);
/*
* These tables are used by the ISA configuration code.
*/
- .data
-
/* interrupt service routine entry points */
IDTVEC(intr)
.long _Xintr0, _Xintr1, _Xintr2, _Xintr3, _Xintr4, _Xintr5, _Xintr6
.long _Xsofttty, _Xsoftnet, _Xsoftclock
/* Some bogus data, to keep vmstat happy, for now. */
- .globl _intrcnt, _eintrcnt
-_intrcnt:
- .long 0
-_eintrcnt:
-
- .globl _intrnames, _eintrnames
+ .globl _intrnames, _eintrnames, _intrcnt, _eintrcnt
_intrnames:
- .long 0
+ .long 0
_eintrnames:
-
- .text
+_intrcnt:
+ .long 0
+_eintrcnt:
-/* $NetBSD: arp.c,v 1.4 1994/10/27 04:21:01 cgd Exp $ */
+/* $NetBSD: arp.c,v 1.5 1996/02/02 18:06:14 mycroft Exp $ */
/*
* source in this file came from
#include "proto.h"
#include "assert.h"
-#include "param.h"
+#include <sys/param.h>
#include "packet.h"
#include "ether.h"
#include "inet.h"
-/* $NetBSD: main.c,v 1.5 1994/10/27 04:21:17 cgd Exp $ */
+/* $NetBSD: main.c,v 1.6 1996/02/02 18:06:17 mycroft Exp $ */
/*
* source code in this file is from:
#include "config.h"
#include "nbtypes.h"
#include "assert.h"
-#include "param.h"
+#include <sys/param.h>
#include "packet.h"
#include "ether.h"
#include "inet.h"
-/* $NetBSD: packet.c,v 1.3 1994/10/27 04:21:21 cgd Exp $ */
+/* $NetBSD: packet.c,v 1.4 1996/02/02 18:06:21 mycroft Exp $ */
/*
* source in this file came from
#include "proto.h"
#include "assert.h"
-#include "param.h"
+#include <sys/param.h>
#include "packet.h"
static packet_t *pool = (packet_t *)0;
-/* $NetBSD: tftp.c,v 1.3 1994/10/27 04:21:26 cgd Exp $ */
+/* $NetBSD: tftp.c,v 1.4 1996/02/02 18:06:23 mycroft Exp $ */
/*
* source in this file came from
#include "proto.h"
#include "assert.h"
-#include "param.h"
+#include <sys/param.h>
#include "packet.h"
#include "ether.h"
#include "inet.h"
}
void *
-pci_map_int(tag, level, func, arg, what)
+pci_map_int(tag, level, func, arg)
pcitag_t tag;
int level;
int (*func) __P((void *));
void *arg;
- char *what;
{
pcireg_t data;
int pin, line;
printf("pci_map_int: pin %c mapped to line %d\n", '@' + pin, line);
#endif
- return isa_intr_establish(line, IST_LEVEL, level, func, arg, what);
+ return isa_intr_establish(line, IST_LEVEL, level, func, arg);
}
-# $NetBSD: Makefile,v 1.5 1994/10/27 04:21:44 cgd Exp $
+# $NetBSD: Makefile,v 1.6 1996/02/01 22:31:28 mycroft Exp $
# @(#)Makefile 7.9 (Berkeley) 5/8/91
DESTDIR=/usr
# startups
srt0.o: srt0.c
- ${CPP} -E -DLOCORE -DRELOC=0x${RELOC} srt0.c | ${AS} -o srt0.o
+ ${CPP} -E -D_LOCORE -DRELOC=0x${RELOC} srt0.c | ${AS} -o srt0.o
wsrt0.o: srt0.c
- ${CPP} -E -DLOCORE -DSMALL -DRELOC=0x${RELOC} -DREL srt0.c | \
+ ${CPP} -E -D_LOCORE -DSMALL -DRELOC=0x${RELOC} -DREL srt0.c | \
${AS} -o wsrt0.o
relsrt0.o: srt0.c
- ${CPP} -E -DLOCORE -DRELOC=0x${RELOC} -DREL srt0.c | ${AS} -o relsrt0.o
+ ${CPP} -E -D_LOCORE -DRELOC=0x${RELOC} -DREL srt0.c | ${AS} -o relsrt0.o
# block 0 boots
wdbootblk.o: wdbootblk.c
- ${CPP} -E -DLOCORE -DRELOC=0x${RELOC} wdbootblk.c | ${AS} -o $@
+ ${CPP} -E -D_LOCORE -DRELOC=0x${RELOC} wdbootblk.c | ${AS} -o $@
fdbootblk.o: fdbootblk.c
- ${CPP} -E -DLOCORE -DRELOC=0x${RELOC} fdbootblk.c | ${AS} -o $@
+ ${CPP} -E -D_LOCORE -DRELOC=0x${RELOC} fdbootblk.c | ${AS} -o $@
asbootblk.o: asbootblk.c
cc -c -O -DRELOC=0x${RELOC} ${INCPATH} asbootblk.c
-/* $OpenBSD: com.c,v 1.7 1996/03/08 16:42:51 niklas Exp $ */
+/* $OpenBSD: com.c,v 1.8 1996/03/19 21:10:09 mickey Exp $ */
/* $NetBSD: com.c,v 1.65 1996/02/10 20:23:18 christos Exp $ */
/*-
if (ia->ia_irq != IRQUNK)
sc->sc_ih = isa_intr_establish(ia->ia_irq, IST_EDGE, IPL_TTY,
- comintr, sc, sc->sc_dev.dv_xname);
+ comintr, sc);
#ifdef KGDB
if (kgdb_dev == makedev(commajor, unit)) {
-/* $OpenBSD: aha.c,v 1.11 1996/03/08 16:42:47 niklas Exp $ */
+/* $OpenBSD: aha.c,v 1.12 1996/03/19 21:10:02 mickey Exp $ */
/* $NetBSD: aha1542.c,v 1.55 1995/12/24 02:31:06 mycroft Exp $ */
/*
isa_establish(&aha->sc_id, &aha->sc_dev);
#endif
aha->sc_ih = isa_intr_establish(ia->ia_irq, IST_EDGE, IPL_BIO, ahaintr,
- aha, aha->sc_dev.dv_xname);
+ aha);
/*
* ask the adapter what subunits are present
-/* $OpenBSD: aha1542.c,v 1.11 1996/03/08 16:42:47 niklas Exp $ */
+/* $OpenBSD: aha1542.c,v 1.12 1996/03/19 21:10:02 mickey Exp $ */
/* $NetBSD: aha1542.c,v 1.55 1995/12/24 02:31:06 mycroft Exp $ */
/*
isa_establish(&aha->sc_id, &aha->sc_dev);
#endif
aha->sc_ih = isa_intr_establish(ia->ia_irq, IST_EDGE, IPL_BIO, ahaintr,
- aha, aha->sc_dev.dv_xname);
+ aha);
/*
* ask the adapter what subunits are present
isa_establish(&ahc->sc_id, &ahc->sc_dev);
#endif
ahc->sc_ih = isa_intr_establish(ia->ia_irq, IST_EDGE, IPL_BIO,
- ahcintr, ahc, ahc->sc_dev.dv_xname);
+ ahcintr, ahc);
/*
* attach the devices on the bus
isa_establish(&sc->sc_id, &sc->sc_dev);
#endif
sc->sc_ih = isa_intr_establish(ia->ia_irq, IST_EDGE, IPL_BIO, aicintr,
- sc, sc->sc_dev.dv_xname);
+ sc);
config_found(self, &sc->sc_link, aicprint);
}
-/* $OpenBSD: ast.c,v 1.4 1996/03/08 16:42:48 niklas Exp $ */
+/* $OpenBSD: ast.c,v 1.5 1996/03/19 21:10:06 mickey Exp $ */
/* $NetBSD: ast.c,v 1.18 1995/06/26 04:08:04 cgd Exp $ */
/*
}
sc->sc_ih = isa_intr_establish(ia->ia_irq, IST_EDGE, IPL_TTY, astintr,
- sc, sc->sc_dev.dv_xname);
+ sc);
}
int
-/* $OpenBSD: boca.c,v 1.4 1996/03/08 16:42:49 niklas Exp $ */
+/* $OpenBSD: boca.c,v 1.5 1996/03/19 21:10:07 mickey Exp $ */
/* $NetBSD: boca.c,v 1.6 1995/12/24 02:31:11 mycroft Exp $ */
/*
}
sc->sc_ih = isa_intr_establish(ia->ia_irq, IST_EDGE, IPL_TTY, bocaintr,
- sc, sc->sc_dev.dv_xname);
+ sc);
}
int
-/* $OpenBSD: bt.c,v 1.4 1996/03/08 16:42:50 niklas Exp $ */
+/* $OpenBSD: bt.c,v 1.5 1996/03/19 21:10:08 mickey Exp $ */
/* $NetBSD: bt742a.c,v 1.50 1995/12/24 02:31:13 mycroft Exp $ */
/*
isa_establish(&bt->sc_id, &bt->sc_dev);
#endif
bt->sc_ih = isa_intr_establish(ia->ia_irq, IST_EDGE, IPL_BIO, btintr,
- bt, bt->sc_dev.dv_xname);
+ bt);
/*
* ask the adapter what subunits are present
-/* $OpenBSD: bt742a.c,v 1.4 1996/03/08 16:42:50 niklas Exp $ */
+/* $OpenBSD: bt742a.c,v 1.5 1996/03/19 21:10:08 mickey Exp $ */
/* $NetBSD: bt742a.c,v 1.50 1995/12/24 02:31:13 mycroft Exp $ */
/*
isa_establish(&bt->sc_id, &bt->sc_dev);
#endif
bt->sc_ih = isa_intr_establish(ia->ia_irq, IST_EDGE, IPL_BIO, btintr,
- bt, bt->sc_dev.dv_xname);
+ bt);
/*
* ask the adapter what subunits are present
-/* $OpenBSD: com.c,v 1.7 1996/03/08 16:42:51 niklas Exp $ */
+/* $OpenBSD: com.c,v 1.8 1996/03/19 21:10:09 mickey Exp $ */
/* $NetBSD: com.c,v 1.65 1996/02/10 20:23:18 christos Exp $ */
/*-
if (ia->ia_irq != IRQUNK)
sc->sc_ih = isa_intr_establish(ia->ia_irq, IST_EDGE, IPL_TTY,
- comintr, sc, sc->sc_dev.dv_xname);
+ comintr, sc);
#ifdef KGDB
if (kgdb_dev == makedev(commajor, unit)) {
isa_establish(&fdc->sc_id, &fdc->sc_dev);
#endif
fdc->sc_ih = isa_intr_establish(ia->ia_irq, IST_EDGE, IPL_BIO, fdcintr,
- fdc, fdc->sc_dev.dv_xname);
+ fdc);
/*
* The NVRAM info only tells us about the first two disks on the
at_dma(read, bp->b_data + fd->sc_skip, fd->sc_nbytes,
fdc->sc_drq);
#else
- isadma_start(bp->b_data + fd->sc_skip, fd->sc_nbytes,
- fdc->sc_drq, read ? ISADMA_START_READ : ISADMA_START_WRITE);
+ isa_dmastart(read, bp->b_data + fd->sc_skip, fd->sc_nbytes,
+ fdc->sc_drq);
#endif
outb(iobase + fdctl, type->rate);
#ifdef FD_DEBUG
#ifdef NEWCONFIG
at_dma_abort(fdc->sc_drq);
#else
- isadma_abort(fdc->sc_drq);
+ isa_dmaabort(fdc->sc_drq);
#endif
case SEEKTIMEDOUT:
case RECALTIMEDOUT:
#ifdef NEWCONFIG
at_dma_abort(fdc->sc_drq);
#else
- isadma_abort(fdc->sc_drq);
+ isa_dmaabort(fdc->sc_drq);
#endif
#ifdef FD_DEBUG
fdcstatus(&fd->sc_dev, 7, bp->b_flags & B_READ ?
#ifdef NEWCONFIG
at_dma_terminate(fdc->sc_drq);
#else
- isadma_done(fdc->sc_drq);
+ read = bp->b_flags & B_READ;
+ isa_dmadone(read, bp->b_data + fd->sc_skip, fd->sc_nbytes,
+ fdc->sc_drq);
#endif
if (fdc->sc_errors) {
diskerr(bp, "fd", "soft error", LOG_PRINTF,
#define FDC_BSIZE 512
#define FDC_NPORT 8
-#define FDC_MAXIOSIZE MAXBSIZE
+#define FDC_MAXIOSIZE NBPG /* XXX should be MAXBSIZE */
-/* $OpenBSD: gus.c,v 1.5 1996/03/08 16:42:54 niklas Exp $ */
+/* $OpenBSD: gus.c,v 1.6 1996/03/19 21:10:11 mickey Exp $ */
/* $NetBSD: gus.c,v 1.7 1996/02/16 08:18:37 mycroft Exp $ */
/*-
* we use IPL_CLOCK.
*/
sc->sc_ih = isa_intr_establish(ia->ia_irq, IST_EDGE, IPL_AUDIO, gusintr,
- sc /* sc->sc_gusdsp */, sc->sc_dev.dv_xname);
+ sc /* sc->sc_gusdsp */);
/*
* Set some default values
-/* $OpenBSD: if_ed.c,v 1.6 1996/03/08 16:42:59 niklas Exp $ */
+/* $OpenBSD: if_ed.c,v 1.7 1996/03/19 21:10:14 mickey Exp $ */
/* $NetBSD: if_ed.c,v 1.87 1996/01/10 16:49:25 chuck Exp $ */
/*
#endif
sc->sc_ih = isa_intr_establish(ia->ia_irq, IST_EDGE, IPL_NET, edintr,
- sc, sc->sc_dev.dv_xname);
+ sc);
sc->sc_sh = shutdownhook_establish((void (*)(void *))edstop, sc);
}
#endif
sc->sc_ih = isa_intr_establish(ia->ia_irq, IST_EDGE, IPL_NET, egintr,
- sc, sc->sc_dev.dv_xname);
+ sc);
}
void
-/* $OpenBSD: if_el.c,v 1.4 1996/03/08 16:43:01 niklas Exp $ */
+/* $OpenBSD: if_el.c,v 1.5 1996/03/19 21:10:17 mickey Exp $ */
/* $NetBSD: if_el.c,v 1.34 1995/12/24 02:31:25 mycroft Exp $ */
/*
#endif
sc->sc_ih = isa_intr_establish(ia->ia_irq, IST_EDGE, IPL_NET, elintr,
- sc, sc->sc_dev.dv_xname);
+ sc);
dprintf(("elattach() finished.\n"));
}
-/* $OpenBSD: if_ep.c,v 1.7 1996/03/08 16:43:02 niklas Exp $ */
+/* $OpenBSD: if_ep.c,v 1.8 1996/03/19 21:10:18 mickey Exp $ */
/* $NetBSD: if_ep.c,v 1.86 1995/12/24 02:31:27 mycroft Exp $ */
/*
{
struct isa_attach_args *ia = aux;
sc->sc_ih = isa_intr_establish(ia->ia_irq, IST_EDGE, IPL_NET,
- epintr, sc, sc->sc_dev.dv_xname);
+ epintr, sc);
}
}
#endif
sc->sc_ih = isa_intr_establish(ia->ia_irq, IST_EDGE, IPL_NET, feintr,
- sc, sc->sc_dev.dv_xname);
+ sc);
}
/*
-/* $OpenBSD: if_ie.c,v 1.4 1996/03/08 16:43:04 niklas Exp $ */
+/* $OpenBSD: if_ie.c,v 1.5 1996/03/19 21:10:21 mickey Exp $ */
/* $NetBSD: if_ie.c,v 1.45 1995/12/24 02:31:33 mycroft Exp $ */
/*-
#endif
sc->sc_ih = isa_intr_establish(ia->ia_irq, IST_EDGE, IPL_NET, ieintr,
- sc, sc->sc_dev.dv_xname);
+ sc);
}
/*
-/* $OpenBSD: if_le.c,v 1.5 1996/03/08 16:43:05 niklas Exp $ */
+/* $OpenBSD: if_le.c,v 1.6 1996/03/19 21:10:22 mickey Exp $ */
/* $NetBSD: if_le.c,v 1.38 1995/12/24 02:31:35 mycroft Exp $ */
/*-
isa_dmacascade(ia->ia_drq);
sc->sc_ih = isa_intr_establish(ia->ia_irq, IST_EDGE, IPL_NET,
- leintredge, sc, sc->sc_dev.dv_xname);
+ leintredge, sc);
}
#endif
-/* $OpenBSD: isavar.h,v 1.4 1996/03/08 16:43:07 niklas Exp $ */
+/* $OpenBSD: isavar.h,v 1.5 1996/03/19 21:10:23 mickey Exp $ */
/* $NetBSD: isavar.h,v 1.17 1995/12/24 02:31:38 mycroft Exp $ */
/*
/* ISA interrupt sharing types */
void isascan __P((struct device *parent, void *match));
void *isa_intr_establish __P((int intr, int type, int level,
- int (*ih_fun)(void *), void *ih_arg, char *ih_what));
+ int (*ih_fun)(void *), void *ih_arg));
void isa_intr_disestablish __P((void *handler));
char *isa_intr_typename __P((int type));
-/* $OpenBSD: lpt.c,v 1.5 1996/03/08 16:43:08 niklas Exp $ */
+/* $OpenBSD: lpt.c,v 1.6 1996/03/19 21:10:24 mickey Exp $ */
/* $NetBSD: lpt.c,v 1.31 1995/12/24 02:31:40 mycroft Exp $ */
/*
if (ia->ia_irq != IRQUNK)
sc->sc_ih = isa_intr_establish(ia->ia_irq, IST_EDGE, IPL_NONE,
- lptintr, sc, sc->sc_dev.dv_xname);
+ lptintr, sc);
}
/*
-/* $OpenBSD: mcd.c,v 1.6 1996/03/08 16:43:09 niklas Exp $ */
+/* $OpenBSD: mcd.c,v 1.7 1996/03/19 21:10:25 mickey Exp $ */
/* $NetBSD: mcd.c,v 1.45 1996/01/30 18:28:05 thorpej Exp $ */
/*
mcd_soft_reset(sc);
sc->sc_ih = isa_intr_establish(ia->ia_irq, IST_EDGE, IPL_BIO, mcdintr,
- sc, sc->sc_dev.dv_xname);
+ sc);
}
/*
-/* $OpenBSD: pas.c,v 1.5 1996/03/08 16:43:10 niklas Exp $ */
+/* $OpenBSD: pas.c,v 1.6 1996/03/19 21:10:27 mickey Exp $ */
/* $NetBSD: pas.c,v 1.12 1996/02/16 08:18:34 mycroft Exp $ */
/*
sc->sc_iobase = iobase;
sc->sc_ih = isa_intr_establish(ia->ia_irq, IST_EDGE, IPL_AUDIO,
- sbdsp_intr, &sc->sc_sbdsp,
- sc->sc_dev.dv_xname);
+ sbdsp_intr, &sc->sc_sbdsp);
printf(" ProAudio Spectrum %s [rev %d] ", pasnames[sc->model], sc->rev);
timeout((void (*)(void *))pcic_intr, pcic, pcic->sc_polltimo);
} else {
pcic->sc_ih = isa_intr_establish(ia->ia_irq, IST_EDGE,
- IPL_NET, pcic_intr, pcic,
- pcic->sc_dev.dv_xname);
+ IPL_NET, pcic_intr, pcic);
pcic->sc_polltimo = 0;
}
}
-/* $OpenBSD: pss.c,v 1.5 1996/03/08 16:43:11 niklas Exp $ */
+/* $OpenBSD: pss.c,v 1.6 1996/03/19 21:10:29 mickey Exp $ */
/* $NetBSD: pss.c,v 1.11 1995/12/24 02:31:45 mycroft Exp $ */
/*
/* Setup interrupt handler for PSS */
sc->sc_ih = isa_intr_establish(ia->ia_irq, IST_EDGE, IPL_AUDIO, pssintr,
- sc, sc->sc_dev.dv_xname);
+ sc);
vers = (inw(sc->sc_iobase+PSS_ID_VERS)&0xff) - 1;
printf(": ESC614%c\n", (vers > 0)?'A'+vers:' ');
-/* $OpenBSD: rtfps.c,v 1.4 1996/03/08 16:43:12 niklas Exp $ */
+/* $OpenBSD: rtfps.c,v 1.5 1996/03/19 21:10:30 mickey Exp $ */
/* $NetBSD: rtfps.c,v 1.14 1995/12/24 02:31:48 mycroft Exp $ */
/*
}
sc->sc_ih = isa_intr_establish(ia->ia_irq, IST_EDGE, IPL_TTY, rtfpsintr,
- sc, sc->sc_dev.dv_xname);
+ sc);
}
int
-/* $OpenBSD: sb.c,v 1.5 1996/03/08 16:43:13 niklas Exp $ */
+/* $OpenBSD: sb.c,v 1.6 1996/03/19 21:10:31 mickey Exp $ */
/* $NetBSD: sb.c,v 1.30 1996/02/16 08:18:32 mycroft Exp $ */
/*
int err;
sc->sc_ih = isa_intr_establish(ia->ia_irq, IST_EDGE, IPL_AUDIO,
- sbdsp_intr, sc, sc->sc_dev.dv_xname);
+ sbdsp_intr, sc);
sbdsp_attach(sc);
isa_establish(&sea->sc_id, &sea->sc_deV);
#endif
sea->sc_ih = isa_intr_establish(ia->ia_irq, IST_EDGE, IPL_BIO, seaintr,
- sea, sea->sc_dev.dv_xname);
+ sea);
/*
* ask the adapter what subunits are present
-/* $OpenBSD: ultra14f.c,v 1.9 1996/03/08 16:43:16 niklas Exp $ */
+/* $OpenBSD: ultra14f.c,v 1.10 1996/03/19 21:10:33 mickey Exp $ */
/* $NetBSD: ultra14f.c,v 1.61 1996/02/09 17:38:09 mycroft Exp $ */
/*
isa_establish(&uha->sc_id, &uha->sc_dev);
#endif
uha->sc_ih = isa_intr_establish(ia->ia_irq, IST_EDGE, IPL_BIO,
- uha->intr, uha, uha->sc_dev.dv_xname);
+ uha->intr, uha);
/*
* ask the adapter what subunits are present
printf("\n");
wdc->sc_ih = isa_intr_establish(ia->ia_irq, IST_EDGE, IPL_BIO, wdcintr,
- wdc, wdc->sc_dev.dv_xname);
+ wdc);
for (wa.wa_drive = 0; wa.wa_drive < 2; wa.wa_drive++)
(void)config_found(self, (void *)&wa, wdprint);
-/* $OpenBSD: wss.c,v 1.5 1996/03/08 16:43:17 niklas Exp $ */
+/* $OpenBSD: wss.c,v 1.6 1996/03/19 21:10:36 mickey Exp $ */
/* $NetBSD: wss.c,v 1.9 1996/02/16 08:18:36 mycroft Exp $ */
/*
isa_establish(&sc->sc_id, &sc->sc_dev);
#endif
sc->sc_ih = isa_intr_establish(ia->ia_irq, IST_EDGE, IPL_AUDIO, ad1848_intr,
- &sc->sc_ad1848, sc->sc_dev.dv_xname);
+ &sc->sc_ad1848);
ad1848_attach(&sc->sc_ad1848);
sc->dens = -1; /* unknown density */
sc->sc_ih = isa_intr_establish(ia->ia_irq, IST_EDGE, IPL_BIO, wtintr,
- sc, sc->sc_dev.dv_xname);
+ sc);
}
int
void pci_conf_write __P((pcitag_t, int, pcireg_t));
void pci_devinfo __P((pcireg_t, pcireg_t, char *, int *));
pcitag_t pci_make_tag __P((int, int, int));
-void *pci_map_int __P((pcitag_t, int, int (*)(void *), void *, char *));
+void *pci_map_int __P((pcitag_t, int, int (*)(void *), void *));
int pci_map_mem __P((pcitag_t, int, vm_offset_t *, vm_offset_t *));
int pci_attach_subdev __P((struct device *, int, int));
--- /dev/null
+/* $OpenBSD: kern_thread.c,v 1.1 1996/03/19 21:10:40 mickey Exp $ */
+
+/*
+ * Copyright (c) 1987, 1990 Carnegie-Mellon University.
+ * All rights reserved.
+ *
+ * Permission to use, copy, modify and distribute this software and
+ * its documentation is hereby granted, provided that both the copyright
+ * notice and this permission notice appear in all copies of the
+ * software, derivative works or modified versions, and any portions
+ * thereof, and that both notices appear in supporting documentation.
+ *
+ * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
+ * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
+ * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
+ *
+ * Carnegie Mellon requests users of this software to return to
+ *
+ * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
+ * School of Computer Science
+ * Carnegie Mellon University
+ * Pittsburgh PA 15213-3890
+ *
+ * any improvements or extensions that they make and grant Carnegie the
+ * rights to redistribute these changes.
+ */
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/proc.h>
+#include <vm/vm_param.h>
+#include <vm/lock.h>
+
+/*
+ * The rest of these routines fake thread handling
+ */
+
+void
+assert_wait(event, interruptible)
+ event_t event;
+ boolean_t interruptible;
+{
+#ifdef lint
+ interruptible++;
+#endif
+ current_thread() = (thread_t)event; /* XXX */
+}
+
+void
+thread_block()
+{
+ int s = splhigh();
+
+ if (current_thread())
+ tsleep(current_thread(), PVM, "thrd_block", 0);
+ splx(s);
+}
+
+void
+thread_sleep(event, lock, interruptible)
+ event_t event;
+ simple_lock_t lock;
+ boolean_t interruptible;
+{
+ int s = splhigh();
+
+ assert_wait (event, interruptible);
+ simple_unlock(lock);
+ if (current_thread())
+ tsleep(event, PVM, "thrd_sleep", 0);
+ splx(s);
+}
+
+void
+thread_wakeup(event)
+ event_t event;
+{
+ int s = splhigh();
+
+ wakeup(event);
+ splx(s);
+}
+
-/* $OpenBSD: umap_subr.c,v 1.4 1996/03/02 00:08:06 niklas Exp $ */
+/* $OpenBSD: umap_subr.c,v 1.5 1996/03/19 21:10:42 mickey Exp $ */
/* $NetBSD: umap_subr.c,v 1.7 1996/02/09 22:41:02 christos Exp $ */
/*
gid_t gid;
u_long (*usermap)[2], (*groupmap)[2];
+ if (credp == NOCRED)
+ return;
+
unentries = MOUNTTOUMAPMOUNT(v_mount)->info_nentries;
usermap = MOUNTTOUMAPMOUNT(v_mount)->info_mapdata;
gnentries = MOUNTTOUMAPMOUNT(v_mount)->info_gnentries;
-/* $OpenBSD: umap_vfsops.c,v 1.3 1996/02/29 13:08:06 niklas Exp $ */
+/* $OpenBSD: umap_vfsops.c,v 1.4 1996/03/19 21:10:43 mickey Exp $ */
/* $NetBSD: umap_vfsops.c,v 1.9 1996/02/09 22:41:05 christos Exp $ */
/*
caddr_t arg;
struct proc *p;
{
-
- return (EOPNOTSUPP);
+ return VFS_QUOTACTL(MOUNTTOUMAPMOUNT(mp)->umapm_vfs, cmd, uid, arg, p);
}
int
struct ucred *cred;
struct proc *p;
{
-
/*
* XXX - Assumes no data cached at umap layer.
*/
ino_t ino;
struct vnode **vpp;
{
-
- return (EOPNOTSUPP);
+ return VFS_VGET(MOUNTTOUMAPMOUNT(mp)->umapm_vfs, ino, vpp);
}
int
#define schednetisr(anisr) { netisr |= 1<<(anisr); setsoftnet(); }
-#ifndef LOCORE
+#ifndef _LOCORE
#ifdef _KERNEL
int netisr; /* scheduling bits for network */
#endif
-/* $OpenBSD: disklabel.h,v 1.4 1996/03/03 12:11:33 niklas Exp $ */
+/* $OpenBSD: disklabel.h,v 1.5 1996/03/19 21:10:47 mickey Exp $ */
/* $NetBSD: disklabel.h,v 1.38 1996/02/09 18:25:05 christos Exp $ */
/*
#define DISKMAGIC ((u_int32_t)0x82564557) /* The disk magic number */
-#ifndef LOCORE
+#ifndef _LOCORE
struct disklabel {
u_int32_t d_magic; /* the magic number */
u_int16_t d_type; /* drive type */
#define p_sgs __partition_u1.sgs
} d_partitions[MAXPARTITIONS]; /* actually may be more */
};
-#else /* LOCORE */
+#else /* _LOCORE */
/*
* offsets for asm boot files.
*/
.set d_secpercyl,56
.set d_secperunit,60
.set d_end_,276 /* size of disk label */
-#endif /* LOCORE */
+#endif /* _LOCORE */
/* d_type values: */
#define DTYPE_SMD 1 /* SMD, XSMD; VAX hp/up */
*/
#define d_blind d_drivedata[0]
-#ifndef LOCORE
+#ifndef _LOCORE
/*
* Structure used to perform a format or other raw operation, returning
* data and/or register values. Register identification and format
int writedisklabel __P((dev_t, void (*)(struct buf *), struct disklabel *,
struct cpu_disklabel *));
#endif
-#endif /* LOCORE */
+#endif /* _LOCORE */
-#if !defined(_KERNEL) && !defined(LOCORE)
+#if !defined(_KERNEL) && !defined(_LOCORE)
#include <sys/cdefs.h>
-/* $OpenBSD: param.h,v 1.5 1996/03/05 02:30:00 dm Exp $ */
+/* $OpenBSD: param.h,v 1.6 1996/03/19 21:10:48 mickey Exp $ */
/* $NetBSD: param.h,v 1.18.2.1 1995/10/12 05:42:01 jtc Exp $ */
/*-
#define NULL 0
#endif
-#ifndef LOCORE
+#ifndef _LOCORE
#include <sys/types.h>
#endif
-/* $OpenBSD: proc.h,v 1.2 1996/03/03 12:12:07 niklas Exp $ */
+/* $OpenBSD: proc.h,v 1.3 1996/03/19 21:10:48 mickey Exp $ */
/* $NetBSD: proc.h,v 1.42 1996/02/09 18:25:23 christos Exp $ */
/*-
char *e_esigcode; /* End of sigcode */
};
+/*
+ * Description of the thread within the process
+ */
+typedef struct proc *proc_t;
+typedef struct thread *thread_t;
+typedef void *event_t;
+
+struct thread {
+
+ proc_t proc;
+ event_t wait_event;
+};
+
/*
* Description of a process.
*
/* End area that is copied on creation. */
#define p_endcopy p_thread
- void *p_thread; /* Id for this "thread"; Mach glue. XXX */
+ thread_t p_thread; /* Id for this "thread"; Mach glue. */
struct user *p_addr; /* Kernel virtual addr of u-area (PROC ONLY). */
struct mdproc p_md; /* Any machine-dependent fields. */
struct proc *ph_rlink;
} qs[NQS];
+#define current_thread() (curproc->p_thread)
+void assert_wait __P((event_t, boolean_t));
+void thread_block __P((void));
+void thread_sleep __P((event_t, struct slock *, boolean_t));
+void thread_wakeup __P((event_t));
+
struct proc *pfind __P((pid_t)); /* Find process by id. */
struct pgrp *pgfind __P((pid_t)); /* Find process group by id. */
-/* $OpenBSD: types.h,v 1.3 1996/03/03 12:12:36 niklas Exp $ */
+/* $OpenBSD: types.h,v 1.4 1996/03/19 21:10:49 mickey Exp $ */
/* $NetBSD: types.h,v 1.24 1995/12/29 01:15:13 jtc Exp $ */
/*-
typedef unsigned int uint; /* Sys V compatibility */
#endif
+#ifdef _KERNEL
+/*
+ * Boolean data type for use only kernel
+ */
+typedef int boolean_t;
+#define TRUE 1
+#define FALSE 0
+#endif /* _KERNEL */
+
typedef u_int64_t u_quad_t; /* quads */
typedef int64_t quad_t;
typedef quad_t * qaddr_t;
* used in the same place that the structure is defined.
*/
struct proc;
+struct thread;
+struct slock;
struct pgrp;
struct ucred;
struct rusage;
-/* $OpenBSD: lfs_alloc.c,v 1.2 1996/02/27 07:13:20 niklas Exp $ */
+/* $OpenBSD: lfs_alloc.c,v 1.3 1996/03/19 21:10:51 mickey Exp $ */
/* $NetBSD: lfs_alloc.c,v 1.3 1996/02/09 22:28:47 christos Exp $ */
/*
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
+#include <sys/proc.h>
#include <sys/buf.h>
#include <sys/vnode.h>
#include <sys/syslog.h>
#include <sys/param.h>
#include <sys/systm.h>
+#include <sys/proc.h>
#include <vm/vm.h>
-/* XXX */
-#include <sys/proc.h>
-typedef void *thread_t;
-#define current_thread() ((thread_t)&curproc->p_thread)
-/* XXX */
-
#if NCPUS > 1
/*
l->want_upgrade = FALSE;
l->read_count = 0;
l->can_sleep = can_sleep;
- l->thread = (char *)-1; /* XXX */
+ l->thread = (thread_t)-1; /* XXX */
l->recursion_depth = 0;
}
simple_lock(&l->interlock);
- if (((thread_t)l->thread) == current_thread()) {
+ if (l->thread == (thread_t)¤t_thread()) {
/*
* Recursive lock.
*/
simple_lock(&l->interlock);
- if (((thread_t)l->thread) == current_thread()) {
+ if (l->thread == (thread_t)¤t_thread()) {
/*
* Recursive lock.
*/
l->read_count--;
- if (((thread_t)l->thread) == current_thread()) {
+ if (l->thread == (thread_t)¤t_thread()) {
/*
* Recursive lock.
*/
simple_lock(&l->interlock);
- if (((thread_t)l->thread) == current_thread()) {
+ if (l->thread == (thread_t)¤t_thread()) {
/*
* Recursive lock
*/
{
simple_lock(&l->interlock);
- if (((thread_t)l->thread) == current_thread()) {
+ if (l->thread == (thread_t)¤t_thread()) {
/*
* Recursive lock
*/
simple_lock(&l->interlock);
- if (((thread_t)l->thread) == current_thread()) {
+ if (l->thread == (thread_t)¤t_thread()) {
/*
* Recursive lock
*/
if (!l->want_write) {
panic("lock_set_recursive: don't have write lock");
}
- l->thread = (char *) current_thread();
+ l->thread = (thread_t)¤t_thread();
simple_unlock(&l->interlock);
}
lock_t l;
{
simple_lock(&l->interlock);
- if (((thread_t) l->thread) != current_thread()) {
+ if (l->thread != (thread_t)¤t_thread()) {
panic("lock_clear_recursive: wrong thread");
}
if (l->recursion_depth == 0)
- l->thread = (char *)-1; /* XXX */
+ l->thread = (thread_t)-1; /* XXX */
simple_unlock(&l->interlock);
}
*/
struct slock {
- int lock_data; /* in general 1 bit is sufficient */
+ boolean_t lock_data; /* in general 1 bit is sufficient */
};
typedef struct slock simple_lock_data_t;
int read_count; /* Number of accepted readers */
#endif /* ns32000 */
#endif /* vax */
- void *thread; /* Thread that has lock, if recursive locking allowed */
+ struct thread *thread; /* Thread that has lock, if recursive locking allowed */
/* (should be thread_t, but but we then have mutually
recursive definitions) */
int recursion_depth;/* Depth of recursion */
-/* $OpenBSD: vm_glue.c,v 1.9 1996/03/03 17:45:29 niklas Exp $ */
+/* $OpenBSD: vm_glue.c,v 1.10 1996/03/19 21:10:55 mickey Exp $ */
/* $NetBSD: vm_glue.c,v 1.52 1996/02/12 21:51:59 christos Exp $ */
/*
p->p_swtime = 0;
}
-/*
- * The rest of these routines fake thread handling
- */
-
-void
-assert_wait(event, ruptible)
- void *event;
- boolean_t ruptible;
-{
-#ifdef lint
- ruptible++;
-#endif
- curproc->p_thread = event;
-}
-
-void
-thread_block()
-{
- int s = splhigh();
-
- if (curproc->p_thread)
- tsleep(curproc->p_thread, PVM, "thrd_block", 0);
- splx(s);
-}
-
-void
-thread_sleep(event, lock, ruptible)
- void *event;
- simple_lock_t lock;
- boolean_t ruptible;
-{
- int s = splhigh();
-
-#ifdef lint
- ruptible++;
-#endif
- curproc->p_thread = event;
- simple_unlock(lock);
- if (curproc->p_thread)
- tsleep(event, PVM, "thrd_sleep", 0);
- splx(s);
-}
-
-void
-thread_wakeup(event)
- void *event;
-{
- int s = splhigh();
-
- wakeup(event);
- splx(s);
-}
-
/*
* DEBUG stuff
*/
+#ifdef DEBUG
int indent = 0;
(*pr)("%r", fmt, ap);
va_end(ap);
}
+#endif
+
#include <machine/vmparam.h>
-/*
- * This belongs in types.h, but breaks too many existing programs.
- */
-typedef int boolean_t;
-#define TRUE 1
-#define FALSE 0
-
/*
* The machine independent pages are refered to as PAGES. A page
* is some number of hardware pages, depending on the target machine.