summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorPer Fogelstrom <pefo@cvs.openbsd.org>1996-05-15 07:09:13 +0000
committerPer Fogelstrom <pefo@cvs.openbsd.org>1996-05-15 07:09:13 +0000
commit7da17c50ca40f7dc53c79b5c3e94831406f23361 (patch)
treed3af201e52a6df2d4e87f484b48c5f71d864ac64 /sys/arch
parent9b817d7486b3414e301bb5234522a769ce9e9a97 (diff)
Catchup of interface changes + prototyping.
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/pica/Makefile10
-rw-r--r--sys/arch/pica/conf/Makefile.pica12
-rw-r--r--sys/arch/pica/conf/files.pica7
-rw-r--r--sys/arch/pica/dev/if_sn.c55
-rw-r--r--sys/arch/pica/pica/clock.c3
-rw-r--r--sys/arch/pica/pica/conf.c8
-rw-r--r--sys/arch/pica/pica/disksubr.c19
-rw-r--r--sys/arch/pica/pica/genassym.c3
-rw-r--r--sys/arch/pica/pica/machdep.c4
-rw-r--r--sys/arch/pica/pica/trap.c4
-rw-r--r--sys/arch/pica/pica/vm_machdep.c8
11 files changed, 62 insertions, 71 deletions
diff --git a/sys/arch/pica/Makefile b/sys/arch/pica/Makefile
index 032edd62f0c..1eb83a21455 100644
--- a/sys/arch/pica/Makefile
+++ b/sys/arch/pica/Makefile
@@ -1,9 +1,9 @@
# from: @(#)Makefile 8.1 (Berkeley) 6/16/93
-# $Id: Makefile,v 1.1 1995/10/18 10:39:06 deraadt Exp $
+# $Id: Makefile,v 1.2 1996/05/15 07:09:06 pefo Exp $
# Makefile for pica links, tags file
-.include "../kern/Make.tags.inc"
+.include "../../kern/Make.tags.inc"
all:
@echo "make links or tags only"
@@ -19,10 +19,10 @@ PICA= /sys/pica/dev/*.[ch] /sys/pica/include/*.[ch] \
APICA= /sys/pica/pica/*.s
tags::
- -ctags -wdt ${COMM} ${PICA}
+ -ctags -wdtif ${COMM} ${PICA}
egrep "^LEAF(.*)|^[AN]LEAF(.*)|^NON_LEAF(.*)" ${APICA} | \
sed "s;\([^:]*\):\([^(]*\)(\([^, )]*\)\(.*\);\3 \1 /^\2(\3\4$$/;" \
>> tags
sort -o tags tags
- chown bin.wsrc tags
- chmod 444 tags
+
+.include <bsd.prog.mk>
diff --git a/sys/arch/pica/conf/Makefile.pica b/sys/arch/pica/conf/Makefile.pica
index 3675b9f7fda..6a3c1965e5c 100644
--- a/sys/arch/pica/conf/Makefile.pica
+++ b/sys/arch/pica/conf/Makefile.pica
@@ -34,7 +34,7 @@ LD=ld.ok
INCLUDES= -I. -I$S/arch -I$S
CPPFLAGS= ${INCLUDES} ${IDENT} -D_KERNEL -Dpica -D__NetBSD__ ${GP} \
-mips2 -mcpu=r4000
-CFLAGS= ${DEBUG} -O2 -Werror
+CFLAGS= ${DEBUG} -O2 -Werror -mno-abicalls
AFLAGS= -x assembler-with-cpp -traditional-cpp -D_LOCORE
### find out what to use for libkern
@@ -58,6 +58,9 @@ LIBCOMPAT= ${COMPATLIB_PROF}
# capitalized (e.g. C for a .c file), and CONFIG_DEP is _C if the file
# is marked as config-dependent.
+USRLAND_C= ${CC} ${CFLAGS} -mabicalls ${CPPFLAGS} ${PROF} -c $<
+USRLAND_C_C= ${CC} ${CFLAGS} -mabicalls ${CPPFLAGS} ${PROF} ${PARAM} -c $<
+
NORMAL_C= ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c $<
NORMAL_C_C= ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} ${PARAM} -c $<
@@ -143,8 +146,11 @@ in_proto.o: Makefile
assym.h: genassym
./genassym >assym.h
-genassym: ${PICA}/pica/genassym.c
- ${NORMAL_C_C}
+genassym: genassym.o
+ ${CC} -o $@ genassym.o
+
+genassym.o: ${PICA}/pica/genassym.c
+ ${USRLAND_C_C}
depend: assym.h param.c
mkdep ${COPTS} ${CFILES} ioconf.c param.c
diff --git a/sys/arch/pica/conf/files.pica b/sys/arch/pica/conf/files.pica
index f3522a83add..0001e1d074d 100644
--- a/sys/arch/pica/conf/files.pica
+++ b/sys/arch/pica/conf/files.pica
@@ -1,4 +1,4 @@
-# $OpenBSD: files.pica,v 1.3 1996/05/02 07:59:36 pefo Exp $
+# $OpenBSD: files.pica,v 1.4 1996/05/15 07:09:08 pefo Exp $
# $NetBSD: files.pica,v 1.16 1995/04/30 10:11:00 cgd Exp $
#
# maxpartitions must be first item in files.${ARCH}
@@ -80,11 +80,10 @@ file arch/pica/dev/lpt.c lpt needs-count
# Console driver on PC-style graphics
device pc: tty
attach pc at pica
-device pms
+device pms: tty
attach pms at pica
-file arch/pica/dev/pccons.c pms needs-count
+file arch/pica/dev/pccons.c pc needs-count
-# PS2 type mouse driver.
# Floppy disk controller
device fdc {drive = -1}
diff --git a/sys/arch/pica/dev/if_sn.c b/sys/arch/pica/dev/if_sn.c
index 47fd54a725a..12bb28dde7e 100644
--- a/sys/arch/pica/dev/if_sn.c
+++ b/sys/arch/pica/dev/if_sn.c
@@ -164,7 +164,7 @@ int ethdebug = 0;
int snintr __P((struct sn_softc *));
int snioctl __P((struct ifnet *ifp, u_long cmd, caddr_t data));
void snstart __P((struct ifnet *ifp));
-void snwatchdog __P(( /*int unit */ ));
+void snwatchdog __P((struct ifnet *ifp));
void snreset __P((struct sn_softc *sc));
/*
@@ -245,8 +245,8 @@ void mtd_free __P((struct mtd *));
struct mtd *mtd_alloc __P((void));
int sngetaddr __P((struct sn_softc *sc));
-int sninit __P((int unit));
-int snstop __P((int unit));
+int sninit __P((struct sn_softc *sc));
+int snstop __P((struct sn_softc *sc));
int sonicput __P((struct sn_softc *sc, struct mbuf *m0));
void camdump __P((struct sn_softc *sc));
@@ -343,8 +343,8 @@ printf("mapped to offset 0x%x size 0x%x\n", SONICBUF - pp, p - SONICBUF);
BUS_INTR_ESTABLISH(ca, (intr_handler_t)snintr, (void *)sc);
- ifp->if_name = "sn";
- ifp->if_unit = sc->sc_dev.dv_unit;
+ bcopy(sc->sc_dev.dv_xname, ifp->if_xname, IFNAMSIZ);
+ ifp->if_softc = sc;
ifp->if_ioctl = snioctl;
ifp->if_start = snstart;
ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
@@ -363,11 +363,12 @@ snioctl(ifp, cmd, data)
caddr_t data;
{
struct ifaddr *ifa;
- struct sn_softc *sc = sn_cd.cd_devs[ifp->if_unit];
+ struct sn_softc *sc = ifp->if_softc;
int s = splnet(), err = 0;
int temp;
+ int error;
- if ((error = ether_ioctl(ifp, &sc->sc_arpcom, cmd, data)) > 0) {
+ if ((error = ether_ioctl(ifp, &sc->sc_ac, cmd, data)) > 0) {
splx(s);
return error;
}
@@ -380,12 +381,12 @@ snioctl(ifp, cmd, data)
switch (ifa->ifa_addr->sa_family) {
#ifdef INET
case AF_INET:
- (void)sninit(ifp->if_unit);
+ (void)sninit(ifp->if_softc);
arp_ifinit(&sc->sc_ac, ifa);
break;
#endif
default:
- (void)sninit(ifp->if_unit);
+ (void)sninit(ifp->if_softc);
break;
}
break;
@@ -393,11 +394,11 @@ snioctl(ifp, cmd, data)
case SIOCSIFFLAGS:
if ((ifp->if_flags & IFF_UP) == 0 &&
ifp->if_flags & IFF_RUNNING) {
- snstop(ifp->if_unit);
+ snstop(ifp->if_softc);
ifp->if_flags &= ~IFF_RUNNING;
} else if (ifp->if_flags & IFF_UP &&
(ifp->if_flags & IFF_RUNNING) == 0)
- (void)sninit(ifp->if_unit);
+ (void)sninit(ifp->if_softc);
/*
* If the state of the promiscuous bit changes, the interface
* must be reset to effect the change.
@@ -447,7 +448,7 @@ void
snstart(ifp)
struct ifnet *ifp;
{
- struct sn_softc *sc = sn_cd.cd_devs[ifp->if_unit];
+ struct sn_softc *sc = ifp->if_softc;
struct mbuf *m;
int len;
@@ -498,15 +499,14 @@ snreset(sc)
struct sn_softc *sc;
{
printf("snreset\n");
- snstop(sc->sc_dev.dv_unit);
- sninit(sc->sc_dev.dv_unit);
+ snstop(sc);
+ sninit(sc);
}
int
-sninit(unit)
- int unit;
+sninit(sc)
+ struct sn_softc *sc;
{
- struct sn_softc *sc = sn_cd.cd_devs[unit];
struct sonic_reg *csr = sc->sc_csr;
int s, error;
@@ -562,7 +562,7 @@ sninit(unit)
return (0);
bad:
- snstop(sc->sc_dev.dv_unit);
+ snstop(sc);
return (error);
}
@@ -572,10 +572,9 @@ bad:
* part way through.
*/
int
-snstop(unit)
- int unit;
+snstop(sc)
+ struct sn_softc *sc;
{
- struct sn_softc *sc = sn_cd.cd_devs[unit];
struct mtd *mtd;
int s = splnet();
@@ -608,20 +607,20 @@ snstop(unit)
* will be handled by higher level protocol timeouts.
*/
void
-snwatchdog(unit)
- int unit;
+snwatchdog(ifp)
+ struct ifnet *ifp;
{
- struct sn_softc *sc = sn_cd.cd_devs[unit];
+ struct sn_softc *sc = ifp->if_softc;
int temp;
if (mtdhead && mtdhead->mtd_mbuf) {
/* something still pending for transmit */
if (mtdhead->mtd_txp->status == 0)
log(LOG_ERR, "%s%d: Tx - timeout\n",
- sc->sc_if.if_name, sc->sc_if.if_unit);
+ sc->sc_if.if_xname, sc->sc_if.if_softc);
else
log(LOG_ERR, "%s%d: Tx - lost interrupt\n",
- sc->sc_if.if_name, sc->sc_if.if_unit);
+ sc->sc_if.if_xname, sc->sc_if.if_softc);
temp = sc->sc_if.if_flags & IFF_UP;
snreset(sc);
sc->sc_if.if_flags |= temp;
@@ -713,7 +712,7 @@ sonicput(sc, m0)
mtd_free(mtdnew);
m_freem(m0);
log(LOG_ERR, "%s%d: tx too many fragments %d\n",
- sc->sc_if.if_name, sc->sc_if.if_unit, fr);
+ sc->sc_if.if_xname, sc->sc_if.if_softc, fr);
sc->sc_if.if_oerrors++;
return (len);
}
@@ -761,7 +760,7 @@ sngetaddr(sc)
unsigned i, x, y;
char *cp, *ea;
-#if 1
+#if 0
sc->sc_csr->s_cr = CR_RST;
wbflush();
sc->sc_csr->s_cep = 0;
diff --git a/sys/arch/pica/pica/clock.c b/sys/arch/pica/pica/clock.c
index 081bd49e367..b648306ed62 100644
--- a/sys/arch/pica/pica/clock.c
+++ b/sys/arch/pica/pica/clock.c
@@ -38,7 +38,7 @@
* from: Utah Hdr: clock.c 1.18 91/01/21
*
* from: @(#)clock.c 8.1 (Berkeley) 6/10/93
- * $Id: clock.c,v 1.3 1996/05/02 07:59:42 pefo Exp $
+ * $Id: clock.c,v 1.4 1996/05/15 07:09:10 pefo Exp $
*/
#include <sys/param.h>
@@ -157,6 +157,7 @@ delay(n)
* Start the real-time and statistics clocks. Leave stathz 0 since there
* are no other timers available.
*/
+void
cpu_initclocks()
{
extern int tickadj;
diff --git a/sys/arch/pica/pica/conf.c b/sys/arch/pica/pica/conf.c
index 95236cf4b74..2aeed2ae974 100644
--- a/sys/arch/pica/pica/conf.c
+++ b/sys/arch/pica/pica/conf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf.c,v 1.5 1996/05/02 07:59:42 pefo Exp $ */
+/* $OpenBSD: conf.c,v 1.6 1996/05/15 07:09:10 pefo Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* from: @(#)conf.c 8.2 (Berkeley) 11/14/93
- * $Id: conf.c,v 1.5 1996/05/02 07:59:42 pefo Exp $
+ * $Id: conf.c,v 1.6 1996/05/15 07:09:10 pefo Exp $
*/
#include <sys/param.h>
@@ -158,14 +158,14 @@ struct cdevsw cdevsw[] =
cdev_tty_init(NPTY,pts), /* 4: pseudo-tty slave */
cdev_ptc_init(NPTY,ptc), /* 5: pseudo-tty master */
cdev_log_init(1,log), /* 6: /dev/klog */
- cdev_fd_init(1,fd), /* 7: file descriptor pseudo-dev */
+ cdev_fd_init(1,filedesc), /* 7: file descriptor pseudo-dev */
cdev_disk_init(NCD,cd), /* 8: SCSI CD */
cdev_disk_init(NSD,sd), /* 9: SCSI disk */
cdev_tape_init(NST,st), /* 10: SCSI tape */
cdev_disk_init(NVND,vnd), /* 11: vnode disk */
cdev_bpftun_init(NBPFILTER,bpf),/* 12: berkeley packet filter */
cdev_disk_init(NFDC,fd), /* 13: Floppy disk */
- cdev_pc_init(1,pc), /* 14: builtin pc style console dev */
+ cdev_pc_init(NPC,pc), /* 14: builtin pc style console dev */
cdev_mouse_init(1,pms), /* 15: builtin PS2 style mouse */
cdev_lpt_init(NLPT,lpt), /* 16: lpt paralell printer interface */
cdev_tty_init(NCOM,com), /* 17: com 16C450 serial interface */
diff --git a/sys/arch/pica/pica/disksubr.c b/sys/arch/pica/pica/disksubr.c
index d7cc7079e4e..44954ae8e0c 100644
--- a/sys/arch/pica/pica/disksubr.c
+++ b/sys/arch/pica/pica/disksubr.c
@@ -43,28 +43,11 @@
extern struct device *bootdv;
/* was this the boot device ? */
-int
+void
dk_establish(dk, dev)
struct disk *dk;
struct device *dev;
{
-#ifdef NOTDEF
- /* XXX: sd -> scsibus -> esp */
- struct bootpath *bp = ((struct esp_softc *)dev->dv_parent->dv_parent)->sc_bp;
- char name[10];
-
-#define CRAZYMAP(v) ((v) == 3 ? 0 : (v) == 0 ? 3 : (v))
-
- if (bp == NULL) {
- printf("no boot path\n");
- return -1;
- }
- sprintf(name, "%s%d", bp->name, CRAZYMAP(bp->val[0]));
- if (strcmp(name, dev->dv_xname) == 0) {
- bootdv = dev;
- }
-#endif
- return 1;
}
/*
diff --git a/sys/arch/pica/pica/genassym.c b/sys/arch/pica/pica/genassym.c
index ebff36f66b3..9774280401e 100644
--- a/sys/arch/pica/pica/genassym.c
+++ b/sys/arch/pica/pica/genassym.c
@@ -34,10 +34,9 @@
* SUCH DAMAGE.
*
* from: @(#)genassym.c 8.2 (Berkeley) 9/23/93
- * $Id: genassym.c,v 1.1 1995/10/18 10:39:19 deraadt Exp $
+ * $Id: genassym.c,v 1.2 1996/05/15 07:09:11 pefo Exp $
*/
-#define _KERNEL
#include <sys/param.h>
#include <sys/buf.h>
diff --git a/sys/arch/pica/pica/machdep.c b/sys/arch/pica/pica/machdep.c
index ab68c064d33..230de8858c9 100644
--- a/sys/arch/pica/pica/machdep.c
+++ b/sys/arch/pica/pica/machdep.c
@@ -37,7 +37,7 @@
* SUCH DAMAGE.
*
* from: @(#)machdep.c 8.3 (Berkeley) 1/12/94
- * $Id: machdep.c,v 1.7 1996/05/08 08:33:32 mickey Exp $
+ * $Id: machdep.c,v 1.8 1996/05/15 07:09:11 pefo Exp $
*/
/* from: Utah Hdr: machdep.c 1.63 91/04/24 */
@@ -517,6 +517,7 @@ consinit()
* cpu_startup: allocate memory for variable-sized tables,
* initialize cpu, and do autoconfiguration.
*/
+void
cpu_startup()
{
register unsigned i;
@@ -863,6 +864,7 @@ sys_sigreturn(p, v, retval)
int waittime = -1;
+void
boot(howto)
register int howto;
{
diff --git a/sys/arch/pica/pica/trap.c b/sys/arch/pica/pica/trap.c
index 2743d6aaff1..f780ee63716 100644
--- a/sys/arch/pica/pica/trap.c
+++ b/sys/arch/pica/pica/trap.c
@@ -38,7 +38,7 @@
* from: Utah Hdr: trap.c 1.32 91/04/06
*
* from: @(#)trap.c 8.5 (Berkeley) 1/11/94
- * $Id: trap.c,v 1.5 1996/05/01 18:16:22 pefo Exp $
+ * $Id: trap.c,v 1.6 1996/05/15 07:09:12 pefo Exp $
*/
#include <sys/param.h>
@@ -625,7 +625,7 @@ trap(statusReg, causeReg, vadr, pc, args)
#endif
#ifdef KTRACE
if (KTRPOINT(p, KTR_SYSRET))
- ktrsysret(p->p_tracep, code, i, rval);
+ ktrsysret(p->p_tracep, code, i, rval[0]);
#endif
goto out;
}
diff --git a/sys/arch/pica/pica/vm_machdep.c b/sys/arch/pica/pica/vm_machdep.c
index 55066d4cd36..d6063d1b7f8 100644
--- a/sys/arch/pica/pica/vm_machdep.c
+++ b/sys/arch/pica/pica/vm_machdep.c
@@ -38,7 +38,7 @@
* from: Utah Hdr: vm_machdep.c 1.21 91/04/06
*
* from: @(#)vm_machdep.c 8.3 (Berkeley) 1/4/94
- * $Id: vm_machdep.c,v 1.2 1996/05/01 18:16:25 pefo Exp $
+ * $Id: vm_machdep.c,v 1.3 1996/05/15 07:09:12 pefo Exp $
*/
@@ -180,10 +180,11 @@ void cpu_exit(p)
/*
* Dump the machine specific header information at the start of a core dump.
*/
-cpu_coredump(p, vp, cred)
+cpu_coredump(p, vp, cred, core)
struct proc *p;
struct vnode *vp;
struct ucred *cred;
+ struct core *core;
{
extern struct proc *machFPCurProcPtr;
@@ -204,9 +205,10 @@ cpu_coredump(p, vp, cred)
* Both addresses are assumed to reside in the Sysmap,
* and size must be a multiple of CLSIZE.
*/
+void
pagemove(from, to, size)
register caddr_t from, to;
- int size;
+ size_t size;
{
register pt_entry_t *fpte, *tpte;