Make the LINT kernel compile with -W -Wreturn-type -Wcomment -Werror, and

add same (sans -Werror) to Makefile for future compilations.
This commit is contained in:
wollman 1993-11-25 01:38:01 +00:00
parent 7385db1ac7
commit f0e00ddec5
90 changed files with 1569 additions and 924 deletions

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)autoconf.c 7.1 (Berkeley) 5/9/91
* $Id$
* $Id: autoconf.c,v 1.4 1993/10/16 14:14:48 rgrimes Exp $
*/
/*
@ -55,6 +55,9 @@
#include "machine/pte.h"
static void swapconf(void);
static void setroot(void);
/*
* The following several variables are related to
* the configuration process, and are used in initializing
@ -66,6 +69,7 @@ extern int cold; /* cold start flag initialized in locore.s */
/*
* Determine i/o configuration for a machine.
*/
void
configure()
{
@ -92,6 +96,7 @@ configure()
/*
* Configure swap space and related parameters.
*/
static void
swapconf()
{
register struct swdevt *swp;
@ -140,10 +145,11 @@ static char devname[][2] = {
* If we can do so, and not instructed not to do so,
* change rootdev to correspond to the load device.
*/
static void
setroot()
{
int majdev, mindev, unit, part, adaptor;
dev_t temp, orootdev;
dev_t temp = 0, orootdev;
struct swdevt *swp;
/*printf("howto %x bootdev %x ", boothowto, bootdev);*/

View File

@ -23,7 +23,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
* $Id$
* $Id: db_disasm.c,v 1.3 1993/10/16 14:14:52 rgrimes Exp $
*/
/*
@ -1067,7 +1067,7 @@ db_disasm(loc, altfmt)
char * i_name;
int i_size;
int i_mode;
int regmodrm;
int regmodrm = 0;
boolean_t first;
int displ;
int prefix;

View File

@ -23,22 +23,23 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
* $Id: db_interface.c,v 1.2 1993/10/16 14:14:55 rgrimes Exp $
* $Id: db_interface.c,v 1.3 1993/11/07 17:41:34 wollman Exp $
*/
/*
* Interface to new debugger.
*/
#include "param.h"
#include "systm.h"
#include "proc.h"
#include <machine/db_machdep.h>
#include "ddb/ddb.h"
#include <sys/reboot.h>
#include <vm/vm_statistics.h>
#include <vm/pmap.h>
#include <setjmp.h>
#include <sys/systm.h> /* just for boothowto --eichin */
int db_active = 0;
db_regs_t ddb_regs;
@ -46,6 +47,7 @@ db_regs_t ddb_regs;
/*
* Received keyboard interrupt sequence.
*/
void
kdb_kbd_trap(regs)
struct i386_saved_state *regs;
{
@ -61,6 +63,7 @@ kdb_kbd_trap(regs)
static jmp_buf *db_nofault = 0;
int
kdb_trap(type, code, regs)
int type, code;
register struct i386_saved_state *regs;
@ -142,6 +145,7 @@ kdb_trap(type, code, regs)
/*
* Print trap reason.
*/
void
kdbprinttrap(type, code)
int type, code;
{
@ -229,8 +233,9 @@ db_write_bytes(addr, size, data)
}
}
void
Debugger (msg)
char *msg;
char *msg;
{
asm ("int $3");
}

View File

@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* from: @(#)machdep.c 7.4 (Berkeley) 6/3/91
* $Id: machdep.c,v 1.17 1993/11/16 09:54:47 davidg Exp $
* $Id: machdep.c,v 1.18 1993/11/17 23:24:56 wollman Exp $
*/
#include "npx.h"
@ -89,6 +89,8 @@ static unsigned int avail_remaining;
#include "i386/isa/isa.h"
#include "i386/isa/rtc.h"
static void identifycpu(void);
static void initcpu(void);
#define EXPECT_BASEMEM 640 /* The expected base memory*/
#define INFORM_WAIT 1 /* Set to pause berfore crash in weird cases*/
@ -144,7 +146,7 @@ cpu_startup()
int maxbufs, base, residual;
extern long Usrptsize;
vm_offset_t minaddr, maxaddr;
vm_size_t size;
vm_size_t size = 0;
int firstaddr;
/*
@ -315,6 +317,7 @@ struct cpu_nameclass i386_cpus[] = {
{ "i586", CPUCLASS_586 }, /* CPU_586 */
};
static void
identifycpu() /* translated from hp300 -- cgd */
{
printf("CPU: ");
@ -505,6 +508,7 @@ struct sigreturn_args {
struct sigcontext *sigcntxp;
};
int
sigreturn(p, uap, retval)
struct proc *p;
struct sigreturn_args *uap;
@ -729,6 +733,7 @@ microtime(tvp)
}
#endif /* HZ */
void
physstrat(bp, strat, prio)
struct buf *bp;
int (*strat)(), prio;
@ -736,15 +741,6 @@ physstrat(bp, strat, prio)
register int s;
caddr_t baddr;
/*
* vmapbuf clobbers b_addr so we must remember it so that it
* can be restored after vunmapbuf. This is truely rude, we
* should really be storing this in a field in the buf struct
* but none are available and I didn't want to add one at
* this time. Note that b_addr for dirty page pushes is
* restored in vunmapbuf. (ugh!)
*/
baddr = bp->b_un.b_addr;
vmapbuf(bp);
(*strat)(bp);
/* pageout daemon doesn't wait for pushed pages */
@ -755,9 +751,9 @@ physstrat(bp, strat, prio)
tsleep((caddr_t)bp, prio, "physstr", 0);
splx(s);
vunmapbuf(bp);
bp->b_un.b_addr = baddr;
}
static void
initcpu()
{
}
@ -932,7 +928,13 @@ struct soft_segment_descriptor ldt_segs[] = {
1, /* default 32 vs 16 bit size */
1 /* limit granularity (byte/page units)*/ } };
setidt(idx, func, typ, dpl) char *func; {
void
setidt(idx, func, typ, dpl)
int idx;
caddr_t func;
int typ;
int dpl;
{
struct gate_descriptor *ip = idt + idx;
ip->gd_looffset = (int)func;
@ -958,7 +960,9 @@ extern IDTVEC(div), IDTVEC(dbg), IDTVEC(nmi), IDTVEC(bpt), IDTVEC(ofl),
int lcr0(), lcr3(), rcr0(), rcr2();
int _gsel_tss;
void
init386(first)
int first;
{
extern ssdtosd(), lgdt(), lidt(), lldt(), etext;
int x, *pi;
@ -1170,7 +1174,10 @@ extern caddr_t CADDR1, CADDR2;
* zero out physical memory
* specified in relocation units (NBPG bytes)
*/
clearseg(n) {
void
clearseg(n)
int n;
{
*(int *)CMAP2 = PG_V | PG_KW | ctob(n);
load_cr3(rcr3());
@ -1185,7 +1192,10 @@ clearseg(n) {
* specified in relocation units (NBPG bytes)
*/
void
copyseg(frm, n) {
copyseg(frm, n)
int frm;
int n;
{
*(int *)CMAP2 = PG_V | PG_KW | ctob(n);
load_cr3(rcr3());
@ -1197,7 +1207,10 @@ copyseg(frm, n) {
* specified in relocation units (NBPG bytes)
*/
void
physcopyseg(frm, to) {
physcopyseg(frm, to)
int frm;
int to;
{
*(int *)CMAP1 = PG_V | PG_KW | ctob(frm);
*(int *)CMAP2 = PG_V | PG_KW | ctob(to);
@ -1218,6 +1231,7 @@ setsoftclock() {
* insert an element into a queue
*/
#undef insque
void /* XXX replace with inline FIXME! */
_insque(element, head)
register struct prochd *element, *head;
{
@ -1231,6 +1245,7 @@ _insque(element, head)
* remove an element from a queue
*/
#undef remque
void /* XXX replace with inline FIXME! */
_remque(element)
register struct prochd *element;
{

View File

@ -38,7 +38,7 @@
*
* from: Utah $Hdr: mem.c 1.13 89/10/08$
* from: @(#)mem.c 7.2 (Berkeley) 5/9/91
* $Id: mem.c,v 1.3 1993/10/16 14:15:06 rgrimes Exp $
* $Id: mem.c,v 1.4 1993/11/22 09:46:45 davidg Exp $
*/
/*
@ -64,6 +64,7 @@
extern char *vmmap; /* poor name! */
/*ARGSUSED*/
int
mmclose(dev, uio, flags)
dev_t dev;
struct uio *uio;
@ -82,6 +83,7 @@ mmclose(dev, uio, flags)
return(0);
}
/*ARGSUSED*/
int
mmopen(dev, uio, flags)
dev_t dev;
struct uio *uio;
@ -100,6 +102,7 @@ mmopen(dev, uio, flags)
return(0);
}
/*ARGSUSED*/
int
mmrw(dev, uio, flags)
dev_t dev;
struct uio *uio;

View File

@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* from: @(#)pmap.c 7.7 (Berkeley) 5/12/91
* $Id: pmap.c,v 1.7 1993/10/15 10:34:25 rgrimes Exp $
* $Id: pmap.c,v 1.8 1993/11/13 02:25:03 davidg Exp $
*/
/*
@ -79,6 +79,7 @@
*/
#include "param.h"
#include "systm.h"
#include "proc.h"
#include "malloc.h"
#include "user.h"
@ -90,6 +91,9 @@
#include "i386/isa/isa.h"
static void i386_protection_init(void);
static void pmap_changebit(vm_offset_t, int, boolean_t);
/*
* Allocate various and sundry SYSMAPs used in the days of old VM
* and not yet converted. XXX.
@ -219,7 +223,6 @@ pmap_bootstrap(firstaddr, loadaddr)
vm_offset_t va;
struct pte *pte;
#endif
extern vm_offset_t maxmem, physmem;
extern int IdlePTD;
avail_start = firstaddr + 8 * NBPG;
@ -1313,6 +1316,7 @@ pmap_kernel()
* bzero to clear its contents, one machine dependent page
* at a time.
*/
void
pmap_zero_page(phys)
register vm_offset_t phys;
{
@ -1335,6 +1339,7 @@ pmap_zero_page(phys)
* bcopy to copy the page, one machine dependent page at a
* time.
*/
void
pmap_copy_page(src, dst)
register vm_offset_t src, dst;
{
@ -1367,6 +1372,7 @@ pmap_copy_page(src, dst)
* will specify that these pages are to be wired
* down (or not) as appropriate.
*/
void
pmap_pageable(pmap, sva, eva, pageable)
pmap_t pmap;
vm_offset_t sva, eva;
@ -1509,6 +1515,7 @@ pmap_phys_address(ppn)
* Miscellaneous support routines follow
*/
static void
i386_protection_init()
{
register int *kp, prot;
@ -1575,6 +1582,7 @@ pmap_testbit(pa, bit)
return(FALSE);
}
void
pmap_changebit(pa, bit, setem)
register vm_offset_t pa;
int bit;

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)trap.c 7.4 (Berkeley) 5/13/91
* $Id: trap.c,v 1.6 1993/11/04 15:05:41 davidg Exp $
* $Id: trap.c,v 1.7 1993/11/13 02:25:08 davidg Exp $
*/
/*
@ -128,6 +128,7 @@ char *trap_msg[] = {
*/
/*ARGSUSED*/
void
trap(frame)
struct trapframe frame;
{
@ -499,6 +500,7 @@ int trapwrite(addr)
* Like trap(), argument is call by reference.
*/
/*ARGSUSED*/
void
syscall(frame)
volatile struct syscframe frame;
{

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)clock.c 7.2 (Berkeley) 5/12/91
* $Id: clock.c,v 1.2 1993/10/16 13:45:44 rgrimes Exp $
* $Id: clock.c,v 1.3 1993/11/04 01:56:31 ache Exp $
*/
/*
@ -56,7 +56,11 @@
#define TIMER_FREQ 1193182 /* XXX - should be in isa.h */
#endif
startrtclock() {
static void findcpuspeed(void);
void
startrtclock()
{
int s;
findcpuspeed(); /* use the clock (while it's free)
@ -84,6 +88,7 @@ startrtclock() {
unsigned int delaycount; /* calibrated loop variable (1 millisecond) */
#define FIRST_GUESS 0x2000
static void
findcpuspeed()
{
unsigned char low;
@ -107,8 +112,9 @@ findcpuspeed()
/* convert 2 digit BCD number */
int
bcd(i)
int i;
int i;
{
return ((i/16)*10 + (i%16));
}
@ -157,6 +163,7 @@ int m,leap;
* Initialize the time of day register, based on the time base which is, e.g.
* from a filesystem.
*/
void
inittodr(base)
time_t base;
{
@ -217,6 +224,7 @@ test_inittodr(base)
/*
* Restart the clock.
*/
void
resettodr()
{
}
@ -226,7 +234,10 @@ resettodr()
*/
#define V(s) __CONCAT(V, s)
extern V(clk)();
enablertclock() {
void
enablertclock()
{
setidt(ICU_OFFSET+0, &V(clk), SDT_SYS386IGT, SEL_KPL);
INTREN(IRQ0);
}

View File

@ -37,7 +37,7 @@
*
* from: @(#)vm_machdep.c 7.3 (Berkeley) 5/13/91
* Utah $Hdr: vm_machdep.c 1.16.1.1 89/06/23$
* $Id$
* $Id: vm_machdep.c,v 1.6 1993/10/15 10:34:29 rgrimes Exp $
*/
#include "npx.h"
@ -62,6 +62,7 @@
* address in each process; in the future we will probably relocate
* the frame pointers on the stack after copying.
*/
int
cpu_fork(p1, p2)
register struct proc *p1, *p2;
{
@ -177,7 +178,10 @@ cpu_exit(p)
panic("cpu_exit");
}
cpu_wait(p) struct proc *p; {
void
cpu_wait(p)
struct proc *p;
{
/* drop per-process resources */
vmspace_free(p->p_vmspace);
@ -188,6 +192,7 @@ cpu_wait(p) struct proc *p; {
/*
* Set a red zone in the kernel stack after the u. area.
*/
void
setredzone(pte, vaddr)
u_short *pte;
caddr_t vaddr;
@ -207,6 +212,7 @@ setredzone(pte, vaddr)
* 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;
@ -230,6 +236,7 @@ pagemove(from, to, size)
/*
* Convert kernel VA to physical address
*/
int
kvtop(addr)
register caddr_t addr;
{
@ -351,6 +358,7 @@ extern vm_map_t phys_map;
* All requests are (re)mapped into kernel VA space via the useriomap
* (a name with only slightly more meaning than "kernelmap")
*/
void
vmapbuf(bp)
register struct buf *bp;
{
@ -385,6 +393,7 @@ vmapbuf(bp)
* Free the io map PTEs associated with this IO operation.
* We also invalidate the TLB entries and restore the original b_addr.
*/
void
vunmapbuf(bp)
register struct buf *bp;
{
@ -404,6 +413,7 @@ vunmapbuf(bp)
/*
* Force reset the processor by invalidating the entire address space!
*/
void /* XXX should be __dead too */
cpu_reset() {
/* force a shutdown by unmapping entire address space ! */
@ -412,4 +422,5 @@ cpu_reset() {
/* "good night, sweet prince .... <THUNK!>" */
tlbflush();
/* NOTREACHED */
while(1); /* to fool compiler... */
}

View File

@ -2,7 +2,7 @@
* Functions to provide access to special i386 instructions.
* XXX - bezillions more are defined in locore.s but are not declared anywhere.
*
* $Id: cpufunc.h,v 1.3 1993/10/16 14:39:08 rgrimes Exp $
* $Id: cpufunc.h,v 1.4 1993/11/07 17:42:47 wollman Exp $
*/
#ifndef _MACHINE_CPUFUNC_H_
@ -13,7 +13,7 @@
#ifdef __GNUC__
static __inline int bdb(void)
static inline int bdb(void)
{
extern int bdb_exists;
@ -23,13 +23,13 @@ static __inline int bdb(void)
return (1);
}
static __inline void
static inline void
disable_intr(void)
{
__asm __volatile("cli");
}
static __inline void
static inline void
enable_intr(void)
{
__asm __volatile("sti");
@ -41,7 +41,7 @@ enable_intr(void)
*/
#define inb(port) ((u_char) u_int_inb(port))
static __inline u_int
static inline u_int
u_int_inb(u_int port)
{
u_char data;
@ -54,7 +54,7 @@ u_int_inb(u_int port)
return data;
}
static __inline void
static inline void
outb(u_int port, u_char data)
{
register u_char al asm("ax");
@ -63,7 +63,8 @@ outb(u_int port, u_char data)
__asm __volatile("outb %0,%%dx" : : "a" (al), "d" (port));
}
static __inline__
static inline
int
imin(a, b)
int a, b;
{
@ -71,7 +72,8 @@ imin(a, b)
return (a < b ? a : b);
}
static __inline__
static inline
int
imax(a, b)
int a, b;
{
@ -79,7 +81,7 @@ imax(a, b)
return (a > b ? a : b);
}
static __inline__
static inline
unsigned int
min(a, b)
unsigned int a, b;
@ -88,7 +90,7 @@ min(a, b)
return (a < b ? a : b);
}
static __inline__
static inline
unsigned int
max(a, b)
unsigned int a, b;
@ -97,7 +99,7 @@ max(a, b)
return (a > b ? a : b);
}
static __inline__
static inline
long
lmin(a, b)
long a, b;
@ -106,7 +108,7 @@ lmin(a, b)
return (a < b ? a : b);
}
static __inline__
static inline
long
lmax(a, b)
long a, b;
@ -115,7 +117,7 @@ lmax(a, b)
return (a > b ? a : b);
}
static __inline__
static inline
unsigned long
ulmin(a, b)
unsigned long a, b;
@ -124,7 +126,7 @@ ulmin(a, b)
return (a < b ? a : b);
}
static __inline__
static inline
unsigned long
ulmax(a, b)
unsigned long a, b;
@ -133,7 +135,8 @@ ulmax(a, b)
return (a > b ? a : b);
}
static __inline__
static inline
int
ffs(mask)
register long mask;
{
@ -148,7 +151,8 @@ ffs(mask)
}
}
static __inline__
static inline
int
bcmp(v1, v2, len)
void *v1, *v2;
register unsigned len;
@ -161,10 +165,10 @@ bcmp(v1, v2, len)
return (0);
}
static __inline__
static inline
size_t
strlen(s1)
register __const__ char *s1;
register const char *s1;
{
register size_t len;

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)clock.c 7.2 (Berkeley) 5/12/91
* $Id: clock.c,v 1.2 1993/10/16 13:45:44 rgrimes Exp $
* $Id: clock.c,v 1.3 1993/11/04 01:56:31 ache Exp $
*/
/*
@ -56,7 +56,11 @@
#define TIMER_FREQ 1193182 /* XXX - should be in isa.h */
#endif
startrtclock() {
static void findcpuspeed(void);
void
startrtclock()
{
int s;
findcpuspeed(); /* use the clock (while it's free)
@ -84,6 +88,7 @@ startrtclock() {
unsigned int delaycount; /* calibrated loop variable (1 millisecond) */
#define FIRST_GUESS 0x2000
static void
findcpuspeed()
{
unsigned char low;
@ -107,8 +112,9 @@ findcpuspeed()
/* convert 2 digit BCD number */
int
bcd(i)
int i;
int i;
{
return ((i/16)*10 + (i%16));
}
@ -157,6 +163,7 @@ int m,leap;
* Initialize the time of day register, based on the time base which is, e.g.
* from a filesystem.
*/
void
inittodr(base)
time_t base;
{
@ -217,6 +224,7 @@ test_inittodr(base)
/*
* Restart the clock.
*/
void
resettodr()
{
}
@ -226,7 +234,10 @@ resettodr()
*/
#define V(s) __CONCAT(V, s)
extern V(clk)();
enablertclock() {
void
enablertclock()
{
setidt(ICU_OFFSET+0, &V(clk), SDT_SYS386IGT, SEL_KPL);
INTREN(IRQ0);
}

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)isa.c 7.2 (Berkeley) 5/13/91
* $Id: isa.c,v 1.8 1993/11/14 23:53:32 ache Exp $
* $Id: isa.c,v 1.9 1993/11/17 00:21:03 ache Exp $
*/
/*
@ -48,7 +48,8 @@
*/
#include "param.h"
#include "systm.h"
#include "systm.h" /* isn't it a joy */
#include "kernel.h" /* to have three of these */
#include "conf.h"
#include "file.h"
#include "buf.h"
@ -80,7 +81,7 @@
#define DMA2_MODE (IO_DMA2 + 2*11) /* mode register */
#define DMA2_FFC (IO_DMA2 + 2*12) /* clear first/last FF */
int config_isadev __P((struct isa_device *, u_int *));
void config_isadev __P((struct isa_device *, u_int *));
/*
* print a conflict message
@ -250,6 +251,7 @@ isa_configure() {
/*
* Configure an ISA device.
*/
void
config_isadev(isdp, mp)
struct isa_device *isdp;
u_int *mp;
@ -338,7 +340,9 @@ extern IDTVEC(intrdefault);
* Fill in default interrupt table (in case of spuruious interrupt
* during configuration of kernel, setup interrupt control unit
*/
isa_defaultirq() {
void
isa_defaultirq()
{
int i;
/* icu vectors */
@ -505,6 +509,7 @@ void isa_dmadone(int flags, caddr_t addr, int nbytes, int chan)
* Return true if special handling needed.
*/
int
isa_dmarangecheck(caddr_t va, unsigned length, unsigned chan) {
vm_offset_t phys, priorpage = 0, endva;
u_int dma_pgmsk = (chan & 4) ? ~(128*1024-1) : ~(64*1024-1);
@ -548,7 +553,7 @@ isa_allocphysmem(caddr_t va, unsigned length, void (*func)()) {
isaphysmemunblock = func;
while (isaphysmemflag & B_BUSY) {
isaphysmemflag |= B_WANTED;
tsleep(&isaphysmemflag, PRIBIO, "isaphys", 0);
tsleep((caddr_t)&isaphysmemflag, PRIBIO, "isaphys", 0);
}
isaphysmemflag |= B_BUSY;
@ -565,7 +570,7 @@ isa_freephysmem(caddr_t va, unsigned length) {
isaphysmemflag &= ~B_BUSY;
if (isaphysmemflag & B_WANTED) {
isaphysmemflag &= B_WANTED;
wakeup(&isaphysmemflag);
wakeup((caddr_t)&isaphysmemflag);
if (isaphysmemunblock)
(*isaphysmemunblock)();
}
@ -575,7 +580,10 @@ isa_freephysmem(caddr_t va, unsigned length) {
* Handle a NMI, possibly a machine check.
* return true to panic system, false to ignore.
*/
isa_nmi(cd) {
int
isa_nmi(cd)
int cd;
{
log(LOG_CRIT, "\nNMI port 61 %x, port 70 %x\n", inb(0x61), inb(0x70));
return(0);
@ -584,7 +592,10 @@ isa_nmi(cd) {
/*
* Caught a stray interrupt, notify
*/
isa_strayintr(d) {
void
isa_strayintr(d)
int d;
{
/* DON'T BOTHER FOR NOW! */
/* for some reason, we get bursts of intr #7, even if not enabled! */
@ -616,9 +627,8 @@ isa_strayintr(d) {
#define CF (1 * TIMER_FREQ)
#define TIMER_FREQ 1193182 /* XXX - should be elsewhere */
extern int hz; /* XXX - should be elsewhere */
int DELAY(n)
void
DELAY(n)
int n;
{
int counter_limit;
@ -683,7 +693,11 @@ int DELAY(n)
#endif
}
getit(unit, timer) {
int
getit(unit, timer)
int unit;
int timer;
{
int high;
int low;
@ -710,19 +724,23 @@ getit(unit, timer) {
return ((high << 8) | low);
}
static beeping;
static
sysbeepstop(f)
static int beeping;
static void
sysbeepstop(f, dummy)
caddr_t f;
int dummy;
{
/* disable counter 2 */
outb(0x61, inb(0x61) & 0xFC);
if (f)
timeout(sysbeepstop, 0, f);
timeout(sysbeepstop, (caddr_t)0, (int)f);
else
beeping = 0;
}
void sysbeep(int pitch, int period)
void
sysbeep(int pitch, int period)
{
outb(0x61, inb(0x61) | 3); /* enable counter 2 */
@ -739,14 +757,17 @@ void sysbeep(int pitch, int period)
if (!beeping) {
beeping = period;
timeout(sysbeepstop, period/2, period);
timeout(sysbeepstop, (caddr_t)(period/2), period);
}
}
/*
* Pass command to keyboard controller (8042)
*/
unsigned kbc_8042cmd(val) {
unsigned
kbc_8042cmd(val)
int val;
{
while (inb(KBSTATP)&KBS_IBF);
if (val) outb(KBCMDP, val);

View File

@ -1,6 +1,6 @@
# Copyright 1990 W. Jolitz
# from: @(#)Makefile.i386 7.1 5/10/91
# $Id: Makefile.i386,v 1.14 1993/11/15 21:06:08 paul Exp $
# $Id: Makefile.i386,v 1.15 1993/11/16 00:45:04 paul Exp $
#
# Makefile for FreeBSD
#
@ -30,7 +30,14 @@ DBSYM= /usr/sbin/dbsym
S= ../..
I386= ../../i386
CWARNFLAGS=
CWARNFLAGS=-W -Wreturn-type -Wcomment
#
# The following flags are next up for working on:
# -Wtraditional -Wredundant-decls -Wnested-externs
#
# When working on removing warnings from code, the `-Werror' flag should be
# of material assistance.
#
COPTFLAGS=-O
INCLUDES= -I. -I$S -I$S/sys
COPTS= ${INCLUDES} ${IDENT} -DKERNEL -Di386 -DNPX
@ -151,8 +158,8 @@ ioconf.o: ioconf.c $S/sys/param.h machine/pte.h $S/sys/buf.h \
${I386}/isa/isa_device.h ${I386}/isa/isa.h ${I386}/isa/icu.h
${CC} -c ${CFLAGS} ioconf.c
conf.o: ${I386}/i386/conf.c
${CC} -traditional -c ${CFLAGS} ${I386}/i386/conf.c
conf.o: ${I386}/i386/conf.c $S/sys/conf.h
${CC} -c ${CFLAGS} ${I386}/i386/conf.c
param.c: $S/conf/param.c
-rm -f param.c

View File

@ -1,6 +1,6 @@
# Copyright 1990 W. Jolitz
# from: @(#)Makefile.i386 7.1 5/10/91
# $Id: Makefile.i386,v 1.14 1993/11/15 21:06:08 paul Exp $
# $Id: Makefile.i386,v 1.15 1993/11/16 00:45:04 paul Exp $
#
# Makefile for FreeBSD
#
@ -30,7 +30,14 @@ DBSYM= /usr/sbin/dbsym
S= ../..
I386= ../../i386
CWARNFLAGS=
CWARNFLAGS=-W -Wreturn-type -Wcomment
#
# The following flags are next up for working on:
# -Wtraditional -Wredundant-decls -Wnested-externs
#
# When working on removing warnings from code, the `-Werror' flag should be
# of material assistance.
#
COPTFLAGS=-O
INCLUDES= -I. -I$S -I$S/sys
COPTS= ${INCLUDES} ${IDENT} -DKERNEL -Di386 -DNPX
@ -151,8 +158,8 @@ ioconf.o: ioconf.c $S/sys/param.h machine/pte.h $S/sys/buf.h \
${I386}/isa/isa_device.h ${I386}/isa/isa.h ${I386}/isa/icu.h
${CC} -c ${CFLAGS} ioconf.c
conf.o: ${I386}/i386/conf.c
${CC} -traditional -c ${CFLAGS} ${I386}/i386/conf.c
conf.o: ${I386}/i386/conf.c $S/sys/conf.h
${CC} -c ${CFLAGS} ${I386}/i386/conf.c
param.c: $S/conf/param.c
-rm -f param.c

View File

@ -23,7 +23,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
* $Id$
* $Id: db_access.c,v 1.2 1993/10/16 16:47:04 rgrimes Exp $
*/
/*
@ -42,11 +42,11 @@
extern void db_read_bytes(); /* machine-dependent */
extern void db_write_bytes(); /* machine-dependent */
int db_extend[] = { /* table for sign-extending */
unsigned db_extend[] = { /* table for sign-extending */
0,
0xFFFFFF80,
0xFFFF8000,
0xFF800000
0xFFFFFF80U,
0xFFFF8000U,
0xFF800000U
};
db_expr_t

View File

@ -23,7 +23,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
* $Id$
* $Id: db_aout.c,v 1.3 1993/10/16 16:47:06 rgrimes Exp $
*/
/*
@ -35,8 +35,9 @@
*/
#include "param.h"
#include "systm.h"
#include "proc.h"
#include <machine/db_machdep.h> /* data types */
#include "ddb/ddb.h"
#include <ddb/db_sym.h>
#ifndef DB_NO_AOUT
@ -72,6 +73,7 @@
int db_symtabsize = SYMTAB_SPACE;
char db_symtab[SYMTAB_SPACE] = { 1 };
void
X_db_sym_init(symtab, esymtab, name)
int * symtab; /* pointer to start of symbol table */
char * esymtab; /* pointer to end of string table,
@ -217,7 +219,8 @@ X_db_line_at_pc()
/*
* Initialization routine for a.out files.
*/
kdb_init()
void
kdb_init(void)
{
#if 0
extern char *esym;

View File

@ -23,7 +23,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
* $Id$
* $Id: db_break.c,v 1.2 1993/10/16 16:47:07 rgrimes Exp $
*/
/*
@ -34,8 +34,9 @@
* Breakpoints.
*/
#include "param.h"
#include "systm.h"
#include "proc.h"
#include <machine/db_machdep.h> /* type definitions */
#include "ddb/ddb.h"
#include <ddb/db_lex.h>
#include <ddb/db_break.h>
@ -291,7 +292,7 @@ db_breakpoint_cmd(addr, have_addr, count, modif)
/* list breakpoints */
void
db_listbreak_cmd()
db_listbreak_cmd(db_expr_t dummy1, int dummy2, db_expr_t dummy3, char *dummy4)
{
db_list_breakpoints();
}

View File

@ -23,7 +23,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
* $Id$
* $Id: db_command.c,v 1.2 1993/10/16 16:47:10 rgrimes Exp $
*/
/*
@ -35,8 +35,9 @@
* Command dispatcher.
*/
#include "param.h"
#include "systm.h"
#include "proc.h"
#include <machine/db_machdep.h> /* type definitions */
#include "ddb/ddb.h"
#include <ddb/db_lex.h>
#include <ddb/db_output.h>
@ -168,7 +169,7 @@ db_command(last_cmdp, cmd_table)
int t;
char modif[TOK_STRING_SIZE];
db_expr_t addr, count;
boolean_t have_addr;
boolean_t have_addr = FALSE;
int result;
t = db_read_token();

View File

@ -23,7 +23,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
* $Id$
* $Id: db_examine.c,v 1.2 1993/10/16 16:47:13 rgrimes Exp $
*/
/*
@ -31,8 +31,10 @@
* Date: 7/90
*/
#include "param.h"
#include "systm.h"
#include "proc.h"
#include <machine/db_machdep.h> /* type definitions */
#include "ddb/ddb.h"
#include <ddb/db_lex.h>
#include <ddb/db_output.h>
@ -44,6 +46,9 @@ char db_examine_format[TOK_STRING_SIZE] = "x";
extern db_addr_t db_disasm(/* db_addr_t, boolean_t */);
/* instruction disassembler */
static void db_examine(db_addr_t, char *, int);
static void db_search(db_addr_t, int, db_expr_t, db_expr_t, u_int);
/*
* Examine (print) data.
*/
@ -64,6 +69,7 @@ db_examine_cmd(addr, have_addr, count, modif)
db_examine((db_addr_t) addr, db_examine_format, count);
}
static void
db_examine(addr, fmt, count)
register
db_addr_t addr;
@ -237,6 +243,7 @@ db_print_cmd(addr, have_addr, count, modif)
db_printf("\n");
}
void
db_print_loc_and_inst(loc)
db_addr_t loc;
{
@ -245,20 +252,12 @@ db_print_loc_and_inst(loc)
(void) db_disasm(loc, TRUE);
}
db_strcpy(dst, src)
register char *dst;
register char *src;
{
while (*dst++ = *src++)
;
}
/*
* Search for a value in memory.
* Syntax: search [/bhl] addr value [mask] [,count]
*/
void
db_search_cmd()
db_search_cmd(db_expr_t dummy1, int dummy2, db_expr_t dummy3, char *dummy4)
{
int t;
db_addr_t addr;
@ -290,7 +289,7 @@ db_search_cmd()
size = 4;
}
if (!db_expression(&addr)) {
if (!db_expression((db_expr_t *)&addr)) {
db_printf("Address missing\n");
db_flush_lex();
return;
@ -321,6 +320,7 @@ db_search_cmd()
db_search(addr, size, value, mask, count);
}
static void
db_search(addr, size, value, mask, count)
register
db_addr_t addr;

View File

@ -23,7 +23,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
* $Id$
* $Id: db_expr.c,v 1.2 1993/10/16 16:47:14 rgrimes Exp $
*/
/*
@ -31,8 +31,9 @@
* Date: 7/90
*/
#include "param.h"
#include "systm.h"
#include "proc.h"
#include <machine/db_machdep.h>
#include "ddb/ddb.h"
#include <ddb/db_lex.h>
#include <ddb/db_access.h>
#include <ddb/db_command.h>

View File

@ -23,7 +23,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
* $Id$
* $Id: db_input.c,v 1.2 1993/10/16 16:47:16 rgrimes Exp $
*/
/*
@ -32,7 +32,9 @@
*/
#include "param.h"
#include "systm.h"
#include "proc.h"
#include "ddb/ddb.h"
#include <ddb/db_output.h>
/*
@ -239,12 +241,15 @@ db_check_interrupt()
}
}
cnmaygetc ()
int
cnmaygetc (void)
{
return (-1);
}
/* called from kdb_trap in db_interface.c */
void
cnpollc (flag)
int flag;
{
}

View File

@ -23,7 +23,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
* $Id$
* $Id: db_lex.c,v 1.2 1993/10/16 16:47:17 rgrimes Exp $
*/
/*
@ -33,6 +33,9 @@
/*
* Lexical analyzer.
*/
#include "param.h"
#include "systm.h"
#include "ddb/ddb.h"
#include <ddb/db_lex.h>
char db_line[120];
@ -78,6 +81,7 @@ db_read_char()
void
db_unread_char(c)
int c;
{
db_look_char = c;
}
@ -132,7 +136,7 @@ db_lex()
if (c >= '0' && c <= '9') {
/* number */
int r, digit;
int r, digit = 0;
if (c > '0')
r = db_radix;

View File

@ -23,7 +23,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
* $Id$
* $Id: db_output.c,v 1.4 1993/10/16 16:47:20 rgrimes Exp $
*/
/*
@ -38,6 +38,7 @@
#include "param.h"
#include "systm.h"
#include <machine/stdarg.h>
#include "ddb/ddb.h"
/*
* Character output - tracks position in line.
@ -58,7 +59,8 @@ int db_tab_stop_width = 8; /* how wide are tab stops? */
((((i) + db_tab_stop_width) / db_tab_stop_width) * db_tab_stop_width)
int db_max_width = 80; /* output line width */
extern void db_check_interrupt();
static void db_printf_guts(const char *, va_list);
/*
* Force pending whitespace.
@ -88,6 +90,7 @@ db_force_whitespace()
/*
* Output character. Buffer whitespace.
*/
void
db_putchar(c)
int c; /* character to output */
{
@ -136,10 +139,8 @@ db_print_position()
/*
* Printing
*/
extern int db_radix;
/*VARARGS1*/
db_printf(char *fmt, ...)
void
db_printf(const char *fmt, ...)
{
va_list listp;
va_start(listp, fmt);
@ -150,6 +151,7 @@ db_printf(char *fmt, ...)
/* alternate name */
/*VARARGS1*/
void
kdbprintf(char *fmt, ...)
{
va_list listp;
@ -190,6 +192,7 @@ db_ksprintn(ul, base, lenp)
return (p);
}
static void
db_printf_guts(fmt, ap)
register const char *fmt;
va_list ap;

View File

@ -23,7 +23,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
* $Id: db_output.h,v 1.2 1993/10/16 16:47:21 rgrimes Exp $
* $Id: db_output.h,v 1.3 1993/11/07 17:39:24 wollman Exp $
*/
#ifndef _DDB_DB_OUTPUT_H_
@ -41,5 +41,4 @@
extern void db_force_whitespace();
extern int db_print_position();
extern void db_end_line();
extern int db_printf();
#endif /* _DDB_DB_OUTPUT_H_ */

View File

@ -23,7 +23,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
* $Id$
* $Id: db_print.c,v 1.2 1993/10/16 16:47:22 rgrimes Exp $
*/
/*
@ -35,9 +35,10 @@
* Miscellaneous printing.
*/
#include "param.h"
#include "systm.h"
#include "proc.h"
#include <machine/db_machdep.h>
#include "ddb/ddb.h"
#include <ddb/db_lex.h>
#include <ddb/db_variables.h>
@ -46,7 +47,7 @@
extern unsigned int db_maxoff;
void
db_show_regs()
db_show_regs(db_expr_t dummy1, int dummy2, db_expr_t dummy3, char *dummy4)
{
int (*func)();
register struct db_variable *regp;

View File

@ -23,7 +23,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
* $Id$
* $Id: db_run.c,v 1.2 1993/10/16 16:47:24 rgrimes Exp $
*/
/*
@ -35,8 +35,9 @@
* Commands to run process.
*/
#include "param.h"
#include "systm.h"
#include "proc.h"
#include <machine/db_machdep.h>
#include "ddb/ddb.h"
#include <ddb/db_lex.h>
#include <ddb/db_break.h>

View File

@ -23,7 +23,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
* $Id$
* $Id: db_sym.c,v 1.2 1993/10/16 16:47:25 rgrimes Exp $
*/
/*
@ -31,8 +31,9 @@
* Date: 7/90
*/
#include "param.h"
#include "systm.h"
#include "proc.h"
#include <machine/db_machdep.h>
#include "ddb/ddb.h"
#include <ddb/db_sym.h>
/*
@ -313,6 +314,10 @@ db_printsym(off, strategy)
boolean_t
db_line_at_pc( sym, filename, linenum, pc)
int sym;
int filename;
int linenum;
int pc;
{
return X_db_line_at_pc( db_last_symtab, sym, filename, linenum, pc);
}

View File

@ -23,7 +23,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
* $Id$
* $Id: db_trap.c,v 1.2 1993/10/16 16:47:28 rgrimes Exp $
*/
/*
@ -35,7 +35,9 @@
* Trap entry point to kernel debugger.
*/
#include "param.h"
#include "systm.h"
#include "proc.h"
#include "ddb/ddb.h"
#include <ddb/db_command.h>
#include <ddb/db_break.h>
@ -46,6 +48,7 @@ extern int db_inst_count;
extern int db_load_count;
extern int db_store_count;
void
db_trap(type, code)
int type, code;
{

View File

@ -23,7 +23,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
* $Id$
* $Id: db_variables.c,v 1.2 1993/10/16 16:47:29 rgrimes Exp $
*/
/*
@ -32,17 +32,15 @@
*/
#include "param.h"
#include "systm.h"
#include "proc.h"
#include <machine/db_machdep.h>
#include "ddb/ddb.h"
#include <ddb/db_lex.h>
#include <ddb/db_variables.h>
extern unsigned int db_maxoff;
extern int db_radix;
extern int db_max_width;
extern int db_tab_stop_width;
void db_read_variable(struct db_variable *, db_expr_t *);
static void db_write_variable(struct db_variable *, db_expr_t *);
struct db_variable db_vars[] = {
{ "radix", &db_radix, FCN_NULL },
@ -107,6 +105,7 @@ db_set_variable(value)
}
void
db_read_variable(vp, valuep)
struct db_variable *vp;
db_expr_t *valuep;
@ -119,6 +118,7 @@ db_read_variable(vp, valuep)
(*func)(vp, valuep, DB_VAR_GET);
}
static void
db_write_variable(vp, valuep)
struct db_variable *vp;
db_expr_t *valuep;
@ -132,7 +132,7 @@ db_write_variable(vp, valuep)
}
void
db_set_cmd()
db_set_cmd(db_expr_t dummy1, int dummy2, db_expr_t dummy3, char *dummy4)
{
db_expr_t value;
int (*func)();

View File

@ -23,7 +23,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
* $Id$
* $Id: db_variables.h,v 1.2 1993/10/16 16:47:31 rgrimes Exp $
*/
/*
@ -52,4 +52,6 @@ extern struct db_variable *db_evars;
extern struct db_variable db_regs[]; /* machine registers */
extern struct db_variable *db_eregs;
extern void db_read_variable(struct db_variable *, db_expr_t *);
#endif /* _DB_VARIABLES_H_ */

View File

@ -23,7 +23,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
* $Id$
* $Id: db_watch.c,v 1.2 1993/10/16 16:47:32 rgrimes Exp $
*/
/*
@ -32,15 +32,15 @@
*/
#include "param.h"
#include "systm.h"
#include "proc.h"
#include <machine/db_machdep.h>
#include "ddb/ddb.h"
#include <vm/vm_map.h>
#include <ddb/db_lex.h>
#include <ddb/db_watch.h>
#include <ddb/db_access.h>
#include <ddb/db_sym.h>
#include <machine/db_machdep.h>
/*
* Watchpoints.
@ -205,7 +205,7 @@ db_watchpoint_cmd(addr, have_addr, count, modif)
/* list watchpoints */
void
db_listwatch_cmd()
db_listwatch_cmd(db_expr_t dummy1, int dummy2, db_expr_t dummy3, char *dummmy4)
{
db_list_watchpoints();
}

View File

@ -23,7 +23,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
* $Id$
* $Id: db_write_cmd.c,v 1.2 1993/10/16 16:47:35 rgrimes Exp $
*/
/*
@ -32,8 +32,9 @@
*/
#include "param.h"
#include "systm.h"
#include "proc.h"
#include <machine/db_machdep.h>
#include "ddb/ddb.h"
#include <ddb/db_lex.h>
#include <ddb/db_access.h>

109
sys/ddb/ddb.h Normal file
View File

@ -0,0 +1,109 @@
/*-
* Copyright (c) 1993, Garrett A. Wollman.
* Copyright (c) 1993, University of Vermont and State Agricultural College.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id$
*/
/*
* Necessary declarations for the `ddb' kernel debugger.
*/
#ifndef __h_ddb_ddb
#define __h_ddb_ddb 1
#include "machine/db_machdep.h" /* type definitions */
/*
* Global variables...
*/
extern char *esym;
extern unsigned int db_maxoff;
extern int db_inst_count;
extern int db_load_count;
extern int db_store_count;
extern int db_radix;
extern int db_max_width;
extern int db_tab_stop_width;
/*
* Functions...
*/
extern void
db_read_bytes(vm_offset_t addr, register int size, register char *data);
/* machine-dependent */
extern void
db_write_bytes(vm_offset_t addr, register int size, register char *data);
/* machine-dependent */
struct vm_map; /* forward declaration */
extern boolean_t db_map_equal(struct vm_map *, struct vm_map *);
extern boolean_t db_map_current(struct vm_map *);
extern struct vm_map *db_map_addr(vm_offset_t);
#define db_strcpy strcpy
extern int db_expression (db_expr_t *valuep);
typedef void db_cmd_fcn(db_expr_t, int, db_expr_t, char *);
extern db_cmd_fcn db_listbreak_cmd, db_listwatch_cmd, db_show_regs;
extern db_cmd_fcn db_print_cmd, db_examine_cmd, db_set_cmd, db_search_cmd;
extern db_cmd_fcn db_write_cmd, db_delete_cmd, db_breakpoint_cmd;
extern db_cmd_fcn db_deletewatch_cmd, db_watchpoint_cmd;
extern db_cmd_fcn db_single_step_cmd, db_trace_until_call_cmd;
extern db_cmd_fcn db_trace_until_matching_cmd, db_continue_cmd;
extern db_cmd_fcn db_stack_trace_cmd;
extern db_addr_t db_disasm(db_addr_t loc, boolean_t altfmt);
/* instruction disassembler */
extern int db_value_of_name (char *name, db_expr_t *valuep);
extern int db_get_variable (db_expr_t *valuep);
extern void db_putchar (int c);
extern void db_error (char *s);
extern int db_readline (char *lstart, int lsize);
extern void db_printf (const char *fmt, ...);
extern void db_check_interrupt(void);
extern void db_print_loc_and_inst (db_addr_t loc);
extern void db_clear_watchpoints (void);
extern void db_set_watchpoints (void);
extern void db_restart_at_pc(boolean_t watchpt);
extern boolean_t db_stop_at_pc(boolean_t *is_breakpoint);
extern void db_skip_to_eol (void);
extern void db_single_step (db_regs_t *regs);
extern void db_trap (int type, int code);
extern void kdbprinttrap(int, int);
#endif /* __h_ddb_ddb */

View File

@ -20,7 +20,7 @@
*/
/*
* $Id: if_ed.c,v 2.14 1993/11/22 10:55:30 davidg Exp davidg $
* $Id: if_ed.c,v 1.23 1993/11/22 11:08:14 davidg Exp $
*/
/*
@ -185,10 +185,16 @@ struct ed_softc {
u_char next_packet; /* pointer to next unread RX packet */
} ed_softc[NED];
int ed_attach(), ed_init(), edintr(), ed_ioctl(), ed_probe(),
ed_start(), ed_reset(), ed_watchdog();
static void ed_stop();
int ed_attach(struct isa_device *);
void ed_init(int);
void edintr(int);
int ed_ioctl(struct ifnet *, int, caddr_t);
int ed_probe(struct isa_device *);
void ed_start(struct ifnet *);
void ed_reset(int, int);
void ed_watchdog(int);
static void ed_get_packet(struct ed_softc *, char *, int /*u_short*/);
static void ed_stop(int);
static inline void ed_rint();
static inline void ed_xmit();
@ -1113,15 +1119,16 @@ ed_attach(isa_dev)
#if NBPFILTER > 0
bpfattach(&sc->bpf, ifp, DLT_EN10MB, sizeof(struct ether_header));
#endif
return 1;
}
/*
* Reset interface.
*/
int
ed_reset(unit)
void
ed_reset(unit, uban)
int unit;
int uban; /* XXX */
{
int s;
@ -1167,7 +1174,7 @@ ed_stop(unit)
* Device timeout/watchdog routine. Entered if the device neglects to
* generate an interrupt after a transmit has been started on it.
*/
int
void
ed_watchdog(unit)
int unit;
{
@ -1176,12 +1183,13 @@ ed_watchdog(unit)
log(LOG_ERR, "ed%d: device timeout\n", unit);
++sc->arpcom.ac_if.if_oerrors;
ed_reset(unit);
ed_reset(unit, 0);
}
/*
* Initialize device.
*/
void
ed_init(unit)
int unit;
{
@ -1410,7 +1418,7 @@ static inline void ed_xmit(ifp)
* 2) that the IFF_OACTIVE flag is checked before this code is called
* (i.e. that the output part of the interface is idle)
*/
int
void
ed_start(ifp)
struct ifnet *ifp;
{
@ -1666,7 +1674,7 @@ ed_rint(unit)
"ed%d: NIC memory corrupt - invalid packet length %d\n",
unit, len);
++sc->arpcom.ac_if.if_ierrors;
ed_reset(unit);
ed_reset(unit, 0);
return;
}
@ -1708,7 +1716,7 @@ ed_rint(unit)
/*
* Ethernet interface interrupt processor
*/
int
void
edintr(unit)
int unit;
{
@ -1831,7 +1839,7 @@ edintr(unit)
/*
* Stop/reset/re-init NIC
*/
ed_reset(unit);
ed_reset(unit, 0);
} else {
/*
@ -2054,13 +2062,14 @@ ed_ioctl(ifp, command, data)
* Retreive packet from shared memory and send to the next level up via
* ether_input(). If there is a BPF listener, give a copy to BPF, too.
*/
static void
ed_get_packet(sc, buf, len)
struct ed_softc *sc;
char *buf;
u_short len;
{
struct ether_header *eh;
struct mbuf *m, *head, *ed_ring_to_mbuf();
struct mbuf *m, *head = 0, *ed_ring_to_mbuf();
u_short off;
int resid;
u_short etype;
@ -2381,7 +2390,7 @@ ed_pio_write_mbufs(sc,m,dst)
if (!maxwait) {
log(LOG_WARNING, "ed%d: remote transmit DMA failed to complete\n",
sc->arpcom.ac_if.if_unit);
ed_reset(sc->arpcom.ac_if.if_unit);
ed_reset(sc->arpcom.ac_if.if_unit, 0);
}
return(len);

View File

@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* from: @(#)fd.c 7.4 (Berkeley) 5/25/91
* $Id: fd.c,v 1.5 1993/09/15 23:27:45 rgrimes Exp $
* $Id: fd.c,v 1.6 1993/09/23 15:22:57 rgrimes Exp $
*
*/
@ -45,6 +45,7 @@
#include "param.h"
#include "dkbad.h"
#include "systm.h"
#include "kernel.h"
#include "conf.h"
#include "file.h"
#include "ioctl.h"
@ -175,18 +176,20 @@ char *fdstates[] =
int fd_debug = 1;
#define TRACE0(arg) if(fd_debug) printf(arg)
#define TRACE1(arg1,arg2) if(fd_debug) printf(arg1,arg2)
#else DEBUG
#else /* DEBUG */
#define TRACE0(arg)
#define TRACE1(arg1,arg2)
#endif DEBUG
#endif /* DEBUG */
extern int hz;
/* state needed for current transfer */
static void fdstart(fdcu_t);
void fdintr(fdcu_t);
static void fd_turnoff(caddr_t, int);
/****************************************************************************/
/* autoconfiguration stuff */
/****************************************************************************/
int fdprobe(), fdattach(), fd_turnoff();
static int fdprobe(struct isa_device *);
static int fdattach(struct isa_device *);
struct isa_driver fddriver = {
fdprobe, fdattach, "fd",
@ -195,8 +198,9 @@ struct isa_driver fddriver = {
/*
* probe for existance of controller
*/
int
fdprobe(dev)
struct isa_device *dev;
struct isa_device *dev;
{
fdcu_t fdcu = dev->id_unit;
if(fdc_data[fdcu].flags & FDC_ATTACHED)
@ -220,8 +224,9 @@ struct isa_device *dev;
/*
* wire controller into system, look for floppy units
*/
int
fdattach(dev)
struct isa_device *dev;
struct isa_device *dev;
{
unsigned fdt,st0, cyl;
int hdr;
@ -285,17 +290,18 @@ struct isa_device *dev;
}
fdt <<= 4;
fd_turnoff(fdu);
fd_turnoff((caddr_t)fdu, 0);
hdr = 1;
}
/* Set transfer to 500kbps */
outb(fdc->baseport+fdctl,0); /*XXX*/
return 1;
}
int
fdsize(dev)
dev_t dev;
dev_t dev;
{
return(0);
}
@ -303,8 +309,7 @@ dev_t dev;
/****************************************************************************/
/* fdstrategy */
/****************************************************************************/
fdstrategy(bp)
register struct buf *bp; /* IO operation to perform */
void fdstrategy(struct buf *bp)
{
register struct buf *dp,*dp0,*dp1;
long nblocks,blknum;
@ -359,6 +364,7 @@ fdstrategy(bp)
/* motor control stuff */
/* remember to not deselect the drive we're working on */
/****************************************************************************/
void
set_motor(fdcu, fdu, reset)
fdcu_t fdcu;
fdu_t fdu;
@ -389,9 +395,10 @@ set_motor(fdcu, fdu, reset)
| (m1 ? FDO_MOEN1 : 0)));
}
fd_turnoff(fdu)
fdu_t fdu;
static void
fd_turnoff(caddr_t arg1, int arg2)
{
fdu_t fdu = (fdu_t)arg1;
int s;
fd_p fd = fd_data + fdu;
@ -401,9 +408,10 @@ fd_turnoff(fdu)
splx(s);
}
fd_motor_on(fdu)
fdu_t fdu;
void
fd_motor_on(caddr_t arg1, int arg2)
{
fdu_t fdu = (fdu_t)arg1;
int s;
fd_p fd = fd_data + fdu;
@ -416,6 +424,9 @@ fd_motor_on(fdu)
splx(s);
}
static void fd_turnon1(fdu_t);
void
fd_turnon(fdu)
fdu_t fdu;
{
@ -424,12 +435,12 @@ fd_turnon(fdu)
{
fd_turnon1(fdu);
fd->flags |= FD_MOTOR_WAIT;
timeout(fd_motor_on,fdu,hz); /* in 1 sec its ok */
timeout(fd_motor_on, (caddr_t)fdu, hz); /* in 1 sec its ok */
}
}
fd_turnon1(fdu)
fdu_t fdu;
static void
fd_turnon1(fdu_t fdu)
{
fd_p fd = fd_data + fdu;
fd->flags |= FD_MOTOR;
@ -459,6 +470,7 @@ in_fdc(fdcu)
#endif
}
int
out_fdc(fdcu, x)
fdcu_t fdcu;
int x;
@ -485,6 +497,7 @@ out_fdc(fdcu, x)
/****************************************************************************/
/* fdopen/fdclose */
/****************************************************************************/
int
Fdopen(dev, flags)
dev_t dev;
int flags;
@ -501,8 +514,10 @@ Fdopen(dev, flags)
return 0;
}
int
fdclose(dev, flags)
dev_t dev;
int flags;
{
fdu_t fdu = FDUNIT(minor(dev));
fd_data[fdu].flags &= ~FD_OPEN;
@ -519,6 +534,7 @@ fdclose(dev, flags)
* If the controller is already busy, we need do nothing, as it *
* will pick up our work when the present work completes *
\***************************************************************/
static void
fdstart(fdcu)
fdcu_t fdcu;
{
@ -534,9 +550,10 @@ fdstart(fdcu)
splx(s);
}
fd_timeout(fdcu)
fdcu_t fdcu;
static void
fd_timeout(caddr_t arg1, int arg2)
{
fdcu_t fdcu = (fdcu_t)arg1;
fdu_t fdu = fdc_data[fdcu].fdu;
int st0, st3, cyl;
struct buf *dp,*bp;
@ -580,9 +597,10 @@ fd_timeout(fdcu)
}
/* just ensure it has the right spl */
fd_pseudointr(fdcu)
fdcu_t fdcu;
static void
fd_pseudointr(caddr_t arg1, int arg2)
{
fdcu_t fdcu = (fdcu_t)arg1;
int s;
s = splbio();
fdintr(fdcu);
@ -594,22 +612,24 @@ fd_pseudointr(fdcu)
* keep calling the state machine until it returns a 0 *
* ALWAYS called at SPLBIO *
\***********************************************************************/
fdintr(fdcu)
fdcu_t fdcu;
void
fdintr(fdcu_t fdcu)
{
fdc_p fdc = fdc_data + fdcu;
while(fdstate(fdcu, fdc));
while(fdstate(fdcu, fdc))
;
}
/***********************************************************************\
* The controller state machine. *
* if it returns a non zero value, it should be called again immediatly *
\***********************************************************************/
int fdstate(fdcu, fdc)
int
fdstate(fdcu, fdc)
fdcu_t fdcu;
fdc_p fdc;
{
int read,head,trac,sec,i,s,sectrac,cyl,st0;
int read, head, trac, sec = 0, i = 0, s, sectrac, cyl, st0;
unsigned long blknum;
fdu_t fdu = fdc->fdu;
fd_p fd;
@ -645,7 +665,7 @@ int fdstate(fdcu, fdc)
TRACE1("[%s]",fdstates[fdc->state]);
TRACE1("(0x%x)",fd->flags);
untimeout(fd_turnoff, fdu);
timeout(fd_turnoff,fdu,4 * hz);
timeout(fd_turnoff, (caddr_t)fdu, 4 * hz);
switch (fdc->state)
{
case DEVIDLE:
@ -689,12 +709,12 @@ int fdstate(fdcu, fdc)
out_fdc(fdcu,bp->b_cylin * fd->ft->steptrac);
fd->track = -2;
fdc->state = SEEKWAIT;
timeout(fd_timeout,fdcu,2 * hz);
timeout(fd_timeout, (caddr_t)fdcu, 2 * hz);
return(0); /* will return later */
case SEEKWAIT:
untimeout(fd_timeout,fdcu);
/* allow heads to settle */
timeout(fd_pseudointr,fdcu,hz/50);
timeout(fd_pseudointr, (caddr_t)fdcu, hz / 50);
fdc->state = SEEKCOMPLETE;
return(0); /* will return later */
break;
@ -743,7 +763,7 @@ int fdstate(fdcu, fdc)
out_fdc(fdcu,fd->ft->gap); /* gap size */
out_fdc(fdcu,fd->ft->datalen); /* data length */
fdc->state = IOCOMPLETE;
timeout(fd_timeout,fdcu,2 * hz);
timeout(fd_timeout, (caddr_t)fdcu, 2 * hz);
return(0); /* will return later */
case IOCOMPLETE: /* IO DONE, post-analyze */
untimeout(fd_timeout,fdcu);
@ -800,7 +820,7 @@ int fdstate(fdcu, fdc)
return(0); /* will return later */
case RECALWAIT:
/* allow heads to settle */
timeout(fd_pseudointr,fdcu,hz/30);
timeout(fd_pseudointr, (caddr_t)fdcu, hz / 30);
fdc->state = RECALCOMPLETE;
return(0); /* will return later */
case RECALCOMPLETE:
@ -848,6 +868,7 @@ int fdstate(fdcu, fdc)
return(1); /* Come back immediatly to new state */
}
int
retrier(fdcu)
fdcu_t fdcu;
{

View File

@ -39,7 +39,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id$
* $Id: if_ie.c,v 1.1 1993/10/12 06:52:31 rgrimes Exp $
*/
/*
@ -106,7 +106,6 @@ iomem, and to make 16-pointers, we subtract iomem and and with 0xffff.
#include "param.h"
#include "systm.h"
#include "mbuf.h"
#include "buf.h"
#include "protosw.h"
#include "socket.h"
#include "ioctl.h"
@ -135,7 +134,6 @@ iomem, and to make 16-pointers, we subtract iomem and and with 0xffff.
#endif
#include "i386/isa/isa.h"
/*#include "machine/cpufunc.h"*/
#include "i386/isa/isa_device.h"
#include "i386/isa/ic/i82586.h"
#include "i386/isa/if_iereg.h"
@ -171,14 +169,14 @@ int ie_debug = IED_RNR;
/* Forward declaration */
struct ie_softc;
int ieprobe(struct isa_device *dvp);
int ieattach(struct isa_device *dvp);
int ieinit(int unit);
int ieioctl(struct ifnet *ifp, int command, void *data);
int iestart(struct ifnet *ifp);
static int ieprobe(struct isa_device *dvp);
static int ieattach(struct isa_device *dvp);
static void ieinit(int unit);
static int ieioctl(struct ifnet *ifp, int command, caddr_t data);
static void iestart(struct ifnet *ifp);
static void sl_reset_586(int unit);
static void sl_chan_attn(int unit);
int iereset(int unit, int dummy);
static void iereset(int unit, int dummy);
static void ie_readframe(int unit, struct ie_softc *ie, int bufno);
static void ie_drop_packet_buffer(int unit, struct ie_softc *ie);
static void sl_read_ether(int unit, unsigned char addr[6]);
@ -407,7 +405,7 @@ ieattach(dvp)
while(ifa && ifa->ifa_addr && ifa->ifa_addr->sa_family != AF_LINK)
ifa = ifa->ifa_next;
if(!ifa || !ifa->ifa_addr) return;
if(!ifa || !ifa->ifa_addr) return 1;
/* Provide our ether address to the higher layers */
sdl = (struct sockaddr_dl *)ifa->ifa_addr;
@ -415,6 +413,7 @@ ieattach(dvp)
sdl->sdl_alen = 6;
sdl->sdl_slen = 0;
bcopy(ie->arpcom.ac_enaddr, LLADDR(sdl), 6);
return 1;
}
}
@ -1075,8 +1074,9 @@ static void ie_drop_packet_buffer(int unit, struct ie_softc *ie) {
/*
* Start transmission on an interface.
*/
int iestart(ifp)
struct ifnet *ifp;
static void
iestart(ifp)
struct ifnet *ifp;
{
struct ie_softc *ie = &ie_softc[ifp->if_unit];
struct mbuf *m0, *m;
@ -1086,9 +1086,9 @@ int iestart(ifp)
volatile u_short *bptr = &ie->scb->ie_command_list;
if(!(ifp->if_flags & IFF_RUNNING))
return 0;
return;
if(ifp->if_flags & IFF_OACTIVE)
return 0;
return;
do {
IF_DEQUEUE(&ie->arpcom.ac_if.if_snd, m);
@ -1147,7 +1147,7 @@ int iestart(ifp)
ifp->if_flags |= IFF_OACTIVE;
}
return 0;
return;
}
/*
@ -1281,14 +1281,15 @@ void sl_read_ether(unit, addr)
}
int iereset(unit, dummy)
int unit, dummy;
static void
iereset(unit, dummy)
int unit, dummy;
{
int s = splimp();
if(unit >= NIE) {
splx(s);
return -1;
return;
}
printf("ie%d: reset\n", unit);
@ -1313,17 +1314,18 @@ int iereset(unit, dummy)
ieioctl(&ie_softc[unit].arpcom.ac_if, SIOCSIFFLAGS, 0);
splx(s);
return 0;
return;
}
/*
* This is called if we time out.
*/
static int chan_attn_timeout(rock)
caddr_t rock;
static void
chan_attn_timeout(rock, arg2)
caddr_t rock;
int arg2;
{
*(int *)rock = 1;
return 0;
}
/*
@ -1545,7 +1547,8 @@ static int mc_setup(int unit, caddr_t ptr,
*
* THIS ROUTINE MUST BE CALLED AT splimp() OR HIGHER.
*/
int ieinit(unit)
static void
ieinit(unit)
int unit;
{
struct ie_softc *ie = &ie_softc[unit];
@ -1570,7 +1573,7 @@ int ieinit(unit)
if(command_and_wait(unit, IE_CU_START, cmd, IE_STAT_COMPL)
|| !(cmd->com.ie_cmd_status & IE_STAT_OK)) {
printf("ie%d: configure command failed\n", unit);
return 0;
return;
}
}
/*
@ -1590,7 +1593,7 @@ int ieinit(unit)
if(command_and_wait(unit, IE_CU_START, cmd, IE_STAT_COMPL)
|| !(cmd->com.ie_cmd_status & IE_STAT_OK)) {
printf("ie%d: individual address setup command failed\n", unit);
return 0;
return;
}
}
@ -1645,7 +1648,7 @@ int ieinit(unit)
ie->arpcom.ac_if.if_flags |= IFF_RUNNING; /* tell higher levels that we are here */
start_receiver(unit);
return 0;
return;
}
static void ie_stop(unit)
@ -1654,10 +1657,11 @@ static void ie_stop(unit)
command_and_wait(unit, IE_RU_DISABLE, 0, 0);
}
int ieioctl(ifp, command, data)
struct ifnet *ifp;
int command;
void *data;
static int
ieioctl(ifp, command, data)
struct ifnet *ifp;
int command;
caddr_t data;
{
struct ifaddr *ifa = (struct ifaddr *)data;
struct ie_softc *ie = &ie_softc[ifp->if_unit];

View File

@ -34,7 +34,7 @@
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id: mcd.c,v 1.1 1993/10/12 06:08:29 rgrimes Exp $
* $Id: mcd.c,v 1.2 1993/10/16 13:46:13 rgrimes Exp $
*/
static char COPYRIGHT[] = "mcd-driver (C)1993 by H.Veit & B.Moore";
@ -141,7 +141,7 @@ struct mcd_data {
/* prototypes */
int mcdopen(dev_t dev);
int mcdclose(dev_t dev);
int mcdstrategy(struct buf *bp);
void mcdstrategy(struct buf *bp);
int mcdioctl(dev_t dev, int cmd, caddr_t addr, int flags);
int mcdsize(dev_t dev);
static void mcd_done(struct mcd_mbx *mbx);
@ -289,7 +289,8 @@ int mcdclose(dev_t dev)
return 0;
}
int mcdstrategy(struct buf *bp)
void
mcdstrategy(struct buf *bp)
{
struct mcd_data *cd;
struct buf *qp;
@ -787,7 +788,9 @@ static int mcd_volinfo(int unit)
return -1;
}
int mcdintr(unit)
void
mcdintr(unit)
int unit;
{
int port = mcd_data[unit].iobase;
u_int i;
@ -830,13 +833,13 @@ static void mcd_doread(int state, struct mcd_mbx *mbxin)
/* get status */
outb(port+mcd_command, MCD_CMDGETSTAT);
mbx->count = RDELAY_WAITSTAT;
timeout(mcd_doread,MCD_S_WAITSTAT,hz/100);
timeout((timeout_func_t)mcd_doread,(caddr_t)MCD_S_WAITSTAT,hz/100); /* XXX */
return;
case MCD_S_WAITSTAT:
untimeout(mcd_doread,MCD_S_WAITSTAT);
if (mbx->count-- >= 0) {
if (inb(port+mcd_xfer) & MCD_ST_BUSY) {
timeout(mcd_doread,MCD_S_WAITSTAT,hz/100);
timeout((timeout_func_t)mcd_doread,(caddr_t)MCD_S_WAITSTAT,hz/100); /* XXX */
return;
}
mcd_setflags(unit,cd);
@ -860,7 +863,7 @@ static void mcd_doread(int state, struct mcd_mbx *mbxin)
mcd_put(port+mcd_command, MCD_CMDSETMODE);
mcd_put(port+mcd_command, rm);
timeout(mcd_doread,MCD_S_WAITMODE,hz/100);
timeout((timeout_func_t)mcd_doread,(caddr_t)MCD_S_WAITMODE,hz/100); /* XXX */
return;
} else {
#ifdef MCD_TO_WARNING_ON
@ -878,7 +881,7 @@ static void mcd_doread(int state, struct mcd_mbx *mbxin)
goto readerr;
}
if (inb(port+mcd_xfer) & MCD_ST_BUSY) {
timeout(mcd_doread,MCD_S_WAITMODE,hz/100);
timeout((timeout_func_t)mcd_doread,(caddr_t)MCD_S_WAITMODE,hz/100);
return;
}
mcd_setflags(unit,cd);
@ -905,7 +908,7 @@ static void mcd_doread(int state, struct mcd_mbx *mbxin)
mcd_put(port+mcd_command,0);
mcd_put(port+mcd_command,1);
mbx->count = RDELAY_WAITREAD;
timeout(mcd_doread,MCD_S_WAITREAD,hz/100);
timeout((timeout_func_t)mcd_doread,(caddr_t)MCD_S_WAITREAD,hz/100); /* XXX */
return;
case MCD_S_WAITREAD:
untimeout(mcd_doread,MCD_S_WAITREAD);
@ -935,7 +938,7 @@ static void mcd_doread(int state, struct mcd_mbx *mbxin)
}
if ((k & 4)==0)
mcd_getstat(unit,0);
timeout(mcd_doread,MCD_S_WAITREAD,hz/100);
timeout((timeout_func_t)mcd_doread,(caddr_t)MCD_S_WAITREAD,hz/100); /* XXX */
return;
} else {
#ifdef MCD_TO_WARNING_ON

View File

@ -55,7 +55,9 @@
#include "i386/isa/isa_device.h"
#include "i386/isa/icu.h"
int mseprobe(), mseattach(), mseintr();
static int mseprobe(struct isa_device *);
static int mseattach(struct isa_device *);
void mseintr(int);
struct isa_driver msedriver = {
mseprobe, mseattach, "mse"
@ -146,6 +148,7 @@ struct mse_types {
{ 0, },
};
int
mseprobe(idp)
register struct isa_device *idp;
{
@ -169,6 +172,7 @@ mseprobe(idp)
return (0);
}
int
mseattach(idp)
struct isa_device *idp;
{
@ -181,6 +185,7 @@ mseattach(idp)
/*
* Exclusive open the mouse, initialize it and enable interrupts.
*/
int
mseopen(dev, flag)
dev_t dev;
int flag;
@ -210,7 +215,9 @@ mseopen(dev, flag)
/*
* mseclose: just turn off mouse innterrupts.
*/
int
mseclose(dev, flag)
dev_t dev;
int flag;
{
struct mse_softc *sc = &mse_sc[MSE_UNIT(dev)];
@ -228,6 +235,7 @@ mseclose(dev, flag)
* using bytes 4 and 5.
* (Yes this is cheesy, but it makes the X386 server happy, so...)
*/
int
mseread(dev, uio)
dev_t dev;
struct uio *uio;
@ -288,6 +296,7 @@ mseread(dev, uio)
/*
* mseselect: check for mouse input to be processed.
*/
int
mseselect(dev, rw, p)
dev_t dev;
int rw;
@ -315,6 +324,7 @@ mseselect(dev, rw, p)
/*
* mseintr: update mouse status. sc_deltax and sc_deltay are accumulative.
*/
void
mseintr(unit)
int unit;
{

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)com.c 7.5 (Berkeley) 5/16/91
* $Id: sio.c,v 1.14 1993/11/14 23:29:01 ache Exp $
* $Id: sio.c,v 1.15 1993/11/17 23:38:23 ache Exp $
*/
#include "sio.h"
@ -196,13 +196,6 @@ struct com_s {
u_char ibuf2[2 * RS_IBUFSIZE];
};
/* XXX - these functions ought to be declared in systm.h. */
#define nonint int
nonint timeout __P((timeout_func_t func, caddr_t arg, int t));
int tsleep __P((caddr_t chan, int pri, char *wmesg, int timo));
int ttnread __P((struct tty *tp));
nonint wakeup __P((caddr_t chan));
/*
* These functions in the com module ought to be declared (with a prototype)
* in a com-driver system header. The void ones may need to be int to match
@ -223,23 +216,12 @@ void siocnputc __P((Dev_t dev, int c));
int sioopen __P((Dev_t dev, int oflags, int devtype,
struct proc *p));
/*
* sioopen gets compared to the d_open entry in struct cdevsw. d_open and
* other functions are declared in <sys/conf.h> with short types like dev_t
* in the prototype. Such declarations are broken because they vary with
* __P (significantly in theory - the compiler is allowed to push a short
* arg if it has seen the prototype; insignificantly in practice - gcc
* doesn't push short args and it would be slower on 386's to do so).
*
* Also, most of the device switch functions are still declared old-style
* so they take a Dev_t arg and shorten it to a dev_t. It would be simpler
* and faster if dev_t's were always promoted (to ints or whatever) as
* early as possible.
*
* Until <sys/conf.h> is fixed, we cast sioopen to the following `wrong' type
* when comparing it to the d_open entry just to avoid compiler warnings.
*/
typedef int (*bogus_open_t) __P((dev_t dev, int oflags, int devtype,
struct proc *p));
int sioread __P((Dev_t dev, struct uio *uio, int ioflag));
int sioselect __P((Dev_t dev, int rw, struct proc *p));
void siostop __P((struct tty *tp, int rw));
@ -257,8 +239,8 @@ static int commctl __P((struct com_s *com, int bits, int how));
static int comparam __P((struct tty *tp, struct termios *t));
static int sioprobe __P((struct isa_device *dev));
static void compoll __P((void));
static int comstart __P((struct tty *tp));
static nonint comwakeup __P((caddr_t chan, int ticks));
static void comstart __P((struct tty *tp));
static void comwakeup __P((caddr_t chan, int ticks));
static int tiocm_xxx2mcr __P((int tiocm_xxx));
/* table and macro for fast conversion from a unit number to its com struct */
@ -724,7 +706,7 @@ sioopen(dev, flag, mode, p)
out:
splx(s);
if (error == 0)
error = (*linesw[tp->t_line].l_open)(dev, tp);
error = (*linesw[tp->t_line].l_open)(dev, tp, 0);
#ifdef COM_BIDIR
/* wakeup sleepers */
@ -1161,7 +1143,7 @@ compoll()
s = spltty();
repeat:
for (unit = 0; unit < NSIO; ++unit) {
u_char *buf;
u_char *buf = 0;
u_char *ibuf;
int incc;
struct tty *tp;
@ -1447,7 +1429,7 @@ comparam(tp, t)
return (0);
}
static int /* XXX - should be void */
static void
comstart(tp)
struct tty *tp;
{
@ -1502,7 +1484,6 @@ comstart(tp)
}
out:
splx(s);
return (1);
}
void
@ -1555,7 +1536,7 @@ commctl(com, bits, how)
return (bits);
}
static nonint
static void
comwakeup(chan, ticks)
caddr_t chan;
int ticks;
@ -1577,7 +1558,7 @@ comwakeup(chan, ticks)
enable_intr();
}
}
return (0);
return;
}
void
@ -1601,7 +1582,7 @@ siocnprobe(cp)
/* locate the major number */
for (commajor = 0; commajor < nchrdev; commajor++)
if (cdevsw[commajor].d_open == (bogus_open_t) sioopen)
if (cdevsw[commajor].d_open == sioopen)
break;
/* XXX: ick */

View File

@ -1,6 +1,6 @@
# Copyright 1990 W. Jolitz
# from: @(#)Makefile.i386 7.1 5/10/91
# $Id: Makefile.i386,v 1.14 1993/11/15 21:06:08 paul Exp $
# $Id: Makefile.i386,v 1.15 1993/11/16 00:45:04 paul Exp $
#
# Makefile for FreeBSD
#
@ -30,7 +30,14 @@ DBSYM= /usr/sbin/dbsym
S= ../..
I386= ../../i386
CWARNFLAGS=
CWARNFLAGS=-W -Wreturn-type -Wcomment
#
# The following flags are next up for working on:
# -Wtraditional -Wredundant-decls -Wnested-externs
#
# When working on removing warnings from code, the `-Werror' flag should be
# of material assistance.
#
COPTFLAGS=-O
INCLUDES= -I. -I$S -I$S/sys
COPTS= ${INCLUDES} ${IDENT} -DKERNEL -Di386 -DNPX
@ -151,8 +158,8 @@ ioconf.o: ioconf.c $S/sys/param.h machine/pte.h $S/sys/buf.h \
${I386}/isa/isa_device.h ${I386}/isa/isa.h ${I386}/isa/icu.h
${CC} -c ${CFLAGS} ioconf.c
conf.o: ${I386}/i386/conf.c
${CC} -traditional -c ${CFLAGS} ${I386}/i386/conf.c
conf.o: ${I386}/i386/conf.c $S/sys/conf.h
${CC} -c ${CFLAGS} ${I386}/i386/conf.c
param.c: $S/conf/param.c
-rm -f param.c

View File

@ -14,7 +14,7 @@
*
* commenced: Sun Sep 27 18:14:01 PDT 1992
*
* $Id: aha1742.c,v 2.4 93/10/24 12:47:00 julian Exp Locker: julian $
* $Id: aha1742.c,v 1.11 1993/11/18 05:02:15 rgrimes Exp $
*/
#include <sys/types.h>
@ -57,7 +57,7 @@ int Debugger();
#endif /* kernel */
#ifndef NetBSD
typedef void (*timeout_t) __P((caddr_t));
typedef timeout_func_t timeout_t;
#endif
typedef unsigned long int physaddr;
@ -279,7 +279,7 @@ int ahb_attach();
int ahb_init __P((int unit));
int ahbintr();
int32 ahb_scsi_cmd();
void ahb_timeout();
void ahb_timeout(caddr_t, int);
void ahb_done();
struct ecb *cheat;
void ahb_free_ecb();
@ -734,7 +734,7 @@ ahb_free_ecb(unit, ecb, flags)
int unit, flags;
struct ecb *ecb;
{
unsigned int opri;
unsigned int opri = 0;
struct ahb_data *ahb = ahbdata[unit];
if (!(flags & SCSI_NOMASK))
@ -765,7 +765,7 @@ ahb_get_ecb(unit, flags)
int unit, flags;
{
struct ahb_data *ahb = ahbdata[unit];
unsigned opri;
unsigned opri = 0;
struct ecb *ecbp;
int hashnum;
@ -998,7 +998,7 @@ ahb_scsi_cmd(xs)
if (!(flags & SCSI_NOMASK)) {
s = splbio();
ahb_send_immed(unit, xs->sc_link->target, AHB_TARG_RESET);
timeout((timeout_t)ahb_timeout, (caddr_t)ecb, (xs->timeout * hz) / 1000);
timeout(ahb_timeout, (caddr_t)ecb, (xs->timeout * hz) / 1000);
splx(s);
return (SUCCESSFULLY_QUEUED);
} else {
@ -1127,7 +1127,7 @@ ahb_scsi_cmd(xs)
if (!(flags & SCSI_NOMASK)) {
s = splbio();
ahb_send_mbox(unit, OP_START_ECB, xs->sc_link->target, ecb);
timeout((timeout_t)ahb_timeout, (caddr_t)ecb, (xs->timeout * hz) / 1000);
timeout(ahb_timeout, (caddr_t)ecb, (xs->timeout * hz) / 1000);
splx(s);
SC_DEBUG(xs->sc_link, SDEV_DB3, ("cmd_sent\n"));
return (SUCCESSFULLY_QUEUED);
@ -1157,8 +1157,9 @@ ahb_scsi_cmd(xs)
}
void
ahb_timeout(struct ecb * ecb)
ahb_timeout(caddr_t arg1, int arg2)
{
struct ecb * ecb = (struct ecb *)arg1;
int unit;
struct ahb_data *ahb;
int s = splbio();
@ -1203,7 +1204,7 @@ ahb_timeout(struct ecb * ecb)
printf("\n");
ahb_send_mbox(unit, OP_ABORT_ECB, ecb->xs->sc_link->target, ecb);
/* 2 secs for the abort */
timeout((timeout_t)ahb_timeout, (caddr_t)ecb, 2 * hz);
timeout(ahb_timeout, (caddr_t)ecb, 2 * hz);
ecb->flags = ECB_ABORTED;
}
splx(s);

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)autoconf.c 7.1 (Berkeley) 5/9/91
* $Id$
* $Id: autoconf.c,v 1.4 1993/10/16 14:14:48 rgrimes Exp $
*/
/*
@ -55,6 +55,9 @@
#include "machine/pte.h"
static void swapconf(void);
static void setroot(void);
/*
* The following several variables are related to
* the configuration process, and are used in initializing
@ -66,6 +69,7 @@ extern int cold; /* cold start flag initialized in locore.s */
/*
* Determine i/o configuration for a machine.
*/
void
configure()
{
@ -92,6 +96,7 @@ configure()
/*
* Configure swap space and related parameters.
*/
static void
swapconf()
{
register struct swdevt *swp;
@ -140,10 +145,11 @@ static char devname[][2] = {
* If we can do so, and not instructed not to do so,
* change rootdev to correspond to the load device.
*/
static void
setroot()
{
int majdev, mindev, unit, part, adaptor;
dev_t temp, orootdev;
dev_t temp = 0, orootdev;
struct swdevt *swp;
/*printf("howto %x bootdev %x ", boothowto, bootdev);*/

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)conf.c 5.8 (Berkeley) 5/12/91
* $Id: conf.c,v 1.15 1993/11/18 05:01:51 rgrimes Exp $
* $Id: conf.c,v 1.16 1993/11/22 09:46:44 davidg Exp $
*/
#include "param.h"
@ -44,443 +44,568 @@
#include "tty.h"
#include "conf.h"
int nullop(), enxio(), enodev(), rawread(), rawwrite(), swstrategy();
int rawread(), rawwrite(), swstrategy();
int nullop(), enxio(), enodev();
d_rdwr_t rawread, rawwrite;
d_strategy_t swstrategy;
#include "wd.h"
#include "wx.h"
#if (NWD > 0) || (NWX > 0)
int wdopen(),wdclose(),wdstrategy(),wdioctl();
int wddump(),wdsize();
d_open_t wdopen;
d_close_t wdclose;
d_strategy_t wdstrategy;
d_ioctl_t wdioctl;
d_dump_t wddump;
d_psize_t wdsize;
#else
#define wdopen enxio
#define wdclose enxio
#define wdstrategy enxio
#define wdioctl enxio
#define wddump enxio
#define wdsize NULL
#define wdopen (d_open_t *)enxio
#define wdclose (d_close_t *)enxio
#define wdstrategy (d_strategy_t *)enxio
#define wdioctl (d_ioctl_t *)enxio
#define wddump (d_dump_t *)enxio
#define wdsize (d_psize_t *)0
#endif
#include "sd.h"
#if NSD > 0
int sdopen(),sdclose(),sdstrategy(),sdioctl();
int sddump(),sdsize();
d_open_t sdopen;
d_close_t sdclose;
d_strategy_t sdstrategy;
d_ioctl_t sdioctl;
d_dump_t sddump;
d_psize_t sdsize;
#else
#define sdopen enxio
#define sdclose enxio
#define sdstrategy enxio
#define sdioctl enxio
#define sddump enxio
#define sdsize NULL
#define sdopen (d_open_t *)enxio
#define sdclose (d_close_t *)enxio
#define sdstrategy (d_strategy_t *)enxio
#define sdioctl (d_ioctl_t *)enxio
#define sddump (d_dump_t *)enxio
#define sdsize (d_psize_t *)0
#endif
#include "st.h"
#if NST > 0
int stopen(),stclose(),ststrategy(),stioctl();
d_open_t stopen;
d_close_t stclose;
d_strategy_t ststrategy;
d_ioctl_t stioctl;
/*int stdump(),stsize();*/
#define stdump enxio
#define stsize NULL
#define stdump (d_dump_t *)enxio
#define stsize (d_psize_t *)0
#else
#define stopen enxio
#define stclose enxio
#define ststrategy enxio
#define stioctl enxio
#define stdump enxio
#define stsize NULL
#define stopen (d_open_t *)enxio
#define stclose (d_close_t *)enxio
#define ststrategy (d_strategy_t *)enxio
#define stioctl (d_ioctl_t *)enxio
#define stdump (d_dump_t *)enxio
#define stsize (d_psize_t *)0
#endif
#include "cd.h"
#if NCD > 0
int cdopen(),cdclose(),cdstrategy(),cdioctl();
int /*cddump(),*/cdsize();
#define cddump enxio
d_open_t cdopen;
d_close_t cdclose;
d_strategy_t cdstrategy;
d_ioctl_t cdioctl;
d_psize_t cdsize;
#define cddump (d_dump_t *)enxio
#else
#define cdopen enxio
#define cdclose enxio
#define cdstrategy enxio
#define cdioctl enxio
#define cddump enxio
#define cdsize NULL
#define cdopen (d_open_t *)enxio
#define cdclose (d_close_t *)enxio
#define cdstrategy (d_strategy_t *)enxio
#define cdioctl (d_ioctl_t *)enxio
#define cddump (d_dump_t *)enxio
#define cdsize (d_psize_t *)0
#endif
#include "mcd.h"
#if NMCD > 0
int mcdopen(),mcdclose(),mcdstrategy(),mcdioctl();
int /*mcddump(),*/mcdsize();
#define mcddump enxio
d_open_t mcdopen;
d_close_t mcdclose;
d_strategy_t mcdstrategy;
d_ioctl_t mcdioctl;
d_psize_t mcdsize;
#define mcddump (d_dump_t *)enxio
#else
#define mcdopen enxio
#define mcdclose enxio
#define mcdstrategy enxio
#define mcdioctl enxio
#define mcddump enxio
#define mcdsize NULL
#define mcdopen (d_open_t *)enxio
#define mcdclose (d_close_t *)enxio
#define mcdstrategy (d_strategy_t *)enxio
#define mcdioctl (d_ioctl_t *)enxio
#define mcddump (d_dump_t *)enxio
#define mcdsize (d_psize_t *)0
#endif
#include "ch.h"
#if NCH > 0
int chopen(),chclose(),chioctl();
d_open_t chopen;
d_close_t chclose;
d_ioctl_t chioctl;
#else
#define chopen enxio
#define chclose enxio
#define chioctl enxio
#define chopen (d_open_t *)enxio
#define chclose (d_close_t *)enxio
#define chioctl (d_ioctl_t *)enxio
#endif
#include "wt.h"
#if NWT > 0
int wtopen(),wtclose(),wtstrategy(),wtioctl();
int wtdump(),wtsize();
d_open_t wtopen;
d_close_t wtclose;
d_strategy_t wtstrategy;
d_ioctl_t wtioctl;
d_dump_t wtdump;
d_psize_t wtsize;
#else
#define wtopen enxio
#define wtclose enxio
#define wtstrategy enxio
#define wtioctl enxio
#define wtdump enxio
#define wtsize NULL
#define wtopen (d_open_t *)enxio
#define wtclose (d_close_t *)enxio
#define wtstrategy (d_strategy_t *)enxio
#define wtioctl (d_ioctl_t *)enxio
#define wtdump (d_dump_t *)enxio
#define wtsize (d_psize_t *)0
#endif
#include "fd.h"
#if NFD > 0
int Fdopen(),fdclose(),fdstrategy(),fdioctl();
#define fddump enxio
#define fdsize NULL
d_open_t Fdopen;
d_close_t fdclose;
d_strategy_t fdstrategy;
d_ioctl_t fdioctl;
#define fddump (d_dump_t *)enxio
#define fdsize (d_psize_t *)0
#else
#define Fdopen enxio
#define fdclose enxio
#define fdstrategy enxio
#define fdioctl enxio
#define fddump enxio
#define fdsize NULL
#define Fdopen (d_open_t *)enxio
#define fdclose (d_close_t *)enxio
#define fdstrategy (d_strategy_t *)enxio
#define fdioctl (d_ioctl_t *)enxio
#define fddump (d_dump_t *)enxio
#define fdsize (d_psize_t *)0
#endif
int swstrategy(),swread(),swwrite();
#define swopen (d_open_t *)enodev
#define swclose (d_close_t *)enodev
d_strategy_t swstrategy;
#define swioctl (d_ioctl_t *)enodev
#define swdump (d_dump_t *)enodev
#define swsize (d_psize_t *)enodev
d_rdwr_t swread, swwrite;
struct bdevsw bdevsw[] =
{
{ wdopen, wdclose, wdstrategy, wdioctl, /*0*/
wddump, wdsize, NULL },
{ enodev, enodev, swstrategy, enodev, /*1*/
enodev, enodev, NULL },
wddump, wdsize, 0 },
{ swopen, swclose, swstrategy, swioctl, /*1*/
swdump, swsize, 0 },
{ Fdopen, fdclose, fdstrategy, fdioctl, /*2*/
fddump, fdsize, NULL },
fddump, fdsize, 0 },
{ wtopen, wtclose, wtstrategy, wtioctl, /*3*/
wtdump, wtsize, B_TAPE },
{ sdopen, sdclose, sdstrategy, sdioctl, /*4*/
sddump, sdsize, NULL },
sddump, sdsize, 0 },
{ stopen, stclose, ststrategy, stioctl, /*5*/
stdump, stsize, NULL },
stdump, stsize, 0 },
{ cdopen, cdclose, cdstrategy, cdioctl, /*6*/
cddump, cdsize, NULL },
cddump, cdsize, 0 },
{ mcdopen, mcdclose, mcdstrategy, mcdioctl, /*7*/
mcddump, mcdsize, NULL },
mcddump, mcdsize, 0 },
/*
* If you need a bdev major number, please contact the 386bsd patchkit
* coordinator by sending mail to "patches@cs.montana.edu".
* If you need a bdev major number, please contact the FreeBSD team
* by sending mail to "FreeBSD-hackers@freefall.cdrom.com".
* If you assign one yourself it may conflict with someone else.
*/
};
int nblkdev = sizeof (bdevsw) / sizeof (bdevsw[0]);
int cnopen(),cnclose(),cnread(),cnwrite(),cnioctl(),cnselect();
/* console */
d_open_t cnopen;
d_close_t cnclose;
d_rdwr_t cnread, cnwrite;
d_ioctl_t cnioctl;
d_select_t cnselect;
int pcopen(),pcclose(),pcread(),pcwrite(),pcioctl(),pcmmap();
/* more console */
d_open_t pcopen;
d_close_t pcclose;
d_rdwr_t pcread, pcwrite;
d_ioctl_t pcioctl;
d_mmap_t pcmmap;
extern struct tty pccons;
int cttyopen(), cttyread(), cttywrite(), cttyioctl(), cttyselect();
/* controlling TTY */
d_open_t cttyopen;
d_rdwr_t cttyread, cttywrite;
d_ioctl_t cttyioctl;
d_select_t cttyselect;
int mmopen(), mmclose(), mmrw(), memmmap();
/* /dev/mem */
d_open_t mmopen;
d_close_t mmclose;
d_rdwr_t mmrw;
d_mmap_t memmmap;
#define mmselect seltrue
#include "pty.h"
#if NPTY > 0
int ptsopen(),ptsclose(),ptsread(),ptswrite(),ptsstop();
int ptcopen(),ptcclose(),ptcread(),ptcwrite(),ptcselect();
int ptyioctl();
struct tty pt_tty[];
d_open_t ptsopen;
d_close_t ptsclose;
d_rdwr_t ptsread, ptswrite;
d_stop_t ptsstop;
d_open_t ptcopen;
d_close_t ptcclose;
d_rdwr_t ptcread, ptcwrite;
d_select_t ptcselect;
d_ioctl_t ptyioctl;
extern struct tty pt_tty[];
#else
#define ptsopen enxio
#define ptsclose enxio
#define ptsread enxio
#define ptswrite enxio
#define ptcopen enxio
#define ptcclose enxio
#define ptcread enxio
#define ptcwrite enxio
#define ptyioctl enxio
#define ptsopen (d_open_t *)enxio
#define ptsclose (d_close_t *)enxio
#define ptsread (d_rdwr_t *)enxio
#define ptswrite (d_rdwr_t *)enxio
#define ptcopen (d_open_t *)enxio
#define ptcclose (d_close_t *)enxio
#define ptcread (d_rdwr_t *)enxio
#define ptcwrite (d_rdwr_t *)enxio
#define ptyioctl (d_ioctl_t *)enxio
#define pt_tty NULL
#define ptcselect enxio
#define ptsstop nullop
#define ptcselect (d_select_t *)enxio
#define ptsstop (d_stop_t *)nullop
#endif
#include "com.h"
#if NCOM > 0
int comopen(),comclose(),comread(),comwrite(),comioctl(),comselect();
#define comreset enxio
d_open_t comopen;
d_close_t comclose;
d_rdwr_t comread;
d_rdwr_t comwrite;
d_ioctl_t comioctl;
d_select_t comselect;
#define comreset (d_reset_t *)enxio
extern struct tty com_tty[];
#else
#define comopen enxio
#define comclose enxio
#define comread enxio
#define comwrite enxio
#define comioctl enxio
#define comreset enxio
#define comselect enxio
#define comopen (d_open_t *)enxio
#define comclose (d_close_t *)enxio
#define comread (d_rdwr_t *)enxio
#define comwrite (d_rdwr_t *)enxio
#define comioctl (d_ioctl_t *)enxio
#define comreset (d_reset_t *)enxio
#define comselect (d_select_t *)enxio
#define com_tty NULL
#endif
int logopen(),logclose(),logread(),logioctl(),logselect();
/* /dev/klog */
d_open_t logopen;
d_close_t logclose;
d_rdwr_t logread;
d_ioctl_t logioctl;
d_select_t logselect;
int ttselect(), seltrue();
d_select_t ttselect, seltrue;
#include "lpt.h"
#if NLPT > 0
int lptopen(),lptclose(),lptwrite(),lptioctl();
d_open_t lptopen;
d_close_t lptclose;
d_rdwr_t lptwrite;
d_ioctl_t lptioctl;
#else
#define lptopen enxio
#define lptclose enxio
#define lptwrite enxio
#define lptioctl enxio
#define lptopen (d_open_t *)enxio
#define lptclose (d_close_t *)enxio
#define lptwrite (d_rdwr_t *)enxio
#define lptioctl (d_ioctl_t *)enxio
#endif
#include "tw.h"
#if NTW > 0
int twopen(),twclose(),twread(),twwrite(),twselect();
d_open_t twopen;
d_close_t twclose;
d_rdwr_t twread, twwrite;
d_select_t twselect;
#else
#define twopen enxio
#define twclose enxio
#define twread enxio
#define twwrite enxio
#define twselect enxio
#define twopen (d_open_t *)enxio
#define twclose (d_close_t *)enxio
#define twread (d_rdwr_t *)enxio
#define twwrite (d_rdwr_t *)enxio
#define twselect (d_select_t *)enxio
#endif
#include "sb.h" /* Sound Blaster */
#if NSB > 0
int sbopen(), sbclose(), sbioctl(), sbread(), sbwrite();
int sbselect();
d_open_t sbopen;
d_close_t sbclose;
d_ioctl_t sbioctl;
d_rdwr_t sbread, sbwrite;
d_select_t sbselect;
#else
#define sbopen enxio
#define sbclose enxio
#define sbioctl enxio
#define sbread enxio
#define sbwrite enxio
#define sbopen (d_open_t *)enxio
#define sbclose (d_close_t *)enxio
#define sbioctl (d_ioctl_t *)enxio
#define sbread (d_rdwr_t *)enxio
#define sbwrite (d_rdwr_t *)enxio
#define sbselect seltrue
#endif
#include "psm.h"
#if NPSM > 0
int psmopen(),psmclose(),psmread(),psmselect(),psmioctl();
d_open_t psmopen;
d_close_t psmclose;
d_rdwr_t psmread;
d_select_t psmselect;
d_ioctl_t psmioctl;
#else
#define psmopen enxio
#define psmclose enxio
#define psmread enxio
#define psmselect enxio
#define psmioctl enxio
#define psmopen (d_open_t *)enxio
#define psmclose (d_close_t *)enxio
#define psmread (d_rdwr_t *)enxio
#define psmselect (d_select_t *)enxio
#define psmioctl (d_ioctl_t *)enxio
#endif
#include "snd.h" /* General Sound Driver */
#if NSND > 0
int sndopen(), sndclose(), sndioctl(), sndread(), sndwrite();
int sndselect();
d_open_t sndopen;
d_close_t sndclose;
d_ioctl_t sndioctl;
d_rdwr_t sndread, sndwrite;
d_select_t sndselect;
#else
#define sndopen enxio
#define sndclose enxio
#define sndioctl enxio
#define sndread enxio
#define sndwrite enxio
#define sndopen (d_open_t *)enxio
#define sndclose (d_close_t *)enxio
#define sndioctl (d_ioctl_t *)enxio
#define sndread (d_rdwr_t *)enxio
#define sndwrite (d_rdwr_t *)enxio
#define sndselect seltrue
#endif
int fdopen();
/* /dev/fd/NNN */
d_open_t fdopen;
#include "bpfilter.h"
#if NBPFILTER > 0
int bpfopen(),bpfclose(),bpfread(),bpfwrite(),bpfselect(),bpfioctl();
d_open_t bpfopen;
d_close_t bpfclose;
d_rdwr_t bpfread, bpfwrite;
d_select_t bpfselect;
d_ioctl_t bpfioctl;
#else
#define bpfopen enxio
#define bpfclose enxio
#define bpfread enxio
#define bpfwrite enxio
#define bpfselect enxio
#define bpfioctl enxio
#define bpfopen (d_open_t *)enxio
#define bpfclose (d_close_t *)enxio
#define bpfread (d_rdwr_t *)enxio
#define bpfwrite (d_rdwr_t *)enxio
#define bpfselect (d_select_t *)enxio
#define bpfioctl (d_ioctl_t *)enxio
#endif
#include "dcfclk.h"
#if NDCFCLK > 0
int dcfclkopen(),dcfclkclose(),dcfclkread(),dcfclkioctl(),dcfclkselect();
d_open_t dcfclkopen;
d_close_t dcfclkclose;
d_rdwr_t dcfclkread;
d_ioctl_t dcfclkioctl;
d_select_t dcfclkselect;
#else
#define dcfclkopen enxio
#define dcfclkclose enxio
#define dcfclkread enxio
#define dcfclkioctl enxio
#define dcfclkselect enxio
#define dcfclkopen (d_open_t *)enxio
#define dcfclkclose (d_close_t *)enxio
#define dcfclkread (d_rdwr_t *)enxio
#define dcfclkioctl (d_ioctl_t *)enxio
#define dcfclkselect (d_select_t *)enxio
#endif
#include "lpa.h"
#if NLPA > 0
int lpaopen(),lpaclose(),lpawrite(),lpaioctl();
d_open_t lpaopen;
d_close_t lpaclose;
d_rdwr_t lpawrite;
d_ioctl_t lpaioctl;
#else
#define lpaopen enxio
#define lpaclose enxio
#define lpawrite enxio
#define lpaioctl enxio
#define lpaopen (d_open_t *)enxio
#define lpaclose (d_close_t *)enxio
#define lpawrite (d_write_t *)enxio
#define lpaioctl (d_ioctl_t *)enxio
#endif
#include "speaker.h"
#if NSPEAKER > 0
int spkropen(),spkrclose(),spkrwrite(),spkrioctl();
d_open_t spkropen;
d_close_t spkrclose;
d_rdwr_t spkrwrite;
d_ioctl_t spkrioctl;
#else
#define spkropen enxio
#define spkrclose enxio
#define spkrwrite enxio
#define spkrioctl enxio
#define spkropen (d_open_t *)enxio
#define spkrclose (d_close_t *)enxio
#define spkrwrite (d_write_t *)enxio
#define spkrioctl (d_ioctl_t *)enxio
#endif
#include "mse.h"
#if NMSE > 0
int mseopen(),mseclose(),mseread(),mseselect();
d_open_t mseopen;
d_close_t mseclose;
d_rdwr_t mseread;
d_select_t mseselect;
#else
#define mseopen enxio
#define mseclose enxio
#define mseread enxio
#define mseselect enxio
#define mseopen (d_open_t *)enxio
#define mseclose (d_close_t *)enxio
#define mseread (d_rdwr_t *)enxio
#define mseselect (d_select_t *)enxio
#endif
#include "sio.h"
#if NSIO > 0
int sioopen(),sioclose(),sioread(),siowrite(),sioioctl(),sioselect(),
siostop();
#define sioreset enxio
d_open_t sioopen;
d_close_t sioclose;
d_rdwr_t sioread, siowrite;
d_ioctl_t sioioctl;
d_select_t sioselect;
d_stop_t siostop;
#define sioreset (d_reset_t *)enxio
extern struct tty sio_tty[];
#else
#define sioopen enxio
#define sioclose enxio
#define sioread enxio
#define siowrite enxio
#define sioioctl enxio
#define siostop enxio
#define sioreset enxio
#define sioselect enxio
#define sioopen (d_open_t *)enxio
#define sioclose (d_close_t *)enxio
#define sioread (d_rdwr_t *)enxio
#define siowrite (d_rdwr_t *)enxio
#define sioioctl (d_ioctl_t *)enxio
#define siostop (d_stop_t *)enxio
#define sioreset (d_reset_t *)enxio
#define sioselect (d_select_t *)enxio
#define sio_tty NULL
#endif
#include "su.h"
#if NSU > 0
int suopen(),suclose(),suioctl();
#define susize NULL
d_open_t suopen;
d_close_t suclose;
d_ioctl_t suioctl;
#else
#define suopen enxio
#define suclose enxio
#define suioctl enxio
#define susize NULL
#define suopen (d_open_t *)enxio
#define suclose (d_close_t *)enxio
#define suioctl (d_ioctl_t *)enxio
#endif
#include "uk.h"
#if NUK > 0
int ukopen(),ukclose(),ukioctl();
d_open_t ukopen;
d_close_t ukclose;
d_ioctl_t ukioctl;
#else
#define ukopen enxio
#define ukclose enxio
#define ukioctl enxio
#define ukopen (d_open_t *)enxio
#define ukclose (d_close_t *)enxio
#define ukioctl (d_ioctl_t *)enxio
#endif
#define noopen (d_open_t *)enodev
#define noclose (d_close_t *)enodev
#define noread (d_rdwr_t *)enodev
#define nowrite noread
#define noioc (d_ioctl_t *)enodev
#define nostop (d_stop_t *)enodev
#define noreset (d_reset_t *)enodev
#define noselect (d_select_t *)enodev
#define nommap (d_mmap_t *)enodev
#define nostrat (d_strategy_t *)enodev
#define nullopen (d_open_t *)nullop
#define nullclose (d_close_t *)nullop
#define nullstop (d_stop_t *)nullop
#define nullreset (d_reset_t *)nullop
/* open, close, read, write, ioctl, stop, reset, ttys, select, mmap, strat */
struct cdevsw cdevsw[] =
{
{ cnopen, cnclose, cnread, cnwrite, /*0*/
cnioctl, nullop, nullop, NULL, /* console */
cnselect, enodev, NULL },
{ cttyopen, nullop, cttyread, cttywrite, /*1*/
cttyioctl, nullop, nullop, NULL, /* tty */
cttyselect, enodev, NULL },
cnioctl, nullstop, nullreset, NULL, /* console */
cnselect, nommap, NULL },
{ cttyopen, nullclose, cttyread, cttywrite, /*1*/
cttyioctl, nullstop, nullreset, NULL, /* tty */
cttyselect, nommap, NULL },
{ mmopen, mmclose, mmrw, mmrw, /*2*/
enodev, nullop, nullop, NULL, /* memory */
noioc, nullstop, nullreset, NULL, /* memory */
mmselect, memmmap, NULL },
{ wdopen, wdclose, rawread, rawwrite, /*3*/
wdioctl, enodev, nullop, NULL, /* wd */
seltrue, enodev, wdstrategy },
{ nullop, nullop, rawread, rawwrite, /*4*/
enodev, enodev, nullop, NULL, /* swap */
enodev, enodev, swstrategy },
wdioctl, nostop, nullreset, NULL, /* wd */
seltrue, nommap, wdstrategy },
{ nullopen, nullclose, rawread, rawwrite, /*4*/
noioc, nostop, noreset, NULL, /* swap */
noselect, nommap, swstrategy },
{ ptsopen, ptsclose, ptsread, ptswrite, /*5*/
ptyioctl, ptsstop, nullop, pt_tty, /* ttyp */
ttselect, enodev, NULL },
ptyioctl, ptsstop, nullreset, pt_tty, /* ttyp */
ttselect, nommap, NULL },
{ ptcopen, ptcclose, ptcread, ptcwrite, /*6*/
ptyioctl, nullop, nullop, pt_tty, /* ptyp */
ptcselect, enodev, NULL },
{ logopen, logclose, logread, enodev, /*7*/
logioctl, enodev, nullop, NULL, /* klog */
logselect, enodev, NULL },
ptyioctl, nullstop, nullreset, pt_tty, /* ptyp */
ptcselect, nommap, NULL },
{ logopen, logclose, logread, nowrite, /*7*/
logioctl, nostop, nullreset, NULL, /* klog */
logselect, nommap, NULL },
{ comopen, comclose, comread, comwrite, /*8*/
comioctl, enodev, comreset, com_tty, /* com */
comselect, enodev, NULL },
comioctl, nostop, comreset, com_tty, /* com */
comselect, nommap, NULL },
{ Fdopen, fdclose, rawread, rawwrite, /*9*/
fdioctl, enodev, nullop, NULL, /* Fd (!=fd) */
seltrue, enodev, fdstrategy },
fdioctl, nostop, nullreset, NULL, /* Fd (!=fd) */
seltrue, nommap, fdstrategy },
{ wtopen, wtclose, rawread, rawwrite, /*10*/
wtioctl, enodev, nullop, NULL, /* wt */
seltrue, enodev, wtstrategy },
{ enodev, enodev, enodev, enodev, /*11*/
enodev, enodev, nullop, NULL,
seltrue, enodev, enodev },
wtioctl, nostop, nullreset, NULL, /* wt */
seltrue, nommap, wtstrategy },
{ noopen, noclose, noread, nowrite, /*11*/
noioc, nostop, nullreset, NULL,
seltrue, nommap, nostrat },
{ pcopen, pcclose, pcread, pcwrite, /*12*/
pcioctl, nullop, nullop, &pccons, /* pc */
pcioctl, nullstop, nullreset, &pccons, /* pc */
ttselect, pcmmap, NULL },
{ sdopen, sdclose, rawread, rawwrite, /*13*/
sdioctl, enodev, nullop, NULL, /* sd */
seltrue, enodev, sdstrategy },
sdioctl, nostop, nullreset, NULL, /* sd */
seltrue, nommap, sdstrategy },
{ stopen, stclose, rawread, rawwrite, /*14*/
stioctl, enodev, nullop, NULL, /* st */
seltrue, enodev, ststrategy },
{ cdopen, cdclose, rawread, enodev, /*15*/
cdioctl, enodev, nullop, NULL, /* cd */
seltrue, enodev, cdstrategy },
{ lptopen, lptclose, nullop, lptwrite, /*16*/
lptioctl, nullop, nullop, NULL, /* lpt */
seltrue, enodev, enodev},
{ chopen, chclose, enxio, enxio, /*17*/
chioctl, enxio, enxio, NULL, /* ch */
enxio, enxio, enxio },
{ suopen, suclose, enodev, enodev, /*18*/
suioctl, enodev, nullop, NULL, /* scsi 'generic' */
seltrue, enodev, enodev },
stioctl, nostop, nullreset, NULL, /* st */
seltrue, nommap, ststrategy },
{ cdopen, cdclose, rawread, nowrite, /*15*/
cdioctl, nostop, nullreset, NULL, /* cd */
seltrue, nommap, cdstrategy },
{ lptopen, lptclose, noread, lptwrite, /*16*/
lptioctl, nullstop, nullreset, NULL, /* lpt */
seltrue, nommap, nostrat},
{ chopen, chclose, noread, nowrite, /*17*/
chioctl, nostop, nullreset, NULL, /* ch */
noselect, nommap, nostrat },
{ suopen, suclose, noread, nowrite, /*18*/
suioctl, nostop, nullreset, NULL, /* scsi 'generic' */
seltrue, nommap, nostrat },
{ twopen, twclose, twread, twwrite, /*19*/
enodev, nullop, nullop, NULL, /* tw */
twselect, enodev, enodev },
noioc, nullstop, nullreset, NULL, /* tw */
twselect, nommap, nostrat },
{ sbopen, sbclose, sbread, sbwrite, /*20*/
sbioctl, enodev, enodev, NULL, /* soundblaster*/
sbselect, enodev, NULL },
{ psmopen, psmclose, psmread, nullop, /*21*/
psmioctl, enodev, nullop, NULL, /* psm mice */
psmselect, enodev, NULL },
{ fdopen, enxio, enxio, enxio, /*22*/
enxio, enxio, enxio, NULL, /* fd (!=Fd) */
enxio, enxio, enxio },
sbioctl, nostop, nullreset, NULL, /* soundblaster*/
sbselect, nommap, NULL },
{ psmopen, psmclose, psmread, nowrite, /*21*/
psmioctl, nostop, nullreset, NULL, /* psm mice */
psmselect, nommap, NULL },
{ fdopen, noclose, noread, nowrite, /*22*/
noioc, nostop, nullreset, NULL, /* fd (!=Fd) */
noselect, nommap, nostrat },
{ bpfopen, bpfclose, bpfread, bpfwrite, /*23*/
bpfioctl, enodev, nullop, NULL, /* bpf */
bpfselect, enodev, NULL },
{ dcfclkopen, dcfclkclose, dcfclkread, enodev, /*24*/
dcfclkioctl, enodev, nullop, NULL, /* dcfclk */
dcfclkselect, enodev, NULL },
{ lpaopen, lpaclose, nullop, lpawrite, /*25*/
lpaioctl, nullop, nullop, NULL, /* lpa */
seltrue, enodev, enodev},
{ spkropen, spkrclose, enxio, spkrwrite, /*26*/
spkrioctl, enxio, enxio, NULL, /* spkr */
enxio, enxio, enxio },
{ mseopen, mseclose, mseread, nullop, /*27*/
nullop, enodev, nullop, NULL, /* mse */
mseselect, enodev, NULL },
bpfioctl, nostop, nullreset, NULL, /* bpf */
bpfselect, nommap, NULL },
{ dcfclkopen, dcfclkclose, dcfclkread, nowrite, /*24*/
dcfclkioctl, nostop, nullreset, NULL, /* dcfclk */
dcfclkselect, nommap, NULL },
{ lpaopen, lpaclose, noread, lpawrite, /*25*/
lpaioctl, nullstop, nullreset, NULL, /* lpa */
seltrue, nommap, NULL },
{ spkropen, spkrclose, noread, spkrwrite, /*26*/
spkrioctl, nostop, nullreset, NULL, /* spkr */
seltrue, nommap, NULL },
{ mseopen, mseclose, mseread, nowrite, /*27*/
noioc, nostop, nullreset, NULL, /* mse */
mseselect, nommap, NULL },
{ sioopen, sioclose, sioread, siowrite, /*28*/
sioioctl, siostop, sioreset, sio_tty, /* sio */
sioselect, enodev, NULL },
{ mcdopen, mcdclose, rawread, enodev, /*29*/
mcdioctl, enodev, nullop, NULL, /* mitsumi cd */
seltrue, enodev, mcdstrategy },
sioselect, nommap, NULL },
{ mcdopen, mcdclose, rawread, nowrite, /*29*/
mcdioctl, nostop, nullreset, NULL, /* mitsumi cd */
seltrue, nommap, mcdstrategy },
{ sndopen, sndclose, sndread, sndwrite, /*30*/
sndioctl, enodev, enodev, NULL, /* sound driver */
sndselect, enodev, NULL },
{ ukopen, ukclose, enxio, enxio, /*31*/
ukioctl, enxio, enxio, NULL, /* unknown */
enxio, enxio, enxio }, /* scsi */
sndioctl, nostop, nullreset, NULL, /* sound driver */
sndselect, nommap, NULL },
{ ukopen, ukclose, noread, nowrite, /*31*/
ukioctl, nostop, nullreset, NULL, /* unknown */
seltrue, nommap, NULL }, /* scsi */
/*
* If you need a cdev major number, please contact the FreeBSD team
* by sending mail to `freebsd-hackers@freefall.cdrom.com'.

View File

@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* from: @(#)cons.c 7.2 (Berkeley) 5/9/91
* $Id: cons.c,v 1.4 1993/10/18 14:21:48 davidg Exp $
* $Id: cons.c,v 1.5 1993/11/07 17:41:32 wollman Exp $
*/
@ -73,6 +73,7 @@ struct tty *constty = 0; /* virtual console output device */
struct consdev *cn_tab; /* physical console device info */
struct tty *cn_tty; /* XXX: console tty struct for tprintf */
void
cninit()
{
register struct consdev *cp;
@ -99,6 +100,7 @@ cninit()
(*cp->cn_init)(cp);
}
int
cnopen(dev, flag, mode, p)
dev_t dev;
int flag, mode;
@ -110,6 +112,7 @@ cnopen(dev, flag, mode, p)
return ((*cdevsw[major(dev)].d_open)(dev, flag, mode, p));
}
int
cnclose(dev, flag, mode, p)
dev_t dev;
int flag, mode;
@ -121,9 +124,11 @@ cnclose(dev, flag, mode, p)
return ((*cdevsw[major(dev)].d_close)(dev, flag, mode, p));
}
int
cnread(dev, uio, flag)
dev_t dev;
struct uio *uio;
int flag;
{
if (cn_tab == NULL)
return (0);
@ -131,9 +136,11 @@ cnread(dev, uio, flag)
return ((*cdevsw[major(dev)].d_read)(dev, uio, flag));
}
int
cnwrite(dev, uio, flag)
dev_t dev;
struct uio *uio;
int flag;
{
if (cn_tab == NULL)
return (0);
@ -144,9 +151,12 @@ cnwrite(dev, uio, flag)
return ((*cdevsw[major(dev)].d_write)(dev, uio, flag));
}
int
cnioctl(dev, cmd, data, flag, p)
dev_t dev;
int cmd;
caddr_t data;
int flag;
struct proc *p;
{
int error;
@ -169,6 +179,7 @@ cnioctl(dev, cmd, data, flag, p)
}
/*ARGSUSED*/
int
cnselect(dev, rw, p)
dev_t dev;
int rw;
@ -179,6 +190,7 @@ cnselect(dev, rw, p)
return (ttselect(cn_tab->cn_dev, rw, p));
}
int
cngetc()
{
if (cn_tab == NULL)
@ -186,6 +198,7 @@ cngetc()
return ((*cn_tab->cn_getc)(cn_tab->cn_dev));
}
void
cnputc(c)
register int c;
{

View File

@ -23,7 +23,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
* $Id$
* $Id: db_disasm.c,v 1.3 1993/10/16 14:14:52 rgrimes Exp $
*/
/*
@ -1067,7 +1067,7 @@ db_disasm(loc, altfmt)
char * i_name;
int i_size;
int i_mode;
int regmodrm;
int regmodrm = 0;
boolean_t first;
int displ;
int prefix;

View File

@ -23,22 +23,23 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
* $Id: db_interface.c,v 1.2 1993/10/16 14:14:55 rgrimes Exp $
* $Id: db_interface.c,v 1.3 1993/11/07 17:41:34 wollman Exp $
*/
/*
* Interface to new debugger.
*/
#include "param.h"
#include "systm.h"
#include "proc.h"
#include <machine/db_machdep.h>
#include "ddb/ddb.h"
#include <sys/reboot.h>
#include <vm/vm_statistics.h>
#include <vm/pmap.h>
#include <setjmp.h>
#include <sys/systm.h> /* just for boothowto --eichin */
int db_active = 0;
db_regs_t ddb_regs;
@ -46,6 +47,7 @@ db_regs_t ddb_regs;
/*
* Received keyboard interrupt sequence.
*/
void
kdb_kbd_trap(regs)
struct i386_saved_state *regs;
{
@ -61,6 +63,7 @@ kdb_kbd_trap(regs)
static jmp_buf *db_nofault = 0;
int
kdb_trap(type, code, regs)
int type, code;
register struct i386_saved_state *regs;
@ -142,6 +145,7 @@ kdb_trap(type, code, regs)
/*
* Print trap reason.
*/
void
kdbprinttrap(type, code)
int type, code;
{
@ -229,8 +233,9 @@ db_write_bytes(addr, size, data)
}
}
void
Debugger (msg)
char *msg;
char *msg;
{
asm ("int $3");
}

View File

@ -32,7 +32,7 @@
*
* from tahoe: in_cksum.c 1.2 86/01/05
* from: @(#)in_cksum.c 1.3 (Berkeley) 1/19/91
* $Id$
* $Id: in_cksum.c,v 1.2 1993/10/16 14:15:00 rgrimes Exp $
*/
#include "param.h"
@ -59,6 +59,7 @@
#define ADD(n) asm("adcl " #n "(%2), %0": "=r"(sum): "0"(sum), "r"(w))
#define MOP asm("adcl $0, %0": "=r"(sum): "0"(sum))
int
in_cksum(m, len)
register struct mbuf *m;
register int len;

View File

@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* from: @(#)machdep.c 7.4 (Berkeley) 6/3/91
* $Id: machdep.c,v 1.17 1993/11/16 09:54:47 davidg Exp $
* $Id: machdep.c,v 1.18 1993/11/17 23:24:56 wollman Exp $
*/
#include "npx.h"
@ -89,6 +89,8 @@ static unsigned int avail_remaining;
#include "i386/isa/isa.h"
#include "i386/isa/rtc.h"
static void identifycpu(void);
static void initcpu(void);
#define EXPECT_BASEMEM 640 /* The expected base memory*/
#define INFORM_WAIT 1 /* Set to pause berfore crash in weird cases*/
@ -144,7 +146,7 @@ cpu_startup()
int maxbufs, base, residual;
extern long Usrptsize;
vm_offset_t minaddr, maxaddr;
vm_size_t size;
vm_size_t size = 0;
int firstaddr;
/*
@ -315,6 +317,7 @@ struct cpu_nameclass i386_cpus[] = {
{ "i586", CPUCLASS_586 }, /* CPU_586 */
};
static void
identifycpu() /* translated from hp300 -- cgd */
{
printf("CPU: ");
@ -505,6 +508,7 @@ struct sigreturn_args {
struct sigcontext *sigcntxp;
};
int
sigreturn(p, uap, retval)
struct proc *p;
struct sigreturn_args *uap;
@ -729,6 +733,7 @@ microtime(tvp)
}
#endif /* HZ */
void
physstrat(bp, strat, prio)
struct buf *bp;
int (*strat)(), prio;
@ -736,15 +741,6 @@ physstrat(bp, strat, prio)
register int s;
caddr_t baddr;
/*
* vmapbuf clobbers b_addr so we must remember it so that it
* can be restored after vunmapbuf. This is truely rude, we
* should really be storing this in a field in the buf struct
* but none are available and I didn't want to add one at
* this time. Note that b_addr for dirty page pushes is
* restored in vunmapbuf. (ugh!)
*/
baddr = bp->b_un.b_addr;
vmapbuf(bp);
(*strat)(bp);
/* pageout daemon doesn't wait for pushed pages */
@ -755,9 +751,9 @@ physstrat(bp, strat, prio)
tsleep((caddr_t)bp, prio, "physstr", 0);
splx(s);
vunmapbuf(bp);
bp->b_un.b_addr = baddr;
}
static void
initcpu()
{
}
@ -932,7 +928,13 @@ struct soft_segment_descriptor ldt_segs[] = {
1, /* default 32 vs 16 bit size */
1 /* limit granularity (byte/page units)*/ } };
setidt(idx, func, typ, dpl) char *func; {
void
setidt(idx, func, typ, dpl)
int idx;
caddr_t func;
int typ;
int dpl;
{
struct gate_descriptor *ip = idt + idx;
ip->gd_looffset = (int)func;
@ -958,7 +960,9 @@ extern IDTVEC(div), IDTVEC(dbg), IDTVEC(nmi), IDTVEC(bpt), IDTVEC(ofl),
int lcr0(), lcr3(), rcr0(), rcr2();
int _gsel_tss;
void
init386(first)
int first;
{
extern ssdtosd(), lgdt(), lidt(), lldt(), etext;
int x, *pi;
@ -1170,7 +1174,10 @@ extern caddr_t CADDR1, CADDR2;
* zero out physical memory
* specified in relocation units (NBPG bytes)
*/
clearseg(n) {
void
clearseg(n)
int n;
{
*(int *)CMAP2 = PG_V | PG_KW | ctob(n);
load_cr3(rcr3());
@ -1185,7 +1192,10 @@ clearseg(n) {
* specified in relocation units (NBPG bytes)
*/
void
copyseg(frm, n) {
copyseg(frm, n)
int frm;
int n;
{
*(int *)CMAP2 = PG_V | PG_KW | ctob(n);
load_cr3(rcr3());
@ -1197,7 +1207,10 @@ copyseg(frm, n) {
* specified in relocation units (NBPG bytes)
*/
void
physcopyseg(frm, to) {
physcopyseg(frm, to)
int frm;
int to;
{
*(int *)CMAP1 = PG_V | PG_KW | ctob(frm);
*(int *)CMAP2 = PG_V | PG_KW | ctob(to);
@ -1218,6 +1231,7 @@ setsoftclock() {
* insert an element into a queue
*/
#undef insque
void /* XXX replace with inline FIXME! */
_insque(element, head)
register struct prochd *element, *head;
{
@ -1231,6 +1245,7 @@ _insque(element, head)
* remove an element from a queue
*/
#undef remque
void /* XXX replace with inline FIXME! */
_remque(element)
register struct prochd *element;
{

View File

@ -6,7 +6,7 @@
* [expediant "port" of linux 8087 emulator to 386BSD, with apologies -wfj]
*
* from: 386BSD 0.1
* $Id$
* $Id: math_emulate.c,v 1.4 1993/10/16 14:15:04 rgrimes Exp $
*/
/*
@ -67,10 +67,11 @@ static temp_real_unaligned * __st(int i);
unsigned char get_fs_byte(char *adr) { return(fubyte(adr)); }
unsigned short get_fs_word(unsigned short *adr) { return(fuword(adr)); }
unsigned long get_fs_long(unsigned long *adr) { return(fuword(adr)); }
put_fs_byte(unsigned char val, char *adr) { (void)subyte(adr,val); }
put_fs_word(unsigned short val, short *adr) { (void)susword(adr,val); }
put_fs_long(unsigned long val, unsigned long *adr) { (void)suword(adr,val); }
void put_fs_byte(unsigned char val, char *adr) { (void)subyte(adr,val); }
void put_fs_word(unsigned short val, short *adr) { (void)susword(adr,val); }
void put_fs_long(u_long val, unsigned long *adr) { (void)suword(adr,val); }
int
math_emulate(struct trapframe * info)
{
unsigned short code;

View File

@ -38,7 +38,7 @@
*
* from: Utah $Hdr: mem.c 1.13 89/10/08$
* from: @(#)mem.c 7.2 (Berkeley) 5/9/91
* $Id: mem.c,v 1.3 1993/10/16 14:15:06 rgrimes Exp $
* $Id: mem.c,v 1.4 1993/11/22 09:46:45 davidg Exp $
*/
/*
@ -64,6 +64,7 @@
extern char *vmmap; /* poor name! */
/*ARGSUSED*/
int
mmclose(dev, uio, flags)
dev_t dev;
struct uio *uio;
@ -82,6 +83,7 @@ mmclose(dev, uio, flags)
return(0);
}
/*ARGSUSED*/
int
mmopen(dev, uio, flags)
dev_t dev;
struct uio *uio;
@ -100,6 +102,7 @@ mmopen(dev, uio, flags)
return(0);
}
/*ARGSUSED*/
int
mmrw(dev, uio, flags)
dev_t dev;
struct uio *uio;

View File

@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* from: @(#)pmap.c 7.7 (Berkeley) 5/12/91
* $Id: pmap.c,v 1.7 1993/10/15 10:34:25 rgrimes Exp $
* $Id: pmap.c,v 1.8 1993/11/13 02:25:03 davidg Exp $
*/
/*
@ -79,6 +79,7 @@
*/
#include "param.h"
#include "systm.h"
#include "proc.h"
#include "malloc.h"
#include "user.h"
@ -90,6 +91,9 @@
#include "i386/isa/isa.h"
static void i386_protection_init(void);
static void pmap_changebit(vm_offset_t, int, boolean_t);
/*
* Allocate various and sundry SYSMAPs used in the days of old VM
* and not yet converted. XXX.
@ -219,7 +223,6 @@ pmap_bootstrap(firstaddr, loadaddr)
vm_offset_t va;
struct pte *pte;
#endif
extern vm_offset_t maxmem, physmem;
extern int IdlePTD;
avail_start = firstaddr + 8 * NBPG;
@ -1313,6 +1316,7 @@ pmap_kernel()
* bzero to clear its contents, one machine dependent page
* at a time.
*/
void
pmap_zero_page(phys)
register vm_offset_t phys;
{
@ -1335,6 +1339,7 @@ pmap_zero_page(phys)
* bcopy to copy the page, one machine dependent page at a
* time.
*/
void
pmap_copy_page(src, dst)
register vm_offset_t src, dst;
{
@ -1367,6 +1372,7 @@ pmap_copy_page(src, dst)
* will specify that these pages are to be wired
* down (or not) as appropriate.
*/
void
pmap_pageable(pmap, sva, eva, pageable)
pmap_t pmap;
vm_offset_t sva, eva;
@ -1509,6 +1515,7 @@ pmap_phys_address(ppn)
* Miscellaneous support routines follow
*/
static void
i386_protection_init()
{
register int *kp, prot;
@ -1575,6 +1582,7 @@ pmap_testbit(pa, bit)
return(FALSE);
}
void
pmap_changebit(pa, bit, setem)
register vm_offset_t pa;
int bit;

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)trap.c 7.4 (Berkeley) 5/13/91
* $Id: trap.c,v 1.6 1993/11/04 15:05:41 davidg Exp $
* $Id: trap.c,v 1.7 1993/11/13 02:25:08 davidg Exp $
*/
/*
@ -128,6 +128,7 @@ char *trap_msg[] = {
*/
/*ARGSUSED*/
void
trap(frame)
struct trapframe frame;
{
@ -499,6 +500,7 @@ int trapwrite(addr)
* Like trap(), argument is call by reference.
*/
/*ARGSUSED*/
void
syscall(frame)
volatile struct syscframe frame;
{

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)clock.c 7.2 (Berkeley) 5/12/91
* $Id: clock.c,v 1.2 1993/10/16 13:45:44 rgrimes Exp $
* $Id: clock.c,v 1.3 1993/11/04 01:56:31 ache Exp $
*/
/*
@ -56,7 +56,11 @@
#define TIMER_FREQ 1193182 /* XXX - should be in isa.h */
#endif
startrtclock() {
static void findcpuspeed(void);
void
startrtclock()
{
int s;
findcpuspeed(); /* use the clock (while it's free)
@ -84,6 +88,7 @@ startrtclock() {
unsigned int delaycount; /* calibrated loop variable (1 millisecond) */
#define FIRST_GUESS 0x2000
static void
findcpuspeed()
{
unsigned char low;
@ -107,8 +112,9 @@ findcpuspeed()
/* convert 2 digit BCD number */
int
bcd(i)
int i;
int i;
{
return ((i/16)*10 + (i%16));
}
@ -157,6 +163,7 @@ int m,leap;
* Initialize the time of day register, based on the time base which is, e.g.
* from a filesystem.
*/
void
inittodr(base)
time_t base;
{
@ -217,6 +224,7 @@ test_inittodr(base)
/*
* Restart the clock.
*/
void
resettodr()
{
}
@ -226,7 +234,10 @@ resettodr()
*/
#define V(s) __CONCAT(V, s)
extern V(clk)();
enablertclock() {
void
enablertclock()
{
setidt(ICU_OFFSET+0, &V(clk), SDT_SYS386IGT, SEL_KPL);
INTREN(IRQ0);
}

View File

@ -37,7 +37,7 @@
*
* from: @(#)vm_machdep.c 7.3 (Berkeley) 5/13/91
* Utah $Hdr: vm_machdep.c 1.16.1.1 89/06/23$
* $Id$
* $Id: vm_machdep.c,v 1.6 1993/10/15 10:34:29 rgrimes Exp $
*/
#include "npx.h"
@ -62,6 +62,7 @@
* address in each process; in the future we will probably relocate
* the frame pointers on the stack after copying.
*/
int
cpu_fork(p1, p2)
register struct proc *p1, *p2;
{
@ -177,7 +178,10 @@ cpu_exit(p)
panic("cpu_exit");
}
cpu_wait(p) struct proc *p; {
void
cpu_wait(p)
struct proc *p;
{
/* drop per-process resources */
vmspace_free(p->p_vmspace);
@ -188,6 +192,7 @@ cpu_wait(p) struct proc *p; {
/*
* Set a red zone in the kernel stack after the u. area.
*/
void
setredzone(pte, vaddr)
u_short *pte;
caddr_t vaddr;
@ -207,6 +212,7 @@ setredzone(pte, vaddr)
* 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;
@ -230,6 +236,7 @@ pagemove(from, to, size)
/*
* Convert kernel VA to physical address
*/
int
kvtop(addr)
register caddr_t addr;
{
@ -351,6 +358,7 @@ extern vm_map_t phys_map;
* All requests are (re)mapped into kernel VA space via the useriomap
* (a name with only slightly more meaning than "kernelmap")
*/
void
vmapbuf(bp)
register struct buf *bp;
{
@ -385,6 +393,7 @@ vmapbuf(bp)
* Free the io map PTEs associated with this IO operation.
* We also invalidate the TLB entries and restore the original b_addr.
*/
void
vunmapbuf(bp)
register struct buf *bp;
{
@ -404,6 +413,7 @@ vunmapbuf(bp)
/*
* Force reset the processor by invalidating the entire address space!
*/
void /* XXX should be __dead too */
cpu_reset() {
/* force a shutdown by unmapping entire address space ! */
@ -412,4 +422,5 @@ cpu_reset() {
/* "good night, sweet prince .... <THUNK!>" */
tlbflush();
/* NOTREACHED */
while(1); /* to fool compiler... */
}

View File

@ -2,7 +2,7 @@
* Functions to provide access to special i386 instructions.
* XXX - bezillions more are defined in locore.s but are not declared anywhere.
*
* $Id: cpufunc.h,v 1.3 1993/10/16 14:39:08 rgrimes Exp $
* $Id: cpufunc.h,v 1.4 1993/11/07 17:42:47 wollman Exp $
*/
#ifndef _MACHINE_CPUFUNC_H_
@ -13,7 +13,7 @@
#ifdef __GNUC__
static __inline int bdb(void)
static inline int bdb(void)
{
extern int bdb_exists;
@ -23,13 +23,13 @@ static __inline int bdb(void)
return (1);
}
static __inline void
static inline void
disable_intr(void)
{
__asm __volatile("cli");
}
static __inline void
static inline void
enable_intr(void)
{
__asm __volatile("sti");
@ -41,7 +41,7 @@ enable_intr(void)
*/
#define inb(port) ((u_char) u_int_inb(port))
static __inline u_int
static inline u_int
u_int_inb(u_int port)
{
u_char data;
@ -54,7 +54,7 @@ u_int_inb(u_int port)
return data;
}
static __inline void
static inline void
outb(u_int port, u_char data)
{
register u_char al asm("ax");
@ -63,7 +63,8 @@ outb(u_int port, u_char data)
__asm __volatile("outb %0,%%dx" : : "a" (al), "d" (port));
}
static __inline__
static inline
int
imin(a, b)
int a, b;
{
@ -71,7 +72,8 @@ imin(a, b)
return (a < b ? a : b);
}
static __inline__
static inline
int
imax(a, b)
int a, b;
{
@ -79,7 +81,7 @@ imax(a, b)
return (a > b ? a : b);
}
static __inline__
static inline
unsigned int
min(a, b)
unsigned int a, b;
@ -88,7 +90,7 @@ min(a, b)
return (a < b ? a : b);
}
static __inline__
static inline
unsigned int
max(a, b)
unsigned int a, b;
@ -97,7 +99,7 @@ max(a, b)
return (a > b ? a : b);
}
static __inline__
static inline
long
lmin(a, b)
long a, b;
@ -106,7 +108,7 @@ lmin(a, b)
return (a < b ? a : b);
}
static __inline__
static inline
long
lmax(a, b)
long a, b;
@ -115,7 +117,7 @@ lmax(a, b)
return (a > b ? a : b);
}
static __inline__
static inline
unsigned long
ulmin(a, b)
unsigned long a, b;
@ -124,7 +126,7 @@ ulmin(a, b)
return (a < b ? a : b);
}
static __inline__
static inline
unsigned long
ulmax(a, b)
unsigned long a, b;
@ -133,7 +135,8 @@ ulmax(a, b)
return (a > b ? a : b);
}
static __inline__
static inline
int
ffs(mask)
register long mask;
{
@ -148,7 +151,8 @@ ffs(mask)
}
}
static __inline__
static inline
int
bcmp(v1, v2, len)
void *v1, *v2;
register unsigned len;
@ -161,10 +165,10 @@ bcmp(v1, v2, len)
return (0);
}
static __inline__
static inline
size_t
strlen(s1)
register __const__ char *s1;
register const char *s1;
{
register size_t len;

View File

@ -12,7 +12,7 @@
* on the understanding that TFS is not responsible for the correct
* functioning of this software in any circumstances.
*
* $Id: aha1542.c,v 2.8 93/10/24 12:55:08 julian Exp Locker: julian $
* $Id: aha1542.c,v 1.15 1993/11/18 05:02:12 rgrimes Exp $
*/
/*
@ -314,7 +314,7 @@ void aha_done();
int ahaattach();
int ahaintr();
int32 aha_scsi_cmd();
void aha_timeout();
void aha_timeout(caddr_t, int);
void ahaminphys();
u_int32 aha_adapter_info();
@ -388,6 +388,10 @@ main()
*/
int
aha_cmd(unit, icnt, ocnt, wait, retval, opcode, args)
int unit;
int icnt;
int ocnt;
int wait;
u_char *retval;
unsigned opcode;
u_char args;
@ -613,6 +617,7 @@ aha_adapter_info(unit)
*/
int
ahaintr(unit)
int unit;
{
struct aha_ccb *ccb;
unsigned char stat;
@ -696,10 +701,12 @@ ahaintr(unit)
*/
void
aha_free_ccb(unit, ccb, flags)
int unit;
struct aha_ccb *ccb;
int flags;
{
struct aha_data *aha = ahadata[unit];
unsigned int opri;
unsigned int opri = 0;
if (!(flags & SCSI_NOMASK))
opri = splbio();
@ -712,7 +719,7 @@ aha_free_ccb(unit, ccb, flags)
* one to come free, starting with queued entries
*/
if (!ccb->next) {
wakeup(&aha->aha_ccb_free);
wakeup((caddr_t)&aha->aha_ccb_free);
}
if (!(flags & SCSI_NOMASK))
splx(opri);
@ -723,9 +730,11 @@ aha_free_ccb(unit, ccb, flags)
*/
struct aha_ccb *
aha_get_ccb(unit, flags)
int unit;
int flags;
{
struct aha_data *aha = ahadata[unit];
unsigned opri;
unsigned opri = 0;
struct aha_ccb *rc;
if (!(flags & SCSI_NOMASK))
@ -1182,7 +1191,7 @@ aha_scsi_cmd(xs)
bcopy(xs->cmd, &ccb->scsi_cmd, ccb->scsi_cmd_length);
if (!(flags & SCSI_NOMASK)) {
s = splbio(); /* stop instant timeouts */
timeout(aha_timeout, ccb, (xs->timeout * hz) / 1000);
timeout(aha_timeout, (caddr_t)ccb, (xs->timeout * hz) / 1000);
aha_startmbx(ccb->mbx);
/*
* Usually return SUCCESSFULLY QUEUED
@ -1237,7 +1246,7 @@ aha_poll(unit, xs, ccb)
* clock is not running yet by taking out the
* clock queue entry it makes
*/
aha_timeout(ccb);
aha_timeout((caddr_t)ccb, 0);
/*
* because we are polling,
@ -1265,7 +1274,7 @@ aha_poll(unit, xs, ccb)
* Notice that this time there is no
* clock queue entry to remove
*/
aha_timeout(ccb);
aha_timeout((caddr_t)ccb, 0);
}
}
if (xs->error)
@ -1401,8 +1410,9 @@ aha_bus_speed_check(unit, speed)
#endif /*TUNE_1542*/
void
aha_timeout(struct aha_ccb * ccb)
aha_timeout(caddr_t arg1, int arg2)
{
struct aha_ccb * ccb = (struct aha_ccb *)arg1;
int unit;
int s = splbio();
struct aha_data *aha;
@ -1436,7 +1446,7 @@ aha_timeout(struct aha_ccb * ccb)
printf("\n");
aha_abortmbx(ccb->mbx);
/* 4 secs for the abort */
timeout(aha_timeout, ccb, 4 * hz);
timeout(aha_timeout, (caddr_t)ccb, 4 * hz);
ccb->flags = CCB_ABORTED;
} splx(s);
}

View File

@ -14,7 +14,7 @@
*
* commenced: Sun Sep 27 18:14:01 PDT 1992
*
* $Id: aha1742.c,v 2.4 93/10/24 12:47:00 julian Exp Locker: julian $
* $Id: aha1742.c,v 1.11 1993/11/18 05:02:15 rgrimes Exp $
*/
#include <sys/types.h>
@ -57,7 +57,7 @@ int Debugger();
#endif /* kernel */
#ifndef NetBSD
typedef void (*timeout_t) __P((caddr_t));
typedef timeout_func_t timeout_t;
#endif
typedef unsigned long int physaddr;
@ -279,7 +279,7 @@ int ahb_attach();
int ahb_init __P((int unit));
int ahbintr();
int32 ahb_scsi_cmd();
void ahb_timeout();
void ahb_timeout(caddr_t, int);
void ahb_done();
struct ecb *cheat;
void ahb_free_ecb();
@ -734,7 +734,7 @@ ahb_free_ecb(unit, ecb, flags)
int unit, flags;
struct ecb *ecb;
{
unsigned int opri;
unsigned int opri = 0;
struct ahb_data *ahb = ahbdata[unit];
if (!(flags & SCSI_NOMASK))
@ -765,7 +765,7 @@ ahb_get_ecb(unit, flags)
int unit, flags;
{
struct ahb_data *ahb = ahbdata[unit];
unsigned opri;
unsigned opri = 0;
struct ecb *ecbp;
int hashnum;
@ -998,7 +998,7 @@ ahb_scsi_cmd(xs)
if (!(flags & SCSI_NOMASK)) {
s = splbio();
ahb_send_immed(unit, xs->sc_link->target, AHB_TARG_RESET);
timeout((timeout_t)ahb_timeout, (caddr_t)ecb, (xs->timeout * hz) / 1000);
timeout(ahb_timeout, (caddr_t)ecb, (xs->timeout * hz) / 1000);
splx(s);
return (SUCCESSFULLY_QUEUED);
} else {
@ -1127,7 +1127,7 @@ ahb_scsi_cmd(xs)
if (!(flags & SCSI_NOMASK)) {
s = splbio();
ahb_send_mbox(unit, OP_START_ECB, xs->sc_link->target, ecb);
timeout((timeout_t)ahb_timeout, (caddr_t)ecb, (xs->timeout * hz) / 1000);
timeout(ahb_timeout, (caddr_t)ecb, (xs->timeout * hz) / 1000);
splx(s);
SC_DEBUG(xs->sc_link, SDEV_DB3, ("cmd_sent\n"));
return (SUCCESSFULLY_QUEUED);
@ -1157,8 +1157,9 @@ ahb_scsi_cmd(xs)
}
void
ahb_timeout(struct ecb * ecb)
ahb_timeout(caddr_t arg1, int arg2)
{
struct ecb * ecb = (struct ecb *)arg1;
int unit;
struct ahb_data *ahb;
int s = splbio();
@ -1203,7 +1204,7 @@ ahb_timeout(struct ecb * ecb)
printf("\n");
ahb_send_mbox(unit, OP_ABORT_ECB, ecb->xs->sc_link->target, ecb);
/* 2 secs for the abort */
timeout((timeout_t)ahb_timeout, (caddr_t)ecb, 2 * hz);
timeout(ahb_timeout, (caddr_t)ecb, 2 * hz);
ecb->flags = ECB_ABORTED;
}
splx(s);

View File

@ -12,7 +12,7 @@
* on the understanding that TFS is not responsible for the correct
* functioning of this software in any circumstances.
*
* $Id: bt742a.c,v 2.3 93/10/16 02:00:33 julian Exp Locker: julian $
* $Id: bt742a.c,v 1.10 1993/11/18 05:02:17 rgrimes Exp $
*/
/*
@ -188,7 +188,7 @@ struct bt_mbx {
#if defined(BIG_DMA)
WARNING...THIS WON'T WORK(won't fit on 1 page)
/* #define BT_NSEG 2048 /* Number of scatter gather segments - to much vm */
/* #define BT_NSEG 2048*/ /* Number of scatter gather segments - to much vm */
#define BT_NSEG 128
#else
#define BT_NSEG 33
@ -347,7 +347,7 @@ int btprobe();
int btattach();
int btintr();
int32 bt_scsi_cmd();
void bt_timeout();
void bt_timeout(caddr_t, int);
void bt_inquire_setup_information();
void bt_done();
void btminphys();
@ -417,6 +417,10 @@ main()
*/
int
bt_cmd(unit, icnt, ocnt, wait, retval, opcode, args)
int unit;
int icnt;
int ocnt;
int wait;
u_char *retval;
unsigned opcode;
u_char args;
@ -655,7 +659,7 @@ btintr(unit)
return 1;
}
outb(BT_CMD_DATA_PORT, 0x00); /* Disable */
wakeup(&bt->bt_mbx);
wakeup((caddr_t)&bt->bt_mbx);
outb(BT_CTRL_STAT_PORT, BT_IRST);
return 1;
}
@ -748,10 +752,12 @@ btintr(unit)
*/
void
bt_free_ccb(unit, ccb, flags)
int unit;
struct bt_ccb *ccb;
int flags;
{
struct bt_data *bt = btdata[unit];
unsigned int opri;
unsigned int opri = 0;
if (!(flags & SCSI_NOMASK))
opri = splbio();
@ -764,7 +770,7 @@ bt_free_ccb(unit, ccb, flags)
* starting with queued entries.
*/
if (!ccb->next) {
wakeup(&bt->bt_ccb_free);
wakeup((caddr_t)&bt->bt_ccb_free);
}
if (!(flags & SCSI_NOMASK))
@ -779,9 +785,11 @@ bt_free_ccb(unit, ccb, flags)
*/
struct bt_ccb *
bt_get_ccb(unit, flags)
int unit;
int flags;
{
struct bt_data *bt = btdata[unit];
unsigned opri;
unsigned opri = 0;
struct bt_ccb *ccbp;
struct bt_mbx *wmbx; /* Mail Box pointer specified unit */
BT_MBO *wmbo; /* Out Mail Box pointer */
@ -858,7 +866,7 @@ BT_MBO *
bt_send_mbo(int unit, int flags, int cmd, struct bt_ccb *ccb)
{
struct bt_data *bt = btdata[unit];
unsigned opri;
unsigned opri = 0;
BT_MBO *wmbo; /* Mail Box Out pointer */
struct bt_mbx *wmbx; /* Mail Box pointer specified unit */
int i, wait;
@ -1342,7 +1350,7 @@ bt_scsi_cmd(xs)
*/
SC_DEBUG(xs->sc_link, SDEV_DB3, ("cmd_sent\n"));
if (!(flags & SCSI_NOMASK)) {
timeout(bt_timeout, ccb, (xs->timeout * hz) / 1000);
timeout(bt_timeout, (caddr_t)ccb, (xs->timeout * hz) / 1000);
return (SUCCESSFULLY_QUEUED);
}
/*
@ -1387,7 +1395,7 @@ bt_poll(unit, xs, ccb)
* accounting for the fact that the clock is not running yet
* by taking out the clock queue entry it makes.
*/
bt_timeout(ccb);
bt_timeout((caddr_t)ccb, 0);
/*
* because we are polling, take out the timeout entry
@ -1414,7 +1422,7 @@ bt_poll(unit, xs, ccb)
* We timed out again... This is bad. Notice that
* this time there is no clock queue entry to remove.
*/
bt_timeout(ccb);
bt_timeout((caddr_t)ccb, 0);
}
}
if (xs->error)
@ -1423,8 +1431,9 @@ bt_poll(unit, xs, ccb)
}
void
bt_timeout(struct bt_ccb * ccb)
bt_timeout(caddr_t arg1, int arg2)
{
struct bt_ccb * ccb = (struct bt_ccb *)arg1;
int unit;
struct bt_data *bt;
int s = splbio();
@ -1467,7 +1476,7 @@ bt_timeout(struct bt_ccb * ccb)
bt_send_mbo(unit, ~SCSI_NOMASK,
BT_MBO_ABORT, ccb);
/* 2 secs for the abort */
timeout(bt_timeout, ccb, 2 * hz);
timeout(bt_timeout, (caddr_t)ccb, 2 * hz);
ccb->flags = CCB_ABORTED;
}
splx(s);

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)clock.c 7.2 (Berkeley) 5/12/91
* $Id: clock.c,v 1.2 1993/10/16 13:45:44 rgrimes Exp $
* $Id: clock.c,v 1.3 1993/11/04 01:56:31 ache Exp $
*/
/*
@ -56,7 +56,11 @@
#define TIMER_FREQ 1193182 /* XXX - should be in isa.h */
#endif
startrtclock() {
static void findcpuspeed(void);
void
startrtclock()
{
int s;
findcpuspeed(); /* use the clock (while it's free)
@ -84,6 +88,7 @@ startrtclock() {
unsigned int delaycount; /* calibrated loop variable (1 millisecond) */
#define FIRST_GUESS 0x2000
static void
findcpuspeed()
{
unsigned char low;
@ -107,8 +112,9 @@ findcpuspeed()
/* convert 2 digit BCD number */
int
bcd(i)
int i;
int i;
{
return ((i/16)*10 + (i%16));
}
@ -157,6 +163,7 @@ int m,leap;
* Initialize the time of day register, based on the time base which is, e.g.
* from a filesystem.
*/
void
inittodr(base)
time_t base;
{
@ -217,6 +224,7 @@ test_inittodr(base)
/*
* Restart the clock.
*/
void
resettodr()
{
}
@ -226,7 +234,10 @@ resettodr()
*/
#define V(s) __CONCAT(V, s)
extern V(clk)();
enablertclock() {
void
enablertclock()
{
setidt(ICU_OFFSET+0, &V(clk), SDT_SYS386IGT, SEL_KPL);
INTREN(IRQ0);
}

View File

@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* from: @(#)fd.c 7.4 (Berkeley) 5/25/91
* $Id: fd.c,v 1.5 1993/09/15 23:27:45 rgrimes Exp $
* $Id: fd.c,v 1.6 1993/09/23 15:22:57 rgrimes Exp $
*
*/
@ -45,6 +45,7 @@
#include "param.h"
#include "dkbad.h"
#include "systm.h"
#include "kernel.h"
#include "conf.h"
#include "file.h"
#include "ioctl.h"
@ -175,18 +176,20 @@ char *fdstates[] =
int fd_debug = 1;
#define TRACE0(arg) if(fd_debug) printf(arg)
#define TRACE1(arg1,arg2) if(fd_debug) printf(arg1,arg2)
#else DEBUG
#else /* DEBUG */
#define TRACE0(arg)
#define TRACE1(arg1,arg2)
#endif DEBUG
#endif /* DEBUG */
extern int hz;
/* state needed for current transfer */
static void fdstart(fdcu_t);
void fdintr(fdcu_t);
static void fd_turnoff(caddr_t, int);
/****************************************************************************/
/* autoconfiguration stuff */
/****************************************************************************/
int fdprobe(), fdattach(), fd_turnoff();
static int fdprobe(struct isa_device *);
static int fdattach(struct isa_device *);
struct isa_driver fddriver = {
fdprobe, fdattach, "fd",
@ -195,8 +198,9 @@ struct isa_driver fddriver = {
/*
* probe for existance of controller
*/
int
fdprobe(dev)
struct isa_device *dev;
struct isa_device *dev;
{
fdcu_t fdcu = dev->id_unit;
if(fdc_data[fdcu].flags & FDC_ATTACHED)
@ -220,8 +224,9 @@ struct isa_device *dev;
/*
* wire controller into system, look for floppy units
*/
int
fdattach(dev)
struct isa_device *dev;
struct isa_device *dev;
{
unsigned fdt,st0, cyl;
int hdr;
@ -285,17 +290,18 @@ struct isa_device *dev;
}
fdt <<= 4;
fd_turnoff(fdu);
fd_turnoff((caddr_t)fdu, 0);
hdr = 1;
}
/* Set transfer to 500kbps */
outb(fdc->baseport+fdctl,0); /*XXX*/
return 1;
}
int
fdsize(dev)
dev_t dev;
dev_t dev;
{
return(0);
}
@ -303,8 +309,7 @@ dev_t dev;
/****************************************************************************/
/* fdstrategy */
/****************************************************************************/
fdstrategy(bp)
register struct buf *bp; /* IO operation to perform */
void fdstrategy(struct buf *bp)
{
register struct buf *dp,*dp0,*dp1;
long nblocks,blknum;
@ -359,6 +364,7 @@ fdstrategy(bp)
/* motor control stuff */
/* remember to not deselect the drive we're working on */
/****************************************************************************/
void
set_motor(fdcu, fdu, reset)
fdcu_t fdcu;
fdu_t fdu;
@ -389,9 +395,10 @@ set_motor(fdcu, fdu, reset)
| (m1 ? FDO_MOEN1 : 0)));
}
fd_turnoff(fdu)
fdu_t fdu;
static void
fd_turnoff(caddr_t arg1, int arg2)
{
fdu_t fdu = (fdu_t)arg1;
int s;
fd_p fd = fd_data + fdu;
@ -401,9 +408,10 @@ fd_turnoff(fdu)
splx(s);
}
fd_motor_on(fdu)
fdu_t fdu;
void
fd_motor_on(caddr_t arg1, int arg2)
{
fdu_t fdu = (fdu_t)arg1;
int s;
fd_p fd = fd_data + fdu;
@ -416,6 +424,9 @@ fd_motor_on(fdu)
splx(s);
}
static void fd_turnon1(fdu_t);
void
fd_turnon(fdu)
fdu_t fdu;
{
@ -424,12 +435,12 @@ fd_turnon(fdu)
{
fd_turnon1(fdu);
fd->flags |= FD_MOTOR_WAIT;
timeout(fd_motor_on,fdu,hz); /* in 1 sec its ok */
timeout(fd_motor_on, (caddr_t)fdu, hz); /* in 1 sec its ok */
}
}
fd_turnon1(fdu)
fdu_t fdu;
static void
fd_turnon1(fdu_t fdu)
{
fd_p fd = fd_data + fdu;
fd->flags |= FD_MOTOR;
@ -459,6 +470,7 @@ in_fdc(fdcu)
#endif
}
int
out_fdc(fdcu, x)
fdcu_t fdcu;
int x;
@ -485,6 +497,7 @@ out_fdc(fdcu, x)
/****************************************************************************/
/* fdopen/fdclose */
/****************************************************************************/
int
Fdopen(dev, flags)
dev_t dev;
int flags;
@ -501,8 +514,10 @@ Fdopen(dev, flags)
return 0;
}
int
fdclose(dev, flags)
dev_t dev;
int flags;
{
fdu_t fdu = FDUNIT(minor(dev));
fd_data[fdu].flags &= ~FD_OPEN;
@ -519,6 +534,7 @@ fdclose(dev, flags)
* If the controller is already busy, we need do nothing, as it *
* will pick up our work when the present work completes *
\***************************************************************/
static void
fdstart(fdcu)
fdcu_t fdcu;
{
@ -534,9 +550,10 @@ fdstart(fdcu)
splx(s);
}
fd_timeout(fdcu)
fdcu_t fdcu;
static void
fd_timeout(caddr_t arg1, int arg2)
{
fdcu_t fdcu = (fdcu_t)arg1;
fdu_t fdu = fdc_data[fdcu].fdu;
int st0, st3, cyl;
struct buf *dp,*bp;
@ -580,9 +597,10 @@ fd_timeout(fdcu)
}
/* just ensure it has the right spl */
fd_pseudointr(fdcu)
fdcu_t fdcu;
static void
fd_pseudointr(caddr_t arg1, int arg2)
{
fdcu_t fdcu = (fdcu_t)arg1;
int s;
s = splbio();
fdintr(fdcu);
@ -594,22 +612,24 @@ fd_pseudointr(fdcu)
* keep calling the state machine until it returns a 0 *
* ALWAYS called at SPLBIO *
\***********************************************************************/
fdintr(fdcu)
fdcu_t fdcu;
void
fdintr(fdcu_t fdcu)
{
fdc_p fdc = fdc_data + fdcu;
while(fdstate(fdcu, fdc));
while(fdstate(fdcu, fdc))
;
}
/***********************************************************************\
* The controller state machine. *
* if it returns a non zero value, it should be called again immediatly *
\***********************************************************************/
int fdstate(fdcu, fdc)
int
fdstate(fdcu, fdc)
fdcu_t fdcu;
fdc_p fdc;
{
int read,head,trac,sec,i,s,sectrac,cyl,st0;
int read, head, trac, sec = 0, i = 0, s, sectrac, cyl, st0;
unsigned long blknum;
fdu_t fdu = fdc->fdu;
fd_p fd;
@ -645,7 +665,7 @@ int fdstate(fdcu, fdc)
TRACE1("[%s]",fdstates[fdc->state]);
TRACE1("(0x%x)",fd->flags);
untimeout(fd_turnoff, fdu);
timeout(fd_turnoff,fdu,4 * hz);
timeout(fd_turnoff, (caddr_t)fdu, 4 * hz);
switch (fdc->state)
{
case DEVIDLE:
@ -689,12 +709,12 @@ int fdstate(fdcu, fdc)
out_fdc(fdcu,bp->b_cylin * fd->ft->steptrac);
fd->track = -2;
fdc->state = SEEKWAIT;
timeout(fd_timeout,fdcu,2 * hz);
timeout(fd_timeout, (caddr_t)fdcu, 2 * hz);
return(0); /* will return later */
case SEEKWAIT:
untimeout(fd_timeout,fdcu);
/* allow heads to settle */
timeout(fd_pseudointr,fdcu,hz/50);
timeout(fd_pseudointr, (caddr_t)fdcu, hz / 50);
fdc->state = SEEKCOMPLETE;
return(0); /* will return later */
break;
@ -743,7 +763,7 @@ int fdstate(fdcu, fdc)
out_fdc(fdcu,fd->ft->gap); /* gap size */
out_fdc(fdcu,fd->ft->datalen); /* data length */
fdc->state = IOCOMPLETE;
timeout(fd_timeout,fdcu,2 * hz);
timeout(fd_timeout, (caddr_t)fdcu, 2 * hz);
return(0); /* will return later */
case IOCOMPLETE: /* IO DONE, post-analyze */
untimeout(fd_timeout,fdcu);
@ -800,7 +820,7 @@ int fdstate(fdcu, fdc)
return(0); /* will return later */
case RECALWAIT:
/* allow heads to settle */
timeout(fd_pseudointr,fdcu,hz/30);
timeout(fd_pseudointr, (caddr_t)fdcu, hz / 30);
fdc->state = RECALCOMPLETE;
return(0); /* will return later */
case RECALCOMPLETE:
@ -848,6 +868,7 @@ int fdstate(fdcu, fdc)
return(1); /* Come back immediatly to new state */
}
int
retrier(fdcu)
fdcu_t fdcu;
{

View File

@ -36,7 +36,7 @@
*
* @(#)icu.s 7.2 (Berkeley) 5/21/91
*
* $Id: icu.s,v 1.3 1993/09/06 16:12:03 rgrimes Exp $
* $Id: icu.s,v 1.4 1993/11/13 02:25:21 davidg Exp $
*/
/*
@ -191,7 +191,9 @@ none_to_unpend:
testl $~((1 << NETISR_SCLK) | (1 << NETISR_AST)),%eax
je test_ASTs # no net stuff, just temporary AST's
FASTSPL_VARMASK(_netmask)
#if 0
DONET(NETISR_RAW, _rawintr, 5)
#endif
#ifdef INET
DONET(NETISR_IP, _ipintr, 6)
@ -280,7 +282,9 @@ in_spl0:
/*
* XXX - what about other net intrs?
*/
#if 0
DONET(NETISR_RAW, _rawintr, 21)
#endif
#ifdef INET
DONET(NETISR_IP, _ipintr, 22)

View File

@ -20,7 +20,7 @@
*/
/*
* $Id: if_ed.c,v 2.14 1993/11/22 10:55:30 davidg Exp davidg $
* $Id: if_ed.c,v 1.23 1993/11/22 11:08:14 davidg Exp $
*/
/*
@ -185,10 +185,16 @@ struct ed_softc {
u_char next_packet; /* pointer to next unread RX packet */
} ed_softc[NED];
int ed_attach(), ed_init(), edintr(), ed_ioctl(), ed_probe(),
ed_start(), ed_reset(), ed_watchdog();
static void ed_stop();
int ed_attach(struct isa_device *);
void ed_init(int);
void edintr(int);
int ed_ioctl(struct ifnet *, int, caddr_t);
int ed_probe(struct isa_device *);
void ed_start(struct ifnet *);
void ed_reset(int, int);
void ed_watchdog(int);
static void ed_get_packet(struct ed_softc *, char *, int /*u_short*/);
static void ed_stop(int);
static inline void ed_rint();
static inline void ed_xmit();
@ -1113,15 +1119,16 @@ ed_attach(isa_dev)
#if NBPFILTER > 0
bpfattach(&sc->bpf, ifp, DLT_EN10MB, sizeof(struct ether_header));
#endif
return 1;
}
/*
* Reset interface.
*/
int
ed_reset(unit)
void
ed_reset(unit, uban)
int unit;
int uban; /* XXX */
{
int s;
@ -1167,7 +1174,7 @@ ed_stop(unit)
* Device timeout/watchdog routine. Entered if the device neglects to
* generate an interrupt after a transmit has been started on it.
*/
int
void
ed_watchdog(unit)
int unit;
{
@ -1176,12 +1183,13 @@ ed_watchdog(unit)
log(LOG_ERR, "ed%d: device timeout\n", unit);
++sc->arpcom.ac_if.if_oerrors;
ed_reset(unit);
ed_reset(unit, 0);
}
/*
* Initialize device.
*/
void
ed_init(unit)
int unit;
{
@ -1410,7 +1418,7 @@ static inline void ed_xmit(ifp)
* 2) that the IFF_OACTIVE flag is checked before this code is called
* (i.e. that the output part of the interface is idle)
*/
int
void
ed_start(ifp)
struct ifnet *ifp;
{
@ -1666,7 +1674,7 @@ ed_rint(unit)
"ed%d: NIC memory corrupt - invalid packet length %d\n",
unit, len);
++sc->arpcom.ac_if.if_ierrors;
ed_reset(unit);
ed_reset(unit, 0);
return;
}
@ -1708,7 +1716,7 @@ ed_rint(unit)
/*
* Ethernet interface interrupt processor
*/
int
void
edintr(unit)
int unit;
{
@ -1831,7 +1839,7 @@ edintr(unit)
/*
* Stop/reset/re-init NIC
*/
ed_reset(unit);
ed_reset(unit, 0);
} else {
/*
@ -2054,13 +2062,14 @@ ed_ioctl(ifp, command, data)
* Retreive packet from shared memory and send to the next level up via
* ether_input(). If there is a BPF listener, give a copy to BPF, too.
*/
static void
ed_get_packet(sc, buf, len)
struct ed_softc *sc;
char *buf;
u_short len;
{
struct ether_header *eh;
struct mbuf *m, *head, *ed_ring_to_mbuf();
struct mbuf *m, *head = 0, *ed_ring_to_mbuf();
u_short off;
int resid;
u_short etype;
@ -2381,7 +2390,7 @@ ed_pio_write_mbufs(sc,m,dst)
if (!maxwait) {
log(LOG_WARNING, "ed%d: remote transmit DMA failed to complete\n",
sc->arpcom.ac_if.if_unit);
ed_reset(sc->arpcom.ac_if.if_unit);
ed_reset(sc->arpcom.ac_if.if_unit, 0);
}
return(len);

View File

@ -39,7 +39,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id$
* $Id: if_ie.c,v 1.1 1993/10/12 06:52:31 rgrimes Exp $
*/
/*
@ -106,7 +106,6 @@ iomem, and to make 16-pointers, we subtract iomem and and with 0xffff.
#include "param.h"
#include "systm.h"
#include "mbuf.h"
#include "buf.h"
#include "protosw.h"
#include "socket.h"
#include "ioctl.h"
@ -135,7 +134,6 @@ iomem, and to make 16-pointers, we subtract iomem and and with 0xffff.
#endif
#include "i386/isa/isa.h"
/*#include "machine/cpufunc.h"*/
#include "i386/isa/isa_device.h"
#include "i386/isa/ic/i82586.h"
#include "i386/isa/if_iereg.h"
@ -171,14 +169,14 @@ int ie_debug = IED_RNR;
/* Forward declaration */
struct ie_softc;
int ieprobe(struct isa_device *dvp);
int ieattach(struct isa_device *dvp);
int ieinit(int unit);
int ieioctl(struct ifnet *ifp, int command, void *data);
int iestart(struct ifnet *ifp);
static int ieprobe(struct isa_device *dvp);
static int ieattach(struct isa_device *dvp);
static void ieinit(int unit);
static int ieioctl(struct ifnet *ifp, int command, caddr_t data);
static void iestart(struct ifnet *ifp);
static void sl_reset_586(int unit);
static void sl_chan_attn(int unit);
int iereset(int unit, int dummy);
static void iereset(int unit, int dummy);
static void ie_readframe(int unit, struct ie_softc *ie, int bufno);
static void ie_drop_packet_buffer(int unit, struct ie_softc *ie);
static void sl_read_ether(int unit, unsigned char addr[6]);
@ -407,7 +405,7 @@ ieattach(dvp)
while(ifa && ifa->ifa_addr && ifa->ifa_addr->sa_family != AF_LINK)
ifa = ifa->ifa_next;
if(!ifa || !ifa->ifa_addr) return;
if(!ifa || !ifa->ifa_addr) return 1;
/* Provide our ether address to the higher layers */
sdl = (struct sockaddr_dl *)ifa->ifa_addr;
@ -415,6 +413,7 @@ ieattach(dvp)
sdl->sdl_alen = 6;
sdl->sdl_slen = 0;
bcopy(ie->arpcom.ac_enaddr, LLADDR(sdl), 6);
return 1;
}
}
@ -1075,8 +1074,9 @@ static void ie_drop_packet_buffer(int unit, struct ie_softc *ie) {
/*
* Start transmission on an interface.
*/
int iestart(ifp)
struct ifnet *ifp;
static void
iestart(ifp)
struct ifnet *ifp;
{
struct ie_softc *ie = &ie_softc[ifp->if_unit];
struct mbuf *m0, *m;
@ -1086,9 +1086,9 @@ int iestart(ifp)
volatile u_short *bptr = &ie->scb->ie_command_list;
if(!(ifp->if_flags & IFF_RUNNING))
return 0;
return;
if(ifp->if_flags & IFF_OACTIVE)
return 0;
return;
do {
IF_DEQUEUE(&ie->arpcom.ac_if.if_snd, m);
@ -1147,7 +1147,7 @@ int iestart(ifp)
ifp->if_flags |= IFF_OACTIVE;
}
return 0;
return;
}
/*
@ -1281,14 +1281,15 @@ void sl_read_ether(unit, addr)
}
int iereset(unit, dummy)
int unit, dummy;
static void
iereset(unit, dummy)
int unit, dummy;
{
int s = splimp();
if(unit >= NIE) {
splx(s);
return -1;
return;
}
printf("ie%d: reset\n", unit);
@ -1313,17 +1314,18 @@ int iereset(unit, dummy)
ieioctl(&ie_softc[unit].arpcom.ac_if, SIOCSIFFLAGS, 0);
splx(s);
return 0;
return;
}
/*
* This is called if we time out.
*/
static int chan_attn_timeout(rock)
caddr_t rock;
static void
chan_attn_timeout(rock, arg2)
caddr_t rock;
int arg2;
{
*(int *)rock = 1;
return 0;
}
/*
@ -1545,7 +1547,8 @@ static int mc_setup(int unit, caddr_t ptr,
*
* THIS ROUTINE MUST BE CALLED AT splimp() OR HIGHER.
*/
int ieinit(unit)
static void
ieinit(unit)
int unit;
{
struct ie_softc *ie = &ie_softc[unit];
@ -1570,7 +1573,7 @@ int ieinit(unit)
if(command_and_wait(unit, IE_CU_START, cmd, IE_STAT_COMPL)
|| !(cmd->com.ie_cmd_status & IE_STAT_OK)) {
printf("ie%d: configure command failed\n", unit);
return 0;
return;
}
}
/*
@ -1590,7 +1593,7 @@ int ieinit(unit)
if(command_and_wait(unit, IE_CU_START, cmd, IE_STAT_COMPL)
|| !(cmd->com.ie_cmd_status & IE_STAT_OK)) {
printf("ie%d: individual address setup command failed\n", unit);
return 0;
return;
}
}
@ -1645,7 +1648,7 @@ int ieinit(unit)
ie->arpcom.ac_if.if_flags |= IFF_RUNNING; /* tell higher levels that we are here */
start_receiver(unit);
return 0;
return;
}
static void ie_stop(unit)
@ -1654,10 +1657,11 @@ static void ie_stop(unit)
command_and_wait(unit, IE_RU_DISABLE, 0, 0);
}
int ieioctl(ifp, command, data)
struct ifnet *ifp;
int command;
void *data;
static int
ieioctl(ifp, command, data)
struct ifnet *ifp;
int command;
caddr_t data;
{
struct ifaddr *ifa = (struct ifaddr *)data;
struct ie_softc *ie = &ie_softc[ifp->if_unit];

View File

@ -93,8 +93,13 @@ struct is_softc {
int is_debug;
/* Function prototypes */
int is_probe(),is_attach(),is_watchdog();
int is_ioctl(),is_init(),is_start();
static int is_probe(struct isa_device *);
static int is_attach(struct isa_device *);
static void is_watchdog(int);
static int is_ioctl(struct ifnet *, int, caddr_t);
static void is_init(int);
static void is_start(struct ifnet *);
static void istint(int);
static inline void is_rint(int unit);
static inline void isread(struct is_softc*, unsigned char*, int);
@ -107,6 +112,7 @@ struct isa_driver isdriver = {
"is"
};
void
iswrcsr(unit,port,val)
int unit;
u_short port;
@ -130,6 +136,7 @@ u_short isrdcsr(unit,port)
return(inw(iobase+RDP));
}
int
is_probe(isa_dev)
struct isa_device *isa_dev;
{
@ -163,8 +170,8 @@ is_probe(isa_dev)
/*
* Reset of interface.
*/
int
is_reset(int unit)
static void
is_reset(int unit, int uban)
{
int s;
struct is_softc *is = &is_softc[unit];
@ -271,18 +278,20 @@ is_attach(isa_dev)
#if NBPFILTER > 0
bpfattach(&is->bpf, ifp, DLT_EN10MB, sizeof(struct ether_header));
#endif
return 1;
}
int
static void
is_watchdog(unit)
int unit;
{
log(LOG_ERR, "is%d: device timeout\n", unit);
is_reset(unit);
is_reset(unit, 0);
}
/* Lance initialisation block set up */
void
init_mem(unit)
int unit;
{
@ -353,6 +362,7 @@ init_mem(unit)
* and transmit/receive descriptor rings.
*/
static void
is_init(unit)
int unit;
{
@ -413,6 +423,7 @@ is_init(unit)
* and map it to the interface before starting the output.
* called only at splimp or interrupt level.
*/
static void
is_start(ifp)
struct ifnet *ifp;
{
@ -541,14 +552,15 @@ is_start(ifp)
if (is_debug)
printf("no_td = %x, last_td = %x\n",is->no_td, is->last_td);
#endif
return(0);
}
/*
* Controller interrupt.
*/
void
isintr(unit)
int unit;
{
register struct is_softc *is = &is_softc[unit];
u_short isr;
@ -574,14 +586,14 @@ isintr(unit)
if (!(isr&RXON)) {
printf("is%d: !(isr&RXON)\n", unit);
is->arpcom.ac_if.if_ierrors++;
is_reset(unit);
return(1);
is_reset(unit, 0);
return;
}
if (!(isr&TXON)) {
printf("is%d: !(isr&TXON)\n", unit);
is->arpcom.ac_if.if_oerrors++;
is_reset(unit);
return(1);
is_reset(unit, 0);
return;
}
if (isr&RINT) {
@ -598,6 +610,7 @@ isintr(unit)
}
}
static void
istint(unit)
int unit;
{
@ -669,7 +682,7 @@ static inline void is_rint(int unit)
is->last_rd = rmd;
printf("is%d: Chained buffer\n",unit);
if ((cdm->flags & (OWN|ERR|STP|ENP)) != ENP) {
is_reset(unit);
is_reset(unit, 0);
return;
}
}else
@ -851,6 +864,7 @@ isget(buf, totlen, off0, ifp)
/*
* Process an ioctl request.
*/
int
is_ioctl(ifp, cmd, data)
register struct ifnet *ifp;
int cmd;

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)isa.c 7.2 (Berkeley) 5/13/91
* $Id: isa.c,v 1.8 1993/11/14 23:53:32 ache Exp $
* $Id: isa.c,v 1.9 1993/11/17 00:21:03 ache Exp $
*/
/*
@ -48,7 +48,8 @@
*/
#include "param.h"
#include "systm.h"
#include "systm.h" /* isn't it a joy */
#include "kernel.h" /* to have three of these */
#include "conf.h"
#include "file.h"
#include "buf.h"
@ -80,7 +81,7 @@
#define DMA2_MODE (IO_DMA2 + 2*11) /* mode register */
#define DMA2_FFC (IO_DMA2 + 2*12) /* clear first/last FF */
int config_isadev __P((struct isa_device *, u_int *));
void config_isadev __P((struct isa_device *, u_int *));
/*
* print a conflict message
@ -250,6 +251,7 @@ isa_configure() {
/*
* Configure an ISA device.
*/
void
config_isadev(isdp, mp)
struct isa_device *isdp;
u_int *mp;
@ -338,7 +340,9 @@ extern IDTVEC(intrdefault);
* Fill in default interrupt table (in case of spuruious interrupt
* during configuration of kernel, setup interrupt control unit
*/
isa_defaultirq() {
void
isa_defaultirq()
{
int i;
/* icu vectors */
@ -505,6 +509,7 @@ void isa_dmadone(int flags, caddr_t addr, int nbytes, int chan)
* Return true if special handling needed.
*/
int
isa_dmarangecheck(caddr_t va, unsigned length, unsigned chan) {
vm_offset_t phys, priorpage = 0, endva;
u_int dma_pgmsk = (chan & 4) ? ~(128*1024-1) : ~(64*1024-1);
@ -548,7 +553,7 @@ isa_allocphysmem(caddr_t va, unsigned length, void (*func)()) {
isaphysmemunblock = func;
while (isaphysmemflag & B_BUSY) {
isaphysmemflag |= B_WANTED;
tsleep(&isaphysmemflag, PRIBIO, "isaphys", 0);
tsleep((caddr_t)&isaphysmemflag, PRIBIO, "isaphys", 0);
}
isaphysmemflag |= B_BUSY;
@ -565,7 +570,7 @@ isa_freephysmem(caddr_t va, unsigned length) {
isaphysmemflag &= ~B_BUSY;
if (isaphysmemflag & B_WANTED) {
isaphysmemflag &= B_WANTED;
wakeup(&isaphysmemflag);
wakeup((caddr_t)&isaphysmemflag);
if (isaphysmemunblock)
(*isaphysmemunblock)();
}
@ -575,7 +580,10 @@ isa_freephysmem(caddr_t va, unsigned length) {
* Handle a NMI, possibly a machine check.
* return true to panic system, false to ignore.
*/
isa_nmi(cd) {
int
isa_nmi(cd)
int cd;
{
log(LOG_CRIT, "\nNMI port 61 %x, port 70 %x\n", inb(0x61), inb(0x70));
return(0);
@ -584,7 +592,10 @@ isa_nmi(cd) {
/*
* Caught a stray interrupt, notify
*/
isa_strayintr(d) {
void
isa_strayintr(d)
int d;
{
/* DON'T BOTHER FOR NOW! */
/* for some reason, we get bursts of intr #7, even if not enabled! */
@ -616,9 +627,8 @@ isa_strayintr(d) {
#define CF (1 * TIMER_FREQ)
#define TIMER_FREQ 1193182 /* XXX - should be elsewhere */
extern int hz; /* XXX - should be elsewhere */
int DELAY(n)
void
DELAY(n)
int n;
{
int counter_limit;
@ -683,7 +693,11 @@ int DELAY(n)
#endif
}
getit(unit, timer) {
int
getit(unit, timer)
int unit;
int timer;
{
int high;
int low;
@ -710,19 +724,23 @@ getit(unit, timer) {
return ((high << 8) | low);
}
static beeping;
static
sysbeepstop(f)
static int beeping;
static void
sysbeepstop(f, dummy)
caddr_t f;
int dummy;
{
/* disable counter 2 */
outb(0x61, inb(0x61) & 0xFC);
if (f)
timeout(sysbeepstop, 0, f);
timeout(sysbeepstop, (caddr_t)0, (int)f);
else
beeping = 0;
}
void sysbeep(int pitch, int period)
void
sysbeep(int pitch, int period)
{
outb(0x61, inb(0x61) | 3); /* enable counter 2 */
@ -739,14 +757,17 @@ void sysbeep(int pitch, int period)
if (!beeping) {
beeping = period;
timeout(sysbeepstop, period/2, period);
timeout(sysbeepstop, (caddr_t)(period/2), period);
}
}
/*
* Pass command to keyboard controller (8042)
*/
unsigned kbc_8042cmd(val) {
unsigned
kbc_8042cmd(val)
int val;
{
while (inb(KBSTATP)&KBS_IBF);
if (val) outb(KBCMDP, val);

View File

@ -46,7 +46,7 @@
* SUCH DAMAGE.
*
* from: unknown origin, 386BSD 0.1
* $Id$
* $Id: lpt.c,v 1.5 1993/10/16 13:46:10 rgrimes Exp $
*/
/*
@ -77,7 +77,7 @@
#define BUFSIZE 1024
#ifndef DEBUG
#define lprintf
#define lprintf (void)
#else
#define lprintf if (lptflag) printf
int lptflag = 1;
@ -281,7 +281,8 @@ lprintf ("status %x\n", inb(port+lpt_status) );
}
/* wait 1/4 second, give up if we get a signal */
if (tsleep (sc, LPPRI|PCATCH, "lptinit", hz/4) != EWOULDBLOCK) {
if (tsleep ((caddr_t)sc, LPPRI|PCATCH, "lptinit",
hz/4) != EWOULDBLOCK) {
sc->sc_state = 0;
splx(s);
return (EBUSY);
@ -303,7 +304,7 @@ lprintf ("status %x\n", inb(port+lpt_status) );
sc->sc_inbuf = geteblk(BUFSIZE);
sc->sc_xfercnt = 0;
splx(s);
timeout (lptout, sc, hz/2);
timeout (lptout, (caddr_t)sc, hz/2);
lprintf("opened.\n");
return(0);
}
@ -315,7 +316,7 @@ lptout (sc)
lprintf ("T %x ", inb(sc->sc_port+lpt_status));
if (sc->sc_state&OPEN)
timeout (lptout, sc, hz/2);
timeout (lptout, (caddr_t)sc, hz/2);
else sc->sc_state &= ~TOUT;
if (sc->sc_state & ERROR)
@ -350,7 +351,8 @@ lptclose(dev, flag)
while ((inb(port+lpt_status) & (LPS_SEL|LPS_OUT|LPS_NBSY|LPS_NERR)) !=
(LPS_SEL|LPS_NBSY|LPS_NERR) || sc->sc_xfercnt)
/* wait 1/4 second, give up if we get a signal */
if (tsleep (sc, LPPRI|PCATCH, "lpclose", hz) != EWOULDBLOCK)
if (tsleep ((caddr_t)sc, LPPRI|PCATCH,
"lpclose", hz) != EWOULDBLOCK)
break;
sc->sc_state = 0;
@ -388,7 +390,8 @@ lprintf("\nC %d. ", sc->sc_xfercnt);
(void) splx(pl);
}
lprintf("W ");
if (err = tsleep (sc, LPPRI|PCATCH, "lpwrite", 0))
if (err = tsleep ((caddr_t)sc, LPPRI|PCATCH,
"lpwrite", 0))
return(err);
}
}

View File

@ -34,7 +34,7 @@
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id: mcd.c,v 1.1 1993/10/12 06:08:29 rgrimes Exp $
* $Id: mcd.c,v 1.2 1993/10/16 13:46:13 rgrimes Exp $
*/
static char COPYRIGHT[] = "mcd-driver (C)1993 by H.Veit & B.Moore";
@ -141,7 +141,7 @@ struct mcd_data {
/* prototypes */
int mcdopen(dev_t dev);
int mcdclose(dev_t dev);
int mcdstrategy(struct buf *bp);
void mcdstrategy(struct buf *bp);
int mcdioctl(dev_t dev, int cmd, caddr_t addr, int flags);
int mcdsize(dev_t dev);
static void mcd_done(struct mcd_mbx *mbx);
@ -289,7 +289,8 @@ int mcdclose(dev_t dev)
return 0;
}
int mcdstrategy(struct buf *bp)
void
mcdstrategy(struct buf *bp)
{
struct mcd_data *cd;
struct buf *qp;
@ -787,7 +788,9 @@ static int mcd_volinfo(int unit)
return -1;
}
int mcdintr(unit)
void
mcdintr(unit)
int unit;
{
int port = mcd_data[unit].iobase;
u_int i;
@ -830,13 +833,13 @@ static void mcd_doread(int state, struct mcd_mbx *mbxin)
/* get status */
outb(port+mcd_command, MCD_CMDGETSTAT);
mbx->count = RDELAY_WAITSTAT;
timeout(mcd_doread,MCD_S_WAITSTAT,hz/100);
timeout((timeout_func_t)mcd_doread,(caddr_t)MCD_S_WAITSTAT,hz/100); /* XXX */
return;
case MCD_S_WAITSTAT:
untimeout(mcd_doread,MCD_S_WAITSTAT);
if (mbx->count-- >= 0) {
if (inb(port+mcd_xfer) & MCD_ST_BUSY) {
timeout(mcd_doread,MCD_S_WAITSTAT,hz/100);
timeout((timeout_func_t)mcd_doread,(caddr_t)MCD_S_WAITSTAT,hz/100); /* XXX */
return;
}
mcd_setflags(unit,cd);
@ -860,7 +863,7 @@ static void mcd_doread(int state, struct mcd_mbx *mbxin)
mcd_put(port+mcd_command, MCD_CMDSETMODE);
mcd_put(port+mcd_command, rm);
timeout(mcd_doread,MCD_S_WAITMODE,hz/100);
timeout((timeout_func_t)mcd_doread,(caddr_t)MCD_S_WAITMODE,hz/100); /* XXX */
return;
} else {
#ifdef MCD_TO_WARNING_ON
@ -878,7 +881,7 @@ static void mcd_doread(int state, struct mcd_mbx *mbxin)
goto readerr;
}
if (inb(port+mcd_xfer) & MCD_ST_BUSY) {
timeout(mcd_doread,MCD_S_WAITMODE,hz/100);
timeout((timeout_func_t)mcd_doread,(caddr_t)MCD_S_WAITMODE,hz/100);
return;
}
mcd_setflags(unit,cd);
@ -905,7 +908,7 @@ static void mcd_doread(int state, struct mcd_mbx *mbxin)
mcd_put(port+mcd_command,0);
mcd_put(port+mcd_command,1);
mbx->count = RDELAY_WAITREAD;
timeout(mcd_doread,MCD_S_WAITREAD,hz/100);
timeout((timeout_func_t)mcd_doread,(caddr_t)MCD_S_WAITREAD,hz/100); /* XXX */
return;
case MCD_S_WAITREAD:
untimeout(mcd_doread,MCD_S_WAITREAD);
@ -935,7 +938,7 @@ static void mcd_doread(int state, struct mcd_mbx *mbxin)
}
if ((k & 4)==0)
mcd_getstat(unit,0);
timeout(mcd_doread,MCD_S_WAITREAD,hz/100);
timeout((timeout_func_t)mcd_doread,(caddr_t)MCD_S_WAITREAD,hz/100); /* XXX */
return;
} else {
#ifdef MCD_TO_WARNING_ON

View File

@ -55,7 +55,9 @@
#include "i386/isa/isa_device.h"
#include "i386/isa/icu.h"
int mseprobe(), mseattach(), mseintr();
static int mseprobe(struct isa_device *);
static int mseattach(struct isa_device *);
void mseintr(int);
struct isa_driver msedriver = {
mseprobe, mseattach, "mse"
@ -146,6 +148,7 @@ struct mse_types {
{ 0, },
};
int
mseprobe(idp)
register struct isa_device *idp;
{
@ -169,6 +172,7 @@ mseprobe(idp)
return (0);
}
int
mseattach(idp)
struct isa_device *idp;
{
@ -181,6 +185,7 @@ mseattach(idp)
/*
* Exclusive open the mouse, initialize it and enable interrupts.
*/
int
mseopen(dev, flag)
dev_t dev;
int flag;
@ -210,7 +215,9 @@ mseopen(dev, flag)
/*
* mseclose: just turn off mouse innterrupts.
*/
int
mseclose(dev, flag)
dev_t dev;
int flag;
{
struct mse_softc *sc = &mse_sc[MSE_UNIT(dev)];
@ -228,6 +235,7 @@ mseclose(dev, flag)
* using bytes 4 and 5.
* (Yes this is cheesy, but it makes the X386 server happy, so...)
*/
int
mseread(dev, uio)
dev_t dev;
struct uio *uio;
@ -288,6 +296,7 @@ mseread(dev, uio)
/*
* mseselect: check for mouse input to be processed.
*/
int
mseselect(dev, rw, p)
dev_t dev;
int rw;
@ -315,6 +324,7 @@ mseselect(dev, rw, p)
/*
* mseintr: update mouse status. sc_deltax and sc_deltay are accumulative.
*/
void
mseintr(unit)
int unit;
{

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)com.c 7.5 (Berkeley) 5/16/91
* $Id: sio.c,v 1.14 1993/11/14 23:29:01 ache Exp $
* $Id: sio.c,v 1.15 1993/11/17 23:38:23 ache Exp $
*/
#include "sio.h"
@ -196,13 +196,6 @@ struct com_s {
u_char ibuf2[2 * RS_IBUFSIZE];
};
/* XXX - these functions ought to be declared in systm.h. */
#define nonint int
nonint timeout __P((timeout_func_t func, caddr_t arg, int t));
int tsleep __P((caddr_t chan, int pri, char *wmesg, int timo));
int ttnread __P((struct tty *tp));
nonint wakeup __P((caddr_t chan));
/*
* These functions in the com module ought to be declared (with a prototype)
* in a com-driver system header. The void ones may need to be int to match
@ -223,23 +216,12 @@ void siocnputc __P((Dev_t dev, int c));
int sioopen __P((Dev_t dev, int oflags, int devtype,
struct proc *p));
/*
* sioopen gets compared to the d_open entry in struct cdevsw. d_open and
* other functions are declared in <sys/conf.h> with short types like dev_t
* in the prototype. Such declarations are broken because they vary with
* __P (significantly in theory - the compiler is allowed to push a short
* arg if it has seen the prototype; insignificantly in practice - gcc
* doesn't push short args and it would be slower on 386's to do so).
*
* Also, most of the device switch functions are still declared old-style
* so they take a Dev_t arg and shorten it to a dev_t. It would be simpler
* and faster if dev_t's were always promoted (to ints or whatever) as
* early as possible.
*
* Until <sys/conf.h> is fixed, we cast sioopen to the following `wrong' type
* when comparing it to the d_open entry just to avoid compiler warnings.
*/
typedef int (*bogus_open_t) __P((dev_t dev, int oflags, int devtype,
struct proc *p));
int sioread __P((Dev_t dev, struct uio *uio, int ioflag));
int sioselect __P((Dev_t dev, int rw, struct proc *p));
void siostop __P((struct tty *tp, int rw));
@ -257,8 +239,8 @@ static int commctl __P((struct com_s *com, int bits, int how));
static int comparam __P((struct tty *tp, struct termios *t));
static int sioprobe __P((struct isa_device *dev));
static void compoll __P((void));
static int comstart __P((struct tty *tp));
static nonint comwakeup __P((caddr_t chan, int ticks));
static void comstart __P((struct tty *tp));
static void comwakeup __P((caddr_t chan, int ticks));
static int tiocm_xxx2mcr __P((int tiocm_xxx));
/* table and macro for fast conversion from a unit number to its com struct */
@ -724,7 +706,7 @@ sioopen(dev, flag, mode, p)
out:
splx(s);
if (error == 0)
error = (*linesw[tp->t_line].l_open)(dev, tp);
error = (*linesw[tp->t_line].l_open)(dev, tp, 0);
#ifdef COM_BIDIR
/* wakeup sleepers */
@ -1161,7 +1143,7 @@ compoll()
s = spltty();
repeat:
for (unit = 0; unit < NSIO; ++unit) {
u_char *buf;
u_char *buf = 0;
u_char *ibuf;
int incc;
struct tty *tp;
@ -1447,7 +1429,7 @@ comparam(tp, t)
return (0);
}
static int /* XXX - should be void */
static void
comstart(tp)
struct tty *tp;
{
@ -1502,7 +1484,6 @@ comstart(tp)
}
out:
splx(s);
return (1);
}
void
@ -1555,7 +1536,7 @@ commctl(com, bits, how)
return (bits);
}
static nonint
static void
comwakeup(chan, ticks)
caddr_t chan;
int ticks;
@ -1577,7 +1558,7 @@ comwakeup(chan, ticks)
enable_intr();
}
}
return (0);
return;
}
void
@ -1601,7 +1582,7 @@ siocnprobe(cp)
/* locate the major number */
for (commajor = 0; commajor < nchrdev; commajor++)
if (cdevsw[commajor].d_open == (bogus_open_t) sioopen)
if (cdevsw[commajor].d_open == sioopen)
break;
/* XXX: ick */

View File

@ -40,7 +40,7 @@ int gus_base, gus_irq, gus_dma;
static int
set_gus_irq (int interrupt_level)
{
int retcode;
int retcode = EINVAL;
#ifdef linux
struct sigaction sa;
@ -72,7 +72,7 @@ set_gus_irq (int interrupt_level)
int
gus_set_midi_irq (int interrupt_level)
{
int retcode;
int retcode = EINVAL;
#ifdef linux
struct sigaction sa;

View File

@ -130,7 +130,7 @@ poll_mpu401 (unsigned long dummy)
static int
set_mpu401_irq (int interrupt_level)
{
int retcode;
int retcode = EINVAL;
#ifdef linux
struct sigaction sa;

View File

@ -44,6 +44,7 @@
#include "param.h"
#include "systm.h"
#include "kernel.h"
#include "ioctl.h"
#include "tty.h"
#include "proc.h"
@ -51,7 +52,6 @@
#include "conf.h"
#include "file.h"
#include "uio.h"
/* #include "kernel.h" */
#include "syslog.h"
#include "errno.h"
#include "malloc.h"
@ -119,14 +119,14 @@ typedef struct uio snd_rw_buf;
* user space. The count is number of bytes to be moved.
*/
#define COPY_FROM_USER(target, source, offs, count) \
if (uiomove(target, count, source)) { \
do { if (uiomove(target, count, source)) { \
printf ("sb: Bad copyin()!\n"); \
} else
} } while(0)
/* Like COPY_FOM_USER but for writes. */
#define COPY_TO_USER(target, offs, source, count) \
if (uiomove(source, count, target)) { \
do { if (uiomove(source, count, target)) { \
printf ("sb: Bad copyout()!\n"); \
} else
} } while(0)
/*
* The following macros are like COPY_*_USER but work just with one byte (8bit),
* short (16 bit) or long (32 bit) at a time.
@ -207,7 +207,7 @@ typedef struct uio snd_rw_buf;
#define INTERRUPTIBLE_SLEEP_ON(on_what, flag) \
{ \
flag = 1; \
flag=tsleep(&(on_what), (PRIBIO-5)|PCATCH, "sndint", __timeout_val); \
flag=tsleep((caddr_t)&(on_what), (PRIBIO-5)|PCATCH, "sndint", __timeout_val); \
if(flag == ERESTART) __process_aborting = 1;\
else __process_aborting = 0;\
__timeout_val = 0; \
@ -215,7 +215,7 @@ typedef struct uio snd_rw_buf;
}
/* An the following wakes up a process */
#define WAKE_UP(who) wakeup(&(who))
#define WAKE_UP(who) wakeup((caddr_t)&(who))
/*
* Timing macros. This driver assumes that there is a timer running in the
@ -224,7 +224,6 @@ typedef struct uio snd_rw_buf;
*/
#ifndef HZ
extern int hz;
#define HZ hz
#endif
@ -286,8 +285,8 @@ extern int hz;
* The rest of this file is not complete yet. The functions using these
* macros will not work
*/
#define ALLOC_DMA_CHN(chn) (0)
#define RELEASE_DMA_CHN(chn) (0)
#define ALLOC_DMA_CHN(chn) ({ 0; })
#define RELEASE_DMA_CHN(chn) ({ 0; })
#define DMA_MODE_READ 0
#define DMA_MODE_WRITE 1
#define RELEASE_IRQ(irq_no)

View File

@ -129,6 +129,7 @@ set_pas_irq (int interrupt_level)
return retcode;
#else
/* # error This routine does not work with this OS */
return EINVAL;
#endif
}

View File

@ -224,7 +224,7 @@ sbintr (int unused)
static int
set_dsp_irq (int interrupt_level)
{
int retcode;
int retcode = EINVAL;
#ifdef linux
struct sigaction sa;

View File

@ -491,7 +491,7 @@ request_sound_timer (int count)
int tmp = count;
if (count < 0)
timeout (sequencer_timer, 0, -count);
timeout ((timeout_func_t)sequencer_timer, 0, -count);
else
{
@ -505,7 +505,7 @@ request_sound_timer (int count)
if (!count)
count = 1;
timeout (sequencer_timer, 0, count);
timeout ((timeout_func_t)sequencer_timer, 0, count);
}
timer_running = 1;
}

View File

@ -19,7 +19,7 @@
* commenced: Sun Sep 27 18:14:01 PDT 1992
* slight mod to make work with 34F as well: Wed Jun 2 18:05:48 WST 1993
*
* $Id: ultra14f.c,v 2.3 93/10/16 02:01:08 julian Exp Locker: julian $
* $Id: ultra14f.c,v 1.12 1993/11/18 05:02:20 rgrimes Exp $
*/
#include <sys/types.h>
@ -243,7 +243,7 @@ int uhaprobe();
int uha_attach();
int uhaintr();
int32 uha_scsi_cmd();
void uha_timeout();
void uha_timeout(caddr_t, int);
void uha_free_mscp();
int uha_abort();
void uhaminphys();
@ -494,6 +494,7 @@ uha_adapter_info(unit)
*/
int
uhaintr(unit)
int unit;
{
struct uha_data *uha = uhadata[unit];
struct mscp *mscp;
@ -611,10 +612,12 @@ uha_done(unit, mscp)
*/
void
uha_free_mscp(unit, mscp, flags)
int unit;
struct mscp *mscp;
int flags;
{
struct uha_data *uha = uhadata[unit];
unsigned int opri;
unsigned int opri = 0;
if (!(flags & SCSI_NOMASK))
opri = splbio();
@ -627,7 +630,7 @@ uha_free_mscp(unit, mscp, flags)
* one to come free, starting with queued entries
*/
if (!mscp->next) {
wakeup(&uha->free_mscp);
wakeup((caddr_t)&uha->free_mscp);
}
if (!(flags & SCSI_NOMASK))
splx(opri);
@ -644,7 +647,7 @@ uha_get_mscp(unit, flags)
int unit, flags;
{
struct uha_data *uha = uhadata[unit];
unsigned opri;
unsigned opri = 0;
struct mscp *mscpp;
int hashnum;
@ -1045,7 +1048,7 @@ uha_scsi_cmd(xs)
if (!(flags & SCSI_NOMASK)) {
s = splbio();
uha_send_mbox(unit, mscp);
timeout(uha_timeout, mscp, (xs->timeout * hz) / 1000);
timeout(uha_timeout, (caddr_t)mscp, (xs->timeout * hz) / 1000);
splx(s);
SC_DEBUG(xs->sc_link, SDEV_DB3, ("cmd_sent\n"));
return (SUCCESSFULLY_QUEUED);
@ -1076,8 +1079,9 @@ uha_scsi_cmd(xs)
}
void
uha_timeout(struct mscp *mscp)
uha_timeout(caddr_t arg1, int arg2)
{
struct mscp *mscp = (struct mscp *)arg1;
int unit;
struct uha_data *uha;
int s = splbio();
@ -1101,7 +1105,7 @@ uha_timeout(struct mscp *mscp)
uha_done(unit, mscp, FAIL);
} else { /* abort the operation that has timed out */
printf("\n");
timeout(uha_timeout, mscp, 2 * hz);
timeout(uha_timeout, (caddr_t)mscp, 2 * hz);
mscp->flags = MSCP_ABORTED;
}
splx(s);

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)wd.c 7.2 (Berkeley) 5/9/91
* $Id: wd.c,v 1.15 1993/11/22 23:25:46 nate Exp $
* $Id: wd.c,v 1.16 1993/11/23 21:36:37 nate Exp $
*/
/* TODO:peel out buffer at low ipl, speed improvement */
@ -141,8 +141,8 @@ static int wdcommand(struct disk *, int);
static int wdcontrol(struct buf *);
static int wdsetctlr(dev_t, struct disk *);
static int wdgetctlr(int, struct disk *);
static int wdtimeout(int);
static int wdreset(int);
static void wdtimeout(caddr_t, int);
static void wdreset(int);
/*
* Probe for controller.
@ -211,7 +211,7 @@ wdattach(struct isa_device *dvp)
}
/* initialize timeout */
wdtimeout_status[unit] = 0;
wdtimeout(unit);
wdtimeout((caddr_t)unit, 0);
/* print out description of drive, suppressing multiple blanks*/
if(wdgetctlr(unit, du) == 0) {
@ -244,7 +244,7 @@ wdattach(struct isa_device *dvp)
* to complete. Multi-page transfers are supported. All I/O requests must
* be a multiple of a sector in length.
*/
int
void
wdstrategy(register struct buf *bp)
{
register struct buf *dp;
@ -1188,7 +1188,7 @@ wdsize(dev_t dev)
return((int)du->dk_dd.d_partitions[part].p_size);
}
static int
static void
wdreset(int wdc)
{
outb(wdc+wd_ctlr, (WDCTL_RST|WDCTL_IDS));
@ -1199,9 +1199,10 @@ wdreset(int wdc)
outb(wdc+wd_ctlr, WDCTL_4BIT);
}
static int
wdtimeout(int unit)
static void
wdtimeout(caddr_t arg1, int arg2)
{
int unit = (int)arg1;
int x = splbio();
if (wdtimeout_status[unit]) {
@ -1216,9 +1217,8 @@ wdtimeout(int unit)
wdstart();
}
}
timeout(wdtimeout, unit, 100);
timeout(wdtimeout, (caddr_t)unit, 100); /* XXX !!! 100 what? */
splx(x);
return (0);
}
extern char *vmmap; /* poor name! */

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)wdreg.h 7.1 (Berkeley) 5/9/91
* $Id$
* $Id: wdreg.h,v 1.4 1993/10/16 13:46:33 rgrimes Exp $
*/
/*
@ -132,7 +132,7 @@ struct wdparams {
*/
int wdprobe(struct isa_device *);
int wdattach(struct isa_device *);
int wdstrategy(struct buf *);
void wdstrategy(struct buf *);
void wdintr(struct intrframe);
int wdopen(dev_t, int, int, struct proc *);
int wdclose(dev_t dev, int flags, int fmt);
@ -141,4 +141,4 @@ int wdioctl(dev_t, int, caddr_t, int);
int wdsize(dev_t);
int wddump(dev_t);
#endif KERNEL
#endif /* KERNEL */

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)clock.c 7.2 (Berkeley) 5/12/91
* $Id: clock.c,v 1.2 1993/10/16 13:45:44 rgrimes Exp $
* $Id: clock.c,v 1.3 1993/11/04 01:56:31 ache Exp $
*/
/*
@ -56,7 +56,11 @@
#define TIMER_FREQ 1193182 /* XXX - should be in isa.h */
#endif
startrtclock() {
static void findcpuspeed(void);
void
startrtclock()
{
int s;
findcpuspeed(); /* use the clock (while it's free)
@ -84,6 +88,7 @@ startrtclock() {
unsigned int delaycount; /* calibrated loop variable (1 millisecond) */
#define FIRST_GUESS 0x2000
static void
findcpuspeed()
{
unsigned char low;
@ -107,8 +112,9 @@ findcpuspeed()
/* convert 2 digit BCD number */
int
bcd(i)
int i;
int i;
{
return ((i/16)*10 + (i%16));
}
@ -157,6 +163,7 @@ int m,leap;
* Initialize the time of day register, based on the time base which is, e.g.
* from a filesystem.
*/
void
inittodr(base)
time_t base;
{
@ -217,6 +224,7 @@ test_inittodr(base)
/*
* Restart the clock.
*/
void
resettodr()
{
}
@ -226,7 +234,10 @@ resettodr()
*/
#define V(s) __CONCAT(V, s)
extern V(clk)();
enablertclock() {
void
enablertclock()
{
setidt(ICU_OFFSET+0, &V(clk), SDT_SYS386IGT, SEL_KPL);
INTREN(IRQ0);
}

View File

@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* from: @(#)fd.c 7.4 (Berkeley) 5/25/91
* $Id: fd.c,v 1.5 1993/09/15 23:27:45 rgrimes Exp $
* $Id: fd.c,v 1.6 1993/09/23 15:22:57 rgrimes Exp $
*
*/
@ -45,6 +45,7 @@
#include "param.h"
#include "dkbad.h"
#include "systm.h"
#include "kernel.h"
#include "conf.h"
#include "file.h"
#include "ioctl.h"
@ -175,18 +176,20 @@ char *fdstates[] =
int fd_debug = 1;
#define TRACE0(arg) if(fd_debug) printf(arg)
#define TRACE1(arg1,arg2) if(fd_debug) printf(arg1,arg2)
#else DEBUG
#else /* DEBUG */
#define TRACE0(arg)
#define TRACE1(arg1,arg2)
#endif DEBUG
#endif /* DEBUG */
extern int hz;
/* state needed for current transfer */
static void fdstart(fdcu_t);
void fdintr(fdcu_t);
static void fd_turnoff(caddr_t, int);
/****************************************************************************/
/* autoconfiguration stuff */
/****************************************************************************/
int fdprobe(), fdattach(), fd_turnoff();
static int fdprobe(struct isa_device *);
static int fdattach(struct isa_device *);
struct isa_driver fddriver = {
fdprobe, fdattach, "fd",
@ -195,8 +198,9 @@ struct isa_driver fddriver = {
/*
* probe for existance of controller
*/
int
fdprobe(dev)
struct isa_device *dev;
struct isa_device *dev;
{
fdcu_t fdcu = dev->id_unit;
if(fdc_data[fdcu].flags & FDC_ATTACHED)
@ -220,8 +224,9 @@ struct isa_device *dev;
/*
* wire controller into system, look for floppy units
*/
int
fdattach(dev)
struct isa_device *dev;
struct isa_device *dev;
{
unsigned fdt,st0, cyl;
int hdr;
@ -285,17 +290,18 @@ struct isa_device *dev;
}
fdt <<= 4;
fd_turnoff(fdu);
fd_turnoff((caddr_t)fdu, 0);
hdr = 1;
}
/* Set transfer to 500kbps */
outb(fdc->baseport+fdctl,0); /*XXX*/
return 1;
}
int
fdsize(dev)
dev_t dev;
dev_t dev;
{
return(0);
}
@ -303,8 +309,7 @@ dev_t dev;
/****************************************************************************/
/* fdstrategy */
/****************************************************************************/
fdstrategy(bp)
register struct buf *bp; /* IO operation to perform */
void fdstrategy(struct buf *bp)
{
register struct buf *dp,*dp0,*dp1;
long nblocks,blknum;
@ -359,6 +364,7 @@ fdstrategy(bp)
/* motor control stuff */
/* remember to not deselect the drive we're working on */
/****************************************************************************/
void
set_motor(fdcu, fdu, reset)
fdcu_t fdcu;
fdu_t fdu;
@ -389,9 +395,10 @@ set_motor(fdcu, fdu, reset)
| (m1 ? FDO_MOEN1 : 0)));
}
fd_turnoff(fdu)
fdu_t fdu;
static void
fd_turnoff(caddr_t arg1, int arg2)
{
fdu_t fdu = (fdu_t)arg1;
int s;
fd_p fd = fd_data + fdu;
@ -401,9 +408,10 @@ fd_turnoff(fdu)
splx(s);
}
fd_motor_on(fdu)
fdu_t fdu;
void
fd_motor_on(caddr_t arg1, int arg2)
{
fdu_t fdu = (fdu_t)arg1;
int s;
fd_p fd = fd_data + fdu;
@ -416,6 +424,9 @@ fd_motor_on(fdu)
splx(s);
}
static void fd_turnon1(fdu_t);
void
fd_turnon(fdu)
fdu_t fdu;
{
@ -424,12 +435,12 @@ fd_turnon(fdu)
{
fd_turnon1(fdu);
fd->flags |= FD_MOTOR_WAIT;
timeout(fd_motor_on,fdu,hz); /* in 1 sec its ok */
timeout(fd_motor_on, (caddr_t)fdu, hz); /* in 1 sec its ok */
}
}
fd_turnon1(fdu)
fdu_t fdu;
static void
fd_turnon1(fdu_t fdu)
{
fd_p fd = fd_data + fdu;
fd->flags |= FD_MOTOR;
@ -459,6 +470,7 @@ in_fdc(fdcu)
#endif
}
int
out_fdc(fdcu, x)
fdcu_t fdcu;
int x;
@ -485,6 +497,7 @@ out_fdc(fdcu, x)
/****************************************************************************/
/* fdopen/fdclose */
/****************************************************************************/
int
Fdopen(dev, flags)
dev_t dev;
int flags;
@ -501,8 +514,10 @@ Fdopen(dev, flags)
return 0;
}
int
fdclose(dev, flags)
dev_t dev;
int flags;
{
fdu_t fdu = FDUNIT(minor(dev));
fd_data[fdu].flags &= ~FD_OPEN;
@ -519,6 +534,7 @@ fdclose(dev, flags)
* If the controller is already busy, we need do nothing, as it *
* will pick up our work when the present work completes *
\***************************************************************/
static void
fdstart(fdcu)
fdcu_t fdcu;
{
@ -534,9 +550,10 @@ fdstart(fdcu)
splx(s);
}
fd_timeout(fdcu)
fdcu_t fdcu;
static void
fd_timeout(caddr_t arg1, int arg2)
{
fdcu_t fdcu = (fdcu_t)arg1;
fdu_t fdu = fdc_data[fdcu].fdu;
int st0, st3, cyl;
struct buf *dp,*bp;
@ -580,9 +597,10 @@ fd_timeout(fdcu)
}
/* just ensure it has the right spl */
fd_pseudointr(fdcu)
fdcu_t fdcu;
static void
fd_pseudointr(caddr_t arg1, int arg2)
{
fdcu_t fdcu = (fdcu_t)arg1;
int s;
s = splbio();
fdintr(fdcu);
@ -594,22 +612,24 @@ fd_pseudointr(fdcu)
* keep calling the state machine until it returns a 0 *
* ALWAYS called at SPLBIO *
\***********************************************************************/
fdintr(fdcu)
fdcu_t fdcu;
void
fdintr(fdcu_t fdcu)
{
fdc_p fdc = fdc_data + fdcu;
while(fdstate(fdcu, fdc));
while(fdstate(fdcu, fdc))
;
}
/***********************************************************************\
* The controller state machine. *
* if it returns a non zero value, it should be called again immediatly *
\***********************************************************************/
int fdstate(fdcu, fdc)
int
fdstate(fdcu, fdc)
fdcu_t fdcu;
fdc_p fdc;
{
int read,head,trac,sec,i,s,sectrac,cyl,st0;
int read, head, trac, sec = 0, i = 0, s, sectrac, cyl, st0;
unsigned long blknum;
fdu_t fdu = fdc->fdu;
fd_p fd;
@ -645,7 +665,7 @@ int fdstate(fdcu, fdc)
TRACE1("[%s]",fdstates[fdc->state]);
TRACE1("(0x%x)",fd->flags);
untimeout(fd_turnoff, fdu);
timeout(fd_turnoff,fdu,4 * hz);
timeout(fd_turnoff, (caddr_t)fdu, 4 * hz);
switch (fdc->state)
{
case DEVIDLE:
@ -689,12 +709,12 @@ int fdstate(fdcu, fdc)
out_fdc(fdcu,bp->b_cylin * fd->ft->steptrac);
fd->track = -2;
fdc->state = SEEKWAIT;
timeout(fd_timeout,fdcu,2 * hz);
timeout(fd_timeout, (caddr_t)fdcu, 2 * hz);
return(0); /* will return later */
case SEEKWAIT:
untimeout(fd_timeout,fdcu);
/* allow heads to settle */
timeout(fd_pseudointr,fdcu,hz/50);
timeout(fd_pseudointr, (caddr_t)fdcu, hz / 50);
fdc->state = SEEKCOMPLETE;
return(0); /* will return later */
break;
@ -743,7 +763,7 @@ int fdstate(fdcu, fdc)
out_fdc(fdcu,fd->ft->gap); /* gap size */
out_fdc(fdcu,fd->ft->datalen); /* data length */
fdc->state = IOCOMPLETE;
timeout(fd_timeout,fdcu,2 * hz);
timeout(fd_timeout, (caddr_t)fdcu, 2 * hz);
return(0); /* will return later */
case IOCOMPLETE: /* IO DONE, post-analyze */
untimeout(fd_timeout,fdcu);
@ -800,7 +820,7 @@ int fdstate(fdcu, fdc)
return(0); /* will return later */
case RECALWAIT:
/* allow heads to settle */
timeout(fd_pseudointr,fdcu,hz/30);
timeout(fd_pseudointr, (caddr_t)fdcu, hz / 30);
fdc->state = RECALCOMPLETE;
return(0); /* will return later */
case RECALCOMPLETE:
@ -848,6 +868,7 @@ int fdstate(fdcu, fdc)
return(1); /* Come back immediatly to new state */
}
int
retrier(fdcu)
fdcu_t fdcu;
{

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)com.c 7.5 (Berkeley) 5/16/91
* $Id: sio.c,v 1.14 1993/11/14 23:29:01 ache Exp $
* $Id: sio.c,v 1.15 1993/11/17 23:38:23 ache Exp $
*/
#include "sio.h"
@ -196,13 +196,6 @@ struct com_s {
u_char ibuf2[2 * RS_IBUFSIZE];
};
/* XXX - these functions ought to be declared in systm.h. */
#define nonint int
nonint timeout __P((timeout_func_t func, caddr_t arg, int t));
int tsleep __P((caddr_t chan, int pri, char *wmesg, int timo));
int ttnread __P((struct tty *tp));
nonint wakeup __P((caddr_t chan));
/*
* These functions in the com module ought to be declared (with a prototype)
* in a com-driver system header. The void ones may need to be int to match
@ -223,23 +216,12 @@ void siocnputc __P((Dev_t dev, int c));
int sioopen __P((Dev_t dev, int oflags, int devtype,
struct proc *p));
/*
* sioopen gets compared to the d_open entry in struct cdevsw. d_open and
* other functions are declared in <sys/conf.h> with short types like dev_t
* in the prototype. Such declarations are broken because they vary with
* __P (significantly in theory - the compiler is allowed to push a short
* arg if it has seen the prototype; insignificantly in practice - gcc
* doesn't push short args and it would be slower on 386's to do so).
*
* Also, most of the device switch functions are still declared old-style
* so they take a Dev_t arg and shorten it to a dev_t. It would be simpler
* and faster if dev_t's were always promoted (to ints or whatever) as
* early as possible.
*
* Until <sys/conf.h> is fixed, we cast sioopen to the following `wrong' type
* when comparing it to the d_open entry just to avoid compiler warnings.
*/
typedef int (*bogus_open_t) __P((dev_t dev, int oflags, int devtype,
struct proc *p));
int sioread __P((Dev_t dev, struct uio *uio, int ioflag));
int sioselect __P((Dev_t dev, int rw, struct proc *p));
void siostop __P((struct tty *tp, int rw));
@ -257,8 +239,8 @@ static int commctl __P((struct com_s *com, int bits, int how));
static int comparam __P((struct tty *tp, struct termios *t));
static int sioprobe __P((struct isa_device *dev));
static void compoll __P((void));
static int comstart __P((struct tty *tp));
static nonint comwakeup __P((caddr_t chan, int ticks));
static void comstart __P((struct tty *tp));
static void comwakeup __P((caddr_t chan, int ticks));
static int tiocm_xxx2mcr __P((int tiocm_xxx));
/* table and macro for fast conversion from a unit number to its com struct */
@ -724,7 +706,7 @@ sioopen(dev, flag, mode, p)
out:
splx(s);
if (error == 0)
error = (*linesw[tp->t_line].l_open)(dev, tp);
error = (*linesw[tp->t_line].l_open)(dev, tp, 0);
#ifdef COM_BIDIR
/* wakeup sleepers */
@ -1161,7 +1143,7 @@ compoll()
s = spltty();
repeat:
for (unit = 0; unit < NSIO; ++unit) {
u_char *buf;
u_char *buf = 0;
u_char *ibuf;
int incc;
struct tty *tp;
@ -1447,7 +1429,7 @@ comparam(tp, t)
return (0);
}
static int /* XXX - should be void */
static void
comstart(tp)
struct tty *tp;
{
@ -1502,7 +1484,6 @@ comstart(tp)
}
out:
splx(s);
return (1);
}
void
@ -1555,7 +1536,7 @@ commctl(com, bits, how)
return (bits);
}
static nonint
static void
comwakeup(chan, ticks)
caddr_t chan;
int ticks;
@ -1577,7 +1558,7 @@ comwakeup(chan, ticks)
enable_intr();
}
}
return (0);
return;
}
void
@ -1601,7 +1582,7 @@ siocnprobe(cp)
/* locate the major number */
for (commajor = 0; commajor < nchrdev; commajor++)
if (cdevsw[commajor].d_open == (bogus_open_t) sioopen)
if (cdevsw[commajor].d_open == sioopen)
break;
/* XXX: ick */

View File

@ -45,7 +45,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id$
* $Id: subr_rlist.c,v 1.2 1993/10/16 15:24:44 rgrimes Exp $
*/
#include "sys/param.h"
@ -61,8 +61,11 @@
* Add space to a resource list. Used to either
* initialize a list or return free space to it.
*/
void
rlist_free (rlp, start, end)
register struct rlist **rlp; unsigned start, end; {
register struct rlist **rlp;
unsigned start, end;
{
struct rlist *head;
head = *rlp;
@ -178,8 +181,10 @@ struct rlist **rlp; unsigned size, *loc; {
* Finished with this resource list, reclaim all space and
* mark it as being empty.
*/
void
rlist_destroy (rlp)
struct rlist **rlp; {
struct rlist **rlp;
{
struct rlist *lp, *nlp;
lp = *rlp;

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)trap.c 7.4 (Berkeley) 5/13/91
* $Id: trap.c,v 1.6 1993/11/04 15:05:41 davidg Exp $
* $Id: trap.c,v 1.7 1993/11/13 02:25:08 davidg Exp $
*/
/*
@ -128,6 +128,7 @@ char *trap_msg[] = {
*/
/*ARGSUSED*/
void
trap(frame)
struct trapframe frame;
{
@ -499,6 +500,7 @@ int trapwrite(addr)
* Like trap(), argument is call by reference.
*/
/*ARGSUSED*/
void
syscall(frame)
volatile struct syscframe frame;
{

View File

@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* from: @(#)cons.c 7.2 (Berkeley) 5/9/91
* $Id: cons.c,v 1.4 1993/10/18 14:21:48 davidg Exp $
* $Id: cons.c,v 1.5 1993/11/07 17:41:32 wollman Exp $
*/
@ -73,6 +73,7 @@ struct tty *constty = 0; /* virtual console output device */
struct consdev *cn_tab; /* physical console device info */
struct tty *cn_tty; /* XXX: console tty struct for tprintf */
void
cninit()
{
register struct consdev *cp;
@ -99,6 +100,7 @@ cninit()
(*cp->cn_init)(cp);
}
int
cnopen(dev, flag, mode, p)
dev_t dev;
int flag, mode;
@ -110,6 +112,7 @@ cnopen(dev, flag, mode, p)
return ((*cdevsw[major(dev)].d_open)(dev, flag, mode, p));
}
int
cnclose(dev, flag, mode, p)
dev_t dev;
int flag, mode;
@ -121,9 +124,11 @@ cnclose(dev, flag, mode, p)
return ((*cdevsw[major(dev)].d_close)(dev, flag, mode, p));
}
int
cnread(dev, uio, flag)
dev_t dev;
struct uio *uio;
int flag;
{
if (cn_tab == NULL)
return (0);
@ -131,9 +136,11 @@ cnread(dev, uio, flag)
return ((*cdevsw[major(dev)].d_read)(dev, uio, flag));
}
int
cnwrite(dev, uio, flag)
dev_t dev;
struct uio *uio;
int flag;
{
if (cn_tab == NULL)
return (0);
@ -144,9 +151,12 @@ cnwrite(dev, uio, flag)
return ((*cdevsw[major(dev)].d_write)(dev, uio, flag));
}
int
cnioctl(dev, cmd, data, flag, p)
dev_t dev;
int cmd;
caddr_t data;
int flag;
struct proc *p;
{
int error;
@ -169,6 +179,7 @@ cnioctl(dev, cmd, data, flag, p)
}
/*ARGSUSED*/
int
cnselect(dev, rw, p)
dev_t dev;
int rw;
@ -179,6 +190,7 @@ cnselect(dev, rw, p)
return (ttselect(cn_tab->cn_dev, rw, p));
}
int
cngetc()
{
if (cn_tab == NULL)
@ -186,6 +198,7 @@ cngetc()
return ((*cn_tab->cn_getc)(cn_tab->cn_dev));
}
void
cnputc(c)
register int c;
{

View File

@ -14,7 +14,7 @@
*
* Ported to run under 386BSD by Julian Elischer (julian@tfs.com) Sept 1992
*
* $Id: cd.c,v 2.3 93/10/11 11:49:49 julian Exp Locker: julian $
* $Id: cd.c,v 1.12 1993/11/18 05:02:46 rgrimes Exp $
*/
#define SPLCD splbio
@ -200,6 +200,7 @@ cdattach(sc_link)
*/
errval
cdopen(dev)
dev_t dev;
{
errval errcode = 0;
u_int32 unit, part;
@ -424,7 +425,7 @@ cdstrategy(bp)
cdstart(unit);
splx(opri);
return;
return 0; /* XXX ??? is this the right return? */
bad:
bp->b_flags |= B_ERROR;
done:
@ -915,6 +916,8 @@ cdgetdisklabel(unit)
*/
u_int32
cd_size(unit, flags)
int unit;
int flags;
{
struct scsi_read_cd_cap_data rdcap;
struct scsi_read_cd_capacity scsi_cmd;
@ -1183,8 +1186,10 @@ cd_reset(unit)
*/
errval
cd_read_subchannel(unit, mode, format, track, data, len)
u_int32 unit, mode, format, len;
u_int32 unit, mode, format;
int track;
struct cd_sub_channel_info *data;
u_int32 len;
{
struct scsi_read_subchannel scsi_cmd;
errval error;
@ -1253,6 +1258,8 @@ cd_read_toc(unit, mode, start, data, len)
*/
errval
cd_get_parms(unit, flags)
int unit;
int flags;
{
struct cd_data *cd = cd_driver.cd_data[unit];

View File

@ -2,7 +2,7 @@
* Written by grefen@?????
* Based on scsi drivers by Julian Elischer (julian@tfs.com)
*
* $Id: ch.c,v 2.2 93/10/16 00:58:30 julian Exp Locker: julian $
* $Id: ch.c,v 1.5 1993/11/18 05:02:48 rgrimes Exp $
*/
#include <sys/types.h>
@ -115,8 +115,8 @@ chattach(sc_link)
}
ch_data[unit].initialized = 1;
return;
return 1;
/* XXX ??? is this the right return val? */
}
/*
@ -124,6 +124,7 @@ chattach(sc_link)
*/
errval
chopen(dev)
dev_t dev;
{
errval errcode = 0;
u_int32 unit, mode;
@ -189,6 +190,7 @@ chopen(dev)
*/
errval
chclose(dev)
dev_t dev;
{
unsigned char unit, mode;
struct scsi_link *sc_link;
@ -212,6 +214,7 @@ chioctl(dev, cmd, arg, mode)
dev_t dev;
u_int32 cmd;
caddr_t arg;
int mode;
{
/* struct ch_cmd_buf *args; */
union scsi_cmd *scsi_cmd;
@ -275,6 +278,7 @@ chioctl(dev, cmd, arg, mode)
errval
ch_getelem(unit, stat, type, from, data, flags)
u_int32 unit, from, flags;
int type;
short *stat;
char *data;
{

View File

@ -20,6 +20,7 @@
#include <scsi/scsiconf.h>
#include <sys/scsiio.h>
void scsierr(struct buf *, int); /* XXX ??? */
/*
* We let the user interpret his own sense in the generic scsi world.
@ -317,9 +318,10 @@ errval scsi_do_ioctl(struct scsi_link *sc_link, int cmd, caddr_t addr, int f)
return ret;
}
void
scsierr(bp,err)
struct buf *bp;
int err;
struct buf *bp;
int err;
{
bp->b_flags |= B_ERROR;
bp->b_error = err;

View File

@ -14,7 +14,7 @@
*
* Ported to run under 386BSD by Julian Elischer (julian@dialix.oz.au) Sept 1992
*
* $Id: sd.c,v 2.7 93/10/24 12:44:40 julian Exp Locker: julian $
* $Id: sd.c,v 1.12 1993/11/18 05:03:02 rgrimes Exp $
*/
#define SPLSD splbio
@ -72,8 +72,8 @@ int Debugger();
errval sdgetdisklabel __P((unsigned char unit));
errval sd_get_parms __P((int unit, int flags));
errval sdstrategy();
void sdstart();
void sdstrategy __P((struct buf *));
void sdstart __P((u_int32));
struct scsi_device sd_switch =
{
@ -358,7 +358,7 @@ sdminphys(bp)
* can understand. The transfer is described by a buf and will include
* only one physical transfer.
*/
errval
void
sdstrategy(bp)
struct buf *bp;
{
@ -427,7 +427,7 @@ sdstrategy(bp)
sdstart(unit);
splx(opri);
return 0;
return /*0*/;
bad:
bp->b_flags |= B_ERROR;
done:
@ -437,7 +437,7 @@ sdstrategy(bp)
*/
bp->b_resid = bp->b_bcount;
biodone(bp);
return 0;
return /*0*/;
}
/*

View File

@ -2,7 +2,7 @@
* Dummy driver for a device we can't identify.
* by Julian Elischer (julian@tfs.com)
*
* $Id: uk.c,v 1.2 93/10/11 11:53:28 julian Exp Locker: julian $
* $Id: uk.c,v 1.1 1993/11/18 05:03:13 rgrimes Exp $
*/
@ -68,7 +68,7 @@ ukattach(sc_link)
printf("uk%d: unknown device\n", unit);
uk_data[unit].flags = UK_KNOWN;
return;
return 1; /* XXX ??? */
}
@ -77,6 +77,7 @@ ukattach(sc_link)
*/
errval
ukopen(dev)
dev_t dev;
{
errval errcode = 0;
u_int32 unit, mode;
@ -122,8 +123,9 @@ ukopen(dev)
*/
errval
ukclose(dev)
dev_t dev;
{
unsigned char unit, mode;
unsigned char unit = 0, mode; /* XXX !!! XXX FIXME!!! 0??? */
struct scsi_link *sc_link;
sc_link = uk_data[unit].sc_link;
@ -142,6 +144,7 @@ ukioctl(dev, cmd, arg, mode)
dev_t dev;
u_int32 cmd;
caddr_t arg;
int mode;
{
unsigned char unit;
struct scsi_link *sc_link;

View File

@ -16,7 +16,7 @@
* rlist_alloc(&swapmap, 100, &loc); obtain 100 sectors from swap
*
* from: unknown?
* $Id: rlist.h,v 1.4 1993/10/16 17:17:32 rgrimes Exp $
* $Id: rlist.h,v 1.5 1993/11/07 17:52:59 wollman Exp $
*/
#ifndef _SYS_RLIST_H_
@ -30,9 +30,9 @@ struct rlist {
};
/* Functions to manipulate resource lists. */
extern rlist_free __P((struct rlist **, unsigned, unsigned));
extern void rlist_free __P((struct rlist **, unsigned, unsigned));
int rlist_alloc __P((struct rlist **, unsigned, unsigned *));
extern rlist_destroy __P((struct rlist **));
extern void rlist_destroy __P((struct rlist **));
/* heads of lists */