From 4c45483ea9fb51e495c5cc57c7032ab8d97dd211 Mon Sep 17 00:00:00 2001 From: Garrett Wollman Date: Thu, 25 Nov 1993 01:39:19 +0000 Subject: [PATCH] Make the LINT kernel compile with -W -Wreturn-type -Wcomment -Werror, and add same (sans -Werror) to Makefile for future compilations. --- sys/ddb/db_access.c | 10 +- sys/ddb/db_aout.c | 9 +- sys/ddb/db_break.c | 7 +- sys/ddb/db_command.c | 7 +- sys/ddb/db_examine.c | 24 +- sys/ddb/db_expr.c | 5 +- sys/ddb/db_input.c | 9 +- sys/ddb/db_lex.c | 8 +- sys/ddb/db_output.c | 15 +- sys/ddb/db_output.h | 3 +- sys/ddb/db_print.c | 7 +- sys/ddb/db_run.c | 5 +- sys/ddb/db_sym.c | 9 +- sys/ddb/db_trap.c | 5 +- sys/ddb/db_variables.c | 16 +- sys/ddb/db_variables.h | 4 +- sys/ddb/db_watch.c | 8 +- sys/ddb/db_write_cmd.c | 5 +- sys/ddb/ddb.h | 109 ++++++ sys/i386/conf/Makefile.i386 | 15 +- sys/i386/i386/autoconf.c | 10 +- sys/i386/i386/conf.c | 661 ++++++++++++++++++++------------- sys/i386/i386/cons.c | 15 +- sys/i386/i386/db_disasm.c | 4 +- sys/i386/i386/db_interface.c | 13 +- sys/i386/i386/in_cksum.c | 3 +- sys/i386/i386/machdep.c | 47 ++- sys/i386/i386/math_emulate.c | 9 +- sys/i386/i386/mem.c | 5 +- sys/i386/i386/pmap.c | 12 +- sys/i386/i386/trap.c | 4 +- sys/i386/i386/vm_machdep.c | 15 +- sys/i386/include/cpufunc.h | 40 +- sys/i386/isa/aha1542.c | 30 +- sys/i386/isa/aha1742.c | 19 +- sys/i386/isa/bt742a.c | 35 +- sys/i386/isa/clock.c | 19 +- sys/i386/isa/com.c | 53 ++- sys/i386/isa/fd.c | 87 +++-- sys/i386/isa/icu.s | 6 +- sys/i386/isa/if_ed.c | 41 +- sys/i386/isa/if_ie.c | 64 ++-- sys/i386/isa/if_is.c | 38 +- sys/i386/isa/isa.c | 59 ++- sys/i386/isa/lpa.c | 15 +- sys/i386/isa/lpt.c | 17 +- sys/i386/isa/mcd.c | 23 +- sys/i386/isa/mse.c | 12 +- sys/i386/isa/pccons.c | 81 ++-- sys/i386/isa/sio.c | 39 +- sys/i386/isa/sound/gus_card.c | 4 +- sys/i386/isa/sound/mpu401.c | 2 +- sys/i386/isa/sound/os.h | 19 +- sys/i386/isa/sound/pas2_card.c | 1 + sys/i386/isa/sound/sb_dsp.c | 2 +- sys/i386/isa/sound/soundcard.c | 4 +- sys/i386/isa/ultra14f.c | 20 +- sys/i386/isa/wd.c | 20 +- sys/i386/isa/wdreg.h | 6 +- sys/isofs/iso.h | 4 +- sys/isofs/isofs_bmap.c | 9 +- sys/isofs/isofs_lookup.c | 6 +- sys/isofs/isofs_node.c | 11 +- sys/isofs/isofs_node.h | 7 +- sys/isofs/isofs_rrip.c | 59 +-- sys/isofs/isofs_util.c | 6 +- sys/isofs/isofs_vfsops.c | 15 +- sys/isofs/isofs_vnops.c | 18 +- sys/kern/dead_vnops.c | 18 +- sys/kern/fifo_vnops.c | 21 +- sys/kern/init_main.c | 5 +- sys/kern/kern__physio.c | 4 +- sys/kern/kern_acct.c | 17 +- sys/kern/kern_clock.c | 19 +- sys/kern/kern_descrip.c | 16 +- sys/kern/kern_execve.c | 9 +- sys/kern/kern_exit.c | 5 +- sys/kern/kern_fork.c | 5 +- sys/kern/kern_kinfo.c | 19 +- sys/kern/kern_ktrace.c | 24 +- sys/kern/kern_malloc.c | 8 +- sys/kern/kern_proc.c | 15 +- sys/kern/kern_prot.c | 26 +- sys/kern/kern_resource.c | 10 +- sys/kern/kern_sig.c | 23 +- sys/kern/kern_subr.c | 19 +- sys/kern/kern_synch.c | 43 ++- sys/kern/kern_time.c | 18 +- sys/kern/kern_xxx.c | 8 +- sys/kern/spec_vnops.c | 33 +- sys/kern/subr_log.c | 13 +- sys/kern/subr_rlist.c | 11 +- sys/kern/subr_xxx.c | 8 +- sys/kern/sys_generic.c | 17 +- sys/kern/sys_process.c | 11 +- sys/kern/sys_socket.c | 8 +- sys/kern/sysv_shm.c | 22 +- sys/kern/tty.c | 80 +++- sys/kern/tty_compat.c | 12 +- sys/kern/tty_conf.c | 35 +- sys/kern/tty_pty.c | 32 +- sys/kern/tty_ring.c | 32 +- sys/kern/tty_tty.c | 13 +- sys/kern/uipc_domain.c | 17 +- sys/kern/uipc_mbuf.c | 68 +++- sys/kern/uipc_socket.c | 22 +- sys/kern/uipc_socket2.c | 32 +- sys/kern/uipc_syscalls.c | 34 +- sys/kern/uipc_usrreq.c | 26 +- sys/kern/vfs__bio.c | 45 ++- sys/kern/vfs_cache.c | 7 +- sys/kern/vfs_lookup.c | 9 +- sys/kern/vfs_subr.c | 36 +- sys/kern/vfs_syscalls.c | 44 ++- sys/kern/vfs_vnops.c | 13 +- sys/net/bpf_filter.c | 4 +- sys/net/if.c | 33 +- sys/net/if.h | 24 +- sys/net/if_arp.h | 13 +- sys/net/if_ethersubr.c | 8 +- sys/net/if_loop.c | 12 +- sys/net/if_ppp.c | 18 +- sys/net/if_sl.c | 14 +- sys/net/radix.c | 17 +- sys/net/raw_cb.c | 5 +- sys/net/raw_usrreq.c | 7 +- sys/net/route.c | 12 +- sys/net/route.h | 5 +- sys/net/rtsock.c | 73 +--- sys/netccitt/hd_debug.c | 8 +- sys/netccitt/hd_input.c | 55 +-- sys/netccitt/hd_output.c | 25 +- sys/netccitt/hd_subr.c | 33 +- sys/netccitt/hd_timer.c | 3 +- sys/netccitt/hd_var.h | 12 +- sys/netccitt/if_x25subr.c | 92 +++-- sys/netccitt/pk_acct.c | 6 +- sys/netccitt/pk_debug.c | 14 +- sys/netccitt/pk_input.c | 62 ++-- sys/netccitt/pk_output.c | 5 +- sys/netccitt/pk_subr.c | 151 +++++--- sys/netccitt/pk_timer.c | 3 +- sys/netccitt/pk_usrreq.c | 56 +-- sys/netccitt/pk_var.h | 26 +- sys/netinet/if_ether.c | 14 +- sys/netinet/if_ether.h | 8 +- sys/netinet/in.c | 18 +- sys/netinet/in_pcb.c | 19 +- sys/netinet/in_pcb.h | 17 +- sys/netinet/ip_icmp.c | 4 +- sys/netinet/ip_input.c | 23 +- sys/netinet/ip_output.c | 8 +- sys/netinet/raw_ip.c | 6 +- sys/netinet/tcp_debug.c | 3 +- sys/netinet/tcp_input.c | 21 +- sys/netinet/tcp_output.c | 12 +- sys/netinet/tcp_subr.c | 17 +- sys/netinet/tcp_timer.c | 5 +- sys/netinet/tcp_timer.h | 8 +- sys/netinet/tcp_usrreq.c | 7 +- sys/netinet/tcp_var.h | 7 +- sys/netinet/udp_usrreq.c | 14 +- sys/netiso/argo_debug.h | 3 +- sys/netiso/clnl.h | 5 +- sys/netiso/clnp.h | 5 +- sys/netiso/clnp_er.c | 22 +- sys/netiso/clnp_frag.c | 10 +- sys/netiso/clnp_input.c | 9 +- sys/netiso/clnp_options.c | 22 +- sys/netiso/clnp_output.c | 4 +- sys/netiso/clnp_raw.c | 6 +- sys/netiso/clnp_subr.c | 16 +- sys/netiso/clnp_timer.c | 4 +- sys/netiso/cltp_usrreq.c | 12 +- sys/netiso/esis.c | 78 ++-- sys/netiso/if_eon.c | 43 ++- sys/netiso/iso.c | 23 +- sys/netiso/iso_chksum.c | 6 +- sys/netiso/iso_snpac.c | 32 +- sys/netiso/tp_driver.c | 4 +- sys/netiso/tp_emit.c | 3 +- sys/netiso/tp_inet.c | 26 +- sys/netiso/tp_input.c | 25 +- sys/netiso/tp_iso.c | 7 +- sys/netiso/tp_pcb.c | 54 ++- sys/netiso/tp_pcb.h | 36 +- sys/netiso/tp_stat.h | 4 +- sys/netiso/tp_subr.c | 11 +- sys/netiso/tp_subr2.c | 19 +- sys/netiso/tp_trace.h | 6 +- sys/netiso/tp_usrreq.c | 8 +- sys/netns/idp_usrreq.c | 14 +- sys/netns/ns.c | 19 +- sys/netns/ns_error.c | 14 +- sys/netns/ns_input.c | 19 +- sys/netns/ns_output.c | 3 +- sys/netns/ns_pcb.c | 12 +- sys/netns/ns_pcb.h | 4 +- sys/netns/spp_debug.c | 3 +- sys/netns/spp_usrreq.c | 30 +- sys/netrmp/rmp.c | 10 +- sys/nfs/nfs_node.c | 5 +- sys/nfs/nfs_serv.c | 12 +- sys/nfs/nfs_subs.c | 8 +- sys/nfs/nfs_vnops.c | 13 +- sys/nfs/nfsmount.h | 4 +- sys/nfs/nfsnode.h | 4 +- sys/pcfs/denode.h | 4 +- sys/pcfs/pcfs_conv.c | 4 +- sys/pcfs/pcfs_denode.c | 6 +- sys/pcfs/pcfs_fat.c | 8 +- sys/pcfs/pcfs_lookup.c | 10 +- sys/pcfs/pcfs_vfsops.c | 7 +- sys/pcfs/pcfs_vnops.c | 7 +- sys/pcfs/pcfsmount.h | 4 +- sys/scsi/cd.c | 13 +- sys/scsi/ch.c | 10 +- sys/scsi/scsi_ioctl.c | 6 +- sys/scsi/sd.c | 12 +- sys/scsi/uk.c | 9 +- sys/sys/buf.h | 22 +- sys/sys/callout.h | 4 +- sys/sys/conf.h | 80 ++-- sys/sys/disklabel.h | 19 +- sys/sys/fifo.h | 7 +- sys/sys/kernel.h | 3 +- sys/sys/mbuf.h | 4 +- sys/sys/mount.h | 9 +- sys/sys/proc.h | 14 +- sys/sys/rlist.h | 6 +- sys/sys/socketvar.h | 55 ++- sys/sys/specdev.h | 4 +- sys/sys/systm.h | 48 +-- sys/sys/time.h | 10 +- sys/sys/tty.h | 54 ++- sys/sys/un.h | 7 +- sys/sys/unpcb.h | 28 +- sys/sys/vnode.h | 14 +- sys/ufs/fs.h | 8 +- sys/ufs/inode.h | 12 +- sys/ufs/mfs_vfsops.c | 7 +- sys/ufs/mfs_vnops.c | 12 +- sys/ufs/mfsnode.h | 7 +- sys/ufs/quota.h | 33 +- sys/ufs/ufs_alloc.c | 10 +- sys/ufs/ufs_bmap.c | 4 +- sys/ufs/ufs_disksubr.c | 9 +- sys/ufs/ufs_inode.c | 12 +- sys/ufs/ufs_lockf.c | 13 +- sys/ufs/ufs_lookup.c | 22 +- sys/ufs/ufs_quota.c | 36 +- sys/ufs/ufs_subr.c | 9 +- sys/ufs/ufs_vfsops.c | 47 +-- sys/ufs/ufs_vnops.c | 41 +- sys/ufs/ufsmount.h | 4 +- sys/vm/device_pager.c | 2 +- sys/vm/lock.h | 13 + sys/vm/swap_pager.c | 11 +- sys/vm/swap_pager.h | 19 +- sys/vm/vm.h | 5 +- sys/vm/vm_fault.c | 22 +- sys/vm/vm_glue.c | 40 +- sys/vm/vm_kern.c | 10 +- sys/vm/vm_map.c | 12 +- sys/vm/vm_meter.c | 8 +- sys/vm/vm_mmap.c | 21 +- sys/vm/vm_object.c | 14 +- sys/vm/vm_object.h | 4 +- sys/vm/vm_page.c | 4 +- sys/vm/vm_pageout.c | 3 +- sys/vm/vm_pager.c | 5 +- sys/vm/vm_swap.c | 6 +- sys/vm/vm_unix.c | 5 +- sys/vm/vm_user.c | 10 +- sys/vm/vnode_pager.c | 8 +- 275 files changed, 3882 insertions(+), 1779 deletions(-) create mode 100644 sys/ddb/ddb.h diff --git a/sys/ddb/db_access.c b/sys/ddb/db_access.c index cbb25dd371..b519e2853d 100644 --- a/sys/ddb/db_access.c +++ b/sys/ddb/db_access.c @@ -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 diff --git a/sys/ddb/db_aout.c b/sys/ddb/db_aout.c index d1c848f07d..06d1b06e1b 100644 --- a/sys/ddb/db_aout.c +++ b/sys/ddb/db_aout.c @@ -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 /* data types */ +#include "ddb/ddb.h" #include #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; diff --git a/sys/ddb/db_break.c b/sys/ddb/db_break.c index b4d0bbcb3e..41761e818b 100644 --- a/sys/ddb/db_break.c +++ b/sys/ddb/db_break.c @@ -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 /* type definitions */ +#include "ddb/ddb.h" #include #include @@ -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(); } diff --git a/sys/ddb/db_command.c b/sys/ddb/db_command.c index 8c2555dcce..30d8b1745e 100644 --- a/sys/ddb/db_command.c +++ b/sys/ddb/db_command.c @@ -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 /* type definitions */ +#include "ddb/ddb.h" #include #include @@ -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(); diff --git a/sys/ddb/db_examine.c b/sys/ddb/db_examine.c index 7a83692df1..bf9a4c76e7 100644 --- a/sys/ddb/db_examine.c +++ b/sys/ddb/db_examine.c @@ -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 /* type definitions */ + +#include "ddb/ddb.h" #include #include @@ -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; diff --git a/sys/ddb/db_expr.c b/sys/ddb/db_expr.c index b02f225825..3d23949647 100644 --- a/sys/ddb/db_expr.c +++ b/sys/ddb/db_expr.c @@ -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 +#include "ddb/ddb.h" #include #include #include diff --git a/sys/ddb/db_input.c b/sys/ddb/db_input.c index 3cf0b0562b..3f18cd8bea 100644 --- a/sys/ddb/db_input.c +++ b/sys/ddb/db_input.c @@ -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 /* @@ -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; { } diff --git a/sys/ddb/db_lex.c b/sys/ddb/db_lex.c index 84176383d1..655a1b53db 100644 --- a/sys/ddb/db_lex.c +++ b/sys/ddb/db_lex.c @@ -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 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; diff --git a/sys/ddb/db_output.c b/sys/ddb/db_output.c index 442546b9b2..440f486746 100644 --- a/sys/ddb/db_output.c +++ b/sys/ddb/db_output.c @@ -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 +#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; diff --git a/sys/ddb/db_output.h b/sys/ddb/db_output.h index fb4ae67ffc..3969a3450e 100644 --- a/sys/ddb/db_output.h +++ b/sys/ddb/db_output.h @@ -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_ */ diff --git a/sys/ddb/db_print.c b/sys/ddb/db_print.c index 25e4c66600..7ab2099772 100644 --- a/sys/ddb/db_print.c +++ b/sys/ddb/db_print.c @@ -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 +#include "ddb/ddb.h" #include #include @@ -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; diff --git a/sys/ddb/db_run.c b/sys/ddb/db_run.c index 78c0d4c1d4..1ba43c10a0 100644 --- a/sys/ddb/db_run.c +++ b/sys/ddb/db_run.c @@ -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 +#include "ddb/ddb.h" #include #include diff --git a/sys/ddb/db_sym.c b/sys/ddb/db_sym.c index fd02ae455c..74c96e3ac7 100644 --- a/sys/ddb/db_sym.c +++ b/sys/ddb/db_sym.c @@ -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 +#include "ddb/ddb.h" #include /* @@ -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); } diff --git a/sys/ddb/db_trap.c b/sys/ddb/db_trap.c index bcdc4f47f4..abfa770d35 100644 --- a/sys/ddb/db_trap.c +++ b/sys/ddb/db_trap.c @@ -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 #include @@ -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; { diff --git a/sys/ddb/db_variables.c b/sys/ddb/db_variables.c index cd59bb2d57..96ef62057a 100644 --- a/sys/ddb/db_variables.c +++ b/sys/ddb/db_variables.c @@ -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 +#include "ddb/ddb.h" #include #include -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)(); diff --git a/sys/ddb/db_variables.h b/sys/ddb/db_variables.h index 25558bc28b..35e5a00018 100644 --- a/sys/ddb/db_variables.h +++ b/sys/ddb/db_variables.h @@ -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_ */ diff --git a/sys/ddb/db_watch.c b/sys/ddb/db_watch.c index b027732b9d..0322a1805c 100644 --- a/sys/ddb/db_watch.c +++ b/sys/ddb/db_watch.c @@ -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 +#include "ddb/ddb.h" #include #include #include #include #include -#include /* * 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(); } diff --git a/sys/ddb/db_write_cmd.c b/sys/ddb/db_write_cmd.c index 0113958c9b..6de58a68e4 100644 --- a/sys/ddb/db_write_cmd.c +++ b/sys/ddb/db_write_cmd.c @@ -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 +#include "ddb/ddb.h" #include #include diff --git a/sys/ddb/ddb.h b/sys/ddb/ddb.h new file mode 100644 index 0000000000..4d7b206bbd --- /dev/null +++ b/sys/ddb/ddb.h @@ -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 */ diff --git a/sys/i386/conf/Makefile.i386 b/sys/i386/conf/Makefile.i386 index 4c4a6f96f1..dcb811058b 100644 --- a/sys/i386/conf/Makefile.i386 +++ b/sys/i386/conf/Makefile.i386 @@ -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 diff --git a/sys/i386/i386/autoconf.c b/sys/i386/i386/autoconf.c index 9f06f758d8..372dd26832 100644 --- a/sys/i386/i386/autoconf.c +++ b/sys/i386/i386/autoconf.c @@ -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);*/ diff --git a/sys/i386/i386/conf.c b/sys/i386/i386/conf.c index 41e9aeb66b..24b03c45f3 100644 --- a/sys/i386/i386/conf.c +++ b/sys/i386/i386/conf.c @@ -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(); - -int pcopen(),pcclose(),pcread(),pcwrite(),pcioctl(),pcmmap(); +/* console */ +d_open_t cnopen; +d_close_t cnclose; +d_rdwr_t cnread, cnwrite; +d_ioctl_t cnioctl; +d_select_t cnselect; + +/* 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(); - -int mmopen(), mmclose(), mmrw(), memmmap(); +/* controlling TTY */ +d_open_t cttyopen; +d_rdwr_t cttyread, cttywrite; +d_ioctl_t cttyioctl; +d_select_t cttyselect; + +/* /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'. diff --git a/sys/i386/i386/cons.c b/sys/i386/i386/cons.c index 6f76c4c7f8..411531066a 100644 --- a/sys/i386/i386/cons.c +++ b/sys/i386/i386/cons.c @@ -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; { diff --git a/sys/i386/i386/db_disasm.c b/sys/i386/i386/db_disasm.c index a8b98da4a3..4793e401f8 100644 --- a/sys/i386/i386/db_disasm.c +++ b/sys/i386/i386/db_disasm.c @@ -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; diff --git a/sys/i386/i386/db_interface.c b/sys/i386/i386/db_interface.c index fe36fc306a..9f504d4e41 100644 --- a/sys/i386/i386/db_interface.c +++ b/sys/i386/i386/db_interface.c @@ -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 +#include "ddb/ddb.h" #include #include #include #include -#include /* 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"); } diff --git a/sys/i386/i386/in_cksum.c b/sys/i386/i386/in_cksum.c index 3bea1c1da5..75a74f562b 100644 --- a/sys/i386/i386/in_cksum.c +++ b/sys/i386/i386/in_cksum.c @@ -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; diff --git a/sys/i386/i386/machdep.c b/sys/i386/i386/machdep.c index 193a9c9219..e926d0eb18 100644 --- a/sys/i386/i386/machdep.c +++ b/sys/i386/i386/machdep.c @@ -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; { diff --git a/sys/i386/i386/math_emulate.c b/sys/i386/i386/math_emulate.c index f7fa88ed94..fad36b9752 100644 --- a/sys/i386/i386/math_emulate.c +++ b/sys/i386/i386/math_emulate.c @@ -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; diff --git a/sys/i386/i386/mem.c b/sys/i386/i386/mem.c index 0caf00c07f..1113eb222f 100644 --- a/sys/i386/i386/mem.c +++ b/sys/i386/i386/mem.c @@ -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; diff --git a/sys/i386/i386/pmap.c b/sys/i386/i386/pmap.c index ed8ff6a7f8..85838ad94c 100644 --- a/sys/i386/i386/pmap.c +++ b/sys/i386/i386/pmap.c @@ -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; diff --git a/sys/i386/i386/trap.c b/sys/i386/i386/trap.c index 92247ddbc9..e9674773a6 100644 --- a/sys/i386/i386/trap.c +++ b/sys/i386/i386/trap.c @@ -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; { diff --git a/sys/i386/i386/vm_machdep.c b/sys/i386/i386/vm_machdep.c index 38077213ed..773cf21649 100644 --- a/sys/i386/i386/vm_machdep.c +++ b/sys/i386/i386/vm_machdep.c @@ -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 .... " */ tlbflush(); /* NOTREACHED */ + while(1); /* to fool compiler... */ } diff --git a/sys/i386/include/cpufunc.h b/sys/i386/include/cpufunc.h index b105543dec..adaa70cc91 100644 --- a/sys/i386/include/cpufunc.h +++ b/sys/i386/include/cpufunc.h @@ -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; diff --git a/sys/i386/isa/aha1542.c b/sys/i386/isa/aha1542.c index b731ed631d..10cb47c041 100644 --- a/sys/i386/isa/aha1542.c +++ b/sys/i386/isa/aha1542.c @@ -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); } diff --git a/sys/i386/isa/aha1742.c b/sys/i386/isa/aha1742.c index dda504207d..a1457db31d 100644 --- a/sys/i386/isa/aha1742.c +++ b/sys/i386/isa/aha1742.c @@ -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 @@ -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); diff --git a/sys/i386/isa/bt742a.c b/sys/i386/isa/bt742a.c index fa467530c9..4d9947b5ac 100644 --- a/sys/i386/isa/bt742a.c +++ b/sys/i386/isa/bt742a.c @@ -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); diff --git a/sys/i386/isa/clock.c b/sys/i386/isa/clock.c index 133f2d1e8e..836bff01c9 100644 --- a/sys/i386/isa/clock.c +++ b/sys/i386/isa/clock.c @@ -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); } diff --git a/sys/i386/isa/com.c b/sys/i386/isa/com.c index ed538e976e..f745e07880 100644 --- a/sys/i386/isa/com.c +++ b/sys/i386/isa/com.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)com.c 7.5 (Berkeley) 5/16/91 - * $Id$ + * $Id: com.c,v 1.5 1993/10/16 13:45:46 rgrimes Exp $ */ #include "com.h" @@ -58,7 +58,15 @@ #include "i386/isa/ic/ns16550.h" #define cominor(d) -int comprobe(), comattach(), comintr(), comstart(), comparam(); +static int comprobe(); +static int comattach(); +void comintr(int); +static void comstart(struct tty *); +static int comparam(struct tty *, struct termios *); + +static void comeint(int, int, int); +static void commint(int, int); +static void cominit(int, int); struct isa_driver comdriver = { comprobe, comattach, "com" @@ -111,6 +119,7 @@ extern int kgdb_debug_init; #define UNIT(x) (minor(x)) +int comprobe(dev) struct isa_device *dev; { @@ -179,7 +188,8 @@ struct isa_device *isdp; } /* ARGSUSED */ -comopen(dev_t dev, int flag, int mode, struct proc *p) +int +comopen(int /*dev_t*/ dev, int flag, int mode, struct proc *p) { register struct tty *tp; register int unit; @@ -219,11 +229,12 @@ comopen(dev_t dev, int flag, int mode, struct proc *p) } (void) spl0(); if (error == 0) - error = (*linesw[tp->t_line].l_open)(dev, tp); + error = (*linesw[tp->t_line].l_open)(dev, tp, 0); return (error); } /*ARGSUSED*/ +int comclose(dev, flag, mode, p) dev_t dev; int flag, mode; @@ -250,18 +261,22 @@ comclose(dev, flag, mode, p) return(0); } +int comread(dev, uio, flag) dev_t dev; struct uio *uio; + int flag; { register struct tty *tp = &com_tty[UNIT(dev)]; return ((*linesw[tp->t_line].l_read)(tp, uio, flag)); } +int comwrite(dev, uio, flag) dev_t dev; struct uio *uio; + int flag; { int unit = UNIT(dev); register struct tty *tp = &com_tty[unit]; @@ -277,6 +292,7 @@ comwrite(dev, uio, flag) return ((*linesw[tp->t_line].l_write)(tp, uio, flag)); } +void comintr(unit) register int unit; { @@ -284,13 +300,12 @@ comintr(unit) register u_char code; register struct tty *tp; - unit; com = com_addr[unit]; while (1) { code = inb(com+com_iir); switch (code & IIR_IMASK) { case IIR_NOPEND: - return (1); + return; case IIR_RXTOUT: case IIR_RXRDY: tp = &com_tty[unit]; @@ -336,7 +351,7 @@ comintr(unit) break; default: if (code & IIR_NOPEND) - return (1); + return; log(LOG_WARNING, "com%d: weird interrupt: 0x%x\n", unit, code); /* fall through */ @@ -347,9 +362,10 @@ comintr(unit) } } +static void comeint(unit, stat, com) register int unit, stat; - register com; + register int com; { register struct tty *tp; register int c; @@ -376,9 +392,10 @@ comeint(unit, stat, com) (*linesw[tp->t_line].l_rint)(c, tp); } +static void commint(unit, com) register int unit; - register com; + register int com; { register struct tty *tp; register int stat; @@ -402,9 +419,12 @@ commint(unit, com) } } +int comioctl(dev, cmd, data, flag) dev_t dev; + int cmd; caddr_t data; + int flag; { register struct tty *tp; register int unit = UNIT(dev); @@ -460,12 +480,13 @@ comioctl(dev, cmd, data, flag) return (0); } +static int comparam(tp, t) register struct tty *tp; register struct termios *t; { - register com; - register int cfcr, cflag = t->c_cflag; + register int com; + register int cfcr = 0, cflag = t->c_cflag; int unit = UNIT(tp->t_dev); int ospeed = ttspeedtab(t->c_ospeed, comspeedtab); @@ -511,6 +532,7 @@ comparam(tp, t) return(0); } +void comstart(tp) register struct tty *tp; { @@ -551,8 +573,10 @@ out: * Stop output on a line. */ /*ARGSUSED*/ +void comstop(tp, flag) register struct tty *tp; + int flag; { register int s; @@ -564,6 +588,7 @@ comstop(tp, flag) splx(s); } +int commctl(dev, bits, how) dev_t dev; int bits, how; @@ -602,6 +627,7 @@ commctl(dev, bits, how) */ #include "i386/i386/cons.h" +void comcnprobe(cp) struct consdev *cp; { @@ -628,6 +654,7 @@ comcnprobe(cp) #endif } +void comcninit(cp) struct consdev *cp; { @@ -638,6 +665,7 @@ comcninit(cp) comconsinit = 1; } +static void cominit(unit, rate) int unit, rate; { @@ -661,7 +689,9 @@ cominit(unit, rate) splx(s); } +int comcngetc(dev) + dev_t dev; { register com = com_addr[UNIT(dev)]; short stat; @@ -682,6 +712,7 @@ comcngetc(dev) /* * Console kernel output character routine. */ +void comcnputc(dev, c) dev_t dev; register int c; diff --git a/sys/i386/isa/fd.c b/sys/i386/isa/fd.c index c287ef1850..0cde9c6be3 100644 --- a/sys/i386/isa/fd.c +++ b/sys/i386/isa/fd.c @@ -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 @@ bad: /* 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; { diff --git a/sys/i386/isa/icu.s b/sys/i386/isa/icu.s index d424b1b824..1a71eadfa0 100644 --- a/sys/i386/isa/icu.s +++ b/sys/i386/isa/icu.s @@ -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) diff --git a/sys/i386/isa/if_ed.c b/sys/i386/isa/if_ed.c index 600f611598..47c06641a7 100644 --- a/sys/i386/isa/if_ed.c +++ b/sys/i386/isa/if_ed.c @@ -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); diff --git a/sys/i386/isa/if_ie.c b/sys/i386/isa/if_ie.c index 2a68b1c6fe..613f03e348 100644 --- a/sys/i386/isa/if_ie.c +++ b/sys/i386/isa/if_ie.c @@ -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]; diff --git a/sys/i386/isa/if_is.c b/sys/i386/isa/if_is.c index becfe17487..2216604103 100644 --- a/sys/i386/isa/if_is.c +++ b/sys/i386/isa/if_is.c @@ -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; diff --git a/sys/i386/isa/isa.c b/sys/i386/isa/isa.c index 7a16d42d1d..b40ce6ec2e 100644 --- a/sys/i386/isa/isa.c +++ b/sys/i386/isa/isa.c @@ -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); diff --git a/sys/i386/isa/lpa.c b/sys/i386/isa/lpa.c index 96c2a9b288..d547e80f7d 100644 --- a/sys/i386/isa/lpa.c +++ b/sys/i386/isa/lpa.c @@ -45,7 +45,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ + * $Id: lpa.c,v 1.3 1993/09/24 20:37:32 rgrimes Exp $ */ /* @@ -91,7 +91,7 @@ /* debug flags */ #ifndef DEBUG -#define lprintf +#define lprintf (void) #else #define lprintf if (lpaflag) printf int lpaflag = 1; @@ -217,6 +217,7 @@ lpaprobe(struct isa_device *dvp) * lpaattach() * Install device */ +int lpaattach(isdp) struct isa_device *isdp; { @@ -237,6 +238,7 @@ lpaattach(isdp) * * We forbid all but first open */ +int lpaopen(dev, flag) dev_t dev; int flag; @@ -286,7 +288,7 @@ lpaopen(dev, flag) } /* sleep a moment */ - if ((err = tsleep (sc, LPPRI, "lpaopen", LONG)) != + if ((err = tsleep ((caddr_t)sc, LPPRI, "lpaopen", LONG)) != EWOULDBLOCK) { sc->sc_flags = 0; return (EBUSY); @@ -304,7 +306,7 @@ lpaopen(dev, flag) * pushbytes() * Workhorse for actually spinning and writing bytes to printer */ -static +static int pushbytes(sc) struct lpa_softc *sc; { @@ -338,7 +340,8 @@ pushbytes(sc) */ if (tic > MAX_SLEEP) tic = MAX_SLEEP; - err = tsleep(sc, LPPRI, "lpawrite", tic); + err = tsleep((caddr_t)sc, LPPRI, + "lpawrite", tic); if (err != EWOULDBLOCK) { return (err); } @@ -359,6 +362,7 @@ pushbytes(sc) * lpaclose() * Close on lp. Try to flush data in buffer out. */ +int lpaclose(dev, flag) dev_t dev; int flag; @@ -380,6 +384,7 @@ lpaclose(dev, flag) * lpawrite() * Copy from user's buffer, then print */ +int lpawrite(dev, uio) dev_t dev; struct uio *uio; diff --git a/sys/i386/isa/lpt.c b/sys/i386/isa/lpt.c index 6d65d8a8d1..ea5c6ae711 100644 --- a/sys/i386/isa/lpt.c +++ b/sys/i386/isa/lpt.c @@ -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); } } diff --git a/sys/i386/isa/mcd.c b/sys/i386/isa/mcd.c index 3064d08ed3..97b3f51d99 100644 --- a/sys/i386/isa/mcd.c +++ b/sys/i386/isa/mcd.c @@ -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 @@ loop: /* 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 @@ loop: 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 @@ loop: 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 @@ nextblock: 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 @@ nextblock: } 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 diff --git a/sys/i386/isa/mse.c b/sys/i386/isa/mse.c index 60621ccba8..eebe163268 100644 --- a/sys/i386/isa/mse.c +++ b/sys/i386/isa/mse.c @@ -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; { diff --git a/sys/i386/isa/pccons.c b/sys/i386/isa/pccons.c index 9ccddde6a7..1eb18214d8 100644 --- a/sys/i386/isa/pccons.c +++ b/sys/i386/isa/pccons.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)pccons.c 5.11 (Berkeley) 5/21/91 - * $Id: pccons.c,v 1.7 1993/11/03 20:14:49 ats Exp $ + * $Id: pccons.c,v 1.8 1993/11/17 23:25:17 wollman Exp $ */ /* @@ -97,7 +97,8 @@ static struct video_state { char color; /* color or mono display */ } vs; -int pcprobe(), pcattach(); +static int pcprobe(struct isa_device *); +static int pcattach(struct isa_device *); struct isa_driver pcdriver = { pcprobe, pcattach, "pc", @@ -130,12 +131,15 @@ static int char_count; #define CN_TIMERVAL (hz) /* frequency at which to check cons */ #define CN_TIMO (2*60) /* intervals to allow for output char */ -int pcstart(); -int pcparam(); -int ttrstrt(); -char partab[]; +void pcstart(struct tty *); +int pcparam(struct tty *, struct termios *); +extern char partab[]; +static void cursor(caddr_t, int); +static void sput(int /*u_char*/, int /*u_char*/); +static void pc_xmode_on(void); +static void pc_xmode_off(void); -extern pcopen(dev_t, int, int, struct proc *); +int pcopen(int /*dev_t*/, int, int, struct proc *); /* * Wait for CP to accept last CP command sent * before setting up next command. @@ -198,8 +202,9 @@ int kbd_response() /* * these are both bad jokes */ +int pcprobe(dev) -struct isa_device *dev; + struct isa_device *dev; { int again = 0; int response; @@ -255,8 +260,9 @@ struct isa_device *dev; return (IO_KBDSIZE); } +int pcattach(dev) -struct isa_device *dev; + struct isa_device *dev; { u_short *cp = Crtat + (CGA_BUF-MONO_BUF)/CHR; u_short was; @@ -264,12 +270,14 @@ struct isa_device *dev; if (vs.color == 0) printf("pc%d: type monochrome\n",dev->id_unit); else printf("pc%d: type color\n",dev->id_unit); - cursor(0); + cursor(0, 0); + return 0; } /* ARGSUSED */ +int #ifdef __STDC__ -pcopen(dev_t dev, int flag, int mode, struct proc *p) +pcopen(int /*dev_t*/ dev, int flag, int mode, struct proc *p) #else pcopen(dev, flag, mode, p) dev_t dev; @@ -299,9 +307,10 @@ pcopen(dev, flag, mode, p) } else if (tp->t_state&TS_XCLUDE && p->p_ucred->cr_uid != 0) return (EBUSY); tp->t_state |= TS_CARR_ON; - return ((*linesw[tp->t_line].l_open)(dev, tp)); + return ((*linesw[tp->t_line].l_open)(dev, tp, 0)); } +int pcclose(dev, flag, mode, p) dev_t dev; int flag, mode; @@ -313,17 +322,21 @@ pcclose(dev, flag, mode, p) } /*ARGSUSED*/ +int pcread(dev, uio, flag) dev_t dev; struct uio *uio; + int flag; { return ((*linesw[pccons.t_line].l_read)(&pccons, uio, flag)); } /*ARGSUSED*/ +int pcwrite(dev, uio, flag) dev_t dev; struct uio *uio; + int flag; { return ((*linesw[pccons.t_line].l_write)(&pccons, uio, flag)); } @@ -333,8 +346,11 @@ pcwrite(dev, uio, flag) * the console processor wants to give us a character. * Catch the character, and see who it goes to. */ +void pcrint(dev, irq, cpl) dev_t dev; + int irq; /* XXX ??? */ + int cpl; { int c; char *cp; @@ -366,9 +382,12 @@ pcrint(dev, irq, cpl) #define CONSOLE_X_BELL _IOW('t',123,int[2]) #endif /* XSERVER */ +int pcioctl(dev, cmd, data, flag) dev_t dev; + int cmd; caddr_t data; + int flag; { register struct tty *tp = &pccons; register error; @@ -408,6 +427,7 @@ int pcconsintr = 1; * Got a console transmission interrupt - * the console processor wants another character. */ +void pcxint(dev) dev_t dev; { @@ -424,6 +444,7 @@ pcxint(dev) pcstart(&pccons); } +void pcstart(tp) register struct tty *tp; { @@ -457,6 +478,7 @@ out: splx(s); } +void pccnprobe(cp) struct consdev *cp; { @@ -474,6 +496,7 @@ pccnprobe(cp) } /* ARGSUSED */ +void pccninit(cp) struct consdev *cp; { @@ -486,6 +509,7 @@ pccninit(cp) static __color; /* ARGSUSED */ +void pccnputc(dev, c) dev_t dev; char c; @@ -498,6 +522,7 @@ pccnputc(dev, c) /* * Print a character on console. */ +void pcputchar(c, tp) char c; register struct tty *tp; @@ -508,6 +533,7 @@ pcputchar(c, tp) /* ARGSUSED */ +int pccngetc(dev) dev_t dev; { @@ -526,6 +552,7 @@ pccngetc(dev) return (*cp); } +int pcgetchar(tp) register struct tty *tp; { @@ -543,6 +570,7 @@ pcgetchar(tp) /* * Set line parameters */ +int pcparam(tp, t) register struct tty *tp; register struct termios *t; @@ -577,8 +605,10 @@ pcpoll(onoff) static u_short *crtat = 0; -cursor(int a) -{ int pos = crtat - Crtat; +static void +cursor(caddr_t rock, int arg2) +{ + int pos = crtat - Crtat; #ifdef XSERVER /* 15 Aug 92*/ if (!pc_xmode) { @@ -593,7 +623,7 @@ cursor(int a) outb(addr_6845, 11); outb(addr_6845+1, 18); #endif /* FAT_CURSOR */ - if (a == 0) + if (rock == 0) timeout(cursor, 0, hz/10); #ifdef XSERVER /* 15 Aug 92*/ } @@ -619,9 +649,10 @@ static char bgansitopc[] = * sput has support for emulation of the 'pc3' termcap entry. * if ka, use kernel attributes. */ +static void sput(c, ka) -u_char c; -u_char ka; + u_char c; + u_char ka; { int sc = 1; /* do scroll check */ @@ -923,7 +954,7 @@ u_char ka; crtat -= vs.ncol; } if (ka) - cursor(1); + cursor((caddr_t)1, 0); } @@ -1349,7 +1380,7 @@ static Scan_def scan_codes[] = }; - +void update_led() { int response; @@ -1390,7 +1421,9 @@ update_led() * noblock == 0 wait until a key is gotten. Otherwise return a * if no characters are present 0. */ -char *sgetc(noblock) +char * +sgetc(noblock) + int noblock; { u_char dt; unsigned key; @@ -1623,6 +1656,7 @@ loop: #define del 0177 #define cntld 4 +int getchar() { char thechar; @@ -1691,6 +1725,7 @@ dprintf(flgs, fmt /*, va_alist */) __color = 0; } +void consinit() {} /* -hv- 22-Apr-93: to make init_main more portable */ @@ -1720,7 +1755,8 @@ int pcmmap(dev_t dev, int offset, int nprot) #include "machine/psl.h" #include "machine/frame.h" -pc_xmode_on () +static void +pc_xmode_on (void) { struct syscframe *fp; @@ -1732,6 +1768,7 @@ pc_xmode_on () fp->sf_eflags |= PSL_IOPL; } +static void pc_xmode_off () { struct syscframe *fp; @@ -1740,7 +1777,7 @@ pc_xmode_off () return; pc_xmode = 0; - cursor(0); + cursor(0, 0); fp = (struct syscframe *)curproc->p_regs; fp->sf_eflags &= ~PSL_IOPL; diff --git a/sys/i386/isa/sio.c b/sys/i386/isa/sio.c index 45596ed631..39f2e59d24 100644 --- a/sys/i386/isa/sio.c +++ b/sys/i386/isa/sio.c @@ -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 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 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 @@ bidir_open_top: 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 @@ retry: 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 */ diff --git a/sys/i386/isa/sound/gus_card.c b/sys/i386/isa/sound/gus_card.c index 751b74f651..414034deef 100644 --- a/sys/i386/isa/sound/gus_card.c +++ b/sys/i386/isa/sound/gus_card.c @@ -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; diff --git a/sys/i386/isa/sound/mpu401.c b/sys/i386/isa/sound/mpu401.c index 9dd5cb2c6d..e8c011bc79 100644 --- a/sys/i386/isa/sound/mpu401.c +++ b/sys/i386/isa/sound/mpu401.c @@ -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; diff --git a/sys/i386/isa/sound/os.h b/sys/i386/isa/sound/os.h index 3e3aced70f..4037a0374c 100644 --- a/sys/i386/isa/sound/os.h +++ b/sys/i386/isa/sound/os.h @@ -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) diff --git a/sys/i386/isa/sound/pas2_card.c b/sys/i386/isa/sound/pas2_card.c index e5a2f1fb8c..96fe651fba 100644 --- a/sys/i386/isa/sound/pas2_card.c +++ b/sys/i386/isa/sound/pas2_card.c @@ -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 } diff --git a/sys/i386/isa/sound/sb_dsp.c b/sys/i386/isa/sound/sb_dsp.c index 3802d883cc..efe5befc22 100644 --- a/sys/i386/isa/sound/sb_dsp.c +++ b/sys/i386/isa/sound/sb_dsp.c @@ -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; diff --git a/sys/i386/isa/sound/soundcard.c b/sys/i386/isa/sound/soundcard.c index 4988e06072..1089e872c6 100644 --- a/sys/i386/isa/sound/soundcard.c +++ b/sys/i386/isa/sound/soundcard.c @@ -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; } diff --git a/sys/i386/isa/ultra14f.c b/sys/i386/isa/ultra14f.c index 76dc115185..9ed59f99e5 100644 --- a/sys/i386/isa/ultra14f.c +++ b/sys/i386/isa/ultra14f.c @@ -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 @@ -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); diff --git a/sys/i386/isa/wd.c b/sys/i386/isa/wd.c index c1cda88cb0..85790cbe85 100644 --- a/sys/i386/isa/wd.c +++ b/sys/i386/isa/wd.c @@ -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! */ diff --git a/sys/i386/isa/wdreg.h b/sys/i386/isa/wdreg.h index 5feabf5b50..f49416c5c9 100644 --- a/sys/i386/isa/wdreg.h +++ b/sys/i386/isa/wdreg.h @@ -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 */ diff --git a/sys/isofs/iso.h b/sys/isofs/iso.h index 462039d725..09463b7c9c 100644 --- a/sys/isofs/iso.h +++ b/sys/isofs/iso.h @@ -1,5 +1,5 @@ /* - * $Id: iso.h,v 1.2 1993/07/20 03:27:24 jkh Exp $ + * $Id: iso.h,v 1.3 1993/11/07 17:46:01 wollman Exp $ */ #ifndef _ISOFS_ISO_H_ @@ -112,6 +112,6 @@ int isofs_statfs __P((struct mount *mp, struct statfs *sbp, struct proc *p)); int isofs_sync __P((struct mount *mp, int waitfor)); int isofs_fhtovp __P((struct mount *mp, struct fid *fhp, struct vnode **vpp)); int isofs_vptofh __P((struct vnode *vp, struct fid *fhp)); -int isofs_init __P(()); +void isofs_init __P((void)); #endif /* _ISOFS_ISO_H_ */ diff --git a/sys/isofs/isofs_bmap.c b/sys/isofs/isofs_bmap.c index dd8859bb66..7f07c3d489 100644 --- a/sys/isofs/isofs_bmap.c +++ b/sys/isofs/isofs_bmap.c @@ -1,5 +1,5 @@ /* - * $Id: isofs_bmap.c,v 1.2 1993/05/20 03:30:44 cgd Exp $ + * $Id: isofs_bmap.c,v 1.2 1993/07/20 03:27:26 jkh Exp $ */ #include "param.h" @@ -12,10 +12,11 @@ #include "iso.h" #include "isofs_node.h" +int iso_bmap(ip, lblkno, result) -struct iso_node *ip; -int lblkno; -int *result; + struct iso_node *ip; + int lblkno; + int *result; { *result = (ip->iso_extent + lblkno) * (ip->i_mnt->im_bsize / DEV_BSIZE); diff --git a/sys/isofs/isofs_lookup.c b/sys/isofs/isofs_lookup.c index 049f2346b7..20a3d8d568 100644 --- a/sys/isofs/isofs_lookup.c +++ b/sys/isofs/isofs_lookup.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)ufs_lookup.c 7.33 (Berkeley) 5/19/91 - * $Id: isofs_lookup.c,v 1.3 1993/07/27 10:52:35 davidg Exp $ + * $Id: isofs_lookup.c,v 1.4 1993/10/17 01:48:27 rgrimes Exp $ */ #include "param.h" @@ -87,6 +87,7 @@ struct nchstats nchstats; * * NOTE: (LOOKUP | LOCKPARENT) currently returns the parent inode unlocked. */ +int isofs_lookup(vdp, ndp, p) register struct vnode *vdp; register struct nameidata *ndp; @@ -97,7 +98,7 @@ isofs_lookup(vdp, ndp, p) struct buf *bp = 0; /* a buffer of directory entries */ register struct iso_directory_record *ep; /* the current directory entry */ - int entryoffsetinblock; /* offset of ep in bp's buffer */ + int entryoffsetinblock = 0; /* offset of ep in bp's buffer */ enum {NONE, COMPACT, FOUND} slotstatus; int slotoffset = -1; /* offset of area with free space */ int slotsize; /* size of area at slotoffset */ @@ -388,6 +389,7 @@ found: * is non-zero, fill it in with a pointer to the * remaining space in the directory. */ +int iso_blkatoff(ip, offset, res, bpp) struct iso_node *ip; off_t offset; diff --git a/sys/isofs/isofs_node.c b/sys/isofs/isofs_node.c index 4d0337f66b..5420ee88f0 100644 --- a/sys/isofs/isofs_node.c +++ b/sys/isofs/isofs_node.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)isofs_inode.c - * $Id: isofs_node.c,v 1.4 1993/10/25 03:39:55 rgrimes Exp $ + * $Id: isofs_node.c,v 1.5 1993/11/07 21:47:42 wollman Exp $ */ #include "param.h" @@ -65,6 +65,7 @@ int prtactive; /* 1 => print out reclaim of active vnodes */ /* * Initialize hash links for inodes. */ +void isofs_init() { register int i; @@ -87,6 +88,7 @@ isofs_init() * return the inode locked. Detection and handling of mount * points must be done by the calling routine. */ +int iso_iget(xp, ino, ipp, isodir) struct iso_node *xp; ino_t ino; @@ -102,7 +104,7 @@ iso_iget(xp, ino, ipp, isodir) struct buf *bp; struct dinode *dp; union iso_ihead *ih; - int i, error, result; + int i, error, result = 0; struct iso_mnt *imp; ih = &iso_ihead[INOHASH(dev, ino)]; @@ -207,6 +209,7 @@ FlameOff: /* * Unlock and decrement the reference count of an inode structure. */ +void iso_iput(ip) register struct iso_node *ip; { @@ -221,6 +224,7 @@ iso_iput(ip) * Last reference to an inode, write the inode out and if necessary, * truncate and deallocate the file. */ +int isofs_inactive(vp, p) struct vnode *vp; struct proc *p; @@ -252,6 +256,7 @@ isofs_inactive(vp, p) /* * Reclaim an inode so that it can be used for other purposes. */ +int isofs_reclaim(vp) register struct vnode *vp; { @@ -281,6 +286,7 @@ isofs_reclaim(vp) /* * Lock an inode. If its already locked, set the WANT bit and sleep. */ +void iso_ilock(ip) register struct iso_node *ip; { @@ -300,6 +306,7 @@ iso_ilock(ip) /* * Unlock an inode. If WANT bit is on, wakeup. */ +void iso_iunlock(ip) register struct iso_node *ip; { diff --git a/sys/isofs/isofs_node.h b/sys/isofs/isofs_node.h index 51e8a2d85c..32a9df3e92 100644 --- a/sys/isofs/isofs_node.h +++ b/sys/isofs/isofs_node.h @@ -1,5 +1,5 @@ /* - * $Id: isofs_node.h,v 1.2 1993/07/20 03:27:31 jkh Exp $ + * $Id: isofs_node.h,v 1.3 1993/11/07 17:46:04 wollman Exp $ */ #ifndef _ISOFS_ISOFS_NODE_H_ @@ -90,7 +90,10 @@ int isofs_reclaim __P((struct vnode *vp)); int isofs_lock __P((struct vnode *vp)); int isofs_unlock __P((struct vnode *vp)); int isofs_strategy __P((struct buf *bp)); -int isofs_print __P((struct vnode *vp)); +void isofs_print __P((struct vnode *vp)); int isofs_islocked __P((struct vnode *vp)); +void iso_ilock(struct iso_node *); +void iso_iunlock(struct iso_node *); + #endif /* _ISOFS_ISOFS_NODE_H_ */ diff --git a/sys/isofs/isofs_rrip.c b/sys/isofs/isofs_rrip.c index f59f898832..7b32be6143 100644 --- a/sys/isofs/isofs_rrip.c +++ b/sys/isofs/isofs_rrip.c @@ -28,7 +28,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: isofs_rrip.c,v 1.2 1993/07/27 10:52:36 davidg Exp $ + * $Id: isofs_rrip.c,v 1.3 1993/10/25 19:43:04 rgrimes Exp $ */ #include "param.h" @@ -51,31 +51,32 @@ * POSIX file attribute */ static int isofs_rrip_attr( p, ana ) -ISO_RRIP_ATTR *p; -ISO_RRIP_ANALYZE *ana; + ISO_RRIP_ATTR *p; + ISO_RRIP_ANALYZE *ana; { ana->inode.iso_mode = isonum_731(p->mode_l); ana->inode.iso_uid = (uid_t)isonum_731(p->uid_l); ana->inode.iso_gid = (gid_t)isonum_731(p->gid_l); /* ana->inode.iso_links = isonum_731(p->links_l); */ - return; + return 0; } int isofs_rrip_defattr( isodir, ana ) -struct iso_directory_record *isodir; -ISO_RRIP_ANALYZE *ana; + struct iso_directory_record *isodir; + ISO_RRIP_ANALYZE *ana; { ana->inode.iso_mode = (VREAD|VEXEC|(VREAD|VEXEC)>>3|(VREAD|VEXEC)>>6); ana->inode.iso_uid = (uid_t)0; ana->inode.iso_gid = (gid_t)0; + return 0; } /* * POSIX device modes */ static int isofs_rrip_device( p, ana ) -ISO_RRIP_DEVICE *p; -ISO_RRIP_ANALYZE *ana; + ISO_RRIP_DEVICE *p; + ISO_RRIP_ANALYZE *ana; { char buf[3]; @@ -89,35 +90,35 @@ ISO_RRIP_ANALYZE *ana; isonum_731(p->dev_t_high_l), isonum_731(p->dev_t_low_l) ); - return; + return 0; } /* * Symbolic Links */ static int isofs_rrip_slink( p, ana ) -ISO_RRIP_SLINK *p; -ISO_RRIP_ANALYZE *ana; + ISO_RRIP_SLINK *p; + ISO_RRIP_ANALYZE *ana; { - return; + return 0; } /* * Alternate name */ static int isofs_rrip_altname( p, ana ) -ISO_RRIP_ALTNAME *p; -ISO_RRIP_ANALYZE *ana; + ISO_RRIP_ALTNAME *p; + ISO_RRIP_ANALYZE *ana; { - return; + return 0; } /* * Child Link */ static int isofs_rrip_clink( p, ana ) -ISO_RRIP_CLINK *p; -ISO_RRIP_ANALYZE *ana; + ISO_RRIP_CLINK *p; + ISO_RRIP_ANALYZE *ana; { char buf[3]; buf[0] = p->h.type[0]; @@ -129,7 +130,7 @@ ISO_RRIP_ANALYZE *ana; isonum_733(p->dir_loc) ); ana->inode.iso_cln = isonum_733(p->dir_loc); - return; + return 0; } /* @@ -150,7 +151,7 @@ ISO_RRIP_ANALYZE *ana; isonum_733(p->dir_loc) ); ana->inode.iso_pln = isonum_733(p->dir_loc); - return; + return 0; } /* @@ -167,7 +168,7 @@ ISO_RRIP_ANALYZE *ana; buf[2] = 0x00; printf("isofs:%s[%d]\n",buf, isonum_711(p->h.length) ); - return; + return 0; } /* @@ -298,16 +299,17 @@ ISO_RRIP_ANALYZE *ana; else ana->inode.iso_atime = ana->inode.iso_ctime; } - return; + return 0; } int isofs_rrip_deftstamp( isodir, ana ) -struct iso_directory_record *isodir; -ISO_RRIP_ANALYZE *ana; + struct iso_directory_record *isodir; + ISO_RRIP_ANALYZE *ana; { isofs_rrip_tstamp_conv7(isodir->date, &ana->inode.iso_ctime ); ana->inode.iso_atime = ana->inode.iso_ctime; ana->inode.iso_mtime = ana->inode.iso_ctime; + return 0; } @@ -329,7 +331,7 @@ ISO_RRIP_ANALYZE *ana; buf, isonum_711(p->h.length), p->flags ); - return; + return 0; } /* @@ -350,7 +352,7 @@ ISO_RRIP_ANALYZE *ana; buf, isonum_711(p->h.length), p->flags ); - return; + return 0; } /* @@ -358,10 +360,10 @@ ISO_RRIP_ANALYZE *ana; * Nothing to do.... */ static int isofs_rrip_unknown( p, ana ) -ISO_RRIP_EXFLAG *p; -ISO_RRIP_ANALYZE *ana; + ISO_RRIP_EXFLAG *p; + ISO_RRIP_ANALYZE *ana; { - return; + return 0; } typedef struct { @@ -657,4 +659,5 @@ int isofs_hexdump( p, size ) printf("\n"); } printf("\n"); + return 0; } diff --git a/sys/isofs/isofs_util.c b/sys/isofs/isofs_util.c index 0014cf59ba..3730325536 100644 --- a/sys/isofs/isofs_util.c +++ b/sys/isofs/isofs_util.c @@ -1,7 +1,10 @@ /* - * $Id: isofs_util.c,v 1.3 1993/07/19 13:40:08 cgd Exp $ + * $Id: isofs_util.c,v 1.2 1993/07/20 03:27:33 jkh Exp $ */ +#include "param.h" +#include "systm.h" + int isonum_711 (p) char *p; @@ -88,6 +91,7 @@ unsigned char *p; /* * translate and compare a filename */ +int isofncmp(char *fn, int fnlen, char *isofn, int isolen) { int fnidx; diff --git a/sys/isofs/isofs_vfsops.c b/sys/isofs/isofs_vfsops.c index 9c19cf40e6..92daa29b2e 100644 --- a/sys/isofs/isofs_vfsops.c +++ b/sys/isofs/isofs_vfsops.c @@ -1,5 +1,5 @@ /* - * $Id: isofs_vfsops.c,v 1.2 1993/07/20 03:27:36 jkh Exp $ + * $Id: isofs_vfsops.c,v 1.3 1993/10/24 04:29:08 rgrimes Exp $ */ #include "param.h" @@ -43,6 +43,7 @@ struct vfsops isofs_vfsops = { */ #define ROOTNAME "root_device" +int isofs_mountroot() { register struct mount *mp; @@ -96,6 +97,7 @@ int iso_doforce = 1; * * mount system call */ +int isofs_mount(mp, path, data, ndp, p) register struct mount *mp; char *path; @@ -107,7 +109,7 @@ isofs_mount(mp, path, data, ndp, p) struct ufs_args args; u_int size; int error; - struct iso_mnt *imp; + struct iso_mnt *imp = 0; if (error = copyin(data, (caddr_t)&args, sizeof (struct ufs_args))) return (error); @@ -194,6 +196,7 @@ isofs_mount(mp, path, data, ndp, p) /* * Common code for mount and mountroot */ +int iso_mountfs(devvp, mp, p) register struct vnode *devvp; struct mount *mp; @@ -328,6 +331,7 @@ out: * Nothing to do at the moment. */ /* ARGSUSED */ +int isofs_start(mp, flags, p) struct mount *mp; int flags; @@ -340,6 +344,7 @@ isofs_start(mp, flags, p) /* * unmount system call */ +int isofs_unmount(mp, mntflags, p) struct mount *mp; int mntflags; @@ -374,6 +379,7 @@ isofs_unmount(mp, mntflags, p) /* * Check to see if a filesystem is mounted on a block device. */ +int iso_mountedon(vp) register struct vnode *vp; { @@ -396,6 +402,7 @@ iso_mountedon(vp) /* * Return root of a filesystem */ +int isofs_root(mp, vpp) struct mount *mp; struct vnode **vpp; @@ -423,6 +430,7 @@ isofs_root(mp, vpp) /* * Get file system statistics. */ +int isofs_statfs(mp, sbp, p) struct mount *mp; register struct statfs *sbp; @@ -450,6 +458,7 @@ isofs_statfs(mp, sbp, p) return (0); } +int isofs_sync(mp, waitfor) struct mount *mp; int waitfor; @@ -476,6 +485,7 @@ struct ifid { int ifid_ino; }; +int isofs_fhtovp(mp, fhp, vpp) register struct mount *mp; struct fid *fhp; @@ -552,6 +562,7 @@ isofs_fhtovp(mp, fhp, vpp) * Vnode pointer to File handle */ /* ARGSUSED */ +int isofs_vptofh(vp, fhp) struct vnode *vp; struct fid *fhp; diff --git a/sys/isofs/isofs_vnops.c b/sys/isofs/isofs_vnops.c index 8e40b0587e..ffbce1e34c 100644 --- a/sys/isofs/isofs_vnops.c +++ b/sys/isofs/isofs_vnops.c @@ -1,5 +1,5 @@ /* - * $Id: isofs_vnops.c,v 1.5 1993/07/19 13:40:10 cgd Exp $ + * $Id: isofs_vnops.c,v 1.2 1993/07/20 03:27:37 jkh Exp $ */ #include "param.h" #include "systm.h" @@ -28,6 +28,7 @@ * Nothing to do. */ /* ARGSUSED */ +int isofs_open(vp, mode, cred, p) struct vnode *vp; int mode; @@ -43,6 +44,7 @@ isofs_open(vp, mode, cred, p) * Update the times on the inode on writeable file systems. */ /* ARGSUSED */ +int isofs_close(vp, fflag, cred, p) struct vnode *vp; int fflag; @@ -57,6 +59,7 @@ isofs_close(vp, fflag, cred, p) * The mode is shifted to select the owner/group/other fields. The * super user is granted all permissions. */ +int isofs_access(vp, mode, cred, p) struct vnode *vp; register int mode; @@ -67,6 +70,7 @@ isofs_access(vp, mode, cred, p) } /* ARGSUSED */ +int isofs_getattr(vp, vap, cred, p) struct vnode *vp; register struct vattr *vap; @@ -106,6 +110,7 @@ isofs_getattr(vp, vap, cred, p) * Vnode op for reading. */ /* ARGSUSED */ +int isofs_read(vp, uio, ioflag, cred) struct vnode *vp; register struct uio *uio; @@ -165,6 +170,7 @@ isofs_read(vp, uio, ioflag, cred) } /* ARGSUSED */ +int isofs_ioctl(vp, com, data, fflag, cred, p) struct vnode *vp; int com; @@ -177,6 +183,7 @@ isofs_ioctl(vp, com, data, fflag, cred, p) } /* ARGSUSED */ +int isofs_select(vp, which, fflags, cred, p) struct vnode *vp; int which, fflags; @@ -196,6 +203,7 @@ isofs_select(vp, which, fflags, cred, p) * NB Currently unsupported. */ /* ARGSUSED */ +int isofs_mmap(vp, fflags, cred, p) struct vnode *vp; int fflags; @@ -212,6 +220,7 @@ isofs_mmap(vp, fflags, cred, p) * Nothing to do, so just return. */ /* ARGSUSED */ +int isofs_seek(vp, oldoff, newoff, cred) struct vnode *vp; off_t oldoff, newoff; @@ -224,6 +233,7 @@ isofs_seek(vp, oldoff, newoff, cred) /* * Vnode op for readdir */ +int isofs_readdir(vp, uio, cred, eofflagp) struct vnode *vp; register struct uio *uio; @@ -446,6 +456,7 @@ struct ucred *cred; * done. If a buffer has been saved in anticipation of a CREATE, delete it. */ /* ARGSUSED */ +int isofs_abortop(ndp) struct nameidata *ndp; { @@ -458,6 +469,7 @@ isofs_abortop(ndp) /* * Lock an inode. */ +int isofs_lock(vp) struct vnode *vp; { @@ -470,6 +482,7 @@ isofs_lock(vp) /* * Unlock an inode. */ +int isofs_unlock(vp) struct vnode *vp; { @@ -484,6 +497,7 @@ isofs_unlock(vp) /* * Check for a locked inode. */ +int isofs_islocked(vp) struct vnode *vp; { @@ -498,6 +512,7 @@ isofs_islocked(vp) * then call the device strategy routine. */ +int isofs_strategy(bp) register struct buf *bp; { @@ -526,6 +541,7 @@ isofs_strategy(bp) /* * Print out the contents of an inode. */ +void isofs_print(vp) struct vnode *vp; { diff --git a/sys/kern/dead_vnops.c b/sys/kern/dead_vnops.c index 60eaa474d1..bc0459a6ab 100644 --- a/sys/kern/dead_vnops.c +++ b/sys/kern/dead_vnops.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)dead_vnops.c 7.13 (Berkeley) 4/15/91 - * $Id: dead_vnops.c,v 1.2 1993/10/16 15:23:59 rgrimes Exp $ + * $Id: dead_vnops.c,v 1.3 1993/11/07 21:44:40 wollman Exp $ */ #include "param.h" @@ -174,7 +174,7 @@ int dead_bmap __P(( daddr_t *bnp)); int dead_strategy __P(( struct buf *bp)); -int dead_print __P(( +void dead_print __P(( struct vnode *vp)); #define dead_islocked ((int (*) __P(( \ struct vnode *vp))) nullop) @@ -225,6 +225,7 @@ struct vnodeops dead_vnodeops = { * Trivial lookup routine that always fails. */ /* ARGSUSED */ +int dead_lookup(vp, ndp, p) struct vnode *vp; struct nameidata *ndp; @@ -240,6 +241,7 @@ dead_lookup(vp, ndp, p) * Open always fails as if device did not exist. */ /* ARGSUSED */ +int dead_open(vp, mode, cred, p) struct vnode *vp; int mode; @@ -254,6 +256,7 @@ dead_open(vp, mode, cred, p) * Vnode op for read */ /* ARGSUSED */ +int dead_read(vp, uio, ioflag, cred) struct vnode *vp; struct uio *uio; @@ -275,6 +278,7 @@ dead_read(vp, uio, ioflag, cred) * Vnode op for write */ /* ARGSUSED */ +int dead_write(vp, uio, ioflag, cred) register struct vnode *vp; struct uio *uio; @@ -291,6 +295,7 @@ dead_write(vp, uio, ioflag, cred) * Device ioctl operation. */ /* ARGSUSED */ +int dead_ioctl(vp, com, data, fflag, cred, p) struct vnode *vp; register int com; @@ -306,6 +311,7 @@ dead_ioctl(vp, com, data, fflag, cred, p) } /* ARGSUSED */ +int dead_select(vp, which, fflags, cred, p) struct vnode *vp; int which, fflags; @@ -322,6 +328,7 @@ dead_select(vp, which, fflags, cred, p) /* * Just call the device strategy routine */ +int dead_strategy(bp) register struct buf *bp; { @@ -337,6 +344,7 @@ dead_strategy(bp) /* * Wait until the vnode has finished changing state. */ +int dead_lock(vp) struct vnode *vp; { @@ -349,6 +357,7 @@ dead_lock(vp) /* * Wait until the vnode has finished changing state. */ +int dead_bmap(vp, bn, vpp, bnp) struct vnode *vp; daddr_t bn; @@ -365,6 +374,7 @@ dead_bmap(vp, bn, vpp, bnp) * Print out the contents of a dead vnode. */ /* ARGSUSED */ +void dead_print(vp) struct vnode *vp; { @@ -375,6 +385,7 @@ dead_print(vp) /* * Empty vnode failed operation */ +int dead_ebadf() { @@ -384,6 +395,7 @@ dead_ebadf() /* * Empty vnode bad operation */ +int dead_badop() { @@ -394,6 +406,7 @@ dead_badop() /* * Empty vnode null operation */ +int dead_nullop() { @@ -404,6 +417,7 @@ dead_nullop() * We have to wait during times when the vnode is * in a state of change. */ +int chkvnlock(vp) register struct vnode *vp; { diff --git a/sys/kern/fifo_vnops.c b/sys/kern/fifo_vnops.c index a774fa3736..8fd5ddf5b3 100644 --- a/sys/kern/fifo_vnops.c +++ b/sys/kern/fifo_vnops.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)fifo_vnops.c 7.7 (Berkeley) 4/15/91 - * $Id$ + * $Id: fifo_vnops.c,v 1.4 1993/10/16 15:24:02 rgrimes Exp $ */ #ifdef FIFO @@ -100,6 +100,7 @@ struct vnodeops fifo_vnodeops = { * Trivial lookup routine that always fails. */ /* ARGSUSED */ +int fifo_lookup(vp, ndp, p) struct vnode *vp; struct nameidata *ndp; @@ -116,6 +117,7 @@ fifo_lookup(vp, ndp, p) * to find an active instance of a fifo. */ /* ARGSUSED */ +int fifo_open(vp, mode, cred, p) register struct vnode *vp; int mode; @@ -203,6 +205,7 @@ fifo_open(vp, mode, cred, p) * Vnode op for read */ /* ARGSUSED */ +int fifo_read(vp, uio, ioflag, cred) struct vnode *vp; register struct uio *uio; @@ -222,8 +225,8 @@ fifo_read(vp, uio, ioflag, cred) rso->so_state |= SS_NBIO; startresid = uio->uio_resid; VOP_UNLOCK(vp); - error = soreceive(rso, (struct mbuf **)0, uio, (int *)0, - (struct mbuf **)0, (struct mbuf **)0); + error = soreceive(rso, (struct mbuf **)0, uio, + (struct mbuf **)0, (struct mbuf **)0, (int *)0); VOP_LOCK(vp); /* * Clear EOF indication after first such return. @@ -239,6 +242,7 @@ fifo_read(vp, uio, ioflag, cred) * Vnode op for write */ /* ARGSUSED */ +int fifo_write(vp, uio, ioflag, cred) struct vnode *vp; register struct uio *uio; @@ -266,6 +270,7 @@ fifo_write(vp, uio, ioflag, cred) * Device ioctl operation. */ /* ARGSUSED */ +int fifo_ioctl(vp, com, data, fflag, cred, p) struct vnode *vp; int com; @@ -287,6 +292,7 @@ fifo_ioctl(vp, com, data, fflag, cred, p) } /* ARGSUSED */ +int fifo_select(vp, which, fflag, cred, p) struct vnode *vp; int which, fflag; @@ -306,6 +312,7 @@ fifo_select(vp, which, fflag, cred, p) /* * This is a noop, simply returning what one has been given. */ +int fifo_bmap(vp, bn, vpp, bnp) struct vnode *vp; daddr_t bn; @@ -324,6 +331,7 @@ fifo_bmap(vp, bn, vpp, bnp) * At the moment we do not do any locking. */ /* ARGSUSED */ +int fifo_lock(vp) struct vnode *vp; { @@ -332,6 +340,7 @@ fifo_lock(vp) } /* ARGSUSED */ +int fifo_unlock(vp) struct vnode *vp; { @@ -343,6 +352,7 @@ fifo_unlock(vp) * Device close routine */ /* ARGSUSED */ +int fifo_close(vp, fflag, cred, p) register struct vnode *vp; int fflag; @@ -375,6 +385,7 @@ fifo_close(vp, fflag, cred, p) /* * Print out the contents of a fifo vnode. */ +void fifo_print(vp) struct vnode *vp; { @@ -387,6 +398,7 @@ fifo_print(vp) /* * Print out internal contents of a fifo vnode. */ +void fifo_printinfo(vp) struct vnode *vp; { @@ -399,6 +411,7 @@ fifo_printinfo(vp) /* * Fifo failed operation */ +int fifo_ebadf() { @@ -409,6 +422,7 @@ fifo_ebadf() * Fifo advisory byte-level locks. */ /* ARGSUSED */ +int fifo_advlock(vp, id, op, fl, flags) struct vnode *vp; caddr_t id; @@ -423,6 +437,7 @@ fifo_advlock(vp, id, op, fl, flags) /* * Fifo bad operation */ +int fifo_badop() { diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c index 4de6c4fdb2..775f93f3bd 100644 --- a/sys/kern/init_main.c +++ b/sys/kern/init_main.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)init_main.c 7.41 (Berkeley) 5/15/91 - * $Id: init_main.c,v 1.7 1993/10/08 10:50:42 rgrimes Exp $ + * $Id: init_main.c,v 1.8 1993/10/26 21:59:44 nate Exp $ */ #include "param.h" @@ -87,7 +87,7 @@ struct vnode *rootvp, *swapdev_vp; int boothowto; #if __GNUC__ >= 2 -__main() {} +void __main() {} #endif /* @@ -97,6 +97,7 @@ __main() {} * routines including startup(), which does memory initialization * and autoconfiguration. */ +void main() { register int i; diff --git a/sys/kern/kern__physio.c b/sys/kern/kern__physio.c index 18727647d0..a0635de495 100644 --- a/sys/kern/kern__physio.c +++ b/sys/kern/kern__physio.c @@ -45,7 +45,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: kern__physio.c,v 1.2 1993/10/16 15:24:06 rgrimes Exp $ + * $Id: kern__physio.c,v 1.3 1993/11/18 05:02:33 rgrimes Exp $ */ #include "param.h" @@ -65,12 +65,14 @@ int physio(int (*)(), int, struct buf *, int, int, caddr_t, int *, struct proc * * user process directly for read and write operations.. */ +int rawread(dev, uio) dev_t dev; struct uio *uio; { return (uioapply(physio, cdevsw[major(dev)].d_strategy, dev, uio)); } +int rawwrite(dev, uio) dev_t dev; struct uio *uio; { diff --git a/sys/kern/kern_acct.c b/sys/kern/kern_acct.c index 473869485c..967cdb5529 100644 --- a/sys/kern/kern_acct.c +++ b/sys/kern/kern_acct.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)kern_acct.c 7.18 (Berkeley) 5/11/91 - * $Id: kern_acct.c,v 1.7 1993/11/09 17:04:24 ache Exp $ + * $Id: kern_acct.c,v 1.8 1993/11/12 21:19:58 nate Exp $ */ #include "param.h" @@ -61,6 +61,8 @@ struct timeval chk; /* frequency to check space for accounting */ struct vnode *acctp = NULL; /* file to which to do accounting */ struct vnode *savacctp = NULL; /* file to which to do accounting when space */ +static void acctwatch(caddr_t, int); + /* * Enable or disable process accounting. * @@ -80,6 +82,7 @@ struct sysacct_args { }; /* ARGSUSED */ +int sysacct(p, uap, retval) struct proc *p; struct sysacct_args *uap; @@ -89,7 +92,7 @@ sysacct(p, uap, retval) register struct nameidata *ndp; struct nameidata nd; struct vattr attr; - int rv, acctwatch(); + int rv; if (p->p_ucred->cr_uid != 0) return(EPERM); /* must be root */ @@ -148,7 +151,7 @@ sysacct(p, uap, retval) acctp = nd.ni_vp; savacctp = NULL; VOP_UNLOCK(acctp); - acctwatch(&chk); /* look for full system */ + acctwatch((caddr_t)&chk, 0); /* look for full system */ return(0); /* end successfully */ acct_fail: @@ -161,9 +164,12 @@ acct_fail: * Periodically check the file system to see if accounting * should be turned on or off. */ -acctwatch(resettime) - struct timeval *resettime; +static void +acctwatch(arg1, arg2) + caddr_t arg1; + int arg2; { + struct timeval *resettime = (struct timeval *)arg1; struct statfs sb; int s; @@ -196,6 +202,7 @@ acctwatch(resettime) /* Mark Tinguely (tinguely@plains.NoDak.edu) 8/10/93 */ +void acct(p) register struct proc *p; { diff --git a/sys/kern/kern_clock.c b/sys/kern/kern_clock.c index a0e377b3b0..6464ecc375 100644 --- a/sys/kern/kern_clock.c +++ b/sys/kern/kern_clock.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)kern_clock.c 7.16 (Berkeley) 5/9/91 - * $Id: kern_clock.c,v 1.8 1993/11/09 04:23:29 ache Exp $ + * $Id: kern_clock.c,v 1.9 1993/11/09 17:07:27 ache Exp $ */ #include "param.h" @@ -51,6 +51,9 @@ #include "gprof.h" #endif +static void gatherstats(clockframe *); + + /* From callout.h */ struct callout *callfree, *callout, calltodo; int ncallout; @@ -95,12 +98,13 @@ int ncallout; * If this timer is also being used to gather statistics, * we run through the statistics gathering routine as well. */ +void hardclock(frame) clockframe frame; { register struct callout *p1; register struct proc *p = curproc; - register struct pstats *pstats; + register struct pstats *pstats = 0; register struct rusage *ru; register struct vmspace *vm; register int s; @@ -286,6 +290,7 @@ int dk_ndrive = DK_NDRIVE; * or idle state) for the entire last time interval, and * update statistics accordingly. */ +void gatherstats(framep) clockframe *framep; { @@ -339,6 +344,7 @@ gatherstats(framep) * Run periodic events from timeout queue. */ /*ARGSUSED*/ +void softclock(frame) clockframe frame; { @@ -346,7 +352,7 @@ softclock(frame) for (;;) { register struct callout *p1; register caddr_t arg; - register int (*func)(); + register timeout_func_t func; register int a, s; s = splhigh(); @@ -393,8 +399,9 @@ softclock(frame) /* * Arrange that (*func)(arg) is called in t/hz seconds. */ +void timeout(func, arg, t) - int (*func)(); + timeout_func_t func; caddr_t arg; register int t; { @@ -424,8 +431,9 @@ timeout(func, arg, t) * untimeout is called to remove a function timeout call * from the callout structure. */ +void untimeout(func, arg) - int (*func)(); + timeout_func_t func; caddr_t arg; { register struct callout *p1, *p2; @@ -452,6 +460,7 @@ untimeout(func, arg) */ /* XXX clock_t */ +u_long hzto(tv) struct timeval *tv; { diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index 086ecab870..90f94a1262 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)kern_descrip.c 7.28 (Berkeley) 6/25/91 - * $Id$ + * $Id: kern_descrip.c,v 1.4 1993/10/16 15:24:11 rgrimes Exp $ */ #include "param.h" @@ -61,6 +61,7 @@ extern int maxfdescs; /* maximum number of file descriptors to a process */ * System calls on descriptors. */ /* ARGSUSED */ +int getdtablesize(p, uap, retval) struct proc *p; struct args *uap; @@ -80,6 +81,7 @@ struct dup_args { }; /* ARGSUSED */ +int dup(p, uap, retval) struct proc *p; struct dup_args *uap; @@ -118,6 +120,7 @@ struct dup2_args { }; /* ARGSUSED */ +int dup2(p, uap, retval) struct proc *p; struct dup2_args *uap; @@ -168,6 +171,7 @@ struct fcntl_args { }; /* ARGSUSED */ +int fcntl(p, uap, retval) struct proc *p; register struct fcntl_args *uap; @@ -317,6 +321,7 @@ struct close_args { int fd; }; +int close(p, uap, retval) struct proc *p; struct close_args *uap; @@ -352,6 +357,7 @@ struct fstat_args { }; /* ARGSUSED */ +int fstat(p, uap, retval) struct proc *p; register struct fstat_args *uap; @@ -389,6 +395,7 @@ fstat(p, uap, retval) */ int fdexpand; +int fdalloc(p, want, result) struct proc *p; int want; @@ -457,6 +464,7 @@ fdalloc(p, want, result) * Check to see whether n user file descriptors * are available to the process p. */ +int fdavail(p, n) struct proc *p; register int n; @@ -479,6 +487,7 @@ fdavail(p, n) * Create a new open file structure and allocate * a file decriptor for the process that refers to it. */ +int falloc(p, resultfp, resultfd) register struct proc *p; struct file **resultfp; @@ -526,6 +535,7 @@ falloc(p, resultfp, resultfd) /* * Free a file descriptor. */ +void ffree(fp) register struct file *fp; { @@ -659,6 +669,7 @@ fdcloseexec(p) * Internal form of close. * Decrement reference count on file structure. */ +int closef(fp, p) register struct file *fp; register struct proc *p; @@ -713,6 +724,7 @@ struct flock_args { }; /* ARGSUSED */ +int flock(p, uap, retval) struct proc *p; register struct flock_args *uap; @@ -759,6 +771,7 @@ flock(p, uap, retval) * references to this file will be direct to the other driver. */ /* ARGSUSED */ +int fdopen(dev, mode, type) dev_t dev; int mode, type; @@ -779,6 +792,7 @@ fdopen(dev, mode, type) /* * Duplicate the specified descriptor to a free descriptor. */ +int dupfdopen(fdp, indx, dfd, mode) register struct filedesc *fdp; register int indx, dfd; diff --git a/sys/kern/kern_execve.c b/sys/kern/kern_execve.c index b070aed1d7..22d2ff0585 100644 --- a/sys/kern/kern_execve.c +++ b/sys/kern/kern_execve.c @@ -50,7 +50,7 @@ * Significant limitations and lack of compatiblity with POSIX are * present with this version, to make its basic operation more clear. * - * $Id: kern_execve.c,v 1.7 1993/10/19 00:58:51 nate Exp $ + * $Id: kern_execve.c,v 1.8 1993/10/25 17:26:01 davidg Exp $ */ #include "param.h" @@ -90,6 +90,7 @@ struct execve_args { }; /* ARGSUSED */ +int execve(p, uap, retval) struct proc *p; register struct execve_args *uap; @@ -100,13 +101,13 @@ execve(p, uap, retval) char **argbuf, **argbufp, *stringbuf, *stringbufp; char **vectp, *ep; int needsenv, limitonargs, stringlen, addr, size, len, - rv, amt, argc, tsize, dsize, bsize, cnt, file_offset, + rv, amt, argc = 0, tsize, dsize, bsize, cnt, file_offset, virtual_offset; struct vattr attr; struct vmspace *vs; caddr_t newframe; char shellname[MAXINTERP]; /* 05 Aug 92*/ - char *shellargs; + char *shellargs = 0; union { char ex_shell[MAXINTERP]; /* #! and interpreter name */ struct exec ex_hdr; @@ -506,7 +507,7 @@ dont_bother: p->p_flag |= SEXEC; if (p->p_pptr && (p->p_flag & SPPWAIT)) { p->p_flag &= ~SPPWAIT; - wakeup(p->p_pptr); + wakeup((caddr_t)p->p_pptr); } /* implement set userid/groupid */ diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c index ac967af5fe..338133738a 100644 --- a/sys/kern/kern_exit.c +++ b/sys/kern/kern_exit.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)kern_exit.c 7.35 (Berkeley) 6/27/91 - * $Id: kern_exit.c,v 1.8 1993/10/16 15:24:15 rgrimes Exp $ + * $Id: kern_exit.c,v 1.9 1993/10/19 01:01:20 nate Exp $ */ #include "param.h" @@ -268,6 +268,7 @@ struct owait_args { int compat; }; +int owait(p, uap, retval) struct proc *p; register struct owait_args *uap; @@ -290,6 +291,7 @@ struct wait4_args { int compat; }; +int wait4(p, uap, retval) struct proc *p; struct wait4_args *uap; @@ -319,6 +321,7 @@ struct wait1_args { #endif }; +int wait1(q, uap, retval) register struct proc *q; register struct wait1_args *uap; diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c index 4be3c5fa25..61259920ec 100644 --- a/sys/kern/kern_fork.c +++ b/sys/kern/kern_fork.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)kern_fork.c 7.29 (Berkeley) 5/15/91 - * $Id$ + * $Id: kern_fork.c,v 1.2 1993/10/16 15:24:17 rgrimes Exp $ */ #include "param.h" @@ -48,6 +48,7 @@ #include "vm/vm.h" /* ARGSUSED */ +int fork(p, uap, retval) struct proc *p; void *uap; @@ -58,6 +59,7 @@ fork(p, uap, retval) } /* ARGSUSED */ +int vfork(p, uap, retval) struct proc *p; void *uap; @@ -69,6 +71,7 @@ vfork(p, uap, retval) int nprocs = 1; /* process 0 */ +int fork1(p1, isvfork, retval) register struct proc *p1; int isvfork, retval[]; diff --git a/sys/kern/kern_kinfo.c b/sys/kern/kern_kinfo.c index 605787e4b5..eece7e6216 100644 --- a/sys/kern/kern_kinfo.c +++ b/sys/kern/kern_kinfo.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)kern_kinfo.c 7.17 (Berkeley) 6/26/91 - * $Id: kern_kinfo.c,v 1.4 1993/11/07 21:44:42 wollman Exp $ + * $Id: kern_kinfo.c,v 1.5 1993/11/17 22:06:18 nate Exp $ */ #include "param.h" @@ -58,6 +58,7 @@ struct getkerninfo_args { }; /* ARGSUSED */ +int getkerninfo(p, uap, retval) struct proc *p; register struct getkerninfo_args *uap; @@ -132,14 +133,18 @@ done: */ #define KINFO_PROCSLOP (5 * sizeof (struct kinfo_proc)) +int kinfo_doproc(op, where, acopysize, arg, aneeded) + int op; char *where; - int *acopysize, *aneeded; + int *acopysize; + int arg; + int *aneeded; { register struct proc *p; register struct kinfo_proc *dp = (struct kinfo_proc *)where; - register needed = 0; - int buflen; + register int needed = 0; + int buflen = 0; int doingzomb; struct eproc eproc; int error = 0; @@ -253,9 +258,13 @@ fill_eproc(p, ep) /* * Get file structures. */ +int kinfo_file(op, where, acopysize, arg, aneeded) + int op; register char *where; - int *acopysize, *aneeded; + int *acopysize; + int arg; + int *aneeded; { int buflen, needed, error; struct file *fp; diff --git a/sys/kern/kern_ktrace.c b/sys/kern/kern_ktrace.c index cfd84fcdef..ee5703ec99 100644 --- a/sys/kern/kern_ktrace.c +++ b/sys/kern/kern_ktrace.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)kern_ktrace.c 7.15 (Berkeley) 6/21/91 - * $Id$ + * $Id: kern_ktrace.c,v 1.4 1993/10/16 15:24:20 rgrimes Exp $ */ #ifdef KTRACE @@ -46,8 +46,11 @@ #include "malloc.h" #include "syslog.h" +static void ktrwrite(struct vnode *, struct ktr_header *); + struct ktr_header * ktrgetheader(type) + int type; { register struct ktr_header *kth; struct proc *p = curproc; /* XXX */ @@ -61,6 +64,7 @@ ktrgetheader(type) return (kth); } +void ktrsyscall(vp, code, narg, args) struct vnode *vp; int code, narg, args[]; @@ -83,6 +87,7 @@ ktrsyscall(vp, code, narg, args) FREE(kth, M_TEMP); } +void ktrsysret(vp, code, error, retval) struct vnode *vp; int code, error, retval; @@ -101,6 +106,7 @@ ktrsysret(vp, code, error, retval) FREE(kth, M_TEMP); } +void ktrnamei(vp, path) struct vnode *vp; char *path; @@ -114,11 +120,14 @@ ktrnamei(vp, path) FREE(kth, M_TEMP); } +void ktrgenio(vp, fd, rw, iov, len, error) struct vnode *vp; int fd; enum uio_rw rw; register struct iovec *iov; + int len; + int error; { struct ktr_header *kth = ktrgetheader(KTR_GENIO); register struct ktr_genio *ktp; @@ -150,9 +159,13 @@ done: FREE(ktp, M_TEMP); } +void ktrpsig(vp, sig, action, mask, code) struct vnode *vp; + int sig; sig_t action; + int mask; + int code; { struct ktr_header *kth = ktrgetheader(KTR_PSIG); struct ktr_psig kp; @@ -182,6 +195,7 @@ struct ktrace_args { }; /* ARGSUSED */ +int ktrace(curp, uap, retval) struct proc *curp; register struct ktrace_args *uap; @@ -276,8 +290,11 @@ done: return (error); } +int ktrops(curp, p, ops, facs, vp) struct proc *curp, *p; + int ops; + int facs; struct vnode *vp; { @@ -311,8 +328,11 @@ ktrops(curp, p, ops, facs, vp) return (1); } +int ktrsetchildren(curp, top, ops, facs, vp) struct proc *curp, *top; + int ops; + int facs; struct vnode *vp; { register struct proc *p; @@ -345,6 +365,7 @@ ktrsetchildren(curp, top, ops, facs, vp) /*NOTREACHED*/ } +static void ktrwrite(vp, kth) struct vnode *vp; register struct ktr_header *kth; @@ -399,6 +420,7 @@ ktrwrite(vp, kth) * * TODO: check groups. use caller effective gid. */ +int ktrcanset(callp, targetp) struct proc *callp, *targetp; { diff --git a/sys/kern/kern_malloc.c b/sys/kern/kern_malloc.c index 59bbc0f29c..f05ba1b638 100644 --- a/sys/kern/kern_malloc.c +++ b/sys/kern/kern_malloc.c @@ -31,10 +31,11 @@ * SUCH DAMAGE. * * from: @(#)kern_malloc.c 7.25 (Berkeley) 5/8/91 - * $Id: kern_malloc.c,v 1.3 1993/10/18 03:46:54 davidg Exp $ + * $Id: kern_malloc.c,v 1.4 1993/11/22 07:44:32 jkh Exp $ */ #include "param.h" +#include "systm.h" #include "proc.h" #include "kernel.h" #include "malloc.h" @@ -224,16 +225,17 @@ free(addr, type) /* * Initialize the kernel memory allocator */ +void kmeminit() { register long indx; int npg; #if (MAXALLOCSAVE > MINALLOCSIZE * 32768) - ERROR!_kmeminit:_MAXALLOCSAVE_too_big +# error "kmeminit: MAXALLOCSAVE too big" #endif #if (MAXALLOCSAVE < CLBYTES-1) - ERROR!_kmeminit:_MAXALLOCSAVE_too_small +# error "kmeminit: MAXALLOCSAVE too small" #endif npg = VM_KMEM_SIZE/ NBPG; kmemusage = (struct kmemusage *) kmem_alloc(kernel_map, diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c index f821e6f8fa..fcd6dc21c9 100644 --- a/sys/kern/kern_proc.c +++ b/sys/kern/kern_proc.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)kern_proc.c 7.16 (Berkeley) 6/28/91 - * $Id$ + * $Id: kern_proc.c,v 1.2 1993/10/16 15:24:23 rgrimes Exp $ */ #include "param.h" @@ -49,9 +49,13 @@ #include "ioctl.h" #include "tty.h" +static void pgdelete(struct pgrp *); +static void orphanpg(struct pgrp *); + /* * Is p an inferior of the current process? */ +int inferior(p) register struct proc *p; { @@ -95,9 +99,11 @@ pgfind(pgid) /* * Move p to a new or existing process group (and session) */ +void enterpgrp(p, pgid, mksess) register struct proc *p; pid_t pgid; + int mksess; { register struct pgrp *pgrp = pgfind(pgid); register struct proc **pp; @@ -186,6 +192,7 @@ done: /* * remove process from process group */ +void leavepgrp(p) register struct proc *p; { @@ -206,6 +213,7 @@ done: /* * delete a process group */ +static void pgdelete(pgrp) register struct pgrp *pgrp; { @@ -226,8 +234,6 @@ done: FREE(pgrp, M_PGRP); } -static orphanpg(); - /* * Adjust pgrp jobc counters when specified process changes process group. * We count the number of processes in each process group that "qualify" @@ -238,6 +244,7 @@ static orphanpg(); * entering == 0 => p is leaving specified group. * entering == 1 => p is entering specified group. */ +void fixjobc(p, pgrp, entering) register struct proc *p; register struct pgrp *pgrp; @@ -277,7 +284,7 @@ fixjobc(p, pgrp, entering) * if there are any stopped processes in the group, * hang-up all process in that group. */ -static +static void orphanpg(pg) struct pgrp *pg; { diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c index 867ff517f4..d660280ee1 100644 --- a/sys/kern/kern_prot.c +++ b/sys/kern/kern_prot.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)kern_prot.c 7.21 (Berkeley) 5/3/91 - * $Id$ + * $Id: kern_prot.c,v 1.3 1993/10/16 15:24:24 rgrimes Exp $ */ /* @@ -48,6 +48,7 @@ #include "malloc.h" /* ARGSUSED */ +int getpid(p, uap, retval) struct proc *p; void *uap; @@ -62,6 +63,7 @@ getpid(p, uap, retval) } /* ARGSUSED */ +int getppid(p, uap, retval) struct proc *p; void *uap; @@ -73,6 +75,7 @@ getppid(p, uap, retval) } /* Get process group ID; note that POSIX getpgrp takes no parameter */ +int getpgrp(p, uap, retval) struct proc *p; void *uap; @@ -84,6 +87,7 @@ getpgrp(p, uap, retval) } /* ARGSUSED */ +int getuid(p, uap, retval) struct proc *p; void *uap; @@ -98,6 +102,7 @@ getuid(p, uap, retval) } /* ARGSUSED */ +int geteuid(p, uap, retval) struct proc *p; void *uap; @@ -109,6 +114,7 @@ geteuid(p, uap, retval) } /* ARGSUSED */ +int getgid(p, uap, retval) struct proc *p; void *uap; @@ -128,6 +134,7 @@ getgid(p, uap, retval) * correctly in a library function. */ /* ARGSUSED */ +int getegid(p, uap, retval) struct proc *p; void *uap; @@ -143,6 +150,7 @@ struct getgroups_args { int *gidset; /* XXX not yet POSIX */ }; +int getgroups(p, uap, retval) struct proc *p; register struct getgroups_args *uap; @@ -172,6 +180,7 @@ getgroups(p, uap, retval) } /* ARGSUSED */ +int setsid(p, uap, retval) register struct proc *p; void *uap; @@ -207,6 +216,7 @@ struct setpgid_args { }; /* ARGSUSED */ +int setpgid(curp, uap, retval) struct proc *curp; register struct setpgid_args *uap; @@ -241,6 +251,7 @@ struct setuid_args { }; /* ARGSUSED */ +int setuid(p, uap, retval) struct proc *p; struct setuid_args *uap; @@ -270,6 +281,7 @@ struct seteuid_args { }; /* ARGSUSED */ +int seteuid(p, uap, retval) struct proc *p; struct seteuid_args *uap; @@ -297,6 +309,7 @@ struct setgid_args { }; /* ARGSUSED */ +int setgid(p, uap, retval) struct proc *p; struct setgid_args *uap; @@ -321,6 +334,7 @@ struct setegid_args { }; /* ARGSUSED */ +int setegid(p, uap, retval) struct proc *p; struct setegid_args *uap; @@ -347,6 +361,7 @@ struct osetreuid_args { }; /* ARGSUSED */ +int osetreuid(p, uap, retval) register struct proc *p; struct osetreuid_args *uap; @@ -393,6 +408,7 @@ struct osetregid_args { }; /* ARGSUSED */ +int osetregid(p, uap, retval) register struct proc *p; struct osetregid_args *uap; @@ -437,6 +453,7 @@ struct setgroups_args { }; /* ARGSUSED */ +int setgroups(p, uap, retval) struct proc *p; struct setgroups_args *uap; @@ -466,6 +483,7 @@ setgroups(p, uap, retval) /* * Check if gid is a member of the group set. */ +int groupmember(gid, cred) gid_t gid; register struct ucred *cred; @@ -486,6 +504,7 @@ groupmember(gid, cred) * indicating use of super-powers. * Returns 0 or error. */ +int suser(cred, acflag) struct ucred *cred; u_short *acflag; @@ -516,10 +535,11 @@ crget() * Free a cred structure. * Throws away space when ref count gets to 0. */ +void crfree(cr) struct ucred *cr; { - int s = splimp(); /* ??? */ + int s = splimp(); /* ??? XXX FIXME */ if (--cr->cr_ref != 0) { (void) splx(s); @@ -572,6 +592,7 @@ struct getlogin_args { }; /* ARGSUSED */ +int getlogin(p, uap, retval) struct proc *p; struct getlogin_args *uap; @@ -593,6 +614,7 @@ struct setlogin_args { }; /* ARGSUSED */ +int setlogin(p, uap, retval) struct proc *p; struct setlogin_args *uap; diff --git a/sys/kern/kern_resource.c b/sys/kern/kern_resource.c index 9c398d1960..fd54d121a3 100644 --- a/sys/kern/kern_resource.c +++ b/sys/kern/kern_resource.c @@ -31,10 +31,11 @@ * SUCH DAMAGE. * * from: @(#)kern_resource.c 7.13 (Berkeley) 5/9/91 - * $Id: kern_resource.c,v 1.5 1993/10/16 15:24:26 rgrimes Exp $ + * $Id: kern_resource.c,v 1.6 1993/10/19 01:02:16 nate Exp $ */ #include "param.h" +#include "systm.h" #include "resourcevar.h" #include "malloc.h" #include "proc.h" @@ -50,6 +51,7 @@ struct getpriority_args { int who; }; +int getpriority(curp, uap, retval) struct proc *curp; register struct getpriority_args *uap; @@ -110,6 +112,7 @@ struct setpriority_args { }; /* ARGSUSED */ +int setpriority(curp, uap, retval) struct proc *curp; register struct setpriority_args *uap; @@ -163,6 +166,7 @@ setpriority(curp, uap, retval) return (0); } +int donice(curp, chgp, n) register struct proc *curp, *chgp; register int n; @@ -190,6 +194,7 @@ struct setrlimit_args { }; /* ARGSUSED */ +int setrlimit(p, uap, retval) struct proc *p; register struct setrlimit_args *uap; @@ -273,6 +278,7 @@ struct getrlimit_args { }; /* ARGSUSED */ +int getrlimit(p, uap, retval) struct proc *p; register struct getrlimit_args *uap; @@ -291,6 +297,7 @@ struct getrusage_args { }; /* ARGSUSED */ +int getrusage(p, uap, retval) register struct proc *p; register struct getrusage_args *uap; @@ -322,6 +329,7 @@ getrusage(p, uap, retval) sizeof (struct rusage))); } +void ruadd(ru, ru2) register struct rusage *ru, *ru2; { diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index 6f8ea9db07..9c606609ed 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)kern_sig.c 7.35 (Berkeley) 6/28/91 - * $Id: kern_sig.c,v 1.5 1993/10/16 15:24:27 rgrimes Exp $ + * $Id: kern_sig.c,v 1.6 1993/11/10 03:53:26 ache Exp $ */ #define SIGPROP /* include signal properties table */ @@ -59,6 +59,10 @@ #include "kinfo_proc.h" #include "user.h" /* for coredump */ +static void setsigvec(struct proc *, int, struct sigaction *); +static void stop(struct proc *); +static void sigexit(struct proc *, int); + /* * Can process p, with pcred pc, send the signal signo to process q? */ @@ -77,6 +81,7 @@ struct sigaction_args { }; /* ARGSUSED */ +int sigaction(p, uap, retval) struct proc *p; register struct sigaction_args *uap; @@ -116,6 +121,7 @@ sigaction(p, uap, retval) return (0); } +void setsigvec(p, sig, sa) register struct proc *p; int sig; @@ -229,6 +235,7 @@ struct sigprocmask_args { sigset_t mask; }; +int sigprocmask(p, uap, retval) register struct proc *p; struct sigprocmask_args *uap; @@ -261,6 +268,7 @@ sigprocmask(p, uap, retval) } /* ARGSUSED */ +int sigpending(p, uap, retval) struct proc *p; void *uap; @@ -283,6 +291,7 @@ struct osigvec_args { }; /* ARGSUSED */ +int osigvec(p, uap, retval) struct proc *p; register struct osigvec_args *uap; @@ -327,6 +336,7 @@ struct osigblock_args { int mask; }; +int osigblock(p, uap, retval) register struct proc *p; struct osigblock_args *uap; @@ -344,6 +354,7 @@ struct osigsetmask_args { int mask; }; +int osigsetmask(p, uap, retval) struct proc *p; struct osigsetmask_args *uap; @@ -369,6 +380,7 @@ struct sigsuspend_args { }; /* ARGSUSED */ +int sigsuspend(p, uap, retval) register struct proc *p; struct sigsuspend_args *uap; @@ -397,6 +409,7 @@ struct sigstack_args { }; /* ARGSUSED */ +int sigstack(p, uap, retval) struct proc *p; register struct sigstack_args *uap; @@ -420,6 +433,7 @@ struct kill_args { }; /* ARGSUSED */ +int kill(cp, uap, retval) register struct proc *cp; register struct kill_args *uap; @@ -460,6 +474,7 @@ struct okillpg_args { }; /* ARGSUSED */ +int okillpg(p, uap, retval) struct proc *p; register struct okillpg_args *uap; @@ -476,6 +491,7 @@ okillpg(p, uap, retval) * Common code for kill process group/broadcast kill. * cp is calling process. */ +int killpg1(cp, signo, pgid, all) register struct proc *cp; int signo, pgid, all; @@ -795,6 +811,7 @@ out: * while (sig = CURSIG(curproc)) * psig(sig); */ +int issig(p) register struct proc *p; { @@ -932,6 +949,7 @@ issig(p) * Signals are handled elsewhere. * The process must not be on the run queue. */ +static void stop(p) register struct proc *p; { @@ -1012,6 +1030,7 @@ psig(sig) * If dumping core, save the signal number for the debugger. * Calls exit and does not return. */ +static void sigexit(p, sig) register struct proc *p; int sig; @@ -1037,6 +1056,7 @@ sigexit(p, sig) * or was not produced from the same program, * the link count to the corefile is > 1. */ +int coredump(p) register struct proc *p; { @@ -1131,6 +1151,7 @@ out: * Flag error in case process won't see signal immediately (blocked or ignored). */ /* ARGSUSED */ +int nosys(p, args, retval) struct proc *p; void *args; diff --git a/sys/kern/kern_subr.c b/sys/kern/kern_subr.c index 904f8a1f33..4b17daabf1 100644 --- a/sys/kern/kern_subr.c +++ b/sys/kern/kern_subr.c @@ -31,13 +31,14 @@ * SUCH DAMAGE. * * from: @(#)kern_subr.c 7.7 (Berkeley) 4/15/91 - * $Id: kern_subr.c,v 1.2 1993/10/16 15:24:30 rgrimes Exp $ + * $Id: kern_subr.c,v 1.3 1993/11/18 05:02:34 rgrimes Exp $ */ #include "param.h" #include "systm.h" #include "proc.h" +int uiomove(cp, n, uio) register caddr_t cp; register int n; @@ -93,8 +94,11 @@ uiomove(cp, n, uio) return (error); } +int uioapply(func, arg1, arg2, uio) int (*func)() ; + int arg1; + int arg2; register struct uio *uio; { register struct iovec *iov; @@ -133,6 +137,7 @@ uioapply(func, arg1, arg2, uio) /* * Give next character to user as result of read. */ +int ureadc(c, uio) register int c; register struct uio *uio; @@ -171,6 +176,7 @@ again: return (0); } +void strcat(src, append) register char *src, *append; { @@ -181,14 +187,18 @@ strcat(src, append) ; } +char * strcpy(to, from) - register char *to, *from; + char *to; + const char *from; { - + char *old = to; for (; *to = *from; ++from, ++to) ; + return old; } +void strncpy(to, from, cnt) register char *to, *from; register int cnt; @@ -215,10 +225,11 @@ strcmp(s1, s2) -#ifndef lint /* unused except by ct.c, other oddities XXX */ +#ifdef notdef /* unused except by ct.c, other oddities XXX */ /* * Get next character written in by user from uio. */ +int uwritec(uio) struct uio *uio; { diff --git a/sys/kern/kern_synch.c b/sys/kern/kern_synch.c index 4d3ca14115..907ebd6cbc 100644 --- a/sys/kern/kern_synch.c +++ b/sys/kern/kern_synch.c @@ -32,7 +32,7 @@ * SUCH DAMAGE. * * from: @(#)kern_synch.c 7.18 (Berkeley) 6/27/91 - * $Id$ + * $Id: kern_synch.c,v 1.2 1993/10/16 15:24:32 rgrimes Exp $ */ #include "param.h" @@ -45,12 +45,17 @@ #include "machine/cpu.h" +static void endtsleep(caddr_t, int); + u_char curpri; /* usrpri of curproc */ /* * Force switch among equal priority processes every 100ms. */ -roundrobin() +void +roundrobin(dummy1, dummy2) + caddr_t dummy1; + int dummy2; { need_resched(); @@ -145,7 +150,10 @@ fixpt_t ccpu = 0.95122942450071400909 * FSCALE; /* exp(-1/20) */ /* * Recompute process priorities, once a second */ -schedcpu() +void +schedcpu(dummy1, dummy2) + caddr_t dummy1; + int dummy2; { register fixpt_t loadfac = loadfactor(averunnable[0]); register struct proc *p; @@ -211,6 +219,7 @@ schedcpu() * For all load averages >= 1 and max p_cpu of 255, sleeping for at least * six times the loadfactor will decay p_cpu to zero. */ +void updatepri(p) register struct proc *p; { @@ -259,18 +268,18 @@ int safepri; * if possible, and EINTR is returned if the system call should * be interrupted by the signal (return EINTR). */ +int tsleep(chan, pri, wmesg, timo) caddr_t chan; int pri; - char *wmesg; + const char *wmesg; int timo; { register struct proc *p = curproc; register struct slpque *qp; register s; - int sig, catch = pri & PCATCH; + int sig = 0, catch = pri & PCATCH; extern int cold; - int endtsleep(); s = splhigh(); if (cold || panicstr) { @@ -326,7 +335,7 @@ tsleep(chan, pri, wmesg, timo) p->p_stats->p_ru.ru_nvcsw++; swtch(); #include "ddb.h" -#ifdef NDDB +#if NDDB > 0 /* handy breakpoint location after process "wakes" */ asm(".globl bpendtsleep ; bpendtsleep:"); #endif @@ -354,9 +363,12 @@ resume: * set timeout flag and undo the sleep. If proc * is stopped, just unsleep so it will remain stopped. */ -endtsleep(p) - register struct proc *p; +void +endtsleep(arg1, dummy) + caddr_t arg1; + int dummy; { + register struct proc *p = (struct proc *)arg1; int s = splhigh(); if (p->p_wchan) { @@ -369,9 +381,11 @@ endtsleep(p) splx(s); } +#if 1 /* XXX this should go away... */ /* * Short-term, non-interruptable sleep. */ +void sleep(chan, pri) caddr_t chan; int pri; @@ -417,17 +431,19 @@ sleep(chan, pri) p->p_stat = SSLEEP; p->p_stats->p_ru.ru_nvcsw++; swtch(); -#ifdef NDDB +#if NDDB > 0 /* handy breakpoint location after process "wakes" */ asm(".globl bpendsleep ; bpendsleep:"); #endif curpri = p->p_usrpri; splx(s); } +#endif /* * Remove a process from its wait queue */ +void unsleep(p) register struct proc *p; { @@ -452,6 +468,7 @@ unsleep(p) * Wakeup on "chan"; set all processes * sleeping on chan to run state. */ +void wakeup(chan) register caddr_t chan; { @@ -501,6 +518,7 @@ restart: * Initialize the (doubly-linked) run queues * to be empty. */ +void rqinit() { register int i; @@ -514,6 +532,7 @@ rqinit() * placing it on the run queue if it is in memory, * and awakening the swapper if it isn't in memory. */ +void setrun(p) register struct proc *p; { @@ -555,6 +574,7 @@ setrun(p) * Arrange to reschedule if the resulting priority * is better than that of the current process. */ +void setpri(p) register struct proc *p; { @@ -567,8 +587,9 @@ setpri(p) need_resched(); } -#ifdef NDDB +#if NDDB > 0 #define DDBFUNC(s) ddb_##s +void DDBFUNC(ps) () { int np; struct proc *ap, *p, *pp; diff --git a/sys/kern/kern_time.c b/sys/kern/kern_time.c index cf7964dd29..f613d64653 100644 --- a/sys/kern/kern_time.c +++ b/sys/kern/kern_time.c @@ -31,10 +31,11 @@ * SUCH DAMAGE. * * from: @(#)kern_time.c 7.15 (Berkeley) 3/17/91 - * $Id$ + * $Id: kern_time.c,v 1.3 1993/10/16 15:24:33 rgrimes Exp $ */ #include "param.h" +#include "systm.h" #include "resourcevar.h" #include "kernel.h" #include "proc.h" @@ -57,6 +58,7 @@ struct gettimeofday_args { }; /* ARGSUSED */ +int gettimeofday(p, uap, retval) struct proc *p; register struct gettimeofday_args *uap; @@ -83,6 +85,7 @@ struct settimeofday_args { }; /* ARGSUSED */ +int settimeofday(p, uap, retval) struct proc *p; struct settimeofday_args *uap; @@ -120,6 +123,7 @@ struct adjtime_args { }; /* ARGSUSED */ +int adjtime(p, uap, retval) struct proc *p; register struct adjtime_args *uap; @@ -185,6 +189,7 @@ struct getitimer_args { }; /* ARGSUSED */ +int getitimer(p, uap, retval) struct proc *p; register struct getitimer_args *uap; @@ -222,6 +227,7 @@ struct setitimer_args { }; /* ARGSUSED */ +int setitimer(p, uap, retval) struct proc *p; register struct setitimer_args *uap; @@ -265,9 +271,10 @@ setitimer(p, uap, retval) * This is where delay in processing this timeout causes multiple * SIGALRM calls to be compressed into one. */ -realitexpire(p) - register struct proc *p; +void +realitexpire(caddr_t arg1, int arg2) { + register struct proc *p = (struct proc *)arg1; int s; psignal(p, SIGALRM); @@ -295,6 +302,7 @@ realitexpire(p) * fix it to have at least minimal value (i.e. if it is less * than the resolution of the clock, round it up.) */ +int itimerfix(tv) struct timeval *tv; { @@ -317,6 +325,7 @@ itimerfix(tv) * that it is called in a context where the timers * on which it is operating cannot change in value. */ +int itimerdecr(itp, usec) register struct itimerval *itp; int usec; @@ -356,6 +365,7 @@ expire: * it just gets very confused in this case. * Caveat emptor. */ +void timevaladd(t1, t2) struct timeval *t1, *t2; { @@ -365,6 +375,7 @@ timevaladd(t1, t2) timevalfix(t1); } +void timevalsub(t1, t2) struct timeval *t1, *t2; { @@ -374,6 +385,7 @@ timevalsub(t1, t2) timevalfix(t1); } +void timevalfix(t1) struct timeval *t1; { diff --git a/sys/kern/kern_xxx.c b/sys/kern/kern_xxx.c index a0a1e34883..e20dc41998 100644 --- a/sys/kern/kern_xxx.c +++ b/sys/kern/kern_xxx.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)kern_xxx.c 7.17 (Berkeley) 4/20/91 - * $Id: kern_xxx.c,v 1.4 1993/10/16 15:24:35 rgrimes Exp $ + * $Id: kern_xxx.c,v 1.5 1993/10/24 06:19:56 paul Exp $ */ #include "param.h" @@ -42,6 +42,7 @@ #include "utsname.h" /* ARGSUSED */ +int gethostid(p, uap, retval) struct proc *p; void *uap; @@ -57,6 +58,7 @@ struct sethostid_args { }; /* ARGSUSED */ +int sethostid(p, uap, retval) struct proc *p; struct sethostid_args *uap; @@ -76,6 +78,7 @@ struct gethostname_args { }; /* ARGSUSED */ +int gethostname(p, uap, retval) struct proc *p; struct gethostname_args *uap; @@ -93,6 +96,7 @@ struct sethostname_args { }; /* ARGSUSED */ +int sethostname(p, uap, retval) struct proc *p; register struct sethostname_args *uap; @@ -173,6 +177,7 @@ struct reboot_args { }; /* ARGSUSED */ +int reboot(p, uap, retval) struct proc *p; struct reboot_args *uap; @@ -187,6 +192,7 @@ reboot(p, uap, retval) } #ifdef COMPAT_43 +int oquota() { diff --git a/sys/kern/spec_vnops.c b/sys/kern/spec_vnops.c index d1be0ab627..78874f0aa7 100644 --- a/sys/kern/spec_vnops.c +++ b/sys/kern/spec_vnops.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)spec_vnops.c 7.37 (Berkeley) 5/30/91 - * $Id$ + * $Id: spec_vnops.c,v 1.2 1993/10/16 15:24:37 rgrimes Exp $ */ #include "param.h" @@ -52,13 +52,13 @@ #include "disklabel.h" /* symbolic sleep message strings for devices */ -char devopn[] = "devopn"; -char devio[] = "devio"; -char devwait[] = "devwait"; -char devin[] = "devin"; -char devout[] = "devout"; -char devioc[] = "devioc"; -char devcls[] = "devcls"; +const char devopn[] = "devopn"; +const char devio[] = "devio"; +const char devwait[] = "devwait"; +const char devin[] = "devin"; +const char devout[] = "devout"; +const char devioc[] = "devioc"; +const char devcls[] = "devcls"; struct vnodeops spec_vnodeops = { spec_lookup, /* lookup */ @@ -99,6 +99,7 @@ struct vnodeops spec_vnodeops = { /* * Trivial lookup routine that always fails. */ +int spec_lookup(vp, ndp, p) struct vnode *vp; struct nameidata *ndp; @@ -116,6 +117,7 @@ spec_lookup(vp, ndp, p) * Otherwise, call device driver open function. */ /* ARGSUSED */ +int spec_open(vp, mode, cred, p) register struct vnode *vp; int mode; @@ -153,6 +155,7 @@ spec_open(vp, mode, cred, p) * Vnode op for read */ /* ARGSUSED */ +int spec_read(vp, uio, ioflag, cred) register struct vnode *vp; register struct uio *uio; @@ -237,6 +240,7 @@ spec_read(vp, uio, ioflag, cred) * Vnode op for write */ /* ARGSUSED */ +int spec_write(vp, uio, ioflag, cred) register struct vnode *vp; register struct uio *uio; @@ -319,6 +323,7 @@ spec_write(vp, uio, ioflag, cred) * Device ioctl operation. */ /* ARGSUSED */ +int spec_ioctl(vp, com, data, fflag, cred, p) struct vnode *vp; int com; @@ -351,6 +356,7 @@ spec_ioctl(vp, com, data, fflag, cred, p) } /* ARGSUSED */ +int spec_select(vp, which, fflags, cred, p) struct vnode *vp; int which, fflags; @@ -373,6 +379,7 @@ spec_select(vp, which, fflags, cred, p) /* * Just call the device strategy routine */ +int spec_strategy(bp) register struct buf *bp; { @@ -384,6 +391,7 @@ spec_strategy(bp) /* * This is a noop, simply returning what one has been given. */ +int spec_bmap(vp, bn, vpp, bnp) struct vnode *vp; daddr_t bn; @@ -402,6 +410,7 @@ spec_bmap(vp, bn, vpp, bnp) * At the moment we do not do any locking. */ /* ARGSUSED */ +int spec_lock(vp) struct vnode *vp; { @@ -410,6 +419,7 @@ spec_lock(vp) } /* ARGSUSED */ +int spec_unlock(vp) struct vnode *vp; { @@ -421,6 +431,7 @@ spec_unlock(vp) * Device close routine */ /* ARGSUSED */ +int spec_close(vp, flag, cred, p) register struct vnode *vp; int flag; @@ -428,7 +439,7 @@ spec_close(vp, flag, cred, p) struct proc *p; { dev_t dev = vp->v_rdev; - int (*devclose) __P((dev_t, int, int, struct proc *)); + int (*devclose) __P((int /*dev_t*/, int, int, struct proc *)); int mode; switch (vp->v_type) { @@ -479,6 +490,7 @@ spec_close(vp, flag, cred, p) /* * Print out the contents of a special device vnode. */ +void spec_print(vp) struct vnode *vp; { @@ -491,6 +503,7 @@ spec_print(vp) * Special device advisory byte-level locks. */ /* ARGSUSED */ +int spec_advlock(vp, id, op, fl, flags) struct vnode *vp; caddr_t id; @@ -505,6 +518,7 @@ spec_advlock(vp, id, op, fl, flags) /* * Special device failed operation */ +int spec_ebadf() { @@ -514,6 +528,7 @@ spec_ebadf() /* * Special device bad operation */ +int spec_badop() { diff --git a/sys/kern/subr_log.c b/sys/kern/subr_log.c index fac6060ab7..9cf12d220a 100644 --- a/sys/kern/subr_log.c +++ b/sys/kern/subr_log.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)subr_log.c 7.11 (Berkeley) 3/17/91 - * $Id$ + * $Id: subr_log.c,v 1.4 1993/10/16 15:24:39 rgrimes Exp $ */ /* @@ -60,6 +60,7 @@ struct logsoftc { int log_open; /* also used in log() */ /*ARGSUSED*/ +int logopen(dev, flags, mode, p) dev_t dev; int flags, mode; @@ -88,15 +89,19 @@ logopen(dev, flags, mode, p) } /*ARGSUSED*/ +int logclose(dev, flag) dev_t dev; + int flag; { log_open = 0; logsoftc.sc_state = 0; logsoftc.sc_sel = 0; /* 16 Jun 93 */ + return 0; } /*ARGSUSED*/ +int logread(dev, uio, flag) dev_t dev; struct uio *uio; @@ -142,6 +147,7 @@ logread(dev, uio, flag) } /*ARGSUSED*/ +int logselect(dev, rw, p) dev_t dev; int rw; @@ -163,6 +169,7 @@ logselect(dev, rw, p) return (0); } +void logwakeup() { struct proc *p; @@ -186,8 +193,12 @@ logwakeup() } /*ARGSUSED*/ +int logioctl(dev, com, data, flag) + dev_t dev; + int com; caddr_t data; + int flag; { long l; int s; diff --git a/sys/kern/subr_rlist.c b/sys/kern/subr_rlist.c index b8fc075033..3880792716 100644 --- a/sys/kern/subr_rlist.c +++ b/sys/kern/subr_rlist.c @@ -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; diff --git a/sys/kern/subr_xxx.c b/sys/kern/subr_xxx.c index d60ca644db..df459c0dba 100644 --- a/sys/kern/subr_xxx.c +++ b/sys/kern/subr_xxx.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)subr_xxx.c 7.10 (Berkeley) 4/20/91 - * $Id$ + * $Id: subr_xxx.c,v 1.2 1993/10/16 15:24:45 rgrimes Exp $ */ /* @@ -45,6 +45,7 @@ /* * Unsupported device function (e.g. writing to read-only device). */ +int enodev() { @@ -54,6 +55,7 @@ enodev() /* * Unconfigured device function; driver not configured. */ +int enxio() { @@ -63,6 +65,7 @@ enxio() /* * Unsupported ioctl function. */ +int enoioctl() { @@ -74,6 +77,7 @@ enoioctl() * This is used for an otherwise-reasonable operation * that is not supported by the current system binary. */ +int enosys() { @@ -84,6 +88,7 @@ enosys() * Return error for operation not supported * on a specific object or file type. */ +int eopnotsupp() { @@ -93,6 +98,7 @@ eopnotsupp() /* * Generic null operation, always returns success. */ +int nullop() { diff --git a/sys/kern/sys_generic.c b/sys/kern/sys_generic.c index 40a30c806f..1a60e0194e 100644 --- a/sys/kern/sys_generic.c +++ b/sys/kern/sys_generic.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)sys_generic.c 7.30 (Berkeley) 5/30/91 - * $Id$ + * $Id: sys_generic.c,v 1.4 1993/10/16 15:24:47 rgrimes Exp $ */ #include "param.h" @@ -59,6 +59,7 @@ struct read_args { * Read system call. */ /* ARGSUSED */ +int read(p, uap, retval) struct proc *p; register struct read_args *uap; @@ -117,6 +118,7 @@ struct readv_args { }; /* ARGSUSED */ +int readv(p, uap, retval) struct proc *p; register struct readv_args *uap; @@ -126,7 +128,7 @@ readv(p, uap, retval) register struct filedesc *fdp = p->p_fd; struct uio auio; register struct iovec *iov; - struct iovec *saveiov; + struct iovec *saveiov = 0; struct iovec aiov[UIO_SMALLIOV]; long i, cnt, error = 0; unsigned iovlen; @@ -207,6 +209,7 @@ struct write_args { unsigned count; }; +int write(p, uap, retval) struct proc *p; register struct write_args *uap; @@ -268,6 +271,7 @@ struct writev_args { unsigned iovcnt; }; +int writev(p, uap, retval) struct proc *p; register struct writev_args *uap; @@ -277,7 +281,7 @@ writev(p, uap, retval) register struct filedesc *fdp = p->p_fd; struct uio auio; register struct iovec *iov; - struct iovec *saveiov; + struct iovec *saveiov = 0; struct iovec aiov[UIO_SMALLIOV]; long i, cnt, error = 0; unsigned iovlen; @@ -362,6 +366,7 @@ struct ioctl_args { }; /* ARGSUSED */ +int ioctl(p, uap, retval) struct proc *p; register struct ioctl_args *uap; @@ -500,6 +505,7 @@ struct select_args { struct timeval *tv; }; +int select(p, uap, retval) register struct proc *p; register struct select_args *uap; @@ -605,6 +611,7 @@ selscan(struct proc *p, fd_set *ibits, fd_set *obits, int nfd, int *retval) case 1: flag = FWRITE; break; + default: /* pacify GCC */ case 2: flag = 0; break; } @@ -630,14 +637,14 @@ selscan(struct proc *p, fd_set *ibits, fd_set *obits, int nfd, int *retval) /*ARGSUSED*/ int -seltrue(dev_t dev, int which, struct proc *p) +seltrue(int /*dev_t*/ dev, int which, struct proc *p) { return (1); } void -selwakeup(pid_t pid, int coll) +selwakeup(int /*pid_t*/ pid, int coll) { register struct proc *p; diff --git a/sys/kern/sys_process.c b/sys/kern/sys_process.c index ecb7da3e97..c2e23b0568 100644 --- a/sys/kern/sys_process.c +++ b/sys/kern/sys_process.c @@ -31,10 +31,11 @@ * SUCH DAMAGE. * * from: @(#)sys_process.c 7.22 (Berkeley) 5/11/91 - * $Id$ + * $Id: sys_process.c,v 1.6 1993/11/16 09:55:03 davidg Exp $ */ #include "param.h" +#include "systm.h" #include "proc.h" #include "vnode.h" #include "buf.h" @@ -111,7 +112,8 @@ pread (struct proc *procp, unsigned int addr, unsigned int *retval) { rv = vm_map_pageable (kernel_map, kva, kva + PAGE_SIZE, 0); if (!rv) { *retval = 0; - bcopy (kva + page_offset, retval, sizeof *retval); + bcopy ((caddr_t)(kva + page_offset), retval, + sizeof *retval); } vm_map_remove (kernel_map, kva, kva + PAGE_SIZE); } @@ -202,7 +204,7 @@ pwrite (struct proc *procp, unsigned int addr, unsigned int datum) { rv = vm_map_pageable (kernel_map, kva, kva + PAGE_SIZE, 0); if (!rv) { - bcopy (&datum, kva + page_offset, sizeof datum); + bcopy (&datum, (caddr_t)(kva + page_offset), sizeof datum); } vm_map_remove (kernel_map, kva, kva + PAGE_SIZE); } @@ -223,6 +225,7 @@ struct ptrace_args { /* * Process debugging system call. */ +int ptrace(curp, uap, retval) struct proc *curp; register struct ptrace_args *uap; @@ -384,6 +387,7 @@ ptrace(curp, uap, retval) return 0; } +int procxmt(p) register struct proc *p; { @@ -402,6 +406,7 @@ struct profil_args { }; /* ARGSUSED */ +int profil(p, uap, retval) struct proc *p; register struct profil_args *uap; diff --git a/sys/kern/sys_socket.c b/sys/kern/sys_socket.c index 59d2cfee0c..d1cc890fc6 100644 --- a/sys/kern/sys_socket.c +++ b/sys/kern/sys_socket.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)sys_socket.c 7.11 (Berkeley) 4/16/91 - * $Id$ + * $Id: sys_socket.c,v 1.2 1993/10/16 15:24:50 rgrimes Exp $ */ #include "param.h" @@ -51,6 +51,7 @@ struct fileops socketops = { soo_read, soo_write, soo_ioctl, soo_select, soo_close }; /* ARGSUSED */ +int soo_read(fp, uio, cred) struct file *fp; struct uio *uio; @@ -62,6 +63,7 @@ soo_read(fp, uio, cred) } /* ARGSUSED */ +int soo_write(fp, uio, cred) struct file *fp; struct uio *uio; @@ -72,6 +74,7 @@ soo_write(fp, uio, cred) uio, (struct mbuf *)0, (struct mbuf *)0, 0)); } +int soo_ioctl(fp, cmd, data, p) struct file *fp; int cmd; @@ -130,6 +133,7 @@ soo_ioctl(fp, cmd, data, p) (struct mbuf *)cmd, (struct mbuf *)data, (struct mbuf *)0)); } +int soo_select(fp, which, p) struct file *fp; int which; @@ -169,6 +173,7 @@ soo_select(fp, which, p) return (0); } +int soo_stat(so, ub) register struct socket *so; register struct stat *ub; @@ -181,6 +186,7 @@ soo_stat(so, ub) } /* ARGSUSED */ +int soo_close(fp, p) struct file *fp; struct proc *p; diff --git a/sys/kern/sysv_shm.c b/sys/kern/sysv_shm.c index adb8111723..0d87d5206f 100644 --- a/sys/kern/sysv_shm.c +++ b/sys/kern/sysv_shm.c @@ -37,7 +37,7 @@ * * from: Utah $Hdr: uipc_shm.c 1.9 89/08/14$ * from: @(#)sysv_shm.c 7.15 (Berkeley) 5/13/91 - * $Id: sysv_shm.c,v 1.4 1993/10/16 15:24:52 rgrimes Exp $ + * $Id: sysv_shm.c,v 1.5 1993/11/07 17:46:20 wollman Exp $ */ /* @@ -68,8 +68,8 @@ struct shmid_ds *shmsegs; struct shminfo shminfo; -int shmat(), shmctl(), shmdt(), shmget(); -int (*shmcalls[])() = { shmat, shmctl, shmdt, shmget }; +int shmat(), shmctl(), shmdt(), shmget(); /* XXX */ +int (*shmcalls[])() = { shmat, shmctl, shmdt, shmget }; /* XXX */ int shmtot = 0; /* @@ -89,8 +89,12 @@ struct shmhandle { caddr_t shmh_id; }; +static void shmufree(struct proc *, struct shmdesc *); +static void shmfree(struct shmid_ds *); + vm_map_t shm_map; /* address space for shared memory segments */ +void shminit() { register int i; @@ -114,6 +118,7 @@ struct shmsys_args { u_int which; }; +int shmsys(p, uap, retval) struct proc *p; struct shmsys_args *uap; @@ -135,6 +140,7 @@ struct shmget_args { int shmflg; }; +int shmget(p, uap, retval) struct proc *p; register struct shmget_args *uap; @@ -232,6 +238,7 @@ struct shmctl_args { }; /* ARGSUSED */ +int shmctl(p, uap, retval) struct proc *p; register struct shmctl_args *uap; @@ -303,6 +310,7 @@ struct shmat_args { int shmflg; }; +int shmat(p, uap, retval) struct proc *p; register struct shmat_args *uap; @@ -386,6 +394,7 @@ struct shmdt_args { }; /* ARGSUSED */ +int shmdt(p, uap, retval) struct proc *p; struct shmdt_args *uap; @@ -403,8 +412,10 @@ shmdt(p, uap, retval) return(EINVAL); shmufree(p, shmd); shmsegs[shmd->shmd_id % SHMMMNI].shm_lpid = p->p_pid; + return 0; } +void shmfork(p1, p2, isvfork) struct proc *p1, *p2; int isvfork; @@ -427,6 +438,7 @@ shmfork(p1, p2, isvfork) shmsegs[shmd->shmd_id % SHMMMNI].shm_nattch++; } +void shmexit(p) struct proc *p; { @@ -441,6 +453,7 @@ shmexit(p) p->p_vmspace->vm_shm = NULL; } +int shmvalid(id) register int id; { @@ -458,6 +471,7 @@ shmvalid(id) /* * Free user resources associated with a shared memory segment */ +static void shmufree(p, shmd) struct proc *p; struct shmdesc *shmd; @@ -477,6 +491,7 @@ shmufree(p, shmd) /* * Deallocate resources associated with a shared memory segment */ +static void shmfree(shp) register struct shmid_ds *shp; { @@ -509,6 +524,7 @@ shmfree(shp) * XXX This routine would be common to all sysV style IPC * (if the others were implemented). */ +int ipcaccess(ipc, mode, cred) register struct ipc_perm *ipc; int mode; diff --git a/sys/kern/tty.c b/sys/kern/tty.c index 002180bedc..8ea660bf68 100644 --- a/sys/kern/tty.c +++ b/sys/kern/tty.c @@ -32,7 +32,7 @@ * SUCH DAMAGE. * * from: @(#)tty.c 7.44 (Berkeley) 5/28/91 - * $Id: tty.c,v 1.7 1993/11/08 19:15:00 ache Exp $ + * $Id: tty.c,v 1.8 1993/11/14 23:29:31 ache Exp $ */ #include "param.h" @@ -68,12 +68,12 @@ static int proc_compare __P((struct proc *p1, struct proc *p2)); /* symbolic sleep message strings */ -char ttyin[] = "ttyin"; -char ttyout[] = "ttyout"; -char ttopen[] = "ttyopn"; -char ttclos[] = "ttycls"; -char ttybg[] = "ttybg"; -char ttybuf[] = "ttybuf"; +const char ttyin[] = "ttyin"; +const char ttyout[] = "ttyout"; +const char ttopen[] = "ttyopn"; +const char ttclos[] = "ttycls"; +const char ttybg[] = "ttybg"; +const char ttybuf[] = "ttybuf"; /* * Table giving parity for characters and indicating @@ -158,6 +158,7 @@ extern struct tty *constty; /* temporary virtual console */ #define ttbreakc(c) ((c) == '\n' || ((c) == cc[VEOF] || \ (c) == cc[VEOL] || (c) == cc[VEOL2]) && (c) != _POSIX_VDISABLE) +void ttychars(tp) struct tty *tp; { @@ -168,6 +169,7 @@ ttychars(tp) /* * Flush tty after output has drained. */ +int ttywflush(tp) struct tty *tp; { @@ -181,6 +183,7 @@ ttywflush(tp) /* * Wait for output to drain. */ +int ttywait(tp) register struct tty *tp; { @@ -208,10 +211,12 @@ ttywait(tp) * Flush TTY read and/or write queues, * notifying anyone waiting. */ +void ttyflush(tp, rw) register struct tty *tp; + int rw; { - register s; + register int s; s = spltty(); if (rw & FWRITE) @@ -269,6 +274,7 @@ ttyflush(tp, rw) * driver. */ /* static void */ +void ttyblock(tp) struct tty *tp; { @@ -289,7 +295,7 @@ ttyblock(tp) * off our input flow control bits and propagate the change to the driver. */ /* static */ -int +void ttyunblock(tp) struct tty *tp; { @@ -302,6 +308,7 @@ ttyunblock(tp) ttstart(tp); } +void ttstart(tp) struct tty *tp; { @@ -310,6 +317,7 @@ ttstart(tp) (*tp->t_oproc)(tp); } +void ttrstrt(tp) /* XXX */ struct tty *tp; { @@ -330,9 +338,12 @@ ttrstrt(tp) /* XXX */ * and/or reject any of these ioctl commands. */ /*ARGSUSED*/ +int ttioctl(tp, com, data, flag) register struct tty *tp; + int com; caddr_t data; + int flag; { register struct proc *p = curproc; /* XXX */ extern int nldisp; @@ -395,9 +406,9 @@ ttioctl(tp, com, data, flag) if (t != tp->t_line) { s = spltty(); (*linesw[tp->t_line].l_close)(tp, flag); - error = (*linesw[t].l_open)(dev, tp); + error = (*linesw[t].l_open)(dev, tp, 0); if (error) { - (void)(*linesw[tp->t_line].l_open)(dev, tp); + (void)(*linesw[tp->t_line].l_open)(dev, tp, 0); splx(s); return (error); } @@ -636,6 +647,7 @@ ttioctl(tp, com, data, flag) return (0); } +int ttnread(tp) struct tty *tp; { @@ -649,6 +661,7 @@ ttnread(tp) return (nread); } +int ttselect(dev, rw, p) dev_t dev; int rw; @@ -691,9 +704,11 @@ win: /* * Initial open of tty, or (re)entry to standard tty line discipline. */ -ttyopen(dev, tp) +int +ttyopen(dev, tp, dummy) dev_t dev; register struct tty *tp; + int dummy; { tp->t_dev = dev; @@ -712,6 +727,7 @@ ttyopen(dev, tp) /* * "close" a line discipline */ +void ttylclose(tp, flag) struct tty *tp; int flag; @@ -728,6 +744,7 @@ ttylclose(tp, flag) * bumping generation number so that pending read/write calls * can detect recycling of the tty. */ +int ttyclose(tp) register struct tty *tp; { @@ -746,8 +763,10 @@ ttyclose(tp) * Flag indicates new state of carrier. * Returns 0 if the line should be turned off, otherwise 1. */ +int ttymodem(tp, flag) register struct tty *tp; + int flag; { if ((tp->t_state&TS_WOPEN) == 0 && (tp->t_lflag&MDMBUF)) { @@ -786,6 +805,7 @@ ttymodem(tp, flag) * Default modem control routine (for other line disciplines). * Return argument flag, to turn off device on carrier drop. */ +int nullmodem(tp, flag) register struct tty *tp; int flag; @@ -808,6 +828,7 @@ nullmodem(tp, flag) * reinput pending characters after state switch * call at spltty(). */ +void ttypend(tp) register struct tty *tp; { @@ -829,8 +850,9 @@ ttypend(tp) /* * Process input of a single character received on a tty. */ +void ttyinput(c, tp) - register c; + register int c; register struct tty *tp; { register int iflag = tp->t_iflag; @@ -1151,8 +1173,9 @@ startoutput: * Returns < 0 if putc succeeds, otherwise returns char to resend. * Must be recursive. */ +int ttyoutput(c, tp) - register c; + register int c; register struct tty *tp; { register int col; @@ -1251,9 +1274,11 @@ ttyoutput(c, tp) /* * Process a read call on a tty device. */ +int ttread(tp, uio, flag) register struct tty *tp; struct uio *uio; + int flag; { register struct ringb *qp; register int c; @@ -1378,12 +1403,12 @@ loop: * Sleeps here are not interruptible, but we return prematurely * if new signals come in. */ +int ttycheckoutq(tp, wait) register struct tty *tp; int wait; { int hiwat, s, oldsig; - extern int wakeup(); hiwat = tp->t_hiwat; s = spltty(); @@ -1398,7 +1423,8 @@ ttycheckoutq(tp, wait) splx(s); return (0); } - timeout(wakeup, (caddr_t)&tp->t_out, hz); + timeout((timeout_func_t)wakeup, (caddr_t)&tp->t_out, + hz); /* XXX */ tp->t_state |= TS_ASLEEP; tsleep((caddr_t)&tp->t_out, PZERO - 1, "ttchout", 0); } @@ -1409,11 +1435,13 @@ ttycheckoutq(tp, wait) /* * Process a write call on a tty device. */ +int ttwrite(tp, uio, flag) register struct tty *tp; register struct uio *uio; + int flag; { - register char *cp; + register char *cp = 0; register int cc = 0, ce; register struct proc *p = curproc; int i, hiwat, cnt, error, s; @@ -1611,8 +1639,9 @@ ovhiwat: * Rubout one character from the rawq of tp * as cleanly as possible. */ +void ttyrub(c, tp) - register c; + register int c; register struct tty *tp; { char *cp; @@ -1699,6 +1728,7 @@ ttyrub(c, tp) * Crt back over cnt chars perhaps * erasing them. */ +void ttyrubo(tp, cnt) register struct tty *tp; int cnt; @@ -1712,6 +1742,7 @@ ttyrubo(tp, cnt) * Reprint the rawq line. * We assume c_cc has already been checked. */ +void ttyretype(tp) register struct tty *tp; { @@ -1739,8 +1770,9 @@ ttyretype(tp) /* * Echo a typed character to the terminal. */ +void ttyecho(c, tp) - register c; + register int c; register struct tty *tp; { if ((tp->t_state & TS_CNTTB) == 0) @@ -1770,6 +1802,7 @@ ttyecho(c, tp) /* * send string cp to tp */ +void ttyoutstr(cp, tp) register char *cp; register struct tty *tp; @@ -1783,6 +1816,7 @@ ttyoutstr(cp, tp) /* * Wake up any readers on a tty. */ +void ttwakeup(tp) register struct tty *tp; { @@ -1801,7 +1835,9 @@ ttwakeup(tp) * Look up a code for a specified speed in a conversion table; * used by drivers to map software speed values to hardware parameters. */ +int ttspeedtab(speed, table) + int speed; register struct speedtab *table; { @@ -1818,6 +1854,7 @@ ttspeedtab(speed, table) * from hi to low water. * */ +void ttsetwater(tp) struct tty *tp; { @@ -1835,6 +1872,7 @@ ttsetwater(tp) /* * Report on state of foreground process group. */ +void ttyinfo(tp) register struct tty *tp; { @@ -1972,6 +2010,7 @@ proc_compare(p1, p2) /* * Output char to tty; console putchar style. */ +int tputchar(c, tp) int c; struct tty *tp; @@ -1996,11 +2035,12 @@ tputchar(c, tp) * reported by tsleep. If the tty is revoked, restarting a pending * call will redo validation done at the start of the call. */ +int ttysleep(tp, chan, pri, wmesg, timo) struct tty *tp; caddr_t chan; int pri; - char *wmesg; + const char *wmesg; int timo; { int error; diff --git a/sys/kern/tty_compat.c b/sys/kern/tty_compat.c index 84e9ec672c..b6897ad107 100644 --- a/sys/kern/tty_compat.c +++ b/sys/kern/tty_compat.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)tty_compat.c 7.10 (Berkeley) 5/9/91 - * $Id$ + * $Id: tty_compat.c,v 1.2 1993/10/16 15:24:57 rgrimes Exp $ */ /* @@ -51,6 +51,10 @@ #include "kernel.h" #include "syslog.h" +static int ttcompatgetflags(struct tty *); +static void ttcompatsetflags(struct tty *, struct termios *); +static void ttcompatsetlflags(struct tty *, struct termios *); + int ttydebug = 0; static struct speedtab compatspeeds[] = { @@ -81,9 +85,12 @@ static int compatspcodes[] = { }; /*ARGSUSED*/ +int ttcompat(tp, com, data, flag) register struct tty *tp; + int com; caddr_t data; + int flag; { switch (com) { @@ -227,6 +234,7 @@ ttcompat(tp, com, data, flag) return (0); } +static int ttcompatgetflags(tp) register struct tty *tp; { @@ -284,6 +292,7 @@ if (ttydebug) return (flags); } +static void ttcompatsetflags(tp, t) register struct tty *tp; register struct termios *t; @@ -356,6 +365,7 @@ ttcompatsetflags(tp, t) t->c_cflag = cflag; } +static void ttcompatsetlflags(tp, t) register struct tty *tp; register struct termios *t; diff --git a/sys/kern/tty_conf.c b/sys/kern/tty_conf.c index 2bed744746..e3007cc99c 100644 --- a/sys/kern/tty_conf.c +++ b/sys/kern/tty_conf.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)tty_conf.c 7.6 (Berkeley) 5/9/91 - * $Id: tty_conf.c,v 1.3 1993/10/16 15:24:58 rgrimes Exp $ + * $Id: tty_conf.c,v 1.4 1993/11/13 00:19:20 ache Exp $ */ #include "param.h" @@ -43,10 +43,12 @@ int enodev(); int nullop(); +static int nullioctl(struct tty *, int, caddr_t, int); -int ttyopen(),ttylclose(),ttread(),ttwrite(),nullioctl(),ttstart(); -int ttymodem(), nullmodem(), ttyinput(); +#define VE(x) ((void (*)())x) /* XXX */ +#define IE(x) ((int (*)())x) /* XXX */ +/* XXX - doesn't work */ #include "tb.h" #if NTB > 0 int tbopen(),tbclose(),tbread(),tbinput(),tbioctl(); @@ -68,31 +70,32 @@ struct linesw linesw[] = ttyopen, ttylclose, ttread, ttwrite, nullioctl, ttyinput, enodev, nullop, ttstart, ttymodem, /* 0- termios */ - enodev, enodev, enodev, enodev, enodev, /* 1- defunct */ - enodev, enodev, enodev, enodev, enodev, + IE(enodev), VE(enodev), IE(enodev), IE(enodev), IE(enodev), /* 1- defunct */ + VE(enodev), IE(enodev), IE(enodev), VE(enodev), IE(enodev), ttyopen, ttylclose, ttread, ttwrite, nullioctl, ttyinput, enodev, nullop, ttstart, ttymodem, /* 2- NTTYDISC */ + #if NTB > 0 tbopen, tbclose, tbread, enodev, tbioctl, tbinput, enodev, nullop, ttstart, nullmodem, /* 3- TABLDISC */ #else - enodev, enodev, enodev, enodev, enodev, - enodev, enodev, enodev, enodev, enodev, + IE(enodev), VE(enodev), IE(enodev), IE(enodev), IE(enodev), + VE(enodev), IE(enodev), IE(enodev), VE(enodev), IE(enodev), #endif #if NSL > 0 - slopen, slclose, enodev, enodev, sltioctl, - slinput, enodev, nullop, slstart, nullmodem, /* 4- SLIPDISC */ + slopen, VE(slclose), IE(enodev), IE(enodev), sltioctl, + VE(slinput), enodev, nullop, VE(slstart), nullmodem, /* 4- SLIPDISC */ #else - enodev, enodev, enodev, enodev, enodev, - enodev, enodev, enodev, enodev, enodev, + enodev, VE(enodev), enodev, enodev, enodev, + VE(enodev), enodev, enodev, VE(enodev), enodev, #endif #if NPPP > 0 - pppopen, pppclose, pppread, pppwrite, ppptioctl, - pppinput, enodev, nullop, pppstart, ttymodem, /* 5- PPPDISC */ + pppopen, VE(pppclose), pppread, pppwrite, ppptioctl, + VE(pppinput), enodev, nullop, VE(pppstart), ttymodem, /* 5- PPPDISC */ #else - enodev, enodev, enodev, enodev, enodev, - enodev, enodev, enodev, enodev, enodev, + enodev, VE(enodev), enodev, enodev, enodev, + VE(enodev), enodev, enodev, VE(enodev), enodev, #endif }; @@ -103,8 +106,10 @@ int nldisp = sizeof (linesw) / sizeof (linesw[0]); * discipline specific ioctl command. */ /*ARGSUSED*/ +static int nullioctl(tp, cmd, data, flags) struct tty *tp; + int cmd; char *data; int flags; { diff --git a/sys/kern/tty_pty.c b/sys/kern/tty_pty.c index 8642c01c50..9f94843e48 100644 --- a/sys/kern/tty_pty.c +++ b/sys/kern/tty_pty.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)tty_pty.c 7.21 (Berkeley) 5/30/91 - * $Id$ + * $Id: tty_pty.c,v 1.4 1993/10/16 15:25:00 rgrimes Exp $ */ /* @@ -59,6 +59,8 @@ #define BUFSIZ 100 /* Chunk size iomoved to/from user */ +static void ptcwakeup(struct tty *, int); + /* * pts == /dev/tty[pqrs]? * ptc == /dev/pty[pqrs]? @@ -81,8 +83,11 @@ int npty = NPTY; /* for pstat -t */ #define PF_UCNTL 0x80 /* user control mode */ /*ARGSUSED*/ +int ptsopen(dev, flag, devtype, p) dev_t dev; + int flag; + int devtype; struct proc *p; { register struct tty *tp; @@ -120,6 +125,7 @@ ptsopen(dev, flag, devtype, p) return (error); } +int ptsclose(dev, flag, mode, p) dev_t dev; int flag, mode; @@ -134,9 +140,11 @@ ptsclose(dev, flag, mode, p) return(0); } +int ptsread(dev, uio, flag) dev_t dev; struct uio *uio; + int flag; { struct proc *p = curproc; register struct tty *tp = &pt_tty[minor(dev)]; @@ -185,9 +193,11 @@ again: * Wakeups of controlling tty will happen * indirectly, when tty driver calls ptsstart. */ +int ptswrite(dev, uio, flag) dev_t dev; struct uio *uio; + int flag; { register struct tty *tp; @@ -201,6 +211,7 @@ ptswrite(dev, uio, flag) * Start output on pseudo-tty. * Wake up process selecting or sleeping for input from controlling tty. */ +void ptsstart(tp) struct tty *tp; { @@ -215,8 +226,10 @@ ptsstart(tp) ptcwakeup(tp, FREAD); } +static void ptcwakeup(tp, flag) struct tty *tp; + int flag; { struct pt_ioctl *pti = &pt_ioctl[minor(tp->t_dev)]; @@ -239,8 +252,9 @@ ptcwakeup(tp, flag) } /*ARGSUSED*/ +int #ifdef __STDC__ -ptcopen(dev_t dev, int flag, int devtype, struct proc *p) +ptcopen(int /*dev_t*/ dev, int flag, int devtype, struct proc *p) #else ptcopen(dev, flag, devtype, p) dev_t dev; @@ -267,6 +281,8 @@ ptcopen(dev, flag, devtype, p) } extern struct tty *constty; /* -hv- 06.Oct.92*/ + +int ptcclose(dev) dev_t dev; { @@ -285,9 +301,11 @@ ptcclose(dev) return (0); } +int ptcread(dev, uio, flag) dev_t dev; struct uio *uio; + int flag; { register struct tty *tp = &pt_tty[minor(dev)]; struct pt_ioctl *pti = &pt_ioctl[minor(dev)]; @@ -363,6 +381,7 @@ ptcread(dev, uio, flag) return (error); } +void ptsstop(tp, flush) register struct tty *tp; int flush; @@ -386,6 +405,7 @@ ptsstop(tp, flush) ptcwakeup(tp, flag); } +int ptcselect(dev, rw, p) dev_t dev; int rw; @@ -447,12 +467,14 @@ ptcselect(dev, rw, p) return (0); } +int ptcwrite(dev, uio, flag) dev_t dev; register struct uio *uio; + int flag; { register struct tty *tp = &pt_tty[minor(dev)]; - register u_char *cp; + register u_char *cp = 0; register int cc = 0; u_char locbuf[BUFSIZ]; int cnt = 0; @@ -542,15 +564,17 @@ block: } /*ARGSUSED*/ +int ptyioctl(dev, cmd, data, flag) caddr_t data; + int cmd; dev_t dev; + int flag; { register struct tty *tp = &pt_tty[minor(dev)]; register struct pt_ioctl *pti = &pt_ioctl[minor(dev)]; register u_char *cc = tp->t_cc; int stop, error; - extern ttyinput(); /* * IF CONTROLLER STTY THEN MUST FLUSH TO PREVENT A HANG. diff --git a/sys/kern/tty_ring.c b/sys/kern/tty_ring.c index 74bb8d8438..e1b2a08297 100644 --- a/sys/kern/tty_ring.c +++ b/sys/kern/tty_ring.c @@ -45,7 +45,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ + * $Id: tty_ring.c,v 1.2 1993/10/16 15:25:01 rgrimes Exp $ */ #include "param.h" @@ -59,7 +59,10 @@ */ size_t rb_write __P((struct ringb *to, char *buf, size_t nfrom)); -putc(c, rbp) struct ringb *rbp; +int +putc(c, rbp) + int c; + struct ringb *rbp; { char *nxtp; @@ -72,7 +75,9 @@ putc(c, rbp) struct ringb *rbp; return(0); } -getc(rbp) struct ringb *rbp; +int +getc(rbp) + struct ringb *rbp; { u_char c; @@ -85,7 +90,11 @@ getc(rbp) struct ringb *rbp; return (c); } -nextc(cpp, rbp) struct ringb *rbp; char **cpp; { +int +nextc(cpp, rbp) + char **cpp; + struct ringb *rbp; +{ if (*cpp == rbp->rb_tl) return (0); else { char *cp; @@ -95,7 +104,10 @@ nextc(cpp, rbp) struct ringb *rbp; char **cpp; { } } -ungetc(c, rbp) struct ringb *rbp; +int +ungetc(c, rbp) + int c; + struct ringb *rbp; { char *backp; @@ -108,7 +120,9 @@ ungetc(c, rbp) struct ringb *rbp; return(0); } -unputc(rbp) struct ringb *rbp; +int +unputc(rbp) + struct ringb *rbp; { char *backp; int c; @@ -126,7 +140,10 @@ unputc(rbp) struct ringb *rbp; #define peekc(rbp) (*(rbp)->rb_hd) -initrb(rbp) struct ringb *rbp; { +void +initrb(rbp) + struct ringb *rbp; +{ rbp->rb_hd = rbp->rb_tl = rbp->rb_buf; } @@ -157,6 +174,7 @@ initrb(rbp) struct ringb *rbp; { /* * Concatenate ring buffers. */ +void catb(from, to) struct ringb *from, *to; { diff --git a/sys/kern/tty_tty.c b/sys/kern/tty_tty.c index c67849190d..4bf46ee613 100644 --- a/sys/kern/tty_tty.c +++ b/sys/kern/tty_tty.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)tty_tty.c 7.15 (Berkeley) 5/28/91 - * $Id$ + * $Id: tty_tty.c,v 1.2 1993/10/16 15:25:05 rgrimes Exp $ */ /* @@ -49,6 +49,7 @@ #define cttyvp(p) ((p)->p_flag&SCTTY ? (p)->p_session->s_ttyvp : NULL) /*ARGSUSED*/ +int cttyopen(dev, flag, mode, p) dev_t dev; int flag, mode; @@ -69,9 +70,11 @@ cttyopen(dev, flag, mode, p) } /*ARGSUSED*/ +int cttyread(dev, uio, flag) dev_t dev; struct uio *uio; + int flag; { register struct vnode *ttyvp = cttyvp(uio->uio_procp); int error; @@ -85,9 +88,11 @@ cttyread(dev, uio, flag) } /*ARGSUSED*/ +int cttywrite(dev, uio, flag) dev_t dev; struct uio *uio; + int flag; { register struct vnode *ttyvp = cttyvp(uio->uio_procp); int error; @@ -101,6 +106,7 @@ cttywrite(dev, uio, flag) } /*ARGSUSED*/ +int cttyioctl(dev, cmd, addr, flag, p) dev_t dev; int cmd; @@ -112,7 +118,9 @@ cttyioctl(dev, cmd, addr, flag, p) if (ttyvp == NULL) return (EIO); - if (cmd == TIOCNOTTY) { + if (cmd == TIOCSCTTY) /* don't allow controlling tty to be set */ + return EINVAL; /* to controlling tty - infinite recursion */ + else if (cmd == TIOCNOTTY) { if (!SESS_LEADER(p)) { p->p_flag &= ~SCTTY; return (0); @@ -123,6 +131,7 @@ cttyioctl(dev, cmd, addr, flag, p) } /*ARGSUSED*/ +int cttyselect(dev, flag, p) dev_t dev; int flag; diff --git a/sys/kern/uipc_domain.c b/sys/kern/uipc_domain.c index 9e85ada361..7d76dba89c 100644 --- a/sys/kern/uipc_domain.c +++ b/sys/kern/uipc_domain.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)uipc_domain.c 7.9 (Berkeley) 3/4/91 - * $Id: uipc_domain.c,v 1.2 1993/10/16 15:25:06 rgrimes Exp $ + * $Id: uipc_domain.c,v 1.3 1993/11/07 17:46:22 wollman Exp $ */ #include @@ -51,6 +51,10 @@ struct domain *domains; domains = &__CONCAT(x,domain); \ } +static void pfslowtimo(caddr_t, int); +static void pffasttimo(caddr_t, int); + +void domaininit() { register struct domain *dp; @@ -93,8 +97,8 @@ if (max_linkhdr < 16) /* XXX */ max_linkhdr = 16; max_hdr = max_linkhdr + max_protohdr; max_datalen = MHLEN - max_hdr; - pffasttimo(); - pfslowtimo(); + pffasttimo(0, 0); + pfslowtimo(0, 0); } struct protosw * @@ -141,6 +145,7 @@ found: return (maybe); } +void pfctlinput(cmd, sa) int cmd; struct sockaddr *sa; @@ -154,7 +159,8 @@ pfctlinput(cmd, sa) (*pr->pr_ctlinput)(cmd, sa, (caddr_t) 0); } -pfslowtimo() +static void +pfslowtimo(caddr_t dummy1, int dummy2) { register struct domain *dp; register struct protosw *pr; @@ -166,7 +172,8 @@ pfslowtimo() timeout(pfslowtimo, (caddr_t)0, hz/2); } -pffasttimo() +static void +pffasttimo(caddr_t dummy1, int dummy2) { register struct domain *dp; register struct protosw *pr; diff --git a/sys/kern/uipc_mbuf.c b/sys/kern/uipc_mbuf.c index 8afd4dacad..23ce15a7d5 100644 --- a/sys/kern/uipc_mbuf.c +++ b/sys/kern/uipc_mbuf.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)uipc_mbuf.c 7.19 (Berkeley) 4/20/91 - * $Id: uipc_mbuf.c,v 1.3 1993/10/16 15:25:07 rgrimes Exp $ + * $Id: uipc_mbuf.c,v 1.4 1993/11/07 17:46:23 wollman Exp $ */ #include "param.h" @@ -59,6 +59,9 @@ extern vm_map_t mb_map; struct mbuf *mbutl; char *mclrefcnt; +static void m_reclaim(void); + +void mbinit() { int s; @@ -83,8 +86,10 @@ bad: * Must be called at splimp. */ /* ARGSUSED */ +int m_clalloc(ncl, how) /* 31 Aug 92*/ register int ncl; + int how; { int npg, mbx; register caddr_t p; @@ -145,6 +150,7 @@ m_retryhdr(i, t) return (m); } +static void m_reclaim() { register struct domain *dp; @@ -207,6 +213,7 @@ m_free(m) return (n); } +void m_freem(m) register struct mbuf *m; { @@ -330,6 +337,7 @@ nospace: * Copy data from an mbuf chain starting "off" bytes from the beginning, * continuing for "len" bytes, into the indicated buffer. */ +void m_copydata(m, off, len, cp) register struct mbuf *m; register int off; @@ -365,6 +373,7 @@ m_copydata(m, off, len, cp) * Both chains must be of the same type (e.g. MT_DATA). * Any m_pkthdr is not updated. */ +void m_cat(m, n) register struct mbuf *m, *n; { @@ -385,8 +394,10 @@ m_cat(m, n) } } +void m_adj(mp, req_len) struct mbuf *mp; + int req_len; { register int len = req_len; register struct mbuf *m; @@ -525,3 +536,58 @@ bad: MPFail++; return (0); } + +/* + * Copy data from a buffer back into the indicated mbuf chain, + * starting "off" bytes from the beginning, extending the mbuf + * chain if necessary. + */ +void +m_copyback(m0, off, len, cp) + struct mbuf *m0; + register int off; + register int len; + caddr_t cp; + +{ + register int mlen; + register struct mbuf *m = m0, *n; + int totlen = 0; + + if (m0 == 0) + return; + while (off > (mlen = m->m_len)) { + off -= mlen; + totlen += mlen; + if (m->m_next == 0) { + n = m_getclr(M_DONTWAIT, m->m_type); + if (n == 0) + goto out; + n->m_len = min(MLEN, len + off); + m->m_next = n; + } + m = m->m_next; + } + while (len > 0) { + mlen = min (m->m_len - off, len); + bcopy(cp, off + mtod(m, caddr_t), (unsigned)mlen); + cp += mlen; + len -= mlen; + mlen += off; + off = 0; + totlen += mlen; + if (len == 0) + break; + if (m->m_next == 0) { + n = m_get(M_DONTWAIT, m->m_type); + if (n == 0) + break; + n->m_len = min(MLEN, len); + m->m_next = n; + } + m = m->m_next; + } +out: if (((m = m0)->m_flags & M_PKTHDR) && (m->m_pkthdr.len < totlen)) + m->m_pkthdr.len = totlen; +} + diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index 68c8518b75..f01ea6ac73 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)uipc_socket.c 7.28 (Berkeley) 5/4/91 - * $Id: uipc_socket.c,v 1.7 1993/10/18 05:40:30 davidg Exp $ + * $Id: uipc_socket.c,v 1.8 1993/10/23 16:23:49 davidg Exp $ */ #include "param.h" @@ -55,7 +55,9 @@ * switching out to the protocol specific routines. */ /*ARGSUSED*/ +int socreate(dom, aso, type, proto) + int dom; struct socket **aso; register int type; int proto; @@ -91,6 +93,7 @@ socreate(dom, aso, type, proto) return (0); } +int sobind(so, nam) struct socket *so; struct mbuf *nam; @@ -105,6 +108,7 @@ sobind(so, nam) return (error); } +int solisten(so, backlog) register struct socket *so; int backlog; @@ -127,6 +131,7 @@ solisten(so, backlog) return (0); } +void sofree(so) register struct socket *so; { @@ -148,6 +153,7 @@ sofree(so) * Initiate disconnect if connected. * Free socket when disconnect complete. */ +int soclose(so) register struct socket *so; { @@ -198,6 +204,7 @@ discard: /* * Must be called at splnet... */ +int soabort(so) struct socket *so; { @@ -207,6 +214,7 @@ soabort(so) (struct mbuf *)0, (struct mbuf *)0, (struct mbuf *)0)); } +int soaccept(so, nam) register struct socket *so; struct mbuf *nam; @@ -223,6 +231,7 @@ soaccept(so, nam) return (error); } +int soconnect(so, nam) register struct socket *so; struct mbuf *nam; @@ -250,6 +259,7 @@ soconnect(so, nam) return (error); } +int soconnect2(so1, so2) register struct socket *so1; struct socket *so2; @@ -263,6 +273,7 @@ soconnect2(so1, so2) return (error); } +int sodisconnect(so) register struct socket *so; { @@ -301,6 +312,7 @@ bad: * must check for short counts if EINTR/ERESTART are returned. * Data and control buffers are freed on return. */ +int sosend(so, addr, uio, top, control, flags) register struct socket *so; struct mbuf *addr; @@ -463,6 +475,7 @@ out: * an mbuf **mp0 for use in returning the chain. The uio is then used * only for the count in uio_resid. */ +int soreceive(so, paddr, uio, mp0, controlp, flagsp) register struct socket *so; struct mbuf **paddr; @@ -476,7 +489,7 @@ soreceive(so, paddr, uio, mp0, controlp, flagsp) register int flags, len, error, s, offset; struct protosw *pr = so->so_proto; struct mbuf *nextrecord; - int moff, type; + int moff, type = 0; int orig_resid = uio->uio_resid; mp = mp0; @@ -759,6 +772,7 @@ release: return (error); } +int soshutdown(so, how) register struct socket *so; register int how; @@ -774,6 +788,7 @@ soshutdown(so, how) return (0); } +void sorflush(so) register struct socket *so; { @@ -795,6 +810,7 @@ sorflush(so) sbrelease(&asb); } +int sosetopt(so, level, optname, m0) register struct socket *so; int level, optname; @@ -905,6 +921,7 @@ bad: return (error); } +int sogetopt(so, level, optname, mp) register struct socket *so; int level, optname; @@ -988,6 +1005,7 @@ sogetopt(so, level, optname, mp) } } +void sohasoutofband(so) register struct socket *so; { diff --git a/sys/kern/uipc_socket2.c b/sys/kern/uipc_socket2.c index d7301fcd89..6c1faa041b 100644 --- a/sys/kern/uipc_socket2.c +++ b/sys/kern/uipc_socket2.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)uipc_socket2.c 7.17 (Berkeley) 5/4/91 - * $Id$ + * $Id: uipc_socket2.c,v 1.2 1993/10/16 15:25:12 rgrimes Exp $ */ #include "param.h" @@ -50,9 +50,9 @@ */ /* strings for sleep message: */ -char netio[] = "netio"; -char netcon[] = "netcon"; -char netcls[] = "netcls"; +const char netio[] = "netio"; +const char netcon[] = "netcon"; +const char netcls[] = "netcls"; u_long sb_max = SB_MAX; /* patchable */ @@ -86,6 +86,7 @@ u_long sb_max = SB_MAX; /* patchable */ * cause software-interrupt process scheduling. */ +void soisconnecting(so) register struct socket *so; { @@ -94,6 +95,7 @@ soisconnecting(so) so->so_state |= SS_ISCONNECTING; } +void soisconnected(so) register struct socket *so; { @@ -112,6 +114,7 @@ soisconnected(so) } } +void soisdisconnecting(so) register struct socket *so; { @@ -123,6 +126,7 @@ soisdisconnecting(so) sorwakeup(so); } +void soisdisconnected(so) register struct socket *so; { @@ -182,6 +186,7 @@ sonewconn1(head, connstatus) return (so); } +void soqinsque(head, so, q) register struct socket *head, *so; int q; @@ -203,6 +208,7 @@ soqinsque(head, so, q) *prev = so; } +int soqremque(so, q) register struct socket *so; int q; @@ -241,6 +247,7 @@ soqremque(so, q) * Data queued for reading in the socket may yet be read. */ +void socantsendmore(so) struct socket *so; { @@ -249,6 +256,7 @@ socantsendmore(so) sowwakeup(so); } +void socantrcvmore(so) struct socket *so; { @@ -264,6 +272,7 @@ socantrcvmore(so) /* * Queue a process for a select on a socket buffer. */ +void sbselqueue(sb, cp) struct sockbuf *sb; struct proc *cp; @@ -281,6 +290,7 @@ sbselqueue(sb, cp) /* * Wait for data to arrive at/drain from a socket buffer. */ +int sbwait(sb) struct sockbuf *sb; { @@ -295,6 +305,7 @@ sbwait(sb) * Lock a sockbuf already known to be locked; * return any error returned from sleep (EINTR). */ +int sb_lock(sb) register struct sockbuf *sb; { @@ -316,6 +327,7 @@ sb_lock(sb) * Do asynchronous notification via SIGIO * if the socket has the SS_ASYNC flag set. */ +void sowakeup(so, sb) register struct socket *so; register struct sockbuf *sb; @@ -371,6 +383,7 @@ sowakeup(so, sb) * should be released by calling sbrelease() when the socket is destroyed. */ +int soreserve(so, sndcc, rcvcc) register struct socket *so; u_long sndcc, rcvcc; @@ -398,6 +411,7 @@ bad: * Attempt to scale mbmax so that mbcnt doesn't become limiting * if buffering efficiency is near the normal case. */ +int sbreserve(sb, cc) struct sockbuf *sb; u_long cc; @@ -415,6 +429,7 @@ sbreserve(sb, cc) /* * Free mbufs held by a socket, and reserved mbuf space. */ +void sbrelease(sb) struct sockbuf *sb; { @@ -454,6 +469,7 @@ sbrelease(sb) * the mbuf chain is recorded in sb. Empty mbufs are * discarded and mbufs are compacted where possible. */ +void sbappend(sb, m) struct sockbuf *sb; struct mbuf *m; @@ -502,6 +518,7 @@ sbcheck(sb) * As above, except the mbuf chain * begins a new record. */ +void sbappendrecord(sb, m0) register struct sockbuf *sb; register struct mbuf *m0; @@ -536,6 +553,7 @@ sbappendrecord(sb, m0) * is inserted at the beginning of the sockbuf, * but after any other OOB data. */ +void sbinsertoob(sb, m0) register struct sockbuf *sb; register struct mbuf *m0; @@ -580,6 +598,7 @@ sbinsertoob(sb, m0) * m0 must include a packet header with total length. * Returns 0 if no space in sockbuf or insufficient mbufs. */ +int sbappendaddr(sb, asa, m0, control) register struct sockbuf *sb; struct sockaddr *asa; @@ -622,6 +641,7 @@ panic("sbappendaddr"); return (1); } +int sbappendcontrol(sb, m0, control) struct sockbuf *sb; struct mbuf *control, *m0; @@ -658,6 +678,7 @@ sbappendcontrol(sb, m0, control) * buffer sb following mbuf n. If n * is null, the buffer is presumed empty. */ +void sbcompress(sb, m, n) register struct sockbuf *sb; register struct mbuf *m, *n; @@ -706,6 +727,7 @@ sbcompress(sb, m, n) * Free all mbufs in a sockbuf. * Check that all resources are reclaimed. */ +void sbflush(sb) register struct sockbuf *sb; { @@ -721,6 +743,7 @@ sbflush(sb) /* * Drop data from (the front of) a sockbuf. */ +void sbdrop(sb, len) register struct sockbuf *sb; register int len; @@ -764,6 +787,7 @@ sbdrop(sb, len) * Drop a record off the front of a sockbuf * and move the next record to the front. */ +void sbdroprecord(sb) register struct sockbuf *sb; { diff --git a/sys/kern/uipc_syscalls.c b/sys/kern/uipc_syscalls.c index ec6a2706f4..fa9259bc9a 100644 --- a/sys/kern/uipc_syscalls.c +++ b/sys/kern/uipc_syscalls.c @@ -31,10 +31,11 @@ * SUCH DAMAGE. * * from: @(#)uipc_syscalls.c 7.24 (Berkeley) 6/3/91 - * $Id$ + * $Id: uipc_syscalls.c,v 1.4 1993/10/16 15:25:14 rgrimes Exp $ */ #include "param.h" +#include "systm.h" #include "filedesc.h" #include "proc.h" #include "file.h" @@ -60,6 +61,7 @@ struct socket_args { int protocol; }; +int socket(p, uap, retval) struct proc *p; register struct socket_args *uap; @@ -92,6 +94,7 @@ struct bind_args { }; /* ARGSUSED */ +int bind(p, uap, retval) struct proc *p; register struct bind_args *uap; @@ -116,6 +119,7 @@ struct listen_args { }; /* ARGSUSED */ +int listen(p, uap, retval) struct proc *p; register struct listen_args *uap; @@ -138,6 +142,7 @@ struct accept_args { int compat_43; }; +int accept(p, uap, retval) struct proc *p; struct accept_args *uap; @@ -155,6 +160,7 @@ struct oaccept_args { int compat_43; }; +int oaccept(p, uap, retval) struct proc *p; struct oaccept_args *uap; @@ -178,6 +184,7 @@ struct accept1_args { #endif }; +int accept1(p, uap, retval) struct proc *p; register struct accept1_args *uap; @@ -261,6 +268,7 @@ struct connect_args { }; /* ARGSUSED */ +int connect(p, uap, retval) struct proc *p; register struct connect_args *uap; @@ -310,6 +318,7 @@ struct socketpair_args { int *rsv; }; +int socketpair(p, uap, retval) struct proc *p; register struct socketpair_args *uap; @@ -373,6 +382,7 @@ struct sendto_args { int tolen; }; +int sendto(p, uap, retval) struct proc *p; register struct sendto_args *uap; @@ -404,6 +414,7 @@ struct osend_args { int flags; }; +int osend(p, uap, retval) struct proc *p; register struct osend_args *uap; @@ -431,6 +442,7 @@ struct osendmsg_args { int flags; }; +int osendmsg(p, uap, retval) struct proc *p; register struct osendmsg_args *uap; @@ -469,6 +481,7 @@ struct sendmsg_args { int flags; }; +int sendmsg(p, uap, retval) struct proc *p; register struct sendmsg_args *uap; @@ -503,6 +516,7 @@ done: return (error); } +int sendit(p, s, mp, flags, retsize) register struct proc *p; int s; @@ -615,6 +629,7 @@ struct orecvfrom_args { int *fromlenaddr; }; +int orecvfrom(p, uap, retval) struct proc *p; struct orecvfrom_args *uap; @@ -635,6 +650,7 @@ struct recvfrom_args { int *fromlenaddr; }; +int recvfrom(p, uap, retval) struct proc *p; register struct recvfrom_args *uap; @@ -669,6 +685,7 @@ struct orecv_args { int flags; }; +int orecv(p, uap, retval) struct proc *p; register struct orecv_args *uap; @@ -700,6 +717,7 @@ struct orecvmsg_args { int flags; }; +int orecvmsg(p, uap, retval) struct proc *p; register struct orecvmsg_args *uap; @@ -743,6 +761,7 @@ struct recvmsg_args { int flags; }; +int recvmsg(p, uap, retval) struct proc *p; register struct recvmsg_args *uap; @@ -782,6 +801,7 @@ done: return (error); } +int recvit(p, s, mp, namelenp, retsize) register struct proc *p; int s; @@ -918,6 +938,7 @@ struct shutdown_args { }; /* ARGSUSED */ +int shutdown(p, uap, retval) struct proc *p; register struct shutdown_args *uap; @@ -940,6 +961,7 @@ struct setsocketopt_args { }; /* ARGSUSED */ +int setsockopt(p, uap, retval) struct proc *p; register struct setsocketopt_args *uap; @@ -977,6 +999,7 @@ struct getsockopt_args { }; /* ARGSUSED */ +int getsockopt(p, uap, retval) struct proc *p; register struct getsockopt_args *uap; @@ -1009,6 +1032,7 @@ getsockopt(p, uap, retval) } /* ARGSUSED */ +int pipe(p, uap, retval) struct proc *p; struct args *uap; @@ -1065,6 +1089,7 @@ struct getsockname_args { int compat_43; }; +int getsockname(p, uap, retval) struct proc *p; struct getsockname_args *uap; @@ -1082,6 +1107,7 @@ struct ogetsockname_args { int compat_43; }; +int ogetsockname(p, uap, retval) struct proc *p; struct ogetsockname_args *uap; @@ -1106,6 +1132,7 @@ struct getsockname1_args { }; /* ARGSUSED */ +int getsockname1(p, uap, retval) struct proc *p; register struct getsockname1_args *uap; @@ -1154,6 +1181,7 @@ struct getpeername_args { int compat_43; }; +int getpeername(p, uap, retval) struct proc *p; struct getpeername_args *uap; @@ -1171,6 +1199,7 @@ struct ogetpeername_args { int compat_43; }; +int ogetpeername(p, uap, retval) struct proc *p; struct ogetpeername_args *uap; @@ -1195,6 +1224,7 @@ struct getpeername1_args { }; /* ARGSUSED */ +int getpeername1(p, uap, retval) struct proc *p; register struct getpeername1_args *uap; @@ -1232,6 +1262,7 @@ bad: return (error); } +int sockargs(mp, buf, buflen, type) struct mbuf **mp; caddr_t buf; @@ -1270,6 +1301,7 @@ sockargs(mp, buf, buflen, type) return (0); } +int getsock(fdp, fdes, fpp) struct filedesc *fdp; int fdes; diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c index 26886aafae..d04e801d0d 100644 --- a/sys/kern/uipc_usrreq.c +++ b/sys/kern/uipc_usrreq.c @@ -31,10 +31,11 @@ * SUCH DAMAGE. * * from: @(#)uipc_usrreq.c 7.26 (Berkeley) 6/3/91 - * $Id: uipc_usrreq.c,v 1.3 1993/09/14 04:26:40 rgrimes Exp $ + * $Id: uipc_usrreq.c,v 1.4 1993/10/23 16:34:45 davidg Exp $ */ #include "param.h" +#include "systm.h" #include "proc.h" #include "filedesc.h" #include "domain.h" @@ -61,6 +62,7 @@ struct sockaddr sun_noname = { sizeof(sun_noname), AF_UNIX }; ino_t unp_ino; /* prototype for fake inode numbers */ /*ARGSUSED*/ +int uipc_usrreq(so, req, m, nam, control) struct socket *so; int req; @@ -313,6 +315,7 @@ u_long unpdg_recvspace = 4*1024; int unp_rights; /* file descriptors in flight */ +int unp_attach(so) struct socket *so; { @@ -330,6 +333,8 @@ unp_attach(so) case SOCK_DGRAM: error = soreserve(so, unpdg_sendspace, unpdg_recvspace); break; + default: + panic("unp_attach"); } if (error) return (error); @@ -343,6 +348,7 @@ unp_attach(so) return (0); } +void unp_detach(unp) register struct unpcb *unp; { @@ -373,6 +379,7 @@ unp_detach(unp) } } +int unp_bind(unp, nam, p) struct unpcb *unp; struct mbuf *nam; @@ -422,6 +429,7 @@ unp_bind(unp, nam, p) return (0); } +int unp_connect(so, nam, p) struct socket *so; struct mbuf *nam; @@ -481,6 +489,7 @@ bad: return (error); } +int unp_connect2(so, so2) register struct socket *so; register struct socket *so2; @@ -512,6 +521,7 @@ unp_connect2(so, so2) return (0); } +void unp_disconnect(unp) struct unpcb *unp; { @@ -557,6 +567,7 @@ unp_abort(unp) } #endif +void unp_shutdown(unp) struct unpcb *unp; { @@ -567,6 +578,7 @@ unp_shutdown(unp) socantrcvmore(so); } +void unp_drop(unp, errno) struct unpcb *unp; int errno; @@ -590,6 +602,7 @@ unp_drain() } #endif +int unp_externalize(rights) struct mbuf *rights; { @@ -621,6 +634,7 @@ unp_externalize(rights) return (0); } +int unp_internalize(control, p) struct mbuf *control; struct proc *p; @@ -655,9 +669,9 @@ unp_internalize(control, p) } int unp_defer, unp_gcing; -int unp_mark(); extern struct domain unixdomain; +void unp_gc() { register struct file *fp; @@ -719,18 +733,18 @@ restart: unp_gcing = 0; } +void unp_dispose(m) struct mbuf *m; { - int unp_discard(); - if (m) unp_scan(m, unp_discard); } +void unp_scan(m0, op) register struct mbuf *m0; - int (*op)(); + void (*op)(struct file *); { register struct mbuf *m; register struct file **rp; @@ -757,6 +771,7 @@ unp_scan(m0, op) } } +void unp_mark(fp) struct file *fp; { @@ -767,6 +782,7 @@ unp_mark(fp) fp->f_flag |= (FMARK|FDEFER); } +void unp_discard(fp) struct file *fp; { diff --git a/sys/kern/vfs__bio.c b/sys/kern/vfs__bio.c index 0b21e0db17..0384bb57bf 100644 --- a/sys/kern/vfs__bio.c +++ b/sys/kern/vfs__bio.c @@ -45,7 +45,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: vfs__bio.c,v 1.8 1993/11/07 17:46:24 wollman Exp $ + * $Id: vfs__bio.c,v 1.9 1993/11/07 21:44:47 wollman Exp $ */ #include "param.h" @@ -295,12 +295,12 @@ brelse(register struct buf *bp) x=splbio(); if ((bfreelist + BQ_AGE)->b_flags & B_WANTED) { (bfreelist + BQ_AGE) ->b_flags &= ~B_WANTED; - wakeup(bfreelist); + wakeup((caddr_t)bfreelist); } /* anyone need this very block? */ if (bp->b_flags & B_WANTED) { bp->b_flags &= ~B_WANTED; - wakeup(bp); + wakeup((caddr_t)bp); } if (bp->b_flags & (B_INVAL|B_ERROR)) { @@ -385,7 +385,7 @@ tryfree: } else { /* wait for a free buffer of any kind */ (bfreelist + BQ_AGE)->b_flags |= B_WANTED; - tsleep(bfreelist, PRIBIO, "newbuf", 0); + tsleep((caddr_t)bfreelist, PRIBIO, "newbuf", 0); splx(x); return (0); } @@ -465,7 +465,7 @@ getblk(register struct vnode *vp, daddr_t blkno, int size) x = splbio(); if (bp->b_flags & B_BUSY) { bp->b_flags |= B_WANTED; - tsleep (bp, PRIBIO, "getblk", 0); + tsleep ((caddr_t)bp, PRIBIO, "getblk", 0); splx(x); continue; } @@ -593,7 +593,7 @@ biowait(register struct buf *bp) * others biowait()'ing for it will notice when they are * woken up from sleep(). */ -int +void biodone(register struct buf *bp) { int x; @@ -609,6 +609,37 @@ biodone(register struct buf *bp) brelse(bp); bp->b_flags &= ~B_ASYNC; bp->b_flags |= B_DONE; - wakeup(bp); + wakeup((caddr_t)bp); splx(x); } + +/* + * Print out statistics on the current allocation of the buffer pool. + * Can be enabled to print out on every ``sync'' by setting "syncprt" + * in ufs/ufs_vfsops.c. + */ +void +bufstats() +{ + int s, i, j, count; + register struct buf *bp, *dp; + int counts[MAXBSIZE/CLBYTES+1]; + static char *bname[BQUEUES] = { "LOCKED", "LRU", "AGE", "EMPTY" }; + + for (bp = bfreelist, i = 0; bp < &bfreelist[BQUEUES]; bp++, i++) { + count = 0; + for (j = 0; j <= MAXBSIZE/CLBYTES; j++) + counts[j] = 0; + s = splbio(); + for (dp = bp->av_forw; dp != bp; dp = dp->av_forw) { + counts[dp->b_bufsize/CLBYTES]++; + count++; + } + splx(s); + printf("%s: total-%d", bname[i], count); + for (j = 0; j <= MAXBSIZE/CLBYTES; j++) + if (counts[j] != 0) + printf(", %d-%d", j * CLBYTES, counts[j]); + printf("\n"); + } +} diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index 58df7acf27..71f03c731a 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)vfs_cache.c 7.8 (Berkeley) 2/28/91 - * $Id$ + * $Id: vfs_cache.c,v 1.2 1993/10/16 15:25:19 rgrimes Exp $ */ #include "param.h" @@ -92,6 +92,7 @@ int doingcache = 1; /* 1 => enable the cache */ * the name does not exist (negative cacheing), a status of ENOENT * is returned. If the lookup fails, a status of zero is returned. */ +int cache_lookup(ndp) register struct nameidata *ndp; { @@ -189,6 +190,7 @@ cache_lookup(ndp) /* * Add an entry to the cache */ +void cache_enter(ndp) register struct nameidata *ndp; { @@ -240,6 +242,7 @@ cache_enter(ndp) /* * Name cache initialization, from vfs_init() when we are booting */ +void nchinit() { register union nchash *nchp; @@ -264,6 +267,7 @@ nchinit() * Cache flush, a particular vnode; called when a vnode is renamed to * hide entries that would now be invalid */ +void cache_purge(vp) struct vnode *vp; { @@ -291,6 +295,7 @@ cache_purge(vp) * if the cache lru chain is modified while we are dumping the * inode. This makes the algorithm O(n^2), but do you think I care? */ +void cache_purgevfs(mp) struct mount *mp; { diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c index 3f61833efb..ce20836856 100644 --- a/sys/kern/vfs_lookup.c +++ b/sys/kern/vfs_lookup.c @@ -31,10 +31,11 @@ * SUCH DAMAGE. * * from: @(#)vfs_lookup.c 7.32 (Berkeley) 5/21/91 - * $Id: vfs_lookup.c,v 1.3 1993/11/07 17:46:25 wollman Exp $ + * $Id: vfs_lookup.c,v 1.4 1993/11/07 21:44:48 wollman Exp $ */ #include "param.h" +#include "systm.h" #include "syslimits.h" #include "time.h" #include "namei.h" @@ -71,6 +72,7 @@ u_long nextvnodeid; * if symbolic link, massage name in buffer and continue * } */ +int namei(ndp, p) register struct nameidata *ndp; struct proc *p; @@ -93,10 +95,10 @@ namei(ndp, p) MALLOC(ndp->ni_pnbuf, caddr_t, MAXPATHLEN, M_NAMEI, M_WAITOK); if (ndp->ni_segflg == UIO_SYSSPACE) error = copystr(ndp->ni_dirp, ndp->ni_pnbuf, - MAXPATHLEN, &ndp->ni_pathlen); + MAXPATHLEN, (u_int *)&ndp->ni_pathlen); else error = copyinstr(ndp->ni_dirp, ndp->ni_pnbuf, - MAXPATHLEN, &ndp->ni_pathlen); + MAXPATHLEN, (u_int *)&ndp->ni_pathlen); if (error) { free(ndp->ni_pnbuf, M_NAMEI); ndp->ni_vp = NULL; @@ -232,6 +234,7 @@ namei(ndp, p) * if LOCKPARENT set, return locked parent in ni_dvp * if WANTPARENT set, return unlocked parent in ni_dvp */ +int lookup(ndp, p) register struct nameidata *ndp; struct proc *p; diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 31ea0d9ac2..65e581b401 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)vfs_subr.c 7.60 (Berkeley) 6/21/91 - * $Id: vfs_subr.c,v 1.5 1993/11/07 17:46:27 wollman Exp $ + * $Id: vfs_subr.c,v 1.6 1993/11/07 21:44:50 wollman Exp $ */ /* @@ -39,6 +39,7 @@ */ #include "param.h" +#include "systm.h" #include "proc.h" #include "mount.h" #include "time.h" @@ -50,6 +51,8 @@ #include "errno.h" #include "malloc.h" +static void insmntque(struct vnode *, struct mount *); + struct vnode *speclisth[SPECHSZ]; /* device special file vnode hash table */ /* @@ -73,6 +76,7 @@ vfs_remove(mp) * Lock a filesystem. * Used to prevent access to it while mounting and unmounting. */ +int vfs_lock(mp) register struct mount *mp; { @@ -107,6 +111,7 @@ vfs_unlock(mp) * Mark a mount point as busy. * Used to synchronize access and to delay unmounting. */ +int vfs_busy(mp) register struct mount *mp; { @@ -125,6 +130,7 @@ vfs_busy(mp) * Free a busy filesystem. * Panic if filesystem is not busy. */ +void vfs_unbusy(mp) register struct mount *mp; { @@ -181,13 +187,13 @@ void vattr_null(vap) */ struct vnode *vfreeh, **vfreet; extern struct vnodeops dead_vnodeops, spec_vnodeops; -extern void vclean(); long numvnodes; struct vattr va_null; /* * Initialize the vnode structures and initialize each file system type. */ +void vfsinit() { struct vfsops **vfsp; @@ -210,6 +216,7 @@ vfsinit() /* * Return the next vnode from the free list. */ +int getnewvnode(tag, mp, vops, vpp) enum vtagtype tag; struct mount *mp; @@ -257,6 +264,7 @@ getnewvnode(tag, mp, vops, vpp) /* * Move a vnode from one mount queue to another. */ +static void insmntque(vp, mp) register struct vnode *vp; register struct mount *mp; @@ -291,6 +299,7 @@ insmntque(vp, mp) * Make sure all write-behind blocks associated * with mount point are flushed out (from sync). */ +void mntflushbuf(mountp, flags) struct mount *mountp; int flags; @@ -315,6 +324,7 @@ loop: /* * Flush all dirty buffers associated with a vnode. */ +void vflushbuf(vp, flags) register struct vnode *vp; int flags; @@ -364,6 +374,7 @@ loop: /* * Update outstanding I/O count and do wakeup if requested. */ +void vwakeup(bp) register struct buf *bp; { @@ -390,6 +401,7 @@ vwakeup(bp) * filesystem there will be no dirty buffers when we are done. Binval * returns the count of dirty buffers when it is finished. */ +int mntinvalbuf(mountp) struct mount *mountp; { @@ -414,6 +426,7 @@ loop: * Flush out and invalidate all buffers associated with a vnode. * Called with the underlying object locked. */ +int vinvalbuf(vp, save) register struct vnode *vp; int save; @@ -461,6 +474,7 @@ vinvalbuf(vp, save) /* * Associate a buffer with a vnode. */ +void bgetvp(vp, bp) register struct vnode *vp; register struct buf *bp; @@ -489,6 +503,7 @@ bgetvp(vp, bp) /* * Disassociate a buffer from a vnode. */ +void brelvp(bp) register struct buf *bp; { @@ -517,6 +532,7 @@ brelvp(bp) * Used to assign file specific control information * (indirect blocks) to the vnode to which they belong. */ +void reassignbuf(bp, newvp) register struct buf *bp; register struct vnode *newvp; @@ -553,6 +569,7 @@ reassignbuf(bp, newvp) * Used for root filesystem, argdev, and swap areas. * Also used for memory file system special devices. */ +int bdevvp(dev, vpp) dev_t dev; struct vnode **vpp; @@ -646,6 +663,7 @@ loop: * indicate that the vnode is no longer usable (possibly having * been changed to a new file system type). */ +int vget(vp) register struct vnode *vp; { @@ -733,6 +751,7 @@ void vrele(vp) /* * Page or buffer structure gets a reference. */ +void vhold(vp) register struct vnode *vp; { @@ -743,6 +762,7 @@ vhold(vp) /* * Page or buffer structure frees a reference. */ +void holdrele(vp) register struct vnode *vp; { @@ -762,6 +782,7 @@ holdrele(vp) */ int busyprt = 0; /* patch to print out busy vnodes */ +int vflush(mp, skipvp, flags) struct mount *mp; struct vnode *skipvp; @@ -935,11 +956,12 @@ void vgoneall(vp) * Eliminate all activity associated with a vnode * in preparation for reuse. */ -void vgone(vp) +void +vgone(vp) register struct vnode *vp; { register struct vnode *vq; - struct vnode *vx; + struct vnode *vx = 0; long count; /* @@ -1019,6 +1041,7 @@ void vgone(vp) /* * Lookup a vnode by device number. */ +int vfinddev(dev, type, vpp) dev_t dev; enum vtype type; @@ -1038,6 +1061,7 @@ vfinddev(dev, type, vpp) /* * Calculate the total number of references to a special device. */ +int vcount(vp) register struct vnode *vp; { @@ -1068,8 +1092,9 @@ loop: static char *typename[] = { "VNON", "VREG", "VDIR", "VBLK", "VCHR", "VLNK", "VSOCK", "VFIFO", "VBAD" }; +void vprint(label, vp) - char *label; + const char *label; register struct vnode *vp; { char buf[64]; @@ -1129,6 +1154,7 @@ int kinfo_vgetfailed; * Copyout address of vnode followed by vnode. */ /* ARGSUSED */ +int kinfo_vnode(op, where, acopysize, arg, aneeded) int op; char *where; diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index f91ccf0f8d..68ae96da74 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)vfs_syscalls.c 7.74 (Berkeley) 6/21/91 - * $Id: vfs_syscalls.c,v 1.4 1993/10/16 15:25:26 rgrimes Exp $ + * $Id: vfs_syscalls.c,v 1.5 1993/10/23 16:02:54 davidg Exp $ */ #include "param.h" @@ -63,6 +63,7 @@ struct mount_args { }; /* ARGSUSED */ +int mount(p, uap, retval) struct proc *p; register struct mount_args *uap; @@ -71,7 +72,7 @@ mount(p, uap, retval) register struct nameidata *ndp; register struct vnode *vp; register struct mount *mp; - int error, flag; + int error, flag = 0; struct nameidata nd; /* @@ -218,6 +219,7 @@ struct umount_args { }; /* ARGSUSED */ +int unmount(p, uap, retval) struct proc *p; register struct umount_args *uap; @@ -257,6 +259,7 @@ unmount(p, uap, retval) /* * Do an unmount. */ +int dounmount(mp, flags, p) register struct mount *mp; int flags; @@ -293,6 +296,7 @@ dounmount(mp, flags, p) * Sync each mounted filesystem. */ /* ARGSUSED */ +int sync(p, uap, retval) struct proc *p; void *uap; @@ -332,6 +336,7 @@ struct quotactl_args { }; /* ARGSUSED */ +int quotactl(p, uap, retval) struct proc *p; register struct quotactl_args *uap; @@ -363,6 +368,7 @@ struct statfs_args { }; /* ARGSUSED */ +int statfs(p, uap, retval) struct proc *p; register struct statfs_args *uap; @@ -399,6 +405,7 @@ struct fstatfs_args { }; /* ARGSUSED */ +int fstatfs(p, uap, retval) struct proc *p; register struct fstatfs_args *uap; @@ -429,6 +436,7 @@ struct getfsstat_args { int flags; }; +int getfsstat(p, uap, retval) struct proc *p; register struct getfsstat_args *uap; @@ -481,6 +489,7 @@ struct fchdir_args { }; /* ARGSUSED */ +int fchdir(p, uap, retval) struct proc *p; struct fchdir_args *uap; @@ -517,6 +526,7 @@ struct chdir_args { }; /* ARGSUSED */ +int chdir(p, uap, retval) struct proc *p; struct chdir_args *uap; @@ -547,6 +557,7 @@ struct chroot_args { }; /* ARGSUSED */ +int chroot(p, uap, retval) struct proc *p; struct chroot_args *uap; @@ -574,6 +585,7 @@ chroot(p, uap, retval) /* * Common routine for chroot and chdir. */ +int chdirec(ndp, p) struct nameidata *ndp; struct proc *p; @@ -606,6 +618,7 @@ struct open_args { int crtmode; }; +int open(p, uap, retval) struct proc *p; register struct open_args *uap; @@ -684,6 +697,7 @@ struct ocreat_args { int fmode; }; +int ocreat(p, uap, retval) struct proc *p; register struct ocreat_args *uap; @@ -713,6 +727,7 @@ struct mknod_args { }; /* ARGSUSED */ +int mknod(p, uap, retval) struct proc *p; register struct mknod_args *uap; @@ -780,6 +795,7 @@ struct mkfifo_args { }; /* ARGSUSED */ +int mkfifo(p, uap, retval) struct proc *p; register struct mkfifo_args *uap; @@ -825,6 +841,7 @@ struct link_args { }; /* ARGSUSED */ +int link(p, uap, retval) struct proc *p; register struct link_args *uap; @@ -884,6 +901,7 @@ struct symlink_args { }; /* ARGSUSED */ +int symlink(p, uap, retval) struct proc *p; register struct symlink_args *uap; @@ -931,6 +949,7 @@ struct unlink_args { }; /* ARGSUSED */ +int unlink(p, uap, retval) struct proc *p; struct unlink_args *uap; @@ -983,6 +1002,7 @@ struct lseek_args { int sbase; }; +int lseek(p, uap, retval) struct proc *p; register struct lseek_args *uap; @@ -1033,6 +1053,7 @@ struct saccess_args { }; /* ARGSUSED */ +int saccess(p, uap, retval) struct proc *p; register struct saccess_args *uap; @@ -1087,6 +1108,7 @@ struct stat_args { }; /* ARGSUSED */ +int stat(p, uap, retval) struct proc *p; register struct stat_args *uap; @@ -1122,6 +1144,7 @@ struct lstat_args { }; /* ARGSUSED */ +int lstat(p, uap, retval) struct proc *p; register struct lstat_args *uap; @@ -1157,6 +1180,7 @@ struct readlink_args { }; /* ARGSUSED */ +int readlink(p, uap, retval) struct proc *p; register struct readlink_args *uap; @@ -1206,6 +1230,7 @@ struct chflags_args { }; /* ARGSUSED */ +int chflags(p, uap, retval) struct proc *p; register struct chflags_args *uap; @@ -1246,6 +1271,7 @@ struct fdchflags_args { }; /* ARGSUSED */ +int fchflags(p, uap, retval) struct proc *p; register struct fdchflags_args *uap; @@ -1282,6 +1308,7 @@ struct chmod_args { }; /* ARGSUSED */ +int chmod(p, uap, retval) struct proc *p; register struct chmod_args *uap; @@ -1322,6 +1349,7 @@ struct fchmod_args { }; /* ARGSUSED */ +int fchmod(p, uap, retval) struct proc *p; register struct fchmod_args *uap; @@ -1359,6 +1387,7 @@ struct chown_args { }; /* ARGSUSED */ +int chown(p, uap, retval) struct proc *p; register struct chown_args *uap; @@ -1401,6 +1430,7 @@ struct fchown_args { }; /* ARGSUSED */ +int fchown(p, uap, retval) struct proc *p; register struct fchown_args *uap; @@ -1438,6 +1468,7 @@ struct utimes_args { }; /* ARGSUSED */ +int utimes(p, uap, retval) struct proc *p; register struct utimes_args *uap; @@ -1482,6 +1513,7 @@ struct truncate_args { }; /* ARGSUSED */ +int truncate(p, uap, retval) struct proc *p; register struct truncate_args *uap; @@ -1525,6 +1557,7 @@ struct ftruncate_args { }; /* ARGSUSED */ +int ftruncate(p, uap, retval) struct proc *p; register struct ftruncate_args *uap; @@ -1564,6 +1597,7 @@ struct fsync_args { }; /* ARGSUSED */ +int fsync(p, uap, retval) struct proc *p; struct fsync_args *uap; @@ -1595,6 +1629,7 @@ struct rename_args { }; /* ARGSUSED */ +int rename(p, uap, retval) struct proc *p; register struct rename_args *uap; @@ -1685,6 +1720,7 @@ struct mkdir_args { }; /* ARGSUSED */ +int mkdir(p, uap, retval) struct proc *p; register struct mkdir_args *uap; @@ -1730,6 +1766,7 @@ struct rmdir_args { }; /* ARGSUSED */ +int rmdir(p, uap, retval) struct proc *p; struct rmdir_args *uap; @@ -1788,6 +1825,7 @@ struct getdirentries_args { long *basep; }; +int getdirentries(p, uap, retval) struct proc *p; register struct getdirentries_args *uap; @@ -1858,6 +1896,7 @@ struct revoke_args { }; /* ARGSUSED */ +int revoke(p, uap, retval) struct proc *p; register struct revoke_args *uap; @@ -1895,6 +1934,7 @@ out: /* * Convert a user file descriptor to a kernel file entry. */ +int getvnode(fdp, fdes, fpp) struct filedesc *fdp; struct file **fpp; diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index 4892b61cc6..e58bf3e60c 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)vfs_vnops.c 7.33 (Berkeley) 6/27/91 - * $Id$ + * $Id: vfs_vnops.c,v 1.2 1993/10/16 15:25:29 rgrimes Exp $ */ #include "param.h" @@ -54,6 +54,7 @@ struct fileops vnops = * Common code for vnode open operations. * Check permissions, and call the VOP_OPEN or VOP_CREATE routine. */ +int vn_open(ndp, p, fmode, cmode) register struct nameidata *ndp; struct proc *p; @@ -139,6 +140,7 @@ bad: * The read-only status of the file system is checked. * Also, prototype text segments cannot be written. */ +int vn_writechk(vp) register struct vnode *vp; { @@ -167,6 +169,7 @@ vn_writechk(vp) /* * Vnode close call */ +int vn_close(vp, flags, cred, p) register struct vnode *vp; int flags; @@ -186,6 +189,7 @@ vn_close(vp, flags, cred, p) * Package up an I/O request on a vnode into a uio and do it. * [internal interface to file i/o for kernel only] */ +int vn_rdwr(rw, vp, base, len, offset, segflg, ioflg, cred, aresid, p) enum uio_rw rw; struct vnode *vp; @@ -230,6 +234,7 @@ vn_rdwr(rw, vp, base, len, offset, segflg, ioflg, cred, aresid, p) /* * File table vnode read routine. */ +int vn_read(fp, uio, cred) struct file *fp; struct uio *uio; @@ -251,6 +256,7 @@ vn_read(fp, uio, cred) /* * File table vnode write routine. */ +int vn_write(fp, uio, cred) struct file *fp; struct uio *uio; @@ -278,6 +284,7 @@ vn_write(fp, uio, cred) /* * File table vnode stat routine. */ +int vn_stat(vp, sb, p) struct vnode *vp; register struct stat *sb; @@ -345,6 +352,7 @@ vn_stat(vp, sb, p) /* * File table vnode ioctl routine. */ +int vn_ioctl(fp, com, data, p) struct file *fp; int com; @@ -387,6 +395,7 @@ vn_ioctl(fp, com, data, p) /* * File table vnode select routine. */ +int vn_select(fp, which, p) struct file *fp; int which; @@ -400,6 +409,7 @@ vn_select(fp, which, p) /* * File table vnode close routine. */ +int vn_closefile(fp, p) struct file *fp; struct proc *p; @@ -415,6 +425,7 @@ vn_closefile(fp, p) * - get vp by calling VFS_FHTOVP() macro * - if lockflag lock it with VOP_LOCK() */ +int vn_fhtovp(fhp, lockflag, vpp) fhandle_t *fhp; int lockflag; diff --git a/sys/net/bpf_filter.c b/sys/net/bpf_filter.c index 029a508a6f..658e7d42c4 100644 --- a/sys/net/bpf_filter.c +++ b/sys/net/bpf_filter.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * from: @(#)bpf.c 7.5 (Berkeley) 7/15/91 - * $Id$ + * $Id: bpf_filter.c,v 1.2 1993/10/16 17:43:07 rgrimes Exp $ */ #include @@ -172,7 +172,7 @@ bpf_filter(pc, p, wirelen, buflen) u_int wirelen; register u_int buflen; { - register u_long A, X; + register u_long A = 0, X = 0; register int k; long mem[BPF_MEMWORDS]; diff --git a/sys/net/if.c b/sys/net/if.c index feabc0e4bd..b73eb48db5 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)if.c 7.14 (Berkeley) 4/20/91 - * $Id: if.c,v 1.4 1993/10/16 17:43:10 rgrimes Exp $ + * $Id: if.c,v 1.5 1993/11/07 17:46:53 wollman Exp $ */ #include "param.h" @@ -54,6 +54,10 @@ int ifqmaxlen = IFQ_MAXLEN; struct ifqueue rawintrq; /* raw packet input queue */ struct ifnet *ifnet; /* list of configured interfaces */ +static void link_rtrequest(int, struct rtentry *, struct sockaddr *); +static void if_qflush(struct ifqueue *); +static void if_slowtimo(caddr_t, int); + /* * Network interface utility routines. * @@ -61,6 +65,7 @@ struct ifnet *ifnet; /* list of configured interfaces */ * parameters. */ +void ifinit() { register struct ifnet *ifp; @@ -68,7 +73,7 @@ ifinit() for (ifp = ifnet; ifp; ifp = ifp->if_next) if (ifp->if_snd.ifq_maxlen == 0) ifp->if_snd.ifq_maxlen = ifqmaxlen; - if_slowtimo(); + if_slowtimo((caddr_t)0, 0); } #ifdef vax @@ -94,6 +99,7 @@ static char *sprint_d(); * Attach an interface to the * list of "active" interfaces. */ +void if_attach(ifp) struct ifnet *ifp; { @@ -104,7 +110,6 @@ if_attach(ifp) register struct sockaddr_dl *sdl; register struct ifaddr *ifa; static int if_indexlim = 8; - extern link_rtrequest(), ether_output(); while (*p) p = &((*p)->if_next); @@ -120,14 +125,7 @@ if_attach(ifp) } ifnet_addrs = q; } -#if defined(INET) && NETHER > 0 - /* XXX -- Temporary fix before changing 10 ethernet drivers */ - if (ifp->if_output == ether_output) { - ifp->if_type = IFT_ETHER; - ifp->if_addrlen = 6; - ifp->if_hdrlen = 14; - } -#endif + /* * create a Link Level name for this device */ @@ -312,9 +310,11 @@ ifaof_ifpforaddr(addr, ifp) * Lookup an appropriate real ifa to point to. * This should be moved to /sys/net/link.c eventually. */ +void link_rtrequest(cmd, rt, sa) -register struct rtentry *rt; -struct sockaddr *sa; + int cmd; + register struct rtentry *rt; + struct sockaddr *sa; { register struct ifaddr *ifa; struct sockaddr *dst; @@ -335,6 +335,7 @@ struct sockaddr *sa; * the transition. * NOTE: must be called at splnet or eqivalent. */ +void if_down(ifp) register struct ifnet *ifp; { @@ -349,6 +350,7 @@ if_down(ifp) /* * Flush an interface queue. */ +static void if_qflush(ifq) register struct ifqueue *ifq; { @@ -369,7 +371,8 @@ if_qflush(ifq) * from softclock, we decrement timers (if set) and * call the appropriate interface routine on expiration. */ -if_slowtimo() +static void +if_slowtimo(caddr_t dummy1, int dummy2) { register struct ifnet *ifp; int s = splimp(); @@ -427,6 +430,7 @@ ifunit(name) /* * Interface ioctls. */ +int ifioctl(so, cmd, data, p) struct socket *so; int cmd; @@ -565,6 +569,7 @@ ifioctl(so, cmd, data, p) * other information. */ /*ARGSUSED*/ +int ifconf(cmd, data) int cmd; caddr_t data; diff --git a/sys/net/if.h b/sys/net/if.h index be0cce1da5..6864bccd82 100644 --- a/sys/net/if.h +++ b/sys/net/if.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)if.h 7.11 (Berkeley) 3/19/91 - * $Id: if.h,v 1.8 1993/11/14 20:02:20 wollman Exp $ + * $Id: if.h,v 1.9 1993/11/16 02:37:39 wollman Exp $ */ #ifndef _NET_IF_H_ @@ -75,6 +75,8 @@ * (Would like to call this struct ``if'', but C isn't PL/1.) */ +struct rtentry; + struct ifnet { char *if_name; /* name, e.g. ``en'' or ``lo'' */ short if_unit; /* sub-unit for lower level driver */ @@ -91,13 +93,14 @@ struct ifnet { int ifq_drops; } if_snd; /* output queue */ /* procedure handles */ - int (*if_init)(); /* init routine */ - int (*if_output)(); /* output routine (enqueue) */ - int (*if_start)(); /* initiate output routine */ - int (*if_done)(); /* output complete routine */ - int (*if_ioctl)(); /* ioctl routine */ - int (*if_reset)(); /* bus reset routine */ - int (*if_watchdog)(); /* timer routine */ + void (*if_init)(int); /* init routine */ + int (*if_output)(struct ifnet *, struct mbuf *, struct sockaddr *, + struct rtentry *); /* output routine (enqueue) */ + void (*if_start)(struct ifnet *); /* initiate output routine */ + int (*if_done)(struct ifnet *); /* output complete routine */ + int (*if_ioctl)(struct ifnet *, int, caddr_t); /* ioctl routine */ + void (*if_reset)(int, int); /* bus reset routine */ + void (*if_watchdog)(int); /* timer routine */ /* generic interface statistics */ int if_ipackets; /* packets received on interface */ int if_ierrors; /* input errors on interface */ @@ -190,6 +193,8 @@ struct ifnet { * are allocated and attached when an address is set, and are linked * together so all addresses for an interface can be located. */ +struct rtentry; + struct ifaddr { struct sockaddr *ifa_addr; /* address of interface */ struct sockaddr *ifa_dstaddr; /* other end of p-to-p link */ @@ -197,7 +202,8 @@ struct ifaddr { struct sockaddr *ifa_netmask; /* used to determine subnet */ struct ifnet *ifa_ifp; /* back-pointer to interface */ struct ifaddr *ifa_next; /* next address for interface */ - int (*ifa_rtrequest)(); /* check or clean routes (+ or -)'d */ + void (*ifa_rtrequest)(int, struct rtentry *, struct sockaddr *); + /* check or clean routes (+ or -)'d */ struct rtentry *ifa_rt; /* ??? for ROUTETOIF */ u_short ifa_flags; /* mostly rt_flags for cloning */ u_short ifa_llinfolen; /* extra to malloc for link info */ diff --git a/sys/net/if_arp.h b/sys/net/if_arp.h index 7d2efaf26e..2b51fa8f89 100644 --- a/sys/net/if_arp.h +++ b/sys/net/if_arp.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)if_arp.h 7.4 (Berkeley) 6/28/90 - * $Id: if_arp.h,v 1.3 1993/11/07 17:46:56 wollman Exp $ + * $Id: if_arp.h,v 1.4 1993/11/17 23:31:43 wollman Exp $ */ #ifndef _NET_IF_ARP_H_ @@ -74,10 +74,21 @@ struct arpreq { struct sockaddr arp_ha; /* hardware address */ int arp_flags; /* flags */ }; + /* arp_flags and at_flags field values */ #define ATF_INUSE 0x01 /* entry in use */ #define ATF_COM 0x02 /* completed entry (enaddr valid) */ #define ATF_PERM 0x04 /* permanent entry */ #define ATF_PUBL 0x08 /* publish entry (respond for other host) */ #define ATF_USETRAILERS 0x10 /* has requested trailers */ + +/* + * This doesn't really belong here, but there is no obvious other place + * to put it that will get seen by every client... + */ +struct mbuf; struct sockaddr; struct ifnet; struct rtentry; + +extern int +ether_output(struct ifnet *, struct mbuf*, struct sockaddr*, struct rtentry *); + #endif /* _NET_IF_ARP_H_ */ diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c index 6fe67ab260..6913c6f4e1 100644 --- a/sys/net/if_ethersubr.c +++ b/sys/net/if_ethersubr.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)if_ethersubr.c 7.13 (Berkeley) 4/20/91 - * $Id$ + * $Id: if_ethersubr.c,v 1.3 1993/10/16 17:43:16 rgrimes Exp $ */ #include "param.h" @@ -81,6 +81,7 @@ extern struct ifnet loif; * packet leaves a multiple of 512 bytes of data in remainder. * Assumes that ifp is actually pointer to arpcom structure. */ +int ether_output(ifp, m0, dst, rt) register struct ifnet *ifp; struct mbuf *m0; @@ -280,6 +281,7 @@ bad: * the packet is in the mbuf chain m without * the ether header, which is provided separately. */ +void ether_input(ifp, eh, m) struct ifnet *ifp; register struct ether_header *eh; @@ -376,7 +378,7 @@ ether_input(ifp, eh, m) eh->ether_dhost[i] = eh->ether_shost[i]; eh->ether_shost[i] = c; } - ifp->if_output(ifp, m, &sa); + ifp->if_output(ifp, m, &sa, (struct rtentry *)0); return; } dropanyway: @@ -387,7 +389,7 @@ ether_input(ifp, eh, m) #else m_freem(m); return; -#endif ISO +#endif /* ISO */ } s = splimp(); diff --git a/sys/net/if_loop.c b/sys/net/if_loop.c index 4964ab4fa0..df561d11ad 100644 --- a/sys/net/if_loop.c +++ b/sys/net/if_loop.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)if_loop.c 7.13 (Berkeley) 4/26/91 - * $Id: if_loop.c,v 1.3 1993/11/14 00:13:16 wollman Exp $ + * $Id: if_loop.c,v 1.4 1993/11/15 20:45:58 wollman Exp $ */ /* @@ -85,7 +85,7 @@ static caddr_t lo_bpf; struct ifnet loif; int looutput(struct ifnet *, struct mbuf *, struct sockaddr *, struct rtentry *); int loioctl(struct ifnet *, int, caddr_t); -int lortrequest(int, struct rtentry *, struct sockaddr *); +void lortrequest(int, struct rtentry *, struct sockaddr *); void loattach(void) @@ -187,11 +187,11 @@ looutput(ifp, m, dst, rt) } /* ARGSUSED */ -int +void lortrequest(cmd, rt, sa) -int cmd; -struct rtentry *rt; -struct sockaddr *sa; + int cmd; + struct rtentry *rt; + struct sockaddr *sa; { if (rt) { #ifdef DEBUG diff --git a/sys/net/if_ppp.c b/sys/net/if_ppp.c index a1da98a8e9..01b48ac35e 100644 --- a/sys/net/if_ppp.c +++ b/sys/net/if_ppp.c @@ -70,7 +70,7 @@ */ /* - * $Id: if_ppp.c,v 1.3 1993/09/06 19:48:58 rgrimes Exp $ + * $Id: if_ppp.c,v 1.4 1993/10/07 02:19:37 rgrimes Exp $ * From: if_ppp.c,v 1.22 1993/08/31 23:20:40 paulus Exp * From: if_ppp.c,v 1.21 1993/08/29 11:22:37 paulus Exp * From: if_sl.c,v 1.11 84/10/04 12:54:47 rick Exp @@ -155,7 +155,7 @@ int pppread __P((struct tty *tp, struct uio *uio, int flag)); int pppwrite __P((struct tty *tp, struct uio *uio, int flag)); int ppptioctl __P((struct tty *tp, int cmd, caddr_t data, int flag)); int pppoutput __P((struct ifnet *ifp, struct mbuf *m0, - struct sockaddr *dst)); + struct sockaddr *dst, struct rtentry *rt)); void pppstart __P((struct tty *tp)); void pppinput __P((int c, struct tty *tp)); int pppioctl __P((struct ifnet *ifp, int cmd, caddr_t data)); @@ -344,7 +344,7 @@ pppread(tp, uio, flag) register struct ppp_softc *sc = (struct ppp_softc *)tp->t_sc; struct mbuf *m, *m0; register int s; - int error; + int error = 0; if ((tp->t_state & TS_CARR_ON)==0) return (EIO); @@ -420,7 +420,7 @@ pppwrite(tp, uio, flag) *ph1 = *ph2; m0->m_data += PPP_HEADER_LEN; m0->m_len -= PPP_HEADER_LEN; - return (pppoutput(&sc->sc_if, m0, &dst)); + return (pppoutput(&sc->sc_if, m0, &dst, 0)); } /* @@ -569,10 +569,11 @@ pppfcs(fcs, cp, len) * Packet is placed in Information field of PPP frame. */ int -pppoutput(ifp, m0, dst) - struct ifnet *ifp; - struct mbuf *m0; - struct sockaddr *dst; +pppoutput(ifp, m0, dst, rt) + struct ifnet *ifp; + struct mbuf *m0; + struct sockaddr *dst; + struct rtentry *rt; { register struct ppp_softc *sc = &ppp_softc[ifp->if_unit]; struct ppp_header *ph; @@ -1330,6 +1331,7 @@ pppinput(c, tp) /* * Process an ioctl request to interface. */ +int pppioctl(ifp, cmd, data) register struct ifnet *ifp; int cmd; diff --git a/sys/net/if_sl.c b/sys/net/if_sl.c index abc739c5d7..8bdcd74afc 100644 --- a/sys/net/if_sl.c +++ b/sys/net/if_sl.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)if_sl.c 7.22 (Berkeley) 4/20/91 - * $Id: if_sl.c,v 1.4 1993/10/16 17:43:20 rgrimes Exp $ + * $Id: if_sl.c,v 1.5 1993/11/16 02:47:24 wollman Exp $ */ /* @@ -65,7 +65,7 @@ * interrupts and network activity; thus, splimp must be >= spltty. */ -/* $Id: /a/cvs/386BSD/src/sys/net/if_sl.c,v 1.4 1993/10/16 17:43:20 rgrimes Exp $ */ +/* $Id: if_sl.c,v 1.5 1993/11/16 02:47:24 wollman Exp $ */ /* from if_sl.c,v 1.11 84/10/04 12:54:47 rick Exp */ #include "sl.h" @@ -221,15 +221,13 @@ static int slinit(struct sl_softc *); int slopen(int /*dev_t*/, struct tty *); int slclose(struct tty *); int sltioctl(struct tty *, int, caddr_t, int); -int sloutput(struct ifnet *, struct mbuf *, struct sockaddr *); +int sloutput(struct ifnet *, struct mbuf *, struct sockaddr *, struct rtentry *); void slstart(struct tty *); static struct mbuf *sl_btom(struct sl_softc *, int); void slinput(int, struct tty *); static int slrtrequest(int, struct rtentry *, struct sockaddr *); int slioctl(struct ifnet *, int, caddr_t); -int ttrstrt(); /* XXX */ - /* * Called from boot code to establish sl interfaces. */ @@ -346,6 +344,7 @@ slclose(tp) sc->sc_buf = 0; } splx(s); + return 0; } /* @@ -390,10 +389,11 @@ sltioctl(tp, cmd, data, flag) * Queue a packet. Start transmission if not active. */ int -sloutput(ifp, m, dst) +sloutput(ifp, m, dst, rt) struct ifnet *ifp; register struct mbuf *m; struct sockaddr *dst; + struct rtentry *rt; { register struct sl_softc *sc = &sl_softc[ifp->if_unit]; register struct ip *ip; @@ -466,7 +466,7 @@ slstart(tp) struct mbuf *m2; #if NBPFILTER > 0 u_char bpfbuf[SLMTU + SLIP_HDRLEN]; - register int len; + register int len = 0; #endif for (;;) { diff --git a/sys/net/radix.c b/sys/net/radix.c index 35ad9fd7fe..94f7ba3e65 100644 --- a/sys/net/radix.c +++ b/sys/net/radix.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)radix.c 7.9 (Berkeley) 2/4/91 - * $Id$ + * $Id: radix.c,v 1.3 1993/10/16 17:43:30 rgrimes Exp $ */ /* @@ -213,6 +213,7 @@ int rn_saveinfo; struct radix_node * rn_newpair(v, b, nodes) caddr_t v; + int b; struct radix_node nodes[2]; { register struct radix_node *tt = nodes, *t = tt + 1; @@ -293,7 +294,9 @@ on1: struct radix_node * rn_addmask(netmask, search, skip) -caddr_t netmask; + caddr_t netmask; + int search; + int skip; { register struct radix_node *x; register caddr_t cp, cplim; @@ -343,9 +346,9 @@ struct radix_node *head; { register int j; register caddr_t cp; - register struct radix_node *t, *x, *tt; + register struct radix_node *t, *x = 0, *tt; short b = 0, b_leaf; - int vlen = *(u_char *)v, mlen, keyduplicated; + int vlen = *(u_char *)v, mlen = 0, keyduplicated; caddr_t cplim; unsigned char *maskp; struct radix_mask *m, **mp; struct radix_node *saved_tt; @@ -599,9 +602,11 @@ out: } char rn_zeros[MAXKEYLEN], rn_ones[MAXKEYLEN]; +int rn_inithead(head, off, af) -struct radix_node_head **head; -int off; + struct radix_node_head **head; + int off; + int af; { register struct radix_node_head *rnh; register struct radix_node *t, *tt, *ttt; diff --git a/sys/net/raw_cb.c b/sys/net/raw_cb.c index f9b77a76f9..582bb27666 100644 --- a/sys/net/raw_cb.c +++ b/sys/net/raw_cb.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)raw_cb.c 7.11 (Berkeley) 6/28/90 - * $Id: raw_cb.c,v 1.2 1993/10/16 17:43:34 rgrimes Exp $ + * $Id: raw_cb.c,v 1.3 1993/11/07 17:47:04 wollman Exp $ */ #include "param.h" @@ -68,6 +68,7 @@ struct rawcb rawcb; * Allocate a control block and a nominal amount * of buffer space for the socket. */ +int raw_attach(so, proto) register struct socket *so; int proto; @@ -95,6 +96,7 @@ raw_attach(so, proto) * Detach the raw connection block and discard * socket resources. */ +void raw_detach(rp) register struct rawcb *rp; { @@ -114,6 +116,7 @@ raw_detach(rp) /* * Disconnect and possibly release resources. */ +void raw_disconnect(rp) struct rawcb *rp; { diff --git a/sys/net/raw_usrreq.c b/sys/net/raw_usrreq.c index 297873dbf6..22c346471e 100644 --- a/sys/net/raw_usrreq.c +++ b/sys/net/raw_usrreq.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)raw_usrreq.c 7.9 (Berkeley) 6/28/90 - * $Id$ + * $Id: raw_usrreq.c,v 1.3 1993/10/16 17:43:38 rgrimes Exp $ */ #include "param.h" @@ -53,6 +53,7 @@ /* * Initialize raw connection block q. */ +void raw_init() { @@ -69,6 +70,7 @@ raw_init() /* * Raw protocol interface. */ +int raw_input(m0, proto, src, dst) struct mbuf *m0; register struct sockproto *proto; @@ -129,6 +131,7 @@ raw_input(m0, proto, src, dst) } /*ARGSUSED*/ +void raw_ctlinput(cmd, arg) int cmd; struct sockaddr *arg; @@ -140,6 +143,7 @@ raw_ctlinput(cmd, arg) } /*ARGSUSED*/ +int raw_usrreq(so, req, m, nam, control) struct socket *so; int req; @@ -307,4 +311,3 @@ release: return (error); } -rawintr() {} /* XXX - referenced by locore. will soon go away */ diff --git a/sys/net/route.c b/sys/net/route.c index 94dd70a86c..b426e16fce 100644 --- a/sys/net/route.c +++ b/sys/net/route.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)route.c 7.22 (Berkeley) 6/27/91 - * $Id: route.c,v 1.2 1993/10/16 17:43:39 rgrimes Exp $ + * $Id: route.c,v 1.3 1993/11/07 17:47:07 wollman Exp $ */ #include "param.h" @@ -76,6 +76,7 @@ static int rtinits_done = 0; struct radix_node_head *ns_rnhead, *in_rnhead; struct radix_node *rn_match(), *rn_delete(), *rn_addroute(); +void rtinitheads() { if (rtinits_done == 0 && @@ -89,6 +90,7 @@ rtinitheads() /* * Packet routing routines. */ +void rtalloc(ro) register struct route *ro; { @@ -131,6 +133,7 @@ rtalloc1(dst, report) return (newrt); } +void rtfree(rt) register struct rtentry *rt; { @@ -155,6 +158,7 @@ rtfree(rt) * N.B.: must be called at splnet * */ +void rtredirect(dst, gateway, netmask, flags, src, rtp) struct sockaddr *dst, *gateway, *netmask, *src; int flags; @@ -239,6 +243,7 @@ done: /* * Routing table ioctl interface. */ +int rtioctl(req, data, p) int req; caddr_t data; @@ -354,6 +359,7 @@ struct sockaddr *dst, *gateway; #define ROUNDUP(a) (a>0 ? (1 + (((a) - 1) | (sizeof(long) - 1))) : sizeof(long)) +int rtrequest(req, dst, gateway, netmask, flags, ret_nrt) int req, flags; struct sockaddr *dst, *gateway, *netmask; @@ -448,8 +454,9 @@ bad: return (error); } +void rt_maskedcopy(src, dst, netmask) -struct sockaddr *src, *dst, *netmask; + struct sockaddr *src, *dst, *netmask; { register u_char *cp1 = (u_char *)src; register u_char *cp2 = (u_char *)dst; @@ -470,6 +477,7 @@ struct sockaddr *src, *dst, *netmask; * Set up a routing table entry, normally * for an interface. */ +int rtinit(ifa, cmd, flags) register struct ifaddr *ifa; int cmd, flags; diff --git a/sys/net/route.h b/sys/net/route.h index 140998ed00..2c46e7a779 100644 --- a/sys/net/route.h +++ b/sys/net/route.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)route.h 7.13 (Berkeley) 4/25/91 - * $Id: route.h,v 1.2 1993/10/16 17:43:41 rgrimes Exp $ + * $Id: route.h,v 1.3 1993/11/07 17:47:08 wollman Exp $ */ #ifndef _NET_ROUTE_H_ @@ -224,5 +224,8 @@ extern struct mbuf *rthost[RTHASHSIZ]; extern struct mbuf *rtnet[RTHASHSIZ]; extern struct rtstat rtstat; struct rtentry *rtalloc1(); + +extern void rt_maskedcopy(struct sockaddr *, struct sockaddr *, struct sockaddr *); + #endif #endif /* _NET_ROUTE_H_ */ diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c index fcf6b1e390..582402da70 100644 --- a/sys/net/rtsock.c +++ b/sys/net/rtsock.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)rtsock.c 7.18 (Berkeley) 6/27/91 - * $Id: rtsock.c,v 1.3 1993/10/16 17:43:43 rgrimes Exp $ + * $Id: rtsock.c,v 1.4 1993/11/07 17:47:09 wollman Exp $ */ #include "param.h" @@ -49,12 +49,15 @@ #include "machine/mtpr.h" +static void rt_setmetrics(u_long, struct rt_metrics *, struct rt_metrics *); + struct route_cb route_cb; struct sockaddr route_dst = { 2, PF_ROUTE, }; struct sockaddr route_src = { 2, PF_ROUTE, }; struct sockproto route_proto = { PF_ROUTE, }; /*ARGSUSED*/ +int route_usrreq(so, req, m, nam, control) register struct socket *so; int req; @@ -108,6 +111,7 @@ route_usrreq(so, req, m, nam, control) #define ADVANCE(x, n) (x += ROUNDUP((n)->sa_len)) /*ARGSUSED*/ +int route_output(m, so) register struct mbuf *m; struct socket *so; @@ -366,6 +370,7 @@ cleanup: return (error); } +void rt_setmetrics(which, in, out) u_long which; register struct rt_metrics *in, *out; @@ -382,66 +387,19 @@ rt_setmetrics(which, in, out) #undef metric } -/* - * Copy data from a buffer back into the indicated mbuf chain, - * starting "off" bytes from the beginning, extending the mbuf - * chain if necessary. - */ -m_copyback(m0, off, len, cp) - struct mbuf *m0; - register int off; - register int len; - caddr_t cp; - -{ - register int mlen; - register struct mbuf *m = m0, *n; - int totlen = 0; - - if (m0 == 0) - return; - while (off > (mlen = m->m_len)) { - off -= mlen; - totlen += mlen; - if (m->m_next == 0) { - n = m_getclr(M_DONTWAIT, m->m_type); - if (n == 0) - goto out; - n->m_len = min(MLEN, len + off); - m->m_next = n; - } - m = m->m_next; - } - while (len > 0) { - mlen = min (m->m_len - off, len); - bcopy(cp, off + mtod(m, caddr_t), (unsigned)mlen); - cp += mlen; - len -= mlen; - mlen += off; - off = 0; - totlen += mlen; - if (len == 0) - break; - if (m->m_next == 0) { - n = m_get(M_DONTWAIT, m->m_type); - if (n == 0) - break; - n->m_len = min(MLEN, len); - m->m_next = n; - } - m = m->m_next; - } -out: if (((m = m0)->m_flags & M_PKTHDR) && (m->m_pkthdr.len < totlen)) - m->m_pkthdr.len = totlen; -} - /* * The miss message and losing message are very similar. */ +void rt_missmsg(type, dst, gate, mask, src, flags, error) -register struct sockaddr *dst; -struct sockaddr *gate, *mask, *src; + int type; + register struct sockaddr *dst; + struct sockaddr *gate; + struct sockaddr *mask; + struct sockaddr *src; + int flags; + int error; { register struct rt_msghdr *rtm; register struct mbuf *m; @@ -508,6 +466,7 @@ struct walkarg { /* * This is used in dumping the kernel table via getkinfo(). */ +int rt_dumpentry(rn, w) struct radix_node *rn; register struct walkarg *w; @@ -575,6 +534,7 @@ rt_dumpentry(rn, w) #undef next } +int kinfo_rtable(op, where, given, arg, needed) int op, arg; caddr_t where; @@ -618,6 +578,7 @@ kinfo_rtable(op, where, given, arg, needed) return (error); } +int rt_walk(rn, f, w) register struct radix_node *rn; register int (*f)(); diff --git a/sys/netccitt/hd_debug.c b/sys/netccitt/hd_debug.c index b1a54b3e8f..c22eaf295e 100644 --- a/sys/netccitt/hd_debug.c +++ b/sys/netccitt/hd_debug.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * from: @(#)hd_debug.c 7.5 (Berkeley) 5/29/91 - * $Id$ + * $Id: hd_debug.c,v 1.2 1993/10/16 19:46:34 rgrimes Exp $ */ #include "param.h" @@ -68,9 +68,11 @@ struct hdlctrace { int lasttracelogged, freezetrace; #endif +void hd_trace (hdp, direction, frame) -struct hdcb *hdp; -register struct Hdlc_frame *frame; + struct hdcb *hdp; + int direction; + register struct Hdlc_frame *frame; { register char *s; register int nr, pf, ns, i; diff --git a/sys/netccitt/hd_input.c b/sys/netccitt/hd_input.c index 48adb70865..c94e290556 100644 --- a/sys/netccitt/hd_input.c +++ b/sys/netccitt/hd_input.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * From: @(#)hd_input.c 7.7 (Berkeley) 5/29/91 - * $Id$ + * $Id: hd_input.c,v 1.2 1993/09/09 23:20:21 rgrimes Exp $ */ #include "param.h" @@ -58,13 +58,13 @@ /* * forward references */ -static +static void frame_reject (struct hdcb *hdp, int rejectcode, struct Hdlc_iframe *frame); -static +static void rej_routine (struct hdcb *hdp, int rejnr); -static +static void free_iframes (struct hdcb *hdp, int *nr, int finalbit); /* @@ -74,6 +74,7 @@ free_iframes (struct hdcb *hdp, int *nr, int finalbit); * completed reading a frame. */ +void hdintr () { register struct mbuf *m; @@ -128,9 +129,10 @@ hdintr () pkintr (); } +int process_rxframe (hdp, fbuf) -register struct hdcb *hdp; -register struct mbuf *fbuf; + register struct hdcb *hdp; + register struct mbuf *fbuf; { register int queued = FALSE, frametype, pf; register struct Hdlc_frame *frame; @@ -326,10 +328,11 @@ register struct mbuf *fbuf; return (queued); } +int process_iframe (hdp, fbuf, frame) -register struct hdcb *hdp; -struct mbuf *fbuf; -register struct Hdlc_iframe *frame; + register struct hdcb *hdp; + struct mbuf *fbuf; + register struct Hdlc_iframe *frame; { register int nr = frame -> nr, ns = frame -> ns, @@ -454,11 +457,11 @@ int rear, * condition Y (frame length error) are handled elsewhere. */ -static +static void frame_reject (hdp, rejectcode, frame) -struct hdcb *hdp; -int rejectcode; -struct Hdlc_iframe *frame; + struct hdcb *hdp; + int rejectcode; + struct Hdlc_iframe *frame; { register struct Frmr_frame *frmr = &hd_frmr; @@ -502,10 +505,11 @@ struct Hdlc_iframe *frame; * frames is done here. */ +void process_sframe (hdp, frame, frametype) -register struct hdcb *hdp; -register struct Hdlc_sframe *frame; -int frametype; + register struct hdcb *hdp; + register struct Hdlc_sframe *frame; + int frametype; { register int nr = frame -> nr, pf = frame -> pf, pollbit = 0; @@ -559,8 +563,9 @@ int frametype; bool valid_nr (hdp, nr, finalbit) -register struct hdcb *hdp; -register int finalbit; + register struct hdcb *hdp; + int nr; + register int finalbit; { /* Make sure it really does acknowledge something. */ if (hdp->hd_lastrxnr == nr) @@ -604,10 +609,10 @@ register int finalbit; * It then resets the Send State Variable V(S) to accomplish this. */ -static +static void rej_routine (hdp, rejnr) -register struct hdcb *hdp; -register int rejnr; + register struct hdcb *hdp; + register int rejnr; { register int anchor; @@ -648,11 +653,11 @@ register int rejnr; * when a previously written iframe is acknowledged. */ -static +static void free_iframes (hdp, nr, finalbit) -register struct hdcb *hdp; -int *nr; -register int finalbit; + register struct hdcb *hdp; + int *nr; + register int finalbit; { register int i, k; diff --git a/sys/netccitt/hd_output.c b/sys/netccitt/hd_output.c index 133b2d34ae..fb6b52017e 100644 --- a/sys/netccitt/hd_output.c +++ b/sys/netccitt/hd_output.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * from: @(#)hd_output.c 7.6 (Berkeley) 5/29/91 - * $Id$ + * $Id: hd_output.c,v 1.2 1993/10/16 19:46:36 rgrimes Exp $ */ #include "param.h" @@ -64,9 +64,10 @@ * by the input and control routines of the HDLC layer. */ +void hd_output (hdp, m0) -register struct hdcb *hdp; -struct mbuf *m0; + register struct hdcb *hdp; + struct mbuf *m0; { struct x25config *xcp; register struct mbuf *m = m0; @@ -100,8 +101,9 @@ struct mbuf *m0; hd_start (hdp); } +void hd_start (hdp) -register struct hdcb *hdp; + register struct hdcb *hdp; { register struct mbuf *m; @@ -141,10 +143,11 @@ register struct hdcb *hdp; * of old frames is required. */ +void hd_send_iframe (hdp, buf, poll_bit) -register struct hdcb *hdp; -register struct mbuf *buf; -int poll_bit; + register struct hdcb *hdp; + register struct mbuf *buf; + int poll_bit; { register struct Hdlc_iframe *iframe; struct mbuf *m; @@ -192,9 +195,10 @@ int poll_bit; SET_TIMER (hdp); } +void hd_ifoutput(hdp, m) -register struct mbuf *m; -register struct hdcb *hdp; + register struct mbuf *m; + register struct hdcb *hdp; { /* * Queue message on interface, and start output if interface @@ -222,8 +226,9 @@ register struct hdcb *hdp; * received an acknowledgement for a iframe. */ +void hd_resend_iframe (hdp) -register struct hdcb *hdp; + register struct hdcb *hdp; { if (hdp->hd_retxcnt++ < hd_n2) { diff --git a/sys/netccitt/hd_subr.c b/sys/netccitt/hd_subr.c index 8a3a7d9909..f861bae874 100644 --- a/sys/netccitt/hd_subr.c +++ b/sys/netccitt/hd_subr.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * from: @(#)hd_subr.c 7.6 (Berkeley) 5/29/91 - * $Id$ + * $Id: hd_subr.c,v 1.2 1993/10/16 19:46:37 rgrimes Exp $ */ #include "param.h" @@ -55,14 +55,17 @@ #include "hd_var.h" #include "x25.h" +void hd_init () { hdintrq.ifq_maxlen = IFQ_MAXLEN; } +int hd_ctlinput (prc, addr) -struct sockaddr *addr; + int prc; + struct sockaddr *addr; { register struct x25config *xcp = (struct x25config *)addr; register struct hdcb *hdp; @@ -125,8 +128,9 @@ struct sockaddr *addr; return (0); } +void hd_initvars (hdp) -register struct hdcb *hdp; + register struct hdcb *hdp; { register struct mbuf *m; register int i; @@ -151,9 +155,10 @@ register struct hdcb *hdp; hdp->hd_condition = 0; } +int hd_decode (hdp, frame) -register struct hdcb *hdp; -struct Hdlc_frame *frame; + register struct hdcb *hdp; + struct Hdlc_frame *frame; { register int frametype = ILLEGAL; register struct Hdlc_iframe *iframe = (struct Hdlc_iframe *) frame; @@ -216,9 +221,10 @@ struct Hdlc_frame *frame; * Only supervisory or unnumbered frames are processed. */ +void hd_writeinternal (hdp, frametype, pf) -register struct hdcb *hdp; -register int frametype, pf; + register struct hdcb *hdp; + register int frametype, pf; { register struct mbuf *buf; struct Hdlc_frame *frame; @@ -315,9 +321,10 @@ struct hdtxq *q; return (m); } +void hd_append (q, m) -register struct hdtxq *q; -register struct mbuf *m; + register struct hdtxq *q; + register struct mbuf *m; { m -> m_act = NULL; @@ -328,8 +335,9 @@ register struct mbuf *m; q -> tail = m; } +void hd_flush (ifp) -struct ifnet *ifp; + struct ifnet *ifp; { register struct mbuf *m; register int s; @@ -344,9 +352,10 @@ struct ifnet *ifp; } } +void hd_message (hdp, msg) -struct hdcb *hdp; -char *msg; + struct hdcb *hdp; + const char *msg; { char *format_ntn (); diff --git a/sys/netccitt/hd_timer.c b/sys/netccitt/hd_timer.c index 95b70d1b75..16bccab843 100644 --- a/sys/netccitt/hd_timer.c +++ b/sys/netccitt/hd_timer.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * from: @(#)hd_timer.c 7.4 (Berkeley) 5/29/91 - * $Id$ + * $Id: hd_timer.c,v 1.2 1993/10/16 19:46:40 rgrimes Exp $ */ #include "param.h" @@ -71,6 +71,7 @@ int hd_n2 = N2; * amount - if expired then process the event. */ +void hd_timer () { register struct hdcb *hdp; diff --git a/sys/netccitt/hd_var.h b/sys/netccitt/hd_var.h index f5acba44bb..cff29bd29e 100644 --- a/sys/netccitt/hd_var.h +++ b/sys/netccitt/hd_var.h @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * from: @(#)hd_var.h 7.4 (Berkeley) 5/29/91 - * $Id: hd_var.h,v 1.2 1993/10/16 19:46:41 rgrimes Exp $ + * $Id: hd_var.h,v 1.3 1993/11/07 17:47:22 wollman Exp $ */ #ifndef _NETCCITT_HD_VAR_H_ @@ -108,5 +108,13 @@ struct ifqueue hdintrq; /* hdlc packet input queue */ int hd_t1; /* timer T1 value */ int hd_t3; /* RR send timer */ int hd_n2; /* frame retransmission limit */ -#endif + +extern void process_sframe(struct hdcb *, struct Hdlc_sframe *, int); +extern void hd_start(struct hdcb *); +extern void hd_send_iframe(struct hdcb *, struct mbuf *, int); +extern void hd_writeinternal(struct hdcb *, int, int); +extern void hd_flush(struct ifnet *); +extern void hd_message(struct hdcb *, const char *); + +#endif /* KERNEL */ #endif /* _NETCCITT_HD_VAR_H_ */ diff --git a/sys/netccitt/if_x25subr.c b/sys/netccitt/if_x25subr.c index 0e1e7bc594..7013432788 100644 --- a/sys/netccitt/if_x25subr.c +++ b/sys/netccitt/if_x25subr.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)if_x25subr.c 7.14 (Berkeley) 6/26/91 - * $Id$ + * $Id: if_x25subr.c,v 1.2 1993/10/16 19:46:44 rgrimes Exp $ */ #include "param.h" @@ -115,8 +115,10 @@ register struct rtentry *rt; } return lx; } + +void x25_lxfree(lx) -register struct llinfo_x25 *lx; + register struct llinfo_x25 *lx; { register struct rtentry *rt = lx->lx_rt; register struct pklcd *lcp = lx->lx_lcd; @@ -136,9 +138,10 @@ register struct llinfo_x25 *lx; /* * Process a x25 packet as datagram; */ +void x25_ifinput(lcp, m) -struct pklcd *lcp; -register struct mbuf *m; + struct pklcd *lcp; + register struct mbuf *m; { struct llinfo_x25 *lx = (struct llinfo_x25 *)lcp->lcd_upnext; register struct ifnet *ifp; @@ -200,9 +203,11 @@ register struct mbuf *m; } splx(s); } + +void x25_connect_callback(lcp, m) -register struct pklcd *lcp; -register struct mbuf *m; + register struct pklcd *lcp; + register struct mbuf *m; { register struct llinfo_x25 *lx = (struct llinfo_x25 *)lcp->lcd_upnext; if (m == 0) @@ -228,13 +233,13 @@ register struct mbuf *m; #define SA(p) ((struct sockaddr *)(p)) #define RT(p) ((struct rtentry *)(p)) +void x25_dgram_incoming(lcp, m0) -register struct pklcd *lcp; -struct mbuf *m0; + register struct pklcd *lcp; + struct mbuf *m0; { register struct rtentry *rt, *nrt; register struct mbuf *m = m0->m_next; /* m0 has calling sockaddr_x25 */ - int x25_rtrequest(); rt = rtalloc1(SA(&lcp->lcd_faddr), 0); if (rt == 0) { @@ -262,21 +267,22 @@ refuse: lcp->lcd_upper = 0; /* * X.25 output routine. */ +int x25_ifoutput(ifp, m0, dst, rt) -struct ifnet *ifp; -struct mbuf *m0; -struct sockaddr *dst; -register struct rtentry *rt; + struct ifnet *ifp; + struct mbuf *m0; + struct sockaddr *dst; + register struct rtentry *rt; { register struct mbuf *m = m0; register struct llinfo_x25 *lx; struct pklcd *lcp; int s, error = 0; -int plen; -for (plen = 0; m; m = m->m_next) - plen += m->m_len; -m = m0; + int plen; + for (plen = 0; m; m = m->m_next) + plen += m->m_len; + m = m0; if ((ifp->if_flags & IFF_UP) == 0) senderr(ENETDOWN); @@ -328,7 +334,7 @@ next_circuit: if (dst->sa_family == AF_INET && ifp->if_type == IFT_X25DDN && rt->rt_gateway->sa_family != AF_CCITT) - x25_ddnip_to_ccitt(dst, rt); + x25_ddnip_to_ccitt((struct sockaddr_in *)dst, rt); if (rt->rt_gateway->sa_family != AF_CCITT) { if ((rt->rt_flags & RTF_XRESOLVE) == 0) senderr(EHOSTUNREACH); @@ -376,8 +382,9 @@ next_circuit: /* * Simpleminded timer routine. */ +void x25_iftimeout(ifp) -struct ifnet *ifp; + struct ifnet *ifp; { register struct pkcb *pkcb = 0; register struct pklcd **lcpp, *lcp; @@ -399,9 +406,11 @@ struct ifnet *ifp; * This routine gets called when validating additions of new routes * or deletions of old ones. */ +void x25_rtrequest(cmd, rt, dst) -register struct rtentry *rt; -struct sockaddr *dst; + int cmd; + register struct rtentry *rt; + struct sockaddr *dst; { register struct llinfo_x25 *lx = (struct llinfo_x25 *)rt->rt_llinfo; register struct sockaddr_x25 *sa =(struct sockaddr_x25 *)rt->rt_gateway; @@ -432,7 +441,8 @@ struct sockaddr *dst; if (lcp->lcd_ceaddr && Bcmp(rt->rt_gateway, lcp->lcd_ceaddr, lcp->lcd_ceaddr->x25_len) != 0) { - x25_rtinvert(RTM_DELETE, lcp->lcd_ceaddr, rt); + x25_rtinvert(RTM_DELETE, + (struct sockaddr *)lcp->lcd_ceaddr, rt); lcp->lcd_upper = 0; pk_disconnect(lcp); } @@ -443,9 +453,11 @@ struct sockaddr *dst; int x25_dont_rtinvert = 0; +void x25_rtinvert(cmd, sa, rt) -register struct sockaddr *sa; -register struct rtentry *rt; + int cmd; + register struct sockaddr *sa; + register struct rtentry *rt; { struct rtentry *rt2 = 0; /* @@ -496,9 +508,10 @@ union imp_addr { * The following is totally bogus and here only to preserve * the IP to X.25 translation. */ +void x25_ddnip_to_ccitt(src, rt) -struct sockaddr_in *src; -register struct rtentry *rt; + struct sockaddr_in *src; + register struct rtentry *rt; { register struct sockaddr_x25 *dst = (struct sockaddr_x25 *)rt->rt_gateway; union imp_addr imp_addr; @@ -548,9 +561,11 @@ register struct rtentry *rt; * This is a utility routine to be called by x25 devices when a * call request is honored with the intent of starting datagram forwarding. */ +void x25_dg_rtinit(dst, ia, af) -struct sockaddr_x25 *dst; -register struct x25_ifaddr *ia; + struct sockaddr_x25 *dst; + register struct x25_ifaddr *ia; + int af; { struct sockaddr *sa = 0; struct rtentry *rt; @@ -603,7 +618,7 @@ register struct x25_ifaddr *ia; imp_no = temp & 0xff; break; default: - return (0L); + return; } imp_addr.ip = my_addr; if ((imp_addr.imp.s_net & 0x80) == 0x00) { @@ -655,6 +670,7 @@ struct sockaddr_x25 x25_dgmask = { int x25_startproto = 1; struct radix_tree_head *x25_rnhead; +void pk_init() { /* @@ -674,7 +690,7 @@ pk_init() struct x25_dgproto { u_char spi; u_char spilen; - int (*f)(); + void (*f)(struct pklcd *, struct mbuf *); } x25_dgprototab[] = { #if defined(ISO) && defined(TPCONS) { 0x0, 0, tp_incoming}, @@ -684,8 +700,9 @@ struct x25_dgproto { { 0x81, 1, x25_dgram_incoming}, }; +int pk_user_protolisten(info) -register u_char *info; + register u_char *info; { register struct x25_dgproto *dp = x25_dgprototab + ((sizeof x25_dgprototab) / (sizeof *dp)); @@ -713,9 +730,10 @@ gotspi: if (info[1]) * routing entry. If freshly allocated, it glues back the vc from * the rtentry to the socket. */ +int pk_rtattach(so, m0) -register struct socket *so; -struct mbuf *m0; + register struct socket *so; + struct mbuf *m0; { register struct pklcd *lcp = (struct pklcd *)so->so_pcb; register struct mbuf *m = m0; @@ -774,9 +792,11 @@ struct mbuf *m0; } return 0; } + +void x25_rtattach(lcp0, rt) -register struct pklcd *lcp0; -struct rtentry *rt; + register struct pklcd *lcp0; + struct rtentry *rt; { register struct llinfo_x25 *lx = (struct llinfo_x25 *)rt->rt_llinfo; register struct pklcd *lcp; @@ -789,7 +809,7 @@ struct rtentry *rt; } else { lx = x25_lxalloc(rt); if (lx == 0) - return ENOBUFS; + return; } } lx->lx_lcd = lcp = lcp0; diff --git a/sys/netccitt/pk_acct.c b/sys/netccitt/pk_acct.c index 4a0972d76c..becc72e0f4 100644 --- a/sys/netccitt/pk_acct.c +++ b/sys/netccitt/pk_acct.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * from: @(#)pk_acct.c 7.6 (Berkeley) 6/26/91 - * $Id$ + * $Id: pk_acct.c,v 1.2 1993/10/16 19:46:47 rgrimes Exp $ */ #include "param.h" @@ -62,6 +62,7 @@ struct vnode *pkacctp; * Turn on packet accounting */ +int pk_accton (path) char *path; { @@ -95,8 +96,9 @@ pk_accton (path) * Write a record on the accounting file. */ +void pk_acct (lcp) -register struct pklcd *lcp; + register struct pklcd *lcp; { register struct vnode *vp; register struct sockaddr_x25 *sa; diff --git a/sys/netccitt/pk_debug.c b/sys/netccitt/pk_debug.c index 0b3c523f68..43db95bde2 100644 --- a/sys/netccitt/pk_debug.c +++ b/sys/netccitt/pk_debug.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * from: @(#)pk_debug.c 7.7 (Berkeley) 5/9/91 - * $Id$ + * $Id: pk_debug.c,v 1.2 1993/10/16 19:46:48 rgrimes Exp $ */ #include "param.h" @@ -67,10 +67,11 @@ char *pk_name[] = { "Invalid" }; +void pk_trace (xcp, m, dir) -struct x25config *xcp; -register struct mbuf *m; -char *dir; + struct x25config *xcp; + register struct mbuf *m; + char *dir; { register char *s; struct x25_packet *xp = mtod(m, struct x25_packet *); @@ -91,9 +92,10 @@ char *dir; printf ("\n"); } +void mbuf_cache(c, m) -register struct mbuf_cache *c; -struct mbuf *m; + register struct mbuf_cache *c; + struct mbuf *m; { register struct mbuf **mp; diff --git a/sys/netccitt/pk_input.c b/sys/netccitt/pk_input.c index 3103292cd7..23c10aa30c 100644 --- a/sys/netccitt/pk_input.c +++ b/sys/netccitt/pk_input.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * from: @(#)pk_input.c 7.14 (Berkeley) 7/16/91 - * $Id: pk_input.c,v 1.2 1993/10/16 19:46:50 rgrimes Exp $ + * $Id: pk_input.c,v 1.3 1993/10/30 06:37:09 rgrimes Exp $ */ #include "param.h" @@ -101,13 +101,14 @@ caddr_t llnext; return (pkp); } +int pk_resize (pkp) -register struct pkcb *pkp; + register struct pkcb *pkp; { struct pklcd *dev_lcp = 0; struct x25config *xcp = pkp -> pk_xcp; if (pkp -> pk_chan && - (pkp -> pk_maxlcn != xcp -> xc_maxlcn)) { + ((u_long)pkp -> pk_maxlcn != (u_long)xcp -> xc_maxlcn)) { pk_restart (pkp, X25_RESTART_NETWORK_CONGESTION); dev_lcp = pkp -> pk_chan[0]; free ((caddr_t)pkp -> pk_chan, M_IFADDR); @@ -144,8 +145,10 @@ register struct pkcb *pkp; * becomes operational, is reset, or when the link goes down. */ +int pk_ctlinput (code, pkp) -register struct pkcb *pkp; + int code; + register struct pkcb *pkp; { @@ -172,6 +175,7 @@ struct ifqueue pkintrq; * This routine is called if there are semi-smart devices that do HDLC * in hardware and want to queue the packet and call level 3 directly */ +void pkintr () { register struct mbuf *m; @@ -210,8 +214,9 @@ struct mbuf_cache pk_input_cache = {0 }; * */ +void pk_input (m) -register struct mbuf *m; + register struct mbuf *m; { register struct x25_packet *xp; register struct pklcd *lcp; @@ -623,10 +628,10 @@ register struct mbuf *m; m_freem (m); } -static +static void prune_dnic(from, to, dnicname, xcp) -char *from, *to, *dnicname; -register struct x25config *xcp; + char *from, *to, *dnicname; + register struct x25config *xcp; { register char *cp1 = from, *cp2 = from; if (xcp->xc_prepnd0 && *cp1 == '0') { @@ -642,10 +647,12 @@ copyrest: for (cp1 = dnicname; *cp2 = *cp1++;) cp2++; } + /* static */ +void pk_simple_bsd (from, to, lower, len) -register octet *from, *to; -register len, lower; + register octet *from, *to; + register len, lower; { register int c; while (--len >= 0) { @@ -660,10 +667,12 @@ register len, lower; } /*static octet * */ +void pk_from_bcd (a, iscalling, sa, xcp) -register struct x25_calladdr *a; -register struct sockaddr_x25 *sa; -register struct x25config *xcp; + register struct x25_calladdr *a; + int iscalling; + register struct sockaddr_x25 *sa; + register struct x25config *xcp; { octet buf[MAXADDRLN+1]; octet *cp; @@ -689,13 +698,13 @@ register struct x25config *xcp; bcopy ((caddr_t)buf, (caddr_t)sa -> x25_addr, count + 1); } -static +static void save_extra(m0, fp, so) -struct mbuf *m0; -octet *fp; -struct socket *so; + struct mbuf *m0; + octet *fp; + struct socket *so; { - register struct mbuf *m; + register struct mbuf *m = 0; struct cmsghdr cmsghdr; if (m = m_copym (m, 0, (int)M_COPYALL), M_DONTWAIT) { int off = fp - mtod (m0, octet *); @@ -719,9 +728,10 @@ struct socket *so; * sockets awaiting connections. */ +void pk_incoming_call (pkp, m0) -struct mbuf *m0; -struct pkcb *pkp; + struct pkcb *pkp; + struct mbuf *m0; { register struct pklcd *lcp = 0, *l; register struct sockaddr_x25 *sa; @@ -748,8 +758,10 @@ struct pkcb *pkp; ((a -> called_addrlen + a -> calling_addrlen + 1) / 2)); u += *u + 1; udlen = min (16, ((octet *)xp) + len - u); +#if 0 if (udlen < 0) udlen = 0; +#endif pk_from_bcd (a, 1, sa, pkp -> pk_xcp); /* get calling address */ pk_parse_facilities (facp, sa); bcopy ((caddr_t)u, sa -> x25_udata, udlen); @@ -859,9 +871,10 @@ struct pkcb *pkp; pk_clear (lcp, 0, 1); } +void pk_call_accepted (lcp, m) -struct pklcd *lcp; -struct mbuf *m; + struct pklcd *lcp; + struct mbuf *m; { register struct x25_calladdr *ap; register octet *fcp; @@ -885,9 +898,10 @@ struct mbuf *m; lcp -> lcd_upper(lcp, m); } +void pk_parse_facilities (fcp, sa) -register octet *fcp; -register struct sockaddr_x25 *sa; + register octet *fcp; + register struct sockaddr_x25 *sa; { register octet *maxfcp; diff --git a/sys/netccitt/pk_output.c b/sys/netccitt/pk_output.c index 789adc12f5..3045806a77 100644 --- a/sys/netccitt/pk_output.c +++ b/sys/netccitt/pk_output.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * from: @(#)pk_output.c 7.10 (Berkeley) 5/29/91 - * $Id$ + * $Id: pk_output.c,v 1.2 1993/10/16 19:46:51 rgrimes Exp $ */ #include "param.h" @@ -56,8 +56,9 @@ struct mbuf_cache pk_output_cache = {0 }; struct mbuf *nextpk (); +void pk_output (lcp) -register struct pklcd *lcp; + register struct pklcd *lcp; { register struct x25_packet *xp; register struct mbuf *m; diff --git a/sys/netccitt/pk_subr.c b/sys/netccitt/pk_subr.c index e2d7479905..c8df39e19c 100644 --- a/sys/netccitt/pk_subr.c +++ b/sys/netccitt/pk_subr.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * from: @(#)pk_subr.c 7.16 (Berkeley) 6/6/91 - * $Id: pk_subr.c,v 1.2 1993/10/16 19:46:53 rgrimes Exp $ + * $Id: pk_subr.c,v 1.3 1993/11/17 23:32:23 wollman Exp $ */ #include "param.h" @@ -48,6 +48,7 @@ #include "errno.h" #include "time.h" #include "kernel.h" +#include "machine/stdarg.h" #include "../net/if.h" @@ -101,8 +102,9 @@ struct socket *so; * Disconnect X.25 protocol from socket. */ +void pk_disconnect (lcp) -register struct pklcd *lcp; + register struct pklcd *lcp; { register struct socket *so = lcp -> lcd_so; register struct pklcd *l, *p; @@ -145,8 +147,9 @@ register struct pklcd *lcp; * connection and internal descriptors. Wake up any sleepers. */ +void pk_close (lcp) -struct pklcd *lcp; + struct pklcd *lcp; { register struct socket *so = lcp -> lcd_so; @@ -206,9 +209,10 @@ int lcn, type; * state. */ +void pk_restart (pkp, restart_cause) -register struct pkcb *pkp; -int restart_cause; + register struct pkcb *pkp; + int restart_cause; { register struct mbuf *m; register struct pklcd *lcp; @@ -247,8 +251,9 @@ int restart_cause; * This procedure frees up the Logical Channel Descripter. */ +void pk_freelcd (lcp) -register struct pklcd *lcp; + register struct pklcd *lcp; { if (lcp == NULL) return; @@ -268,9 +273,10 @@ register struct pklcd *lcp; * Call User Data field. */ +int pk_bind (lcp, nam) -struct pklcd *lcp; -struct mbuf *nam; + struct pklcd *lcp; + struct mbuf *nam; { register struct pkcb *pkp; register struct pklcd *pp; @@ -316,8 +322,9 @@ struct mbuf *nam; /* * Include a bound control block in the list of listeners. */ +int pk_listen (lcp) -register struct pklcd *lcp; + register struct pklcd *lcp; { register struct pklcd **pp; @@ -341,8 +348,11 @@ register struct pklcd *lcp; /* * Include a listening control block for the benefit of other protocols. */ +int pk_protolisten (spi, spilen, callee) -int (*callee) (); + int spi; + int spilen; + void (*callee) (); { register struct pklcd *lcp = pk_attach ((struct socket *)0); register struct mbuf *nam; @@ -375,10 +385,11 @@ int (*callee) (); * by the remote DTE. */ +void pk_assoc (pkp, lcp, sa) -register struct pkcb *pkp; -register struct pklcd *lcp; -register struct sockaddr_x25 *sa; + register struct pkcb *pkp; + register struct pklcd *lcp; + register struct sockaddr_x25 *sa; { lcp -> lcd_pkp = pkp; @@ -400,11 +411,12 @@ register struct sockaddr_x25 *sa; lcp -> lcd_stime = time.tv_sec; } +int pk_connect (lcp, sa) -register struct pklcd *lcp; -register struct sockaddr_x25 *sa; + register struct pklcd *lcp; + register struct sockaddr_x25 *sa; { - register struct pkcb *pkp; + register struct pkcb *pkp = 0; if (sa -> x25_addr[0] == '\0') return (EDESTADDRREQ); @@ -449,10 +461,11 @@ struct bcdinfo { * address, facilities fields and the user data field. */ +void pk_callrequest (lcp, sa, xcp) -struct pklcd *lcp; -register struct sockaddr_x25 *sa; -register struct x25config *xcp; + struct pklcd *lcp; + register struct sockaddr_x25 *sa; + register struct x25config *xcp; { register struct x25_calladdr *a; register struct mbuf *m = lcp -> lcd_template; @@ -480,9 +493,11 @@ register struct x25config *xcp; m_copyback (m, m -> m_pkthdr.len, sa -> x25_udlen, sa -> x25_udata); } +void pk_build_facilities (m, sa, type) -register struct mbuf *m; -struct sockaddr_x25 *sa; + register struct mbuf *m; + struct sockaddr_x25 *sa; + int type; { register octet *cp; register octet *fcp; @@ -516,10 +531,11 @@ struct sockaddr_x25 *sa; m -> m_pkthdr.len = (m -> m_len += *cp + 1); } +int to_bcd (b, sa, xcp) -register struct bcdinfo *b; -struct sockaddr_x25 *sa; -register struct x25config *xcp; + register struct bcdinfo *b; + struct sockaddr_x25 *sa; + register struct x25config *xcp; { register char *x = sa -> x25_addr; unsigned start = b -> posn; @@ -558,8 +574,9 @@ register struct x25config *xcp; * search is from the highest number to lowest number (DTE). */ +int pk_getlcn (pkp) -register struct pkcb *pkp; + register struct pkcb *pkp; { register int i; @@ -576,9 +593,11 @@ register struct pkcb *pkp; * This procedure sends a CLEAR request packet. The lc state is * set to "SENT_CLEAR". */ - +void pk_clear (lcp, diagnostic, abortive) -register struct pklcd *lcp; + register struct pklcd *lcp; + int diagnostic; + int abortive; { register struct mbuf *m = pk_template (lcp -> lcd_lcn, X25_CLEAR); @@ -606,8 +625,11 @@ register struct pklcd *lcp; * inward data flow, if the current state changes (blocked ==> open or * vice versa), or if forced to generate one. One forces RNR's to ack data. */ +void pk_flowcontrol (lcp, inhibit, forced) -register struct pklcd *lcp; + register struct pklcd *lcp; + int inhibit; + int forced; { inhibit = (inhibit != 0); if (lcp == 0 || lcp -> lcd_state != DATA_TRANSFER || @@ -624,9 +646,10 @@ register struct pklcd *lcp; * virtual circuit. */ -static +static void pk_reset (lcp, diagnostic) -register struct pklcd *lcp; + register struct pklcd *lcp; + int diagnostic; { register struct mbuf *m; register struct socket *so = lcp -> lcd_so; @@ -659,8 +682,9 @@ register struct pklcd *lcp; * virtual circuit. */ +void pk_flush (lcp) -register struct pklcd *lcp; + register struct pklcd *lcp; { register struct socket *so; @@ -685,10 +709,12 @@ register struct pklcd *lcp; /* * This procedure handles all local protocol procedure errors. */ - +void pk_procerror (error, lcp, errstr, diagnostic) -register struct pklcd *lcp; -char *errstr; + int error; + register struct pklcd *lcp; + char *errstr; + int diagnostic; { pk_message (lcp -> lcd_lcn, lcp -> lcd_pkp -> pk_xcp, errstr); @@ -712,10 +738,10 @@ char *errstr; * and process the P(R) values received in the DATA, RR OR RNR * packets. */ - +int pk_ack (lcp, pr) -struct pklcd *lcp; -unsigned pr; + struct pklcd *lcp; + unsigned pr; { register struct socket *so = lcp -> lcd_so; @@ -750,9 +776,9 @@ unsigned pr; * This procedure decodes the X.25 level 3 packet returning a * code to be used in switchs or arrays. */ - +int pk_decode (xp) -register struct x25_packet *xp; + register struct x25_packet *xp; { register int type; @@ -843,10 +869,10 @@ register struct x25_packet *xp; * A restart packet has been received. Print out the reason * for the restart. */ - +void pk_restartcause (pkp, xp) -struct pkcb *pkp; -register struct x25_packet *xp; + struct pkcb *pkp; + register struct x25_packet *xp; { register struct x25config *xcp = pkp -> pk_xcp; register int lcn = LCN(xp); @@ -878,10 +904,10 @@ int Reset_cause[] = { /* * A reset packet has arrived. Return the cause to the user. */ - +void pk_resetcause (pkp, xp) -struct pkcb *pkp; -register struct x25_packet *xp; + struct pkcb *pkp; + register struct x25_packet *xp; { register struct pklcd *lcp = pkp -> pk_chan[LCN(xp)]; @@ -890,8 +916,9 @@ register struct x25_packet *xp; if (code > MAXRESETCAUSE) code = 7; /* EXRNCG */ - pk_message(LCN(xp), lcp -> lcd_pkp, "reset code 0x%x, diagnostic 0x%x", - xp -> packet_data, 4[(u_char *)xp]); + pk_message(LCN(xp), (struct x25config *)lcp -> lcd_pkp, + "reset code 0x%x, diagnostic 0x%x", + xp -> packet_data, 4[(u_char *)xp]); if (lcp -> lcd_so) lcp -> lcd_so -> so_error = Reset_cause[code]; @@ -908,10 +935,10 @@ int Clear_cause[] = { /* * A clear packet has arrived. Return the cause to the user. */ - +void pk_clearcause (pkp, xp) -struct pkcb *pkp; -register struct x25_packet *xp; + struct pkcb *pkp; + register struct x25_packet *xp; { register struct pklcd *lcp = pkp -> pk_chan[LCN(xp)]; @@ -932,10 +959,11 @@ register struct x25config *xcp; } /* VARARGS1 */ -pk_message (lcn, xcp, fmt, a1, a2, a3, a4, a5, a6) -struct x25config *xcp; -char *fmt; +void +pk_message (int lcn, struct x25config *xcp, const char *fmt, ...) { + va_list args; + va_start(args, fmt); if (lcn) if (pkcbhead -> pk_next) @@ -948,13 +976,17 @@ char *fmt; else printf ("X.25: "); - printf (fmt, a1, a2, a3, a4, a5, a6); - printf ("\n"); + printf ("%r\n", fmt, args); + va_end(args); } +int pk_fragment (lcp, m0, qbit, mbit, wait) -struct mbuf *m0; -register struct pklcd *lcp; + struct mbuf *m0; + register struct pklcd *lcp; + int qbit; + int mbit; + int wait; { register struct mbuf *m = m0; register struct x25_packet *xp; @@ -1015,8 +1047,9 @@ abort: struct mbuf * m_split (m0, len0, wait) -register struct mbuf *m0; -int len0; + register struct mbuf *m0; + int len0; + int wait; { register struct mbuf *m, *n; unsigned len = len0, remain; diff --git a/sys/netccitt/pk_timer.c b/sys/netccitt/pk_timer.c index 8fd8b8cb02..17c44ceae9 100644 --- a/sys/netccitt/pk_timer.c +++ b/sys/netccitt/pk_timer.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * from: @(#)pk_timer.c 7.5 (Berkeley) 5/29/91 - * $Id$ + * $Id: pk_timer.c,v 1.2 1993/10/16 19:46:55 rgrimes Exp $ */ #include "param.h" @@ -63,6 +63,7 @@ int pk_t21 = 20 * PR_SLOWHZ; /* call timer */ int pk_t22 = 18 * PR_SLOWHZ; /* reset timer */ int pk_t23 = 18 * PR_SLOWHZ; /* clear timer */ +void pk_timer () { register struct pkcb *pkp; diff --git a/sys/netccitt/pk_usrreq.c b/sys/netccitt/pk_usrreq.c index ea61c933d5..248cb73451 100644 --- a/sys/netccitt/pk_usrreq.c +++ b/sys/netccitt/pk_usrreq.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * from: @(#)pk_usrreq.c 7.16 (Berkeley) 6/27/91 - * $Id$ + * $Id: pk_usrreq.c,v 1.3 1993/10/16 19:46:56 rgrimes Exp $ */ #include "param.h" @@ -60,10 +60,10 @@ * forward references */ -static +static void old_to_new (struct mbuf *m); -static +static void new_to_old (struct mbuf *m); /* @@ -77,11 +77,12 @@ new_to_old (struct mbuf *m); * */ +int pk_usrreq (so, req, m, nam, control) -struct socket *so; -int req; -register struct mbuf *m, *nam; -struct mbuf *control; + struct socket *so; + int req; + register struct mbuf *m, *nam; + struct mbuf *control; { register struct pklcd *lcp = (struct pklcd *) so -> so_pcb; register int error = 0; @@ -306,8 +307,9 @@ release: * assign pk_start to ia -> ia_start when called with SIOCSIFCONF_X25. */ /* ARGSUSED */ +int pk_start (lcp) -register struct pklcd *lcp; + register struct pklcd *lcp; { pk_output (lcp); return (0); /* XXX pk_output should return a value */ @@ -321,17 +323,18 @@ _offsetof(struct sockaddr_x25, x25_addr[0]), 0, -1}; /*ARGSUSED*/ +int pk_control (so, cmd, data, ifp) -struct socket *so; -int cmd; -caddr_t data; -register struct ifnet *ifp; + struct socket *so; + int cmd; + caddr_t data; + register struct ifnet *ifp; { register struct ifreq_x25 *ifr = (struct ifreq_x25 *)data; register struct ifaddr *ifa = 0; register struct x25_ifaddr *ia = 0; struct pklcd *dev_lcp = 0; - int error, s, old_maxlcn; + int error = 0, s, old_maxlcn; unsigned n; /* @@ -396,7 +399,8 @@ register struct ifnet *ifp; ia -> ia_start = pk_start; s = splimp(); if (ifp -> if_ioctl) - error = (*ifp -> if_ioctl)(ifp, SIOCSIFCONF_X25, ifa); + error = (*ifp -> if_ioctl)(ifp, SIOCSIFCONF_X25, + (caddr_t)ifa); if (error) ifp -> if_flags &= ~IFF_UP; else @@ -411,10 +415,11 @@ register struct ifnet *ifp; } } +int pk_ctloutput (cmd, so, level, optname, mp) -struct socket *so; -struct mbuf **mp; -int cmd, level, optname; + struct socket *so; + struct mbuf **mp; + int cmd, level, optname; { register struct mbuf *m = *mp; register struct pklcd *lcp = (struct pklcd *) so -> so_pcb; @@ -460,9 +465,9 @@ int cmd, level, optname; * socket address to the new style */ -static +static void old_to_new (m) -register struct mbuf *m; + register struct mbuf *m; { register struct x25_sockaddr *oldp; register struct sockaddr_x25 *newp; @@ -502,9 +507,9 @@ register struct mbuf *m; * socket address to the old style */ -static +static void new_to_old (m) -register struct mbuf *m; + register struct mbuf *m; { register struct x25_sockaddr *oldp; register struct sockaddr_x25 *newp; @@ -534,9 +539,9 @@ register struct mbuf *m; m -> m_len = sizeof (*oldp); } - +int pk_checksockaddr (m) -struct mbuf *m; + struct mbuf *m; { register struct sockaddr_x25 *sa = mtod (m, struct sockaddr_x25 *); register char *cp; @@ -554,9 +559,10 @@ struct mbuf *m; return (0); } +int pk_send (lcp, m) -struct pklcd *lcp; -register struct mbuf *m; + struct pklcd *lcp; + register struct mbuf *m; { int mqbit = 0, error = 0; register struct x25_packet *xp; diff --git a/sys/netccitt/pk_var.h b/sys/netccitt/pk_var.h index 4a918b3302..62365d5a16 100644 --- a/sys/netccitt/pk_var.h +++ b/sys/netccitt/pk_var.h @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * from: @(#)pk_var.h 7.11 (Berkeley) 5/29/91 - * $Id: pk_var.h,v 1.2 1993/10/16 19:46:58 rgrimes Exp $ + * $Id: pk_var.h,v 1.3 1993/11/07 17:47:26 wollman Exp $ */ @@ -54,7 +54,8 @@ struct pklcd { struct pklcd_q *q_forw; /* debugging chain */ struct pklcd_q *q_back; /* debugging chain */ } lcd_q; - int (*lcd_upper)(); /* switch to socket vs datagram vs ...*/ + void (*lcd_upper)(struct pklcd *, struct mbuf *); + /* switch to socket vs datagram vs ...*/ caddr_t lcd_upnext; /* reference for lcd_upper() */ int (*lcd_send)(); /* if X.25 front end, direct connect */ caddr_t lcd_downnext; /* reference for lcd_send() */ @@ -173,6 +174,27 @@ struct pkcb *pkcbhead; /* head of linked list of networks */ struct pklcd *pk_listenhead; struct pklcd *pk_attach(); +struct sockaddr_in; +struct sockaddr_x25; + +extern void x25_connect_callback(struct pklcd *, struct mbuf *); +extern void x25_rtrequest(int, struct rtentry *, struct sockaddr *); +extern void x25_rtinvert(int, struct sockaddr *, struct rtentry *); +extern void x25_ddnip_to_ccitt(struct sockaddr_in *, struct rtentry *); +extern void x25_rtattach(struct pklcd *, struct rtentry *); + +extern void pk_input(struct mbuf *); +extern void pk_incoming_call(struct pkcb *, struct mbuf *); +extern void pk_call_accepted(struct pklcd *, struct mbuf *); +extern void pk_parse_facilities(octet *, struct sockaddr_x25 *); +extern void pk_close(struct pklcd *); +extern void pk_freelcd(struct pklcd *); +extern void pk_callrequest(struct pklcd *, struct sockaddr_x25 *, struct x25config *); +extern void pk_build_facilities(struct mbuf *, struct sockaddr_x25 *, int); +extern void pk_clear(struct pklcd *, int, int); +extern void pk_flush(struct pklcd *); +extern void pk_message(int, struct x25config *, const char *, ...); + extern char *pk_name[], *pk_state[]; int pk_t20, pk_t21, pk_t22, pk_t23; #endif diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c index 14e0b0cef5..d517bc4120 100644 --- a/sys/netinet/if_ether.c +++ b/sys/netinet/if_ether.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)if_ether.c 7.13 (Berkeley) 10/31/90 - * $Id$ + * $Id: if_ether.c,v 1.3 1993/10/16 18:25:54 rgrimes Exp $ */ /* @@ -60,6 +60,9 @@ #include "ip.h" #include "if_ether.h" +static void in_arpinput(struct arpcom *, struct mbuf *); +static void arptfree(struct arptab *); + #ifdef GATEWAY #define ARPTAB_BSIZ 16 /* bucket size */ #define ARPTAB_NB 37 /* number of buckets */ @@ -100,6 +103,7 @@ extern struct ifnet loif; /* * Timeout routine. Age arp_tab entries once a minute. */ +void arptimer() { register struct arptab *at; @@ -121,6 +125,7 @@ arptimer() /* * Broadcast an ARP packet, asking who has addr on interface ac. */ +void arpwhohas(ac, addr) register struct arpcom *ac; struct in_addr *addr; @@ -172,6 +177,7 @@ int useloopback = 1; /* use loopback interface for local traffic */ * arptab is also altered from input interrupt service (ecintr/ilintr * calls arpinput when ETHERTYPE_ARP packets come in). */ +int arpresolve(ac, m, destip, desten, usetrailers) register struct arpcom *ac; struct mbuf *m; @@ -270,6 +276,7 @@ arpresolve(ac, m, destip, desten, usetrailers) * is received. Common length and type checks are done here, * then the protocol-specific routine is called. */ +void arpinput(ac, m) struct arpcom *ac; struct mbuf *m; @@ -314,13 +321,14 @@ out: * We reply to requests for ETHERTYPE_TRAIL protocol as well, * but don't normally send requests. */ +void in_arpinput(ac, m) register struct arpcom *ac; struct mbuf *m; { register struct ether_arp *ea; struct ether_header *eh; - register struct arptab *at; /* same as "merge" flag */ + register struct arptab *at = 0; /* same as "merge" flag */ register struct in_ifaddr *ia; struct in_ifaddr *maybe_ia = 0; struct mbuf *mcopy = 0; @@ -469,6 +477,7 @@ out: /* * Free an arptab entry. */ +void arptfree(at) register struct arptab *at; { @@ -524,6 +533,7 @@ out: return (at); } +int arpioctl(cmd, data) int cmd; caddr_t data; diff --git a/sys/netinet/if_ether.h b/sys/netinet/if_ether.h index 4b45dde099..683117516d 100644 --- a/sys/netinet/if_ether.h +++ b/sys/netinet/if_ether.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)if_ether.h 7.5 (Berkeley) 6/28/90 - * $Id: if_ether.h,v 1.2 1993/10/16 18:25:55 rgrimes Exp $ + * $Id: if_ether.h,v 1.3 1993/11/07 17:47:47 wollman Exp $ */ #ifndef _NETINET_IF_ETHER_H_ @@ -107,7 +107,9 @@ struct arptab { #ifdef KERNEL extern u_char etherbroadcastaddr[6]; /* defined in net/if_ethersubr.c */ struct arptab *arptnew(); -int ether_output(), ether_input(); -char *ether_sprintf(); + +extern void ether_input(struct ifnet *, struct ether_header *, struct mbuf *); +extern char *ether_sprintf(u_char *); + #endif #endif /* _NETINET_IF_ETHER_H_ */ diff --git a/sys/netinet/in.c b/sys/netinet/in.c index 0366102e21..c3a90c3fb1 100644 --- a/sys/netinet/in.c +++ b/sys/netinet/in.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)in.c 7.17 (Berkeley) 4/20/91 - * $Id: in.c,v 1.4 1993/11/07 22:55:02 wollman Exp $ + * $Id: in.c,v 1.5 1993/11/18 00:08:13 wollman Exp $ */ #include "param.h" @@ -50,6 +50,8 @@ struct in_ifaddr *in_ifaddr; struct ifqueue ipintrq; +static void in_ifscrub(struct ifnet *, struct in_ifaddr *); + /* * Formulate an Internet address from network + host. */ @@ -109,6 +111,7 @@ in_netof(in) /* * Compute and save network mask as sockaddr from an internet address. */ +void in_sockmaskof(in, sockmask) struct in_addr in; register struct sockaddr_in *sockmask; @@ -196,6 +199,7 @@ int subnetsarelocal = SUBNETSARELOCAL; * is true, this includes other subnets of the local net. * Otherwise, it includes only the directly-connected (sub)nets. */ +int in_localaddr(in) struct in_addr in; { @@ -219,6 +223,7 @@ in_localaddr(in) * that may not be forwarded, or whether datagrams to that destination * may be forwarded. */ +int in_canforward(in) struct in_addr in; { @@ -243,6 +248,7 @@ extern struct ifnet loif; * Ifp is 0 if not an interface-specific ioctl. */ /* ARGSUSED */ +int in_control(so, cmd, data, ifp) struct socket *so; int cmd; @@ -367,7 +373,8 @@ in_control(so, cmd, data, ifp) oldaddr = ia->ia_dstaddr; ia->ia_dstaddr = *(struct sockaddr_in *)&ifr->ifr_dstaddr; if (ifp->if_ioctl && - (error = (*ifp->if_ioctl)(ifp, SIOCSIFDSTADDR, ia))) { + (error = (*ifp->if_ioctl)(ifp, SIOCSIFDSTADDR, + (caddr_t)ia))) { ia->ia_dstaddr = oldaddr; return (error); } @@ -466,6 +473,7 @@ in_control(so, cmd, data, ifp) /* * Delete any existing route for an interface. */ +static void in_ifscrub(ifp, ia) register struct ifnet *ifp; register struct in_ifaddr *ia; @@ -484,10 +492,12 @@ in_ifscrub(ifp, ia) * Initialize an interface's internet address * and routing table entry. */ +int in_ifinit(ifp, ia, sin, scrub) register struct ifnet *ifp; register struct in_ifaddr *ia; struct sockaddr_in *sin; + int scrub; { register u_long i = ntohl(sin->sin_addr.s_addr); struct sockaddr_in oldaddr; @@ -500,7 +510,8 @@ in_ifinit(ifp, ia, sin, scrub) * if this is its first address, * and to validate the address if necessary. */ - if (ifp->if_ioctl && (error = (*ifp->if_ioctl)(ifp, SIOCSIFADDR, ia))) { + if (ifp->if_ioctl && (error = (*ifp->if_ioctl)(ifp, SIOCSIFADDR, + (caddr_t)ia))) { splx(s); ia->ia_addr = oldaddr; return (error); @@ -574,6 +585,7 @@ in_iaonnetof(net) /* * Return 1 if the address might be a local broadcast address. */ +int in_broadcast(in) struct in_addr in; { diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index cc21ead3b1..be54b9a44b 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)in_pcb.c 7.14 (Berkeley) 4/20/91 - * $Id: in_pcb.c,v 1.2 1993/10/16 18:26:01 rgrimes Exp $ + * $Id: in_pcb.c,v 1.3 1993/11/18 00:08:15 wollman Exp $ */ #include "param.h" @@ -54,6 +54,7 @@ struct in_addr zeroin_addr; +int in_pcballoc(so, head) struct socket *so; struct inpcb *head; @@ -72,6 +73,7 @@ in_pcballoc(so, head) return (0); } +int in_pcbbind(inp, nam) register struct inpcb *inp; struct mbuf *nam; @@ -135,12 +137,13 @@ noname: * If don't have a local address for this socket yet, * then pick one. */ +int in_pcbconnect(inp, nam) register struct inpcb *inp; struct mbuf *nam; { struct in_ifaddr *ia; - struct sockaddr_in *ifaddr; + struct sockaddr_in *ifaddr = 0; register struct sockaddr_in *sin = mtod(nam, struct sockaddr_in *); if (nam->m_len != sizeof (*sin)) @@ -242,6 +245,7 @@ in_pcbconnect(inp, nam) return (0); } +void in_pcbdisconnect(inp) struct inpcb *inp; { @@ -255,6 +259,7 @@ in_pcbdisconnect(inp) in_pcbdetach(inp); } +void in_pcbdetach(inp) struct inpcb *inp; { @@ -270,6 +275,7 @@ in_pcbdetach(inp) (void) m_free(dtom(inp)); } +void in_setsockaddr(inp, nam) register struct inpcb *inp; struct mbuf *nam; @@ -285,6 +291,7 @@ in_setsockaddr(inp, nam) sin->sin_addr = inp->inp_laddr; } +void in_setpeeraddr(inp, nam) struct inpcb *inp; struct mbuf *nam; @@ -317,12 +324,12 @@ in_pcbnotify(head, dst, fport, laddr, lport, cmd, notify) struct sockaddr *dst; u_short fport, lport; struct in_addr laddr; - int cmd, (*notify)(); + int cmd; + void (*notify)(struct inpcb *, int); { register struct inpcb *inp, *oinp; struct in_addr faddr; int errno; - int in_rtchange(); if ((unsigned)cmd > PRC_NCMDS || dst->sa_family != AF_INET) return; @@ -400,8 +407,10 @@ in_losing(inp) * After a routing change, flush old routing * and allocate a (hopefully) better one. */ -in_rtchange(inp) +void +in_rtchange(inp, errno) register struct inpcb *inp; + int errno; { if (inp->inp_route.ro_rt) { rtfree(inp->inp_route.ro_rt); diff --git a/sys/netinet/in_pcb.h b/sys/netinet/in_pcb.h index b509e51678..826ce4cf34 100644 --- a/sys/netinet/in_pcb.h +++ b/sys/netinet/in_pcb.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)in_pcb.h 7.6 (Berkeley) 6/28/90 - * $Id: in_pcb.h,v 1.3 1993/11/07 17:47:50 wollman Exp $ + * $Id: in_pcb.h,v 1.4 1993/11/18 00:08:16 wollman Exp $ */ #ifndef _NETINET_IN_PCB_H_ @@ -103,7 +103,20 @@ struct raw_inpcb { #define sotorawinpcb(so) ((struct raw_inpcb *)(so)->so_pcb) #ifdef KERNEL -struct inpcb *in_pcblookup(); +/* From in_pcb.h: */ +extern int in_pcballoc(struct socket *, struct inpcb *); +extern int in_pcbbind(struct inpcb *, struct mbuf *); +extern int in_pcbconnect(struct inpcb *, struct mbuf *); +extern void in_pcbdisconnect(struct inpcb *); +extern void in_pcbdetach(struct inpcb *); +extern void in_setsockaddr(struct inpcb *, struct mbuf *); +extern void in_setpeeraddr(struct inpcb *, struct mbuf *); +extern void in_pcbnotify(struct inpcb *, struct sockaddr *, int, struct in_addr, int, int, void (*)(struct inpcb *, int)); +extern void in_losing(struct inpcb *); +extern void in_rtchange(struct inpcb *, int); +extern struct inpcb *in_pcblookup(struct inpcb *, struct in_addr, int, struct in_addr, int, int); + + #ifdef MTUDISC extern void in_pcbmtu(struct inpcb *); extern void in_mtunotify(struct inpcb *); diff --git a/sys/netinet/ip_icmp.c b/sys/netinet/ip_icmp.c index c33a88f7c2..3402a1b896 100644 --- a/sys/netinet/ip_icmp.c +++ b/sys/netinet/ip_icmp.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)ip_icmp.c 7.15 (Berkeley) 4/20/91 - * $Id: ip_icmp.c,v 1.3 1993/11/07 17:47:56 wollman Exp $ + * $Id: ip_icmp.c,v 1.4 1993/11/18 00:08:18 wollman Exp $ */ #include "param.h" @@ -93,7 +93,7 @@ icmp_error(n, type, code, dest, mtu) register struct ip *oip = mtod(n, struct ip *), *nip; register unsigned oiplen = oip->ip_hl << 2; register struct icmp *icp; - register struct mbuf *m; + register struct mbuf *m = 0; unsigned icmplen; u_long oaddr; diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c index 6cb713cdad..75ca5f7d5c 100644 --- a/sys/netinet/ip_input.c +++ b/sys/netinet/ip_input.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)ip_input.c 7.19 (Berkeley) 5/25/91 - * $Id: ip_input.c,v 1.4 1993/11/12 04:03:55 wollman Exp $ + * $Id: ip_input.c,v 1.5 1993/11/18 00:08:20 wollman Exp $ */ #include "param.h" @@ -83,6 +83,12 @@ int ipsendredirects = IPSENDREDIRECTS; int ipprintfs = 0; #endif +static void ip_freef(struct ipq *); +static void ip_enq(struct ipasfrag *, struct ipasfrag *); +static void ip_deq(struct ipasfrag *); +static void save_rte(u_char *, struct in_addr); +static void ip_forward(struct mbuf *, int); + extern struct domain inetdomain; extern struct protosw inetsw[]; u_char ip_protox[IPPROTO_MAX]; @@ -116,6 +122,7 @@ u_long *ip_ifmatrix; * IP initialization: fill in IP protocol switch table. * All protocols not implemented in kernel go to raw IP protocol handler. */ +void ip_init() { register struct protosw *pr; @@ -149,6 +156,7 @@ struct route ipforward_rt; * Ip input routine. Checksum and byte swap header. If fragmented * try to reassemble. Process options. Pass to next level. */ +void ipintr() { register struct ip *ip; @@ -502,6 +510,7 @@ dropfrag: * Free a fragment reassembly header and all * associated datagrams. */ +static void ip_freef(fp) struct ipq *fp; { @@ -520,6 +529,7 @@ ip_freef(fp) * Put an ip fragment on a reassembly chain. * Like insque, but pointers in middle of structure. */ +static void ip_enq(p, prev) register struct ipasfrag *p, *prev; { @@ -533,6 +543,7 @@ ip_enq(p, prev) /* * To ip_enq as remque is to insque. */ +static void ip_deq(p) register struct ipasfrag *p; { @@ -546,6 +557,7 @@ ip_deq(p) * if a timer expires on a reassembly * queue, discard it. */ +void ip_slowtimo() { register struct ipq *fp; @@ -570,6 +582,7 @@ ip_slowtimo() /* * Drain off all datagram fragments. */ +void ip_drain() { @@ -589,6 +602,7 @@ struct in_ifaddr *ip_rtaddr(); * Returns 1 if packet has been forwarded/freed, * 0 if the packet should be processed further. */ +int ip_dooptions(m) struct mbuf *m; { @@ -801,6 +815,7 @@ ip_rtaddr(dst) * Save incoming source route for use in replies, * to be picked up later by ip_srcroute if the receiver is interested. */ +static void save_rte(option, dst) u_char *option; struct in_addr dst; @@ -895,6 +910,7 @@ ip_srcroute() * will be moved, and return value is their length. * XXX should be deleted; last arg currently ignored. */ +void ip_stripoptions(m, mopt) register struct mbuf *m; struct mbuf *mopt; @@ -964,6 +980,7 @@ u_char inetctlerrmap[PRC_NCMDS] = { * The srcrt parameter indicates whether the packet is being forwarded * via a source route. */ +static void ip_forward(m, srcrt) struct mbuf *m; int srcrt; @@ -971,10 +988,10 @@ ip_forward(m, srcrt) register struct ip *ip = mtod(m, struct ip *); register struct sockaddr_in *sin; register struct rtentry *rt; - int error, type = 0, code; + int error, type = 0, code = 0; struct mbuf *mcopy; struct in_addr dest; - int mtu; + int mtu = 0; dest.s_addr = 0; #ifdef DIAGNOSTIC diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c index 0cbb18c05a..34c0702d86 100644 --- a/sys/netinet/ip_output.c +++ b/sys/netinet/ip_output.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)ip_output.c 7.23 (Berkeley) 11/12/90 - * $Id: ip_output.c,v 1.2 1993/10/16 18:26:16 rgrimes Exp $ + * $Id: ip_output.c,v 1.3 1993/10/19 09:14:15 davidg Exp $ */ #include "param.h" @@ -64,6 +64,7 @@ struct mbuf *ip_insertoptions(); * The mbuf chain containing the packet will be freed. * The mbuf opt, if present, will not be freed. */ +int ip_output(m0, opt, ro, flags) struct mbuf *m0; struct mbuf *opt; @@ -345,6 +346,7 @@ ip_insertoptions(m, opt, phlen) * Copy options from ip to jp, * omitting those not copied during fragmentation. */ +int ip_optcopy(ip, jp) struct ip *ip, *jp; { @@ -378,6 +380,7 @@ ip_optcopy(ip, jp) /* * IP socket option processing. */ +int ip_ctloutput(op, so, level, optname, mp) int op; struct socket *so; @@ -386,7 +389,7 @@ ip_ctloutput(op, so, level, optname, mp) { register struct inpcb *inp = sotoinpcb(so); register struct mbuf *m = *mp; - register int optval; + register int optval = 0; int error = 0; if (level != IPPROTO_IP) @@ -512,6 +515,7 @@ ip_ctloutput(op, so, level, optname, mp) * Store in mbuf with pointer in pcbopt, adding pseudo-option * with destination address if source routed. */ +int #ifdef notyet ip_pcbopts(optname, pcbopt, m) int optname; diff --git a/sys/netinet/raw_ip.c b/sys/netinet/raw_ip.c index 664d4326b8..99986cf550 100644 --- a/sys/netinet/raw_ip.c +++ b/sys/netinet/raw_ip.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)raw_ip.c 7.8 (Berkeley) 7/25/90 - * $Id$ + * $Id: raw_ip.c,v 1.2 1993/10/16 18:26:19 rgrimes Exp $ */ #include "param.h" @@ -64,6 +64,7 @@ struct sockproto ripproto = { PF_INET }; * for raw_input routine, then pass them along with * mbuf chain. */ +void rip_input(m) struct mbuf *m; { @@ -84,6 +85,7 @@ rip_input(m) * Tack on options user may have setup with control call. */ #define satosin(sa) ((struct sockaddr_in *)(sa)) +int rip_output(m, so) register struct mbuf *m; struct socket *so; @@ -122,6 +124,7 @@ rip_output(m, so) /* * Raw IP socket option processing. */ +int rip_ctloutput(op, so, level, optname, m) int op; struct socket *so; @@ -190,6 +193,7 @@ rip_ctloutput(op, so, level, optname, m) } /*ARGSUSED*/ +int rip_usrreq(so, req, m, nam, control) register struct socket *so; int req; diff --git a/sys/netinet/tcp_debug.c b/sys/netinet/tcp_debug.c index 8d35cbeff4..b0b38432db 100644 --- a/sys/netinet/tcp_debug.c +++ b/sys/netinet/tcp_debug.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)tcp_debug.c 7.6 (Berkeley) 6/28/90 - * $Id: tcp_debug.c,v 1.2 1993/10/16 18:26:22 rgrimes Exp $ + * $Id: tcp_debug.c,v 1.3 1993/11/07 17:48:03 wollman Exp $ */ #ifdef TCPDEBUG @@ -76,6 +76,7 @@ int tcp_debx; /* * Tcp debug routines */ +void tcp_trace(act, ostate, tp, ti, req) short act, ostate; struct tcpcb *tp; diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 3f043be74c..673a73a904 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)tcp_input.c 7.25 (Berkeley) 6/30/90 - * $Id$ + * $Id: tcp_input.c,v 1.2 1993/10/16 18:26:26 rgrimes Exp $ */ #include "param.h" @@ -59,6 +59,10 @@ #include "tcpip.h" #include "tcp_debug.h" +static void tcp_dooptions(struct tcpcb *, struct mbuf *, struct tcpiphdr *); +static void tcp_pulloutofband(struct socket *, struct tcpiphdr *, struct mbuf *); +static void tcp_xmit_timer(struct tcpcb *); + int tcprexmtthresh = 3; int tcppredack; /* XXX debugging: times hdr predict ok for acks */ int tcppreddat; /* XXX # times header prediction ok for data packets */ @@ -95,6 +99,7 @@ struct tcpcb *tcp_newtcpcb(); } \ } +int tcp_reass(tp, ti, m) register struct tcpcb *tp; register struct tcpiphdr *ti; @@ -202,6 +207,7 @@ present: * TCP input routine, follows pages 65-76 of the * protocol specification dated September, 1981 very closely. */ +void tcp_input(m, iphlen) register struct mbuf *m; int iphlen; @@ -212,9 +218,9 @@ tcp_input(m, iphlen) int len, tlen, off; register struct tcpcb *tp = 0; register int tiflags; - struct socket *so; + struct socket *so = 0; int todrop, acked, ourfinisacked, needoutput = 0; - short ostate; + short ostate = 0; struct in_addr laddr; int dropsocket = 0; int iss = 0; @@ -594,7 +600,7 @@ trimthenstep6: * dropping FIN if necessary. */ ti->ti_seq++; - if (ti->ti_len > tp->rcv_wnd) { + if ((u_long)ti->ti_len > (u_long)tp->rcv_wnd) { todrop = ti->ti_len - tp->rcv_wnd; m_adj(m, -todrop); ti->ti_len = tp->rcv_wnd; @@ -1057,7 +1063,7 @@ step6: * but if two URG's are pending at once, some out-of-band * data may creep in... ick. */ - if (ti->ti_urp <= ti->ti_len + if ((u_long)ti->ti_urp <= (u_long)ti->ti_len #ifdef SO_OOBINLINE && (so->so_options & SO_OOBINLINE) == 0 #endif @@ -1206,6 +1212,7 @@ drop: return; } +static void tcp_dooptions(tp, om, ti) struct tcpcb *tp; struct mbuf *om; @@ -1253,6 +1260,7 @@ tcp_dooptions(tp, om, ti) * It is still reflected in the segment length for * sequencing purposes. */ +static void tcp_pulloutofband(so, ti, m) struct socket *so; struct tcpiphdr *ti; @@ -1283,6 +1291,7 @@ tcp_pulloutofband(so, ti, m) * Collect new round-trip time estimate * and update averages and current timeout. */ +static void tcp_xmit_timer(tp) register struct tcpcb *tp; { @@ -1366,7 +1375,7 @@ tcp_xmit_timer(tp) * While looking at the routing entry, we also initialize other path-dependent * parameters from pre-set or cached values in the routing entry. */ - +int tcp_mss(tp, offer) register struct tcpcb *tp; u_short offer; diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c index 41c2174b54..4052475b0e 100644 --- a/sys/netinet/tcp_output.c +++ b/sys/netinet/tcp_output.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)tcp_output.c 7.22 (Berkeley) 8/31/90 - * $Id$ + * $Id: tcp_output.c,v 1.2 1993/10/16 18:26:29 rgrimes Exp $ */ #include "param.h" @@ -59,10 +59,6 @@ #include "tcpip.h" #include "tcp_debug.h" -#ifdef notyet -extern struct mbuf *m_copypack(); -#endif - /* * Initial options. */ @@ -71,6 +67,7 @@ u_char tcp_initopt[4] = { TCPOPT_MAXSEG, 4, 0x0, 0x0, }; /* * Tcp output routine: figure out what should be sent and send it. */ +int tcp_output(tp) register struct tcpcb *tp; { @@ -79,7 +76,7 @@ tcp_output(tp) int off, flags, error; register struct mbuf *m; register struct tcpiphdr *ti; - u_char *opt; + u_char *opt = 0; unsigned optlen, hdrlen; int idle, sendalot; @@ -460,7 +457,7 @@ send: if (error) { out: if (error == ENOBUFS) { - tcp_quench(tp->t_inpcb); + tcp_quench(tp->t_inpcb, 0); return (0); } if ((error == EHOSTUNREACH || error == ENETDOWN) @@ -486,6 +483,7 @@ out: return (0); } +void tcp_setpersist(tp) register struct tcpcb *tp; { diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index 2f1809afa9..065d19bd78 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)tcp_subr.c 7.20 (Berkeley) 12/1/90 - * $Id: tcp_subr.c,v 1.3 1993/11/07 17:48:08 wollman Exp $ + * $Id: tcp_subr.c,v 1.4 1993/11/18 00:08:22 wollman Exp $ */ #include "param.h" @@ -81,6 +81,7 @@ int tcp_mtuchanged(struct inpcb *, int); /* * Tcp initialization */ +void tcp_init() { @@ -145,6 +146,7 @@ tcp_template(tp) * In any case the ack and sequence number of the transmitted * segment are as specified by the parameters. */ +void tcp_respond(tp, ti, m, ack, seq, flags) struct tcpcb *tp; register struct tcpiphdr *ti; @@ -305,7 +307,7 @@ tcp_close(tp) if (SEQ_LT(tp->iss + so->so_snd.sb_hiwat * 16, tp->snd_max) && (rt = inp->inp_route.ro_rt) && ((struct sockaddr_in *)rt_key(rt))->sin_addr.s_addr != INADDR_ANY) { - register u_long i; + register u_long i = 0; if ((rt->rt_rmx.rmx_locks & RTV_RTT) == 0) { i = tp->t_srtt * @@ -378,6 +380,7 @@ tcp_close(tp) return ((struct tcpcb *)0); } +void tcp_drain() { @@ -388,6 +391,7 @@ tcp_drain() * store error as soft error, but wake up user * (for now, won't do anything until can select for soft error). */ +void tcp_notify(inp, error) register struct inpcb *inp; int error; @@ -411,7 +415,7 @@ tcp_notify(inp, error) * In the immortal words of Ken and Dennis, ``You are not expected to * understand this.'' */ -int /* grrr... should be void... */ +void /* grrr... should be void... */ tcp_checkmtu(struct inpcb *inp, int error) { #ifdef MTUDISC /* @@ -431,13 +435,14 @@ tcp_mtuchanged(struct inpcb *inp, int error) { } #endif /* MTUDISC */ +void tcp_ctlinput(cmd, sa, ip) int cmd; struct sockaddr *sa; register struct ip *ip; { register struct tcphdr *th; - int (*notify)() = tcp_notify, tcp_quench(); + void (*notify)(struct inpcb *, int) = tcp_notify; if (cmd == PRC_QUENCH) notify = tcp_quench; @@ -461,8 +466,10 @@ tcp_ctlinput(cmd, sa, ip) * When a source quench is received, close congestion window * to one segment. We will gradually open it again as we proceed. */ -tcp_quench(inp) +void +tcp_quench(inp, errno) struct inpcb *inp; + int errno; { struct tcpcb *tp = intotcpcb(inp); diff --git a/sys/netinet/tcp_timer.c b/sys/netinet/tcp_timer.c index 5eaa9258b4..c95c5a408b 100644 --- a/sys/netinet/tcp_timer.c +++ b/sys/netinet/tcp_timer.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)tcp_timer.c 7.18 (Berkeley) 6/28/90 - * $Id$ + * $Id: tcp_timer.c,v 1.2 1993/10/16 18:26:33 rgrimes Exp $ */ #include "param.h" @@ -64,6 +64,7 @@ int tcp_maxidle; /* * Fast timeout routine for processing delayed acks */ +void tcp_fasttimo() { register struct inpcb *inp; @@ -88,6 +89,7 @@ tcp_fasttimo() * Updates the timers in all active tcb's and * causes finite state machine actions if timers expire. */ +void tcp_slowtimo() { register struct inpcb *ip, *ipnxt; @@ -135,6 +137,7 @@ tpgone: /* * Cancel all timers for TCP tp. */ +void tcp_canceltimers(tp) struct tcpcb *tp; { diff --git a/sys/netinet/tcp_timer.h b/sys/netinet/tcp_timer.h index 0ad7461c32..a00048f9e7 100644 --- a/sys/netinet/tcp_timer.h +++ b/sys/netinet/tcp_timer.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)tcp_timer.h 7.8 (Berkeley) 6/28/90 - * $Id: tcp_timer.h,v 1.2 1993/10/16 18:26:35 rgrimes Exp $ + * $Id: tcp_timer.h,v 1.3 1993/11/07 17:48:10 wollman Exp $ */ #ifndef _NETINET_TCP_TIMER_H_ @@ -109,7 +109,7 @@ #define TCP_MAXRXTSHIFT 12 /* maximum retransmits */ #ifdef TCPTIMERS -char *tcptimers[] = +const char *tcptimers[] = { "REXMT", "PERSIST", "KEEP", "2MSL" }; #endif @@ -118,9 +118,9 @@ char *tcptimers[] = */ #define TCPT_RANGESET(tv, value, tvmin, tvmax) { \ (tv) = (value); \ - if ((tv) < (tvmin)) \ + if ((u_long)(tv) < (u_long)(tvmin)) \ (tv) = (tvmin); \ - else if ((tv) > (tvmax)) \ + else if ((u_long)(tv) > (u_long)(tvmax)) \ (tv) = (tvmax); \ } diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index e52f02d524..9ba0fb6085 100644 --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)tcp_usrreq.c 7.15 (Berkeley) 6/28/90 - * $Id$ + * $Id: tcp_usrreq.c,v 1.2 1993/10/16 18:26:36 rgrimes Exp $ */ #include "param.h" @@ -72,13 +72,14 @@ struct tcpcb *tcp_newtcpcb(); * (called from the software clock routine), then timertype tells which timer. */ /*ARGSUSED*/ +int tcp_usrreq(so, req, m, nam, control) struct socket *so; int req; struct mbuf *m, *nam, *control; { register struct inpcb *inp; - register struct tcpcb *tp; + register struct tcpcb *tp = 0; int s; int error = 0; int ostate; @@ -337,6 +338,7 @@ tcp_usrreq(so, req, m, nam, control) return (error); } +int tcp_ctloutput(op, so, level, optname, mp) int op; struct socket *so; @@ -408,6 +410,7 @@ u_long tcp_recvspace = 1024*16; * internet protocol control block, tcp control block, * bufer space, and entering LISTEN state if to accept connections. */ +int tcp_attach(so) struct socket *so; { diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h index f9d3b54d08..62f9e40d45 100644 --- a/sys/netinet/tcp_var.h +++ b/sys/netinet/tcp_var.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)tcp_var.h 7.10 (Berkeley) 6/28/90 - * $Id: tcp_var.h,v 1.2 1993/10/16 18:26:38 rgrimes Exp $ + * $Id: tcp_var.h,v 1.3 1993/11/07 17:48:11 wollman Exp $ */ #ifndef _NETINET_TCP_VAR_H_ @@ -219,5 +219,10 @@ extern struct tcpstat tcpstat; /* tcp statistics */ struct tcpiphdr *tcp_template(); struct tcpcb *tcp_close(), *tcp_drop(); struct tcpcb *tcp_timers(), *tcp_disconnect(), *tcp_usrclosed(); + +void tcp_quench(struct inpcb *, int); +void tcp_setpersist(struct tcpcb *); + + #endif #endif /* _NETINET_TCP_VAR_H_ */ diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c index 7b981f2f0f..e3f447c938 100644 --- a/sys/netinet/udp_usrreq.c +++ b/sys/netinet/udp_usrreq.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)udp_usrreq.c 7.20 (Berkeley) 4/20/91 - * $Id: udp_usrreq.c,v 1.3 1993/11/07 17:48:14 wollman Exp $ + * $Id: udp_usrreq.c,v 1.4 1993/11/18 00:08:23 wollman Exp $ */ #include "param.h" @@ -59,10 +59,13 @@ struct udpstat udpstat; struct inpcb *udp_last_inpcb = &udb; +static void udp_detach(struct inpcb *); + /* * UDP protocol implementation. * Per RFC 768, August, 1980. */ +void udp_init() { @@ -78,6 +81,7 @@ int udp_ttl = UDP_TTL; struct sockaddr_in udp_in = { sizeof(udp_in), AF_INET }; +void udp_input(m, iphlen) register struct mbuf *m; int iphlen; @@ -258,8 +262,10 @@ udp_saveopt(p, size, type) * Notify a udp user of an asynchronous error; * just wake up so that he can collect error status. */ +void udp_notify(inp, errno) register struct inpcb *inp; + int errno; { inp->inp_socket->so_error = errno; @@ -267,6 +273,7 @@ udp_notify(inp, errno) sowwakeup(inp->inp_socket); } +void udp_ctlinput(cmd, sa, ip) int cmd; struct sockaddr *sa; @@ -286,6 +293,7 @@ udp_ctlinput(cmd, sa, ip) in_pcbnotify(&udb, sa, 0, zeroin_addr, 0, cmd, udp_notify); } +int udp_output(inp, m, addr, control) register struct inpcb *inp; register struct mbuf *m; @@ -294,7 +302,7 @@ udp_output(inp, m, addr, control) register struct udpiphdr *ui; register int len = m->m_pkthdr.len; struct in_addr laddr; - int s, error = 0; + int s = 0, error = 0; if (control) m_freem(control); /* XXX */ @@ -373,6 +381,7 @@ u_long udp_recvspace = 40 * (1024 + sizeof(struct sockaddr_in)); /* 40 1K datagrams */ /*ARGSUSED*/ +int udp_usrreq(so, req, m, addr, control) struct socket *so; int req; @@ -509,6 +518,7 @@ release: return (error); } +static void udp_detach(inp) struct inpcb *inp; { diff --git a/sys/netiso/argo_debug.h b/sys/netiso/argo_debug.h index 23dc18a4f7..bef8ef61ec 100644 --- a/sys/netiso/argo_debug.h +++ b/sys/netiso/argo_debug.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)argo_debug.h 7.4 (Berkeley) 5/6/91 - * $Id$ + * $Id: argo_debug.h,v 1.2 1993/10/16 21:04:39 rgrimes Exp $ */ /***************************************************************** @@ -172,6 +172,7 @@ if( !(phrase) ) printf("ASSERTION NOT VALID at line %d file %s\n",__LINE__,__FIL #define D_REASS '\21' /* clnp reassembly */ +extern void Dump_buf(char *, int); char *clnp_iso_addrp(); /*********************************************** diff --git a/sys/netiso/clnl.h b/sys/netiso/clnl.h index 60d6c8fd13..875201070f 100644 --- a/sys/netiso/clnl.h +++ b/sys/netiso/clnl.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)clnl.h 7.3 (Berkeley) 5/6/91 - * $Id: clnl.h,v 1.2 1993/10/16 21:04:41 rgrimes Exp $ + * $Id: clnl.h,v 1.3 1993/11/07 17:49:21 wollman Exp $ */ /*********************************************************** @@ -64,6 +64,7 @@ SOFTWARE. * ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison */ struct clnl_protosw { - int (*clnl_input)(); /* input routine */ + void (*clnl_input)(struct mbuf *, struct snpa_hdr *); + /* input routine */ }; #endif /* _NETISO_CLNL_H_ */ diff --git a/sys/netiso/clnp.h b/sys/netiso/clnp.h index 8a1d002151..a49100ae5f 100644 --- a/sys/netiso/clnp.h +++ b/sys/netiso/clnp.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)clnp.h 7.8 (Berkeley) 5/6/91 - * $Id: clnp.h,v 1.2 1993/10/16 21:04:42 rgrimes Exp $ + * $Id: clnp.h,v 1.3 1993/11/07 17:49:22 wollman Exp $ */ /*********************************************************** @@ -461,5 +461,8 @@ struct mbuf *clnp_reass(); #ifdef TROLL extern struct troll trollctl; #endif /* TROLL */ + +extern void clnp_emit_er(struct mbuf *, int /*char*/); + #endif /* KERNEL */ #endif /* _NETISO_CLNP_H_ */ diff --git a/sys/netiso/clnp_er.c b/sys/netiso/clnp_er.c index 7be8918d91..06bb8635af 100644 --- a/sys/netiso/clnp_er.c +++ b/sys/netiso/clnp_er.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)clnp_er.c 7.7 (Berkeley) 5/6/91 - * $Id$ + * $Id: clnp_er.c,v 1.2 1993/10/16 21:04:45 rgrimes Exp $ */ /*********************************************************** @@ -101,10 +101,11 @@ static struct clnp_fixed er_template = { * * NOTES: */ +void clnp_er_input(m, src, reason) -struct mbuf *m; /* ptr to packet itself */ -struct iso_addr *src; /* ptr to src of er */ -u_char reason; /* reason code of er */ + struct mbuf *m; /* ptr to packet itself */ + struct iso_addr *src; /* ptr to src of er */ + u_char reason; /* reason code of er */ { int cmd = -1; extern u_char clnp_protox[]; @@ -189,9 +190,10 @@ u_char reason; /* reason code of er */ * NOTES: This code assumes that we have previously tried to pull * up the header of the datagram into one mbuf. */ +void clnp_discard(m, reason) -struct mbuf *m; /* header of packet to discard */ -char reason; /* reason for discard */ + struct mbuf *m; /* header of packet to discard */ + char reason; /* reason for discard */ { IFDEBUG(D_DISCARD) printf("clnp_discard: m x%x, reason x%x\n", m, reason); @@ -228,9 +230,10 @@ char reason; /* reason for discard */ * was created by us; in this case, do not send * an ER. */ +void clnp_emit_er(m, reason) -struct mbuf *m; /* header of packet to discard */ -char reason; /* reason for discard */ + struct mbuf *m; /* header of packet to discard */ + char reason; /* reason for discard */ { register struct clnp_fixed *clnp = mtod(m, struct clnp_fixed *); register struct clnp_fixed *er; @@ -361,8 +364,9 @@ done: RTFREE(route.ro_rt); } +int clnp_er_index(p) -u_char p; + u_char p; { register u_char *cp = clnp_er_codes + CLNP_ERRORS; while (cp > clnp_er_codes) { diff --git a/sys/netiso/clnp_frag.c b/sys/netiso/clnp_frag.c index 59251f2a45..79db112e0f 100644 --- a/sys/netiso/clnp_frag.c +++ b/sys/netiso/clnp_frag.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)clnp_frag.c 7.12 (Berkeley) 5/6/91 - * $Id$ + * $Id: clnp_frag.c,v 1.3 1993/10/16 21:04:46 rgrimes Exp $ */ /*********************************************************** @@ -82,6 +82,9 @@ SOFTWARE. /* all fragments are hung off this list */ struct clnp_fragl *clnp_frags = NULL; +static void clnp_insert_frag(struct clnp_fragl *, struct mbuf *, struct clnp_segment *); + + struct mbuf *clnp_comp_pdu(); @@ -104,6 +107,7 @@ struct mbuf *clnp_comp_pdu(); * the packet was fragmented during forwarding. In this * case, we ought to send an ER back. */ +int clnp_fragment(ifp, m, first_hop, total_len, segoff, flags, rt) struct ifnet *ifp; /* ptr to outgoing interface */ struct mbuf *m; /* ptr to packet */ @@ -381,6 +385,7 @@ struct clnp_segment *seg; /* segment part of fragment header */ * * NOTES: Failure is only due to insufficient resources. */ +int clnp_newpkt(m, src, dst, seg) struct mbuf *m; /* new fragment */ struct iso_addr *src; /* src of new fragment */ @@ -445,6 +450,7 @@ struct clnp_segment *seg; /* segment part of fragment header */ * The clnp_frag structure actually lies on top of * part of the old clnp header. */ +static void clnp_insert_frag(cfh, m, seg) struct clnp_fragl *cfh; /* header of list of packet fragments */ struct mbuf *m; /* new fragment */ @@ -819,6 +825,7 @@ float troll_random() * NOTES: The operation of this procedure is regulated by the * troll control structure (Troll). */ +int troll_output(ifp, m, dst, rt) struct ifnet *ifp; struct mbuf *m; @@ -853,6 +860,7 @@ struct rtentry *rt; err = (*ifp->if_output)(ifp, m, dst, rt); return(err); } + return 0; } #endif TROLL diff --git a/sys/netiso/clnp_input.c b/sys/netiso/clnp_input.c index a7a4565c81..25024a7f1c 100644 --- a/sys/netiso/clnp_input.c +++ b/sys/netiso/clnp_input.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)clnp_input.c 7.13 (Berkeley) 5/6/91 - * $Id$ + * $Id: clnp_input.c,v 1.2 1993/10/16 21:04:48 rgrimes Exp $ */ /*********************************************************** @@ -94,7 +94,7 @@ struct clnl_protosw clnl_protox[256]; int clnpqmaxlen = IFQ_MAXLEN; /* RAH? why is this a variable */ struct mbuf *clnp_data_ck(); -int clnp_input(); +void clnp_input(struct mbuf *, struct snpa_hdr *); int esis_input(); @@ -114,6 +114,7 @@ int x25esis_input(); * * NOTES: */ +void clnp_init() { register struct protosw *pr; @@ -150,6 +151,7 @@ clnp_init() * * NOTES: */ +void clnlintr() { register struct mbuf *m; /* ptr to first mbuf of pkt */ @@ -279,6 +281,7 @@ next: * TODO: I would like to make seg_part a pointer into the mbuf, but * will it be correctly aligned? */ +void clnp_input(m, shp) struct mbuf *m; /* ptr to first mbuf of pkt */ struct snpa_hdr *shp; /* subnetwork header */ @@ -560,4 +563,4 @@ struct snpa_hdr *shp; /* subnetwork header */ break; } } -#endif ISO +#endif /* ISO */ diff --git a/sys/netiso/clnp_options.c b/sys/netiso/clnp_options.c index a59dfe3c3e..656f7b2950 100644 --- a/sys/netiso/clnp_options.c +++ b/sys/netiso/clnp_options.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)clnp_options.c 7.8 (Berkeley) 5/6/91 - * $Id$ + * $Id: clnp_options.c,v 1.2 1993/10/16 21:04:50 rgrimes Exp $ */ /*********************************************************** @@ -93,6 +93,7 @@ SOFTWARE. * * NOTES: If source routing has been terminated, do nothing. */ +void clnp_update_srcrt(options, oidx) struct mbuf *options; /* ptr to options mbuf */ struct clnp_optidx *oidx; /* ptr to option index */ @@ -140,6 +141,7 @@ struct clnp_optidx *oidx; /* ptr to option index */ * * NOTES: */ +void clnp_dooptions(options, oidx, ifp, isoa) struct mbuf *options; /* ptr to options mbuf */ struct clnp_optidx *oidx; /* ptr to option index */ @@ -214,6 +216,7 @@ struct iso_addr *isoa; /* ptr to our address for this ifp */ * * NOTES: */ +int clnp_set_opts(options, data) struct mbuf **options; /* target for option information */ struct mbuf **data; /* source of option information */ @@ -268,17 +271,18 @@ struct mbuf **data; /* source of option information */ * the offset from the beginning of the mbuf data, not the * actual address. */ +int clnp_opt_sanity(m, opts, len, oidx) -struct mbuf *m; /* mbuf options reside in */ -caddr_t opts; /* ptr to buffer containing options */ -int len; /* length of buffer */ -struct clnp_optidx *oidx; /* RETURN: filled in with option idx info */ + struct mbuf *m; /* mbuf options reside in */ + caddr_t opts; /* ptr to buffer containing options */ + int len; /* length of buffer */ + struct clnp_optidx *oidx; /* RETURN: filled in with option idx info */ { - u_char opcode; /* code of particular option */ - u_char oplen; /* length of a particular option */ - caddr_t opts_end; /* ptr to end of options */ + u_char opcode = 0; /* code of particular option */ + u_char oplen; /* length of a particular option */ + caddr_t opts_end; /* ptr to end of options */ u_char pad = 0, secure = 0, srcrt = 0, recrt = 0, qos = 0, prior = 0; - /* flags for catching duplicate options */ + /* flags for catching duplicate options */ IFDEBUG(D_OPTIONS) printf("clnp_opt_sanity: checking %d bytes of data:\n", len); diff --git a/sys/netiso/clnp_output.c b/sys/netiso/clnp_output.c index e470051503..58fbb039bf 100644 --- a/sys/netiso/clnp_output.c +++ b/sys/netiso/clnp_output.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)clnp_output.c 7.10 (Berkeley) 5/6/91 - * $Id$ + * $Id: clnp_output.c,v 1.2 1993/10/16 21:04:52 rgrimes Exp $ */ /*********************************************************** @@ -164,6 +164,7 @@ int clnp_id = 0; /* id for segmented dgrams */ * to have clnp check that the route has the same dest, but * by avoiding this check, we save a call to iso_addrmatch1. */ +int clnp_output(m0, isop, datalen, flags) struct mbuf *m0; /* data for the packet */ struct isopcb *isop; /* iso pcb */ @@ -545,4 +546,5 @@ done: int clnp_ctloutput() { + return EINVAL; } diff --git a/sys/netiso/clnp_raw.c b/sys/netiso/clnp_raw.c index 582d6e2289..a655948225 100644 --- a/sys/netiso/clnp_raw.c +++ b/sys/netiso/clnp_raw.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)clnp_raw.c 7.8 (Berkeley) 5/6/91 - * $Id$ + * $Id: clnp_raw.c,v 1.2 1993/10/16 21:04:53 rgrimes Exp $ */ /*********************************************************** @@ -97,6 +97,7 @@ struct sockproto rclnp_proto = { PF_ISO, 0 }; * NOTES: The protocol field of rclnp_proto is set to zero indicating * no protocol. */ +void rclnp_input(m, src, dst, hdrlen) struct mbuf *m; /* ptr to packet */ struct sockaddr_iso *src; /* ptr to src address */ @@ -131,6 +132,7 @@ int hdrlen; /* length (in bytes) of clnp header */ * * NOTES: */ +int rclnp_output(m0, so) struct mbuf *m0; /* packet to send */ struct socket *so; /* socket to send from */ @@ -184,6 +186,7 @@ bad: * * NOTES: */ +int rclnp_ctloutput(op, so, level, optname, m) int op; /* type of operation */ struct socket *so; /* ptr to socket */ @@ -271,6 +274,7 @@ struct mbuf **m; /* ptr to ptr to option data */ } /*ARGSUSED*/ +int clnp_usrreq(so, req, m, nam, control) register struct socket *so; int req; diff --git a/sys/netiso/clnp_subr.c b/sys/netiso/clnp_subr.c index 6b9dd5d6d7..375d9de0f4 100644 --- a/sys/netiso/clnp_subr.c +++ b/sys/netiso/clnp_subr.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)clnp_subr.c 7.13 (Berkeley) 5/6/91 - * $Id: clnp_subr.c,v 1.3 1993/10/16 21:04:56 rgrimes Exp $ + * $Id: clnp_subr.c,v 1.4 1993/11/07 17:49:25 wollman Exp $ */ /*********************************************************** @@ -206,6 +206,7 @@ register struct iso_addr *destp; /* ptr to destination address buffer */ * * NOTES: */ +int clnp_ours(dst) register struct iso_addr *dst; /* ptr to destination address */ { @@ -247,6 +248,7 @@ int congest_threshold = 0; * * NOTES: */ +void clnp_forward(m, len, dst, oidx, seg_off, inbound_shp) struct mbuf *m; /* pkt to forward */ int len; /* length of pkt */ @@ -441,6 +443,7 @@ register struct iso_addr *dstp; /* ptr to dst addr */ * NOTES: It is up to the caller to free the routing entry * allocated in route. */ +int clnp_route(dst, ro, flags, first_hop, ifa) struct iso_addr *dst; /* ptr to datagram destination */ register struct route_iso *ro; /* existing route structure */ @@ -536,6 +539,7 @@ clnp_route(dst, ro, flags, first_hop, ifa) * NOTES: Remember that option index pointers are really * offsets from the beginning of the mbuf. */ +int clnp_srcroute(options, oidx, ro, first_hop, ifa, final_dst) struct mbuf *options; /* ptr to options */ struct clnp_optidx *oidx; /* index to options */ @@ -592,6 +596,7 @@ struct iso_addr *final_dst; /* final destination */ * * SIDE EFFECTS: prints notice, slows down system. */ +int clnp_badmtu(ifp, rt, line, file) struct ifnet *ifp; /* outgoing interface */ struct rtentry *rt; /* dst route */ @@ -618,12 +623,13 @@ char *file; /* where the dirty deed occured */ * * NOTES: No attempt has been made to make this efficient */ +void clnp_ypocb(from, to, len) -caddr_t from; /* src buffer */ -caddr_t to; /* dst buffer */ -u_int len; /* number of bytes */ + caddr_t from; /* src buffer */ + caddr_t to; /* dst buffer */ + u_int len; /* number of bytes */ { while (len--) *(to + len) = *(from + len); } -#endif ISO +#endif /* ISO */ diff --git a/sys/netiso/clnp_timer.c b/sys/netiso/clnp_timer.c index c175741755..0854e79b8c 100644 --- a/sys/netiso/clnp_timer.c +++ b/sys/netiso/clnp_timer.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)clnp_timer.c 7.5 (Berkeley) 5/6/91 - * $Id$ + * $Id: clnp_timer.c,v 1.2 1993/10/16 21:04:57 rgrimes Exp $ */ /*********************************************************** @@ -142,6 +142,7 @@ register struct clnp_fragl *cfh; /* fragment header to delete */ * * NOTES: */ +void clnp_slowtimo() { register struct clnp_fragl *cfh = clnp_frags; @@ -170,6 +171,7 @@ clnp_slowtimo() * NOTES: * TODO: should send back ER */ +void clnp_drain() { register struct clnp_fragl *cfh = clnp_frags; diff --git a/sys/netiso/cltp_usrreq.c b/sys/netiso/cltp_usrreq.c index 8a21dad5a8..c992cb2fd4 100644 --- a/sys/netiso/cltp_usrreq.c +++ b/sys/netiso/cltp_usrreq.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)cltp_usrreq.c 7.6 (Berkeley) 6/27/91 - * $Id: cltp_usrreq.c,v 1.3 1993/10/16 21:04:59 rgrimes Exp $ + * $Id: cltp_usrreq.c,v 1.4 1993/11/07 17:49:27 wollman Exp $ */ #ifndef CLTPOVAL_SRC /* XXX -- till files gets changed */ @@ -64,6 +64,7 @@ struct cltpstat cltpstat; * CLTP protocol implementation. * Per ISO 8602, December, 1987. */ +void cltp_init() { @@ -74,6 +75,7 @@ int cltp_cksum = 1; /* ARGUSED */ +int cltp_input(m0, srcsa, dstsa, cons_channel, output) struct mbuf *m0; struct sockaddr *srcsa, *dstsa; @@ -86,7 +88,7 @@ cltp_input(m0, srcsa, dstsa, cons_channel, output) register struct sockaddr_iso *src = (struct sockaddr_iso *)srcsa; int len, hdrlen = *up + 1, dlen = 0; u_char *uplim = up + hdrlen; - caddr_t dtsap; + caddr_t dtsap = 0; for (len = 0; m; m = m->m_next) len += m->m_len; @@ -160,6 +162,7 @@ bad: * Notify a cltp user of an asynchronous error; * just wake up so that he can collect error status. */ +void cltp_notify(isop) register struct isopcb *isop; { @@ -168,6 +171,7 @@ cltp_notify(isop) sowwakeup(isop->isop_socket); } +void cltp_ctlinput(cmd, sa) int cmd; struct sockaddr *sa; @@ -202,6 +206,7 @@ cltp_ctlinput(cmd, sa) } } +int cltp_output(isop, m) register struct isopcb *isop; register struct mbuf *m; @@ -267,13 +272,14 @@ u_long cltp_recvspace = 40 * (1024 + sizeof(struct sockaddr_iso)); /*ARGSUSED*/ +int cltp_usrreq(so, req, m, nam, control) struct socket *so; int req; struct mbuf *m, *nam, *control; { struct isopcb *isop = sotoisopcb(so); - int s, error = 0; + int s = 0, error = 0; if (req == PRU_CONTROL) return (iso_control(so, (int)m, (caddr_t)nam, diff --git a/sys/netiso/esis.c b/sys/netiso/esis.c index 61bebc4411..ecfdb47302 100644 --- a/sys/netiso/esis.c +++ b/sys/netiso/esis.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)esis.c 7.19 (Berkeley) 6/27/91 - * $Id: esis.c,v 1.3 1993/11/07 17:49:33 wollman Exp $ + * $Id: esis.c,v 1.4 1993/11/18 00:10:14 wollman Exp $ */ /*********************************************************** @@ -101,12 +101,20 @@ SOFTWARE. struct rawcb esis_pcb; struct esis_stat esis_stat; -int esis_config(), snpac_age(); -int esis_sendspace = 2048; -int esis_recvspace = 2048; -short esis_holding_time = ESIS_HT; -short esis_config_time = ESIS_CONFIG; -short esis_esconfig_time = ESIS_CONFIG; +void esis_config(caddr_t, int); +extern void snpac_age(caddr_t, int); +void esis_input(struct mbuf *, struct snpa_hdr *); +static void esis_eshinput(struct mbuf *, struct snpa_hdr *); +static void esis_ishinput(struct mbuf *, struct snpa_hdr *); +static void esis_rdinput(struct mbuf *, struct snpa_hdr *); +void esis_shoutput(struct ifnet *, int, int /*short*/, caddr_t, int, struct iso_addr *); +void isis_input(struct mbuf *, struct snpa_hdr *); + +int esis_sendspace = 2048; +int esis_recvspace = 2048; +short esis_holding_time = ESIS_HT; +short esis_config_time = ESIS_CONFIG; +short esis_esconfig_time = ESIS_CONFIG; extern int iso_systype; struct sockaddr_dl esis_dl = { sizeof(esis_dl), AF_LINK }; extern char all_es_snpa[], all_is_snpa[]; @@ -120,6 +128,11 @@ extern char all_es_snpa[], all_is_snpa[]; (m) = (m)->m_next;\ (cp) = mtod((m), caddr_t);\ } + +#ifdef ISO_X25ESIS +void x25esis_input(); +#endif ISO_X25ESIS + /* * FUNCTION: esis_init * @@ -131,13 +144,10 @@ extern char all_es_snpa[], all_is_snpa[]; * * NOTES: */ +void esis_init() { extern struct clnl_protosw clnl_protox[256]; - int esis_input(), isis_input(); -#ifdef ISO_X25ESIS - int x25esis_input(); -#endif ISO_X25ESIS esis_pcb.rcb_next = esis_pcb.rcb_prev = &esis_pcb; llinfo_llc.lc_next = llinfo_llc.lc_prev = &llinfo_llc; @@ -163,6 +173,7 @@ esis_init() * */ /*ARGSUSED*/ +int esis_usrreq(so, req, m, nam, control) struct socket *so; /* socket: used only to get to this code */ int req; /* request */ @@ -245,6 +256,7 @@ release: * * NOTES: */ +void esis_input(m0, shp) struct mbuf *m0; /* ptr to first mbuf of pkt */ struct snpa_hdr *shp; /* subnetwork header */ @@ -302,6 +314,7 @@ bad: * NOTES: Assumes there is enough space for fixed part of header, * DA, BSNPA and NET in first mbuf. */ +void esis_rdoutput(inbound_shp, inbound_m, inbound_oidx, rd_dstnsap, rt) struct snpa_hdr *inbound_shp; /* snpa hdr from incoming packet */ struct mbuf *inbound_m; /* incoming pkt itself */ @@ -446,7 +459,7 @@ struct rtentry *rt; /* snpa cache info regarding next hop of siso.siso_nlen = 6 + 1; /* should be taken from snpa_hdr */ /* +1 is for AFI */ bcopy(inbound_shp->snh_shost, siso.siso_data + 1, 6); - (ifp->if_output)(ifp, m0, &siso, 0); + (ifp->if_output)(ifp, m0, (struct sockaddr *)&siso, 0); } /* @@ -460,6 +473,7 @@ struct rtentry *rt; /* snpa cache info regarding next hop of * * NOTES: Plus 1 here is for length byte */ +int esis_insert_addr(buf, len, isoa, m, nsellen) register caddr_t *buf; /* ptr to buffer to put address into */ int *len; /* ptr to length of buffer so far */ @@ -499,13 +513,14 @@ int ESHonly = 0; * * NOTES: */ +void esis_eshinput(m, shp) struct mbuf *m; /* esh pdu */ struct snpa_hdr *shp; /* subnetwork header */ { struct esis_fixed *pdu = mtod(m, struct esis_fixed *); u_short ht; /* holding time */ - struct iso_addr *nsap; + struct iso_addr *nsap = 0; int naddr; u_char *buf = (u_char *)(pdu + 1); u_char *buflim = pdu->esis_hdr_len + (u_char *)pdu; @@ -583,6 +598,7 @@ bad: * * NOTES: */ +void esis_ishinput(m, shp) struct mbuf *m; /* esh pdu */ struct snpa_hdr *shp; /* subnetwork header */ @@ -613,10 +629,10 @@ struct snpa_hdr *shp; /* subnetwork header */ if (buf[1] != 2) goto bad; CTOH(buf[2], buf[3], newct); - if (esis_config_time != newct) { + if ((u_long)esis_config_time != (u_long)newct) { untimeout(esis_config,0); esis_config_time = newct; - esis_config(); + esis_config(0, 0); } break; @@ -650,6 +666,7 @@ bad: * * NOTES: */ +void esis_rdinput(m0, shp) struct mbuf *m0; /* esh pdu */ struct snpa_hdr *shp; /* subnetwork header */ @@ -745,7 +762,8 @@ bad: ; /* Needed by ESIS_NEXT_OPTION */ * * NOTES: Called every esis_config_time seconds */ -esis_config() +void +esis_config(caddr_t dummy1, int dummy2) { register struct ifnet *ifp; @@ -794,13 +812,14 @@ esis_config() * * NOTES: */ +void esis_shoutput(ifp, type, ht, sn_addr, sn_len, isoa) -struct ifnet *ifp; -int type; -short ht; -caddr_t sn_addr; -int sn_len; -struct iso_addr *isoa; + struct ifnet *ifp; + int type; + short ht; + caddr_t sn_addr; + int sn_len; + struct iso_addr *isoa; { struct mbuf *m, *m0; caddr_t cp, naddrp; @@ -922,7 +941,7 @@ struct iso_addr *isoa; siso.siso_data[0] = AFI_SNA; siso.siso_nlen = sn_len + 1; bcopy(sn_addr, siso.siso_data + 1, (unsigned)sn_len); - (ifp->if_output)(ifp, m0, &siso, 0); + (ifp->if_output)(ifp, m0, (struct sockaddr *)&siso, 0); } /* @@ -936,6 +955,7 @@ struct iso_addr *isoa; * * NOTES: */ +void isis_input(m0, shp) struct mbuf *m0; /* ptr to first mbuf of pkt */ struct snpa_hdr *shp; /* subnetwork header */ @@ -968,24 +988,27 @@ struct snpa_hdr *shp; /* subnetwork header */ } if (mm = m_copy(m0, 0, M_COPYALL)) { /*can't block at interrupt level */ if (sbappendaddr(&rp->rcb_socket->so_rcv, - &esis_dl, mm, (struct mbuf *)0) != 0) + (struct sockaddr *)&esis_dl, + mm, (struct mbuf *)0) != 0) sorwakeup(rp->rcb_socket); else { IFDEBUG(D_ISISINPUT) - printf("Error in sbappenaddr, mm = 0x%x\n", mm); + printf("Error in sbappenaddr, mm = 0x%x\n", mm); ENDDEBUG m_freem(mm); } } } if (first_rp && sbappendaddr(&first_rp->rcb_socket->so_rcv, - &esis_dl, m0, (struct mbuf *)0) != 0) { + (struct sockaddr *)&esis_dl, + m0, (struct mbuf *)0) != 0) { sorwakeup(first_rp->rcb_socket); return; } m_freem(m0); } +int isis_output(sdl, m) register struct sockaddr_dl *sdl; struct mbuf *m; @@ -1049,6 +1072,7 @@ release: * The loop through iso_ifaddr is stupid because * back in if_down, we knew the ifp... */ +void esis_ctlinput(req, siso) int req; /* request: we handle only PRC_IFDOWN */ struct sockaddr_iso *siso; /* address of ifp */ @@ -1062,4 +1086,4 @@ struct sockaddr_iso *siso; /* address of ifp */ } } -#endif ISO +#endif /* ISO */ diff --git a/sys/netiso/if_eon.c b/sys/netiso/if_eon.c index e8f7a609fc..617f23b5f3 100644 --- a/sys/netiso/if_eon.c +++ b/sys/netiso/if_eon.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)if_eon.c 7.16 (Berkeley) 6/27/91 - * $Id: if_eon.c,v 1.2 1993/10/16 21:05:13 rgrimes Exp $ + * $Id: if_eon.c,v 1.3 1993/11/07 17:49:38 wollman Exp $ */ /*********************************************************** @@ -112,15 +112,16 @@ struct eon_stat eonstat; #define EOK 0 -int eoninput(); -int eonoutput(); -int eonioctl(); -int eonattach(); -int eoninit(); -int eonrtrequest(); +void eoninput(struct mbuf *, int); +static int eonoutput(struct ifnet *, struct mbuf *, struct sockaddr *, struct rtentry *); +static int eonioctl(struct ifnet *, int, caddr_t); +static void eonattach(void); +static void eoninit(int); +static void eonrtrequest(int, struct rtentry *, struct sockaddr *); extern int ip_output(); struct ifnet eonif[1]; +void eonprotoinit() { (void) eonattach(); } @@ -137,6 +138,7 @@ struct eon_llinfo eon_llinfo; * RETURNS: void */ +void eonattach() { register struct ifnet *ifp = eonif; @@ -178,6 +180,7 @@ eonattach() * * RETURNS: nothing */ +int eonioctl(ifp, cmd, data) register struct ifnet *ifp; int cmd; @@ -206,11 +209,13 @@ eonioctl(ifp, cmd, data) return(error); } - +void eoniphdr(hdr, loc, ro, class, zero) -struct route *ro; -register struct eon_iphdr *hdr; -caddr_t loc; + struct route *ro; + register struct eon_iphdr *hdr; + caddr_t loc; + int class; + int zero; { struct mbuf mhead; register struct sockaddr_in *sin = (struct sockaddr_in *)&ro->ro_dst; @@ -263,9 +268,11 @@ caddr_t loc; * * RETURNS: nothing */ +void eonrtrequest(cmd, rt, gate) -register struct rtentry *rt; -register struct sockaddr *gate; + int cmd; + register struct rtentry *rt; + register struct sockaddr *gate; { unsigned long zerodst = 0; caddr_t ipaddrloc = (caddr_t) &zerodst; @@ -327,6 +334,7 @@ register struct sockaddr *gate; * RETURNS: nothing */ +void eoninit(unit) int unit; { @@ -348,19 +356,21 @@ eoninit(unit) * NOTES: * */ -eonoutput(ifp, m, dst, rt) +int +eonoutput(ifp, m, xdst, rt) struct ifnet *ifp; register struct mbuf *m; /* packet */ - struct sockaddr_iso *dst; /* destination addr */ + struct sockaddr *xdst; struct rtentry *rt; { + struct sockaddr_iso *dst = (struct sockaddr_iso *)xdst; register struct eon_llinfo *el; register struct eon_iphdr *ei; struct route *ro; int datalen; struct mbuf *mh; int error = 0, class = 0, alen = 0; - caddr_t ipaddrloc; + caddr_t ipaddrloc = 0; static struct eon_iphdr eon_iphdr; static struct route route; @@ -446,6 +456,7 @@ flush: return error; } +void eoninput(m, iphlen) register struct mbuf *m; int iphlen; diff --git a/sys/netiso/iso.c b/sys/netiso/iso.c index 9831d06a60..cf35a701df 100644 --- a/sys/netiso/iso.c +++ b/sys/netiso/iso.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)iso.c 7.14 (Berkeley) 6/27/91 - * $Id: iso.c,v 1.3 1993/10/16 21:05:15 rgrimes Exp $ + * $Id: iso.c,v 1.4 1993/11/07 17:49:40 wollman Exp $ */ /*********************************************************** @@ -88,12 +88,15 @@ SOFTWARE. #ifdef ISO +static void iso_ifscrub(struct ifnet *, struct iso_ifaddr *); + struct iso_ifaddr *iso_ifaddr; struct ifqueue clnlintrq; int iso_interfaces = 0; /* number of external interfaces */ extern struct ifnet loif; /* loopback interface */ -int ether_output(), llc_rtrequest(); +int ether_output(); +void llc_rtrequest(); /* @@ -109,6 +112,8 @@ int ether_output(), llc_rtrequest(); * NOTES: */ struct radix_node_head *iso_rnhead; + +void iso_init() { static iso_init_done; @@ -130,6 +135,7 @@ iso_init() * * NOTES: */ +int iso_addrmatch1(isoaa, isoab) register struct iso_addr *isoaa, *isoab; /* addresses to check */ { @@ -193,6 +199,7 @@ register struct iso_addr *isoaa, *isoab; /* addresses to check */ * * NOTES: */ +int iso_addrmatch(sisoa, sisob) struct sockaddr_iso *sisoa, *sisob; /* addresses to check */ { @@ -434,6 +441,7 @@ caddr_t buf; /* RESULT: network portion of address here */ * Ifp is 0 if not an interface-specific ioctl. */ /* ARGSUSED */ +int iso_control(so, cmd, data, ifp) struct socket *so; int cmd; @@ -593,6 +601,7 @@ iso_control(so, cmd, data, ifp) /* * Delete any existing route for an interface. */ +static void iso_ifscrub(ifp, ia) register struct ifnet *ifp; register struct iso_ifaddr *ia; @@ -616,10 +625,12 @@ iso_ifscrub(ifp, ia) * Initialize an interface's internet address * and routing table entry. */ +int iso_ifinit(ifp, ia, siso, scrub) register struct ifnet *ifp; register struct iso_ifaddr *ia; struct sockaddr_iso *siso; + int scrub; { struct sockaddr_iso oldaddr; int s = splimp(), error, nsellength; @@ -631,7 +642,8 @@ iso_ifinit(ifp, ia, siso, scrub) * if this is its first address, * and to validate the address if necessary. */ - if (ifp->if_ioctl && (error = (*ifp->if_ioctl)(ifp, SIOCSIFADDR, ia))) { + if (ifp->if_ioctl && (error = (*ifp->if_ioctl)(ifp, SIOCSIFADDR, + (caddr_t)ia))) { splx(s); ia->ia_addr = oldaddr; return (error); @@ -737,6 +749,7 @@ iso_ifwithidi(addr) * SIDE EFFECTS: * */ +int iso_ck_addr(isoa) struct iso_addr *isoa; /* address to check */ { @@ -843,6 +856,7 @@ iso_localifa(siso) * NOTES: This could embody some of the functions of * rclnp_ctloutput and cons_ctloutput. */ +int iso_nlctloutput(cmd, optname, pcb, m) int cmd; /* command:set or get */ int optname; /* option of interest */ @@ -911,6 +925,7 @@ struct mbuf *m; /* data for set, buffer for get */ * RETURNS: nada * */ +void dump_isoaddr(s) struct sockaddr_iso *s; { @@ -933,4 +948,4 @@ dump_isoaddr(s) } } -#endif ARGO_DEBUG +#endif /* ARGO_DEBUG */ diff --git a/sys/netiso/iso_chksum.c b/sys/netiso/iso_chksum.c index 56c8d8843f..82d353d74e 100644 --- a/sys/netiso/iso_chksum.c +++ b/sys/netiso/iso_chksum.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)iso_chksum.c 7.5 (Berkeley) 5/6/91 - * $Id$ + * $Id: iso_chksum.c,v 1.3 1993/10/16 21:05:18 rgrimes Exp $ */ /*********************************************************** @@ -188,8 +188,8 @@ iso_gen_csum(m,n,l) register int c0=0, c1=0; register int i=0; int loc = n++, len=0; /* n is position, loc is offset */ - u_char *xloc; - u_char *yloc; + u_char *xloc = 0; + u_char *yloc = 0; int cum=0; /* cum == cumulative length */ IFDEBUG(D_CHKSUM) diff --git a/sys/netiso/iso_snpac.c b/sys/netiso/iso_snpac.c index 89a6203076..f490533535 100644 --- a/sys/netiso/iso_snpac.c +++ b/sys/netiso/iso_snpac.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)iso_snpac.c 7.14 (Berkeley) 6/27/91 - * $Id: iso_snpac.c,v 1.2 1993/10/16 21:05:26 rgrimes Exp $ + * $Id: iso_snpac.c,v 1.3 1993/11/07 17:49:46 wollman Exp $ */ /*********************************************************** @@ -66,6 +66,7 @@ SOFTWARE. #include "types.h" #include "param.h" #include "systm.h" +#include "kernel.h" #include "mbuf.h" #include "domain.h" #include "protosw.h" @@ -87,12 +88,13 @@ SOFTWARE. #include "esis.h" #include "argo_debug.h" +static void snpac_logdefis(struct rtentry *); + struct llinfo_llc llinfo_llc; -int iso_systype = SNPA_ES; /* default to be an ES */ +int iso_systype = SNPA_ES; /* default to be an ES */ extern short esis_holding_time, esis_config_time, esis_esconfig_time; -extern struct timeval time; -extern int esis_config(), hz; +extern int esis_config(); static void snpac_fixdstandmask(); struct sockaddr_iso blank_siso = {sizeof(blank_siso), AF_ISO}; @@ -154,10 +156,11 @@ union sockunion { * * NOTES: This does a lot of obscure magic; */ +void llc_rtrequest(req, rt, sa) -int req; -register struct rtentry *rt; -struct sockaddr *sa; + int req; + register struct rtentry *rt; + struct sockaddr *sa; { register union sockunion *gate = (union sockunion *)rt->rt_gateway; register struct llinfo_llc *lc = (struct llinfo_llc *)rt->rt_llinfo, *lc2; @@ -203,7 +206,7 @@ struct sockaddr *sa; if (rt->rt_flags & RTF_CLONING) { register struct ifaddr *ifa; register struct sockaddr *sa; - for (ifa = ifp->if_addrlist; ifa; ifa->ifa_next) + for (ifa = ifp->if_addrlist; ifa; ifa = ifa->ifa_next) if ((sa = ifa->ifa_addr)->sa_family == AF_LINK) { if (sa->sa_len > gate->sa.sa_len) log(LOG_DEBUG, "llc_rtrequest: cloning address too small\n"); @@ -280,6 +283,7 @@ struct sockaddr *sa; * A mechanism is needed to prevent this function from * being invoked if the system is an IS. */ +int iso_snparesolve(ifp, dest, snpa, snpa_len) struct ifnet *ifp; /* outgoing interface */ struct sockaddr_iso *dest; /* destination */ @@ -345,6 +349,7 @@ int *snpa_len; /* RESULT: length of snpa */ * NOTES: If there is a route entry associated with cache * entry, then delete that as well */ +void snpac_free(lc) register struct llinfo_llc *lc; /* entry to free */ { @@ -373,6 +378,7 @@ register struct llinfo_llc *lc; /* entry to free */ * * NOTES: If entry already exists, then update holding time. */ +int snpac_add(ifp, nsap, snpa, type, ht, nsellength) struct ifnet *ifp; /* interface info is related to */ struct iso_addr *nsap; /* nsap to add */ @@ -456,6 +462,7 @@ int nsellength; /* nsaps may differ only in trailing bytes */ static void snpac_fixdstandmask(nsellength) + int nsellength; { register char *cp = msk.siso_data, *cplim; @@ -481,6 +488,7 @@ snpac_fixdstandmask(nsellength) * * NOTES: */ +int snpac_ioctl (so, cmd, data) struct socket *so; int cmd; /* ioctl to process */ @@ -537,8 +545,9 @@ caddr_t data; /* data for the cmd */ * * NOTES: */ +static void snpac_logdefis(sc) -register struct rtentry *sc; + register struct rtentry *sc; { register struct iso_addr *r; register struct sockaddr_dl *sdl = (struct sockaddr_dl *)sc->rt_gateway; @@ -583,6 +592,7 @@ register struct rtentry *sc; * would time out entries where expiry date is older * than the current time. */ +void snpac_age() { register struct llinfo_llc *lc, *nlc; @@ -616,6 +626,7 @@ snpac_age() * as interm kludge until * real multicast addresses can be configured */ +int snpac_ownmulti(snpa, len) caddr_t snpa; u_int len; @@ -637,6 +648,7 @@ u_int len; * * NOTES: */ +void snpac_flushifp(ifp) struct ifnet *ifp; { @@ -660,6 +672,7 @@ struct ifnet *ifp; * NOTES: In the future, this should make a request of a user * level routing daemon. */ +void snpac_rtrequest(req, host, gateway, netmask, flags, ret_nrt) int req; struct iso_addr *host; @@ -714,6 +727,7 @@ struct rtentry **ret_nrt; * This could be made more efficient by checking * the existing route before adding a new one. */ +void snpac_addrt(ifp, host, gateway, netmask) struct ifnet *ifp; struct iso_addr *host, *gateway, *netmask; diff --git a/sys/netiso/tp_driver.c b/sys/netiso/tp_driver.c index 10305a3770..c81948d522 100644 --- a/sys/netiso/tp_driver.c +++ b/sys/netiso/tp_driver.c @@ -1,6 +1,6 @@ /* * from: unknown - * $Id$ + * $Id: tp_driver.c,v 1.3 1993/10/16 21:05:37 rgrimes Exp $ */ #define _XEBEC_PG static @@ -1044,6 +1044,8 @@ static int inx[26][9] = { {0,0,0,0,0,0,0,0,0,}, {0x0,0x49,-1,0x45,-1,0x44,0x48,-1,0x0, }, {0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,-1, }, }; + +int tp_driver(p, e) register tp_PCB_ *p; register struct tp_event *e; diff --git a/sys/netiso/tp_emit.c b/sys/netiso/tp_emit.c index d3281d5f02..285e969c8f 100644 --- a/sys/netiso/tp_emit.c +++ b/sys/netiso/tp_emit.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)tp_emit.c 7.9 (Berkeley) 5/9/91 - * $Id$ + * $Id: tp_emit.c,v 1.3 1993/10/16 21:05:39 rgrimes Exp $ */ /*********************************************************** @@ -968,4 +968,5 @@ tp_error_emit(error, sref, faddr, laddr, erdata, erlen, tpcb, cons_channel, #endif notdef } } + return 0; } diff --git a/sys/netiso/tp_inet.c b/sys/netiso/tp_inet.c index 6c2ee7e97d..c28c6a045b 100644 --- a/sys/netiso/tp_inet.c +++ b/sys/netiso/tp_inet.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)tp_inet.c 7.8 (Berkeley) 5/6/91 - * $Id$ + * $Id: tp_inet.c,v 1.2 1993/10/16 21:05:42 rgrimes Exp $ */ /*********************************************************** @@ -105,6 +105,8 @@ SOFTWARE. #include "iso_chksum.c" #endif +static void tpin_abort(struct inpcb *, int); + /* * NAME: in_getsufx() @@ -122,6 +124,7 @@ SOFTWARE. * * NOTES: */ +void in_getsufx(inp, lenp, data_out, which) struct inpcb *inp; u_short *lenp; @@ -161,6 +164,7 @@ void in_putsufx(inp, sufxloc, sufxlen, which) struct inpcb *inp; caddr_t sufxloc; + int sufxlen; int which; { if (which == TP_FOREIGN) { @@ -250,6 +254,7 @@ in_putnetaddr(inp, name, which) * * NOTES: */ +int in_cmpnetaddr(inp, name, which) register struct inpcb *inp; register struct sockaddr_in *name; @@ -667,8 +672,6 @@ tpip_ctlinput(cmd, sin) struct sockaddr_in *sin; { extern u_char inetctlerrmap[]; - extern ProtoHook tpin_abort(); - extern ProtoHook in_rtchange(); extern struct in_addr zeroin_addr; if (sin->sin_family != AF_INET && sin->sin_family != AF_IMPLINK) @@ -680,8 +683,8 @@ tpip_ctlinput(cmd, sin) switch (cmd) { case PRC_QUENCH: - in_pcbnotify(&tp_inpcb, sin, 0, - zeroin_addr, 0, cmd, (int (*)())tp_quench); + in_pcbnotify(&tp_inpcb, (struct sockaddr *)sin, 0, + zeroin_addr, 0, cmd, (void (*)())tp_quench); break; case PRC_ROUTEDEAD: @@ -689,7 +692,7 @@ tpip_ctlinput(cmd, sin) case PRC_UNREACH_NET: case PRC_IFDOWN: case PRC_HOSTDEAD: - in_pcbnotify(&tp_inpcb, sin, 0, + in_pcbnotify(&tp_inpcb, (struct sockaddr *)sin, 0, zeroin_addr, 0, cmd, in_rtchange); break; @@ -709,7 +712,7 @@ tpip_ctlinput(cmd, sin) case PRC_TIMXCEED_REASS: case PRC_PARAMPROB: */ - in_pcbnotify(&tp_inpcb, sin, 0, zeroin_addr, 0, + in_pcbnotify(&tp_inpcb, (struct sockaddr *)sin, 0, zeroin_addr, 0, cmd, tpin_abort); } return 0; @@ -734,25 +737,26 @@ tpip_ctlinput(cmd, sin) * NOTES: */ -ProtoHook -tpin_abort(inp) +static void +tpin_abort(inp, errno) struct inpcb *inp; + int errno; { struct tp_event e; e.ev_number = ER_TPDU; e.ATTR(ER_TPDU).e_reason = ENETRESET; (void) tp_driver((struct tp_pcb *)inp->inp_ppcb, &e); - return 0; } #ifdef ARGO_DEBUG +void dump_inaddr(addr) register struct sockaddr_in *addr; { printf("INET: port 0x%x; addr 0x%x\n", addr->sin_port, addr->sin_addr); } -#endif ARGO_DEBUG +#endif /* ARGO_DEBUG */ /* * NAME: tpip_route() diff --git a/sys/netiso/tp_input.c b/sys/netiso/tp_input.c index 8f262698e1..9d208f9fad 100644 --- a/sys/netiso/tp_input.c +++ b/sys/netiso/tp_input.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)tp_input.c 7.19 (Berkeley) 6/27/91 - * $Id$ + * $Id: tp_input.c,v 1.2 1993/10/16 21:05:44 rgrimes Exp $ */ /*********************************************************** @@ -209,7 +209,7 @@ static u_char tpdu_info[][4] = if (Phrase) {error = (Erval); errlen = (int)(Loc); IncStat(Stat); tpibrk();\ goto Whattodo; } -tpibrk() {} +void tpibrk() {} /* * WHENEVER YOU USE THE FOLLOWING MACRO, @@ -370,6 +370,7 @@ ok: } #ifndef TPCONS +int tpcons_output() { return(0); @@ -412,18 +413,18 @@ tp_input(m, faddr, laddr, cons_channel, dgout_routine, ce_bit) { register struct tp_pcb *tpcb = (struct tp_pcb *)0; - register struct tpdu *hdr; - struct socket *so; - struct tp_event e; - int error = 0; - unsigned dutype; - u_short dref, sref = 0, acktime = 2, subseq = 0; /*VAX*/ - u_char preferred_class = 0, class_to_use = 0; - u_char opt, dusize = TP_DFL_TPDUSIZE, addlopt = 0, version; + register struct tpdu *hdr; + struct socket *so; + struct tp_event e; + int error = 0; + unsigned dutype; + u_short dref, sref = 0, acktime = 2, subseq = 0; /*VAX*/ + u_char preferred_class = 0, class_to_use = 0; + u_char opt, dusize = TP_DFL_TPDUSIZE, addlopt = 0, version = 0; #ifdef TP_PERF_MEAS - u_char perf_meas; + u_char perf_meas; #endif TP_PERF_MEAS - u_char fsufxlen = 0, lsufxlen = 0, intercepted = 0; + u_char fsufxlen = 0, lsufxlen = 0, intercepted = 0; caddr_t fsufxloc = 0, lsufxloc = 0; int tpdu_len = 0; u_int takes_data = FALSE; diff --git a/sys/netiso/tp_iso.c b/sys/netiso/tp_iso.c index 0fd25e9cf2..2d2087c26a 100644 --- a/sys/netiso/tp_iso.c +++ b/sys/netiso/tp_iso.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)tp_iso.c 7.11 (Berkeley) 5/6/91 - * $Id$ + * $Id: tp_iso.c,v 1.3 1993/10/16 21:05:47 rgrimes Exp $ */ /*********************************************************** @@ -116,7 +116,7 @@ SOFTWARE. * FUNCTION, ARGUMENTS: * The argument (which) takes the value TP_LOCAL or TP_FOREIGN. */ - +void iso_getsufx(isop, lenp, data_out, which) struct isopcb *isop; u_short *lenp; @@ -260,6 +260,7 @@ iso_putnetaddr(isop, name, which) * with that implicitly stored in an isopcb (isop). * The argument (which) takes values TP_LOCAL or TP_FOREIGN. */ +int iso_cmpnetaddr(isop, name, which) register struct isopcb *isop; register struct sockaddr_iso *name; @@ -698,6 +699,8 @@ tpclnp_ctlinput(cmd, siso) */ static struct sockaddr_iso siso = {sizeof(siso), AF_ISO}; + +void tpclnp_ctlinput1(cmd, isoa) int cmd; struct iso_addr *isoa; diff --git a/sys/netiso/tp_pcb.c b/sys/netiso/tp_pcb.c index 58d39ea0c1..2216c36529 100644 --- a/sys/netiso/tp_pcb.c +++ b/sys/netiso/tp_pcb.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)tp_pcb.c 7.11 (Berkeley) 5/6/91 - * $Id$ + * $Id: tp_pcb.c,v 1.2 1993/10/16 21:05:55 rgrimes Exp $ */ /*********************************************************** @@ -252,56 +252,51 @@ struct tp_conn_param tp_conn_param[] = { }; #ifdef INET -int in_putnetaddr(); -int in_getnetaddr(); -int in_cmpnetaddr(); +int in_putnetaddr(); +int in_getnetaddr(); +int in_cmpnetaddr(); int in_putsufx(); int in_getsufx(); int in_recycle_tsuffix(); int tpip_mtu(); -int in_pcbbind(); -int in_pcbconnect(); -int in_pcbdisconnect(); -int in_pcbdetach(); -int in_pcballoc(); int tpip_output(); int tpip_output_dg(); struct inpcb tp_inpcb; -#endif INET +#endif /* INET */ #ifdef ISO -int iso_putnetaddr(); -int iso_getnetaddr(); -int iso_cmpnetaddr(); +int iso_putnetaddr(); +int iso_getnetaddr(); +int iso_cmpnetaddr(); int iso_putsufx(); int iso_getsufx(); int iso_recycle_tsuffix(); -int tpclnp_mtu(); -int iso_pcbbind(); -int iso_pcbconnect(); -int iso_pcbdisconnect(); -int iso_pcbdetach(); +int tpclnp_mtu(); +int iso_pcbbind(); +int iso_pcbconnect(); +void iso_pcbdisconnect(); +void iso_pcbdetach(); int iso_pcballoc(); int tpclnp_output(); int tpclnp_output_dg(); -int iso_nlctloutput(); +int iso_nlctloutput(); struct isopcb tp_isopcb; -#endif ISO +#endif /* ISO */ #ifdef TPCONS -int iso_putnetaddr(); -int iso_getnetaddr(); -int iso_cmpnetaddr(); +int iso_putnetaddr(); +int iso_getnetaddr(); +int iso_cmpnetaddr(); int iso_putsufx(); int iso_getsufx(); int iso_recycle_tsuffix(); -int iso_pcbbind(); -int tpcons_pcbconnect(); -int tpclnp_mtu(); -int iso_pcbdisconnect(); -int iso_pcbdetach(); +int iso_pcbbind(); +int tpcons_pcbconnect(); +int tpclnp_mtu(); +void iso_pcbdisconnect(); +void iso_pcbdetach(); int iso_pcballoc(); int tpcons_output(); struct isopcb tp_isopcb; -#endif TPCONS +#endif /* TPCONS */ struct nl_protosw nl_protosw[] = { @@ -591,6 +586,7 @@ tp_getref(tpcb) * * NOTES: */ +int tp_attach(so, dom) struct socket *so; int dom; diff --git a/sys/netiso/tp_pcb.h b/sys/netiso/tp_pcb.h index d848546a73..2fe259b46d 100644 --- a/sys/netiso/tp_pcb.h +++ b/sys/netiso/tp_pcb.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)tp_pcb.h 7.9 (Berkeley) 5/6/91 - * $Id: tp_pcb.h,v 1.3 1993/11/07 17:49:56 wollman Exp $ + * $Id: tp_pcb.h,v 1.4 1993/11/18 00:10:15 wollman Exp $ */ /*********************************************************** @@ -135,23 +135,23 @@ struct tp_rtc { }; struct nl_protosw { - int nlp_afamily; /* address family */ - int (*nlp_putnetaddr)(); /* puts addresses in nl pcb */ - int (*nlp_getnetaddr)(); /* gets addresses from nl pcb */ - int (*nlp_cmpnetaddr)(); /* compares address in pcb with sockaddr */ - int (*nlp_putsufx)(); /* puts transport suffixes in nl pcb */ - int (*nlp_getsufx)(); /* gets transport suffixes from nl pcb */ - int (*nlp_recycle_suffix)();/* clears suffix from nl pcb */ - int (*nlp_mtu)(); /* figures out mtu based on nl used */ - int (*nlp_pcbbind)(); /* bind to pcb for net level */ - int (*nlp_pcbconn)(); /* connect for net level */ - int (*nlp_pcbdisc)(); /* disconnect net level */ - int (*nlp_pcbdetach)(); /* detach net level pcb */ - int (*nlp_pcballoc)(); /* allocate a net level pcb */ - int (*nlp_output)(); /* prepare a packet to give to nl */ - int (*nlp_dgoutput)(); /* prepare a packet to give to nl */ - int (*nlp_ctloutput)(); /* hook for network set/get options */ - caddr_t nlp_pcblist; /* list of xx_pcb's for connections */ + int nlp_afamily; /* address family */ + int (*nlp_putnetaddr)(); /* puts addresses in nl pcb */ + int (*nlp_getnetaddr)(); /* gets addresses from nl pcb */ + int (*nlp_cmpnetaddr)(); /* compares address in pcb with sockaddr */ + int (*nlp_putsufx)(); /* puts transport suffixes in nl pcb */ + int (*nlp_getsufx)(); /* gets transport suffixes from nl pcb */ + int (*nlp_recycle_suffix)(); /* clears suffix from nl pcb */ + int (*nlp_mtu)(); /* figures out mtu based on nl used */ + int (*nlp_pcbbind)(); /* bind to pcb for net level */ + int (*nlp_pcbconn)(); /* connect for net level */ + void (*nlp_pcbdisc)(); /* disconnect net level */ + void (*nlp_pcbdetach)(); /* detach net level pcb */ + int (*nlp_pcballoc)(); /* allocate a net level pcb */ + int (*nlp_output)(); /* prepare a packet to give to nl */ + int (*nlp_dgoutput)(); /* prepare a packet to give to nl */ + int (*nlp_ctloutput)(); /* hook for network set/get options */ + caddr_t nlp_pcblist; /* list of xx_pcb's for connections */ }; diff --git a/sys/netiso/tp_stat.h b/sys/netiso/tp_stat.h index 2b83869f66..c7339877f6 100644 --- a/sys/netiso/tp_stat.h +++ b/sys/netiso/tp_stat.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)tp_stat.h 7.5 (Berkeley) 6/27/91 - * $Id: tp_stat.h,v 1.2 1993/10/16 21:05:59 rgrimes Exp $ + * $Id: tp_stat.h,v 1.3 1993/11/07 17:49:59 wollman Exp $ */ /*********************************************************** @@ -275,7 +275,7 @@ struct tp_pmeas { extern int PStat_Junk; #define PStat(tpcb, x) PStat_Junk #define IncPStat(tpcb, x) /* no-op */ -#define tpmeas(a,b,c,d,e,f) 0 +#define tpmeas(a,b,c,d,e,f) #define IFPERF(x) if (0) { #define ENDPERF } diff --git a/sys/netiso/tp_subr.c b/sys/netiso/tp_subr.c index b3a99e6c42..e5f5a83a91 100644 --- a/sys/netiso/tp_subr.c +++ b/sys/netiso/tp_subr.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)tp_subr.c 7.9 (Berkeley) 6/27/91 - * $Id: tp_subr.c,v 1.3 1993/10/16 21:06:03 rgrimes Exp $ + * $Id: tp_subr.c,v 1.4 1993/11/07 17:50:02 wollman Exp $ */ /*********************************************************** @@ -438,6 +438,7 @@ tp_sbdrop(tpcb, seq) * RETURN VALUE: * the highest seq # sent successfully. */ +int tp_send(tpcb) register struct tp_pcb *tpcb; { @@ -488,8 +489,10 @@ tp_send(tpcb) ENDTRACE - if ( SEQ_GT(tpcb, lowseq, highseq) ) - return ; /* don't send, don't change hiwat, don't set timers */ + if( SEQ_GT(tpcb, lowseq, highseq) ) { + /* don't send, don't change hiwat, don't set timers */ + return 0; + } ASSERT( SEQ_LEQ(tpcb, lowseq, highseq) ); SEQ_DEC(tpcb, lowseq); @@ -653,6 +656,8 @@ done: tpcb->tp_sndhiwat, lowseq, eotsdu_reached, tpcb->tp_sock->so_error); ENDTRACE + ; + return 0; } /* diff --git a/sys/netiso/tp_subr2.c b/sys/netiso/tp_subr2.c index 95c5525a45..ce8cd924a2 100644 --- a/sys/netiso/tp_subr2.c +++ b/sys/netiso/tp_subr2.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)tp_subr2.c 7.10 (Berkeley) 6/27/91 - * $Id$ + * $Id: tp_subr2.c,v 1.3 1993/10/16 21:06:04 rgrimes Exp $ */ /*********************************************************** @@ -391,6 +391,7 @@ tp_quench( tpcb, cmd ) * * NOTES: */ +void tp_netcmd( tpcb, cmd ) struct tp_pcb *tpcb; int cmd; @@ -417,7 +418,7 @@ tp_netcmd( tpcb, cmd ) printf("tp_netcmd(0x%x, 0x%x) NOT IMPLEMENTED\n", tpcb, cmd); break; } -#else TPCONS +#else /* TPCONS */ printf("tp_netcmd(): X25 NOT CONFIGURED!!\n"); #endif } @@ -452,7 +453,7 @@ tp_mask_to_num(x) return j; } -static +static void copyQOSparms(src, dst) struct tp_conn_param *src, *dst; { @@ -636,7 +637,7 @@ done: } #ifndef TPCONS -static +static void pk_flowcontrol() {} #endif @@ -747,6 +748,7 @@ tp_setup_perf(tpcb) #endif TP_PERF_MEAS #ifdef ARGO_DEBUG +void dump_addr (addr) register struct sockaddr *addr; { @@ -758,7 +760,7 @@ dump_addr (addr) case AF_ISO: dump_isoaddr((struct sockaddr_iso *)addr); break; -#endif ISO +#endif /* ISO */ default: printf("BAD AF: 0x%x\n", addr->sa_family); break; @@ -773,9 +775,10 @@ dump_addr (addr) * columns of hex/dec numbers will be printed, followed by the * character representations (if printable). */ +void Dump_buf(buf, len) -caddr_t buf; -int len; + char *buf; + int len; { int i,j; #define Buf ((u_char *)buf) @@ -803,5 +806,5 @@ int len; } -#endif ARGO_DEBUG +#endif /* ARGO_DEBUG */ diff --git a/sys/netiso/tp_trace.h b/sys/netiso/tp_trace.h index 925e1600f5..18a20ca46e 100644 --- a/sys/netiso/tp_trace.h +++ b/sys/netiso/tp_trace.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)tp_trace.h 7.5 (Berkeley) 6/27/91 - * $Id: tp_trace.h,v 1.2 1993/10/16 21:06:12 rgrimes Exp $ + * $Id: tp_trace.h,v 1.3 1993/11/07 17:50:06 wollman Exp $ */ /*********************************************************** @@ -183,8 +183,8 @@ extern int tp_Tracen; **********************************************/ #define TPTRACEN 1 -#define tptrace(A,B,C,D,E,F) 0 -#define tptraceTPCB(A,B,C,D,E,F) 0 +#define tptrace(A,B,C,D,E,F) +#define tptraceTPCB(A,B,C,D,E,F) #define IFTRACE(ascii) if (0) { #define ENDTRACE } diff --git a/sys/netiso/tp_usrreq.c b/sys/netiso/tp_usrreq.c index b3ef56e333..99c80a1c24 100644 --- a/sys/netiso/tp_usrreq.c +++ b/sys/netiso/tp_usrreq.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)tp_usrreq.c 7.17 (Berkeley) 6/27/91 - * $Id$ + * $Id: tp_usrreq.c,v 1.2 1993/10/16 21:06:14 rgrimes Exp $ */ /*********************************************************** @@ -167,6 +167,7 @@ dump_mbuf(n, str) * xpd data in the buffer * E* whatever is returned from the fsm. */ +int tp_rcvoob(tpcb, so, m, outflags, inflags) struct tp_pcb *tpcb; register struct socket *so; @@ -273,6 +274,7 @@ release: * EMSGSIZE if trying to send > max-xpd bytes (16) * ENOBUFS if ran out of mbufs */ +int tp_sendoob(tpcb, so, xdata, outflags) struct tp_pcb *tpcb; register struct socket *so; @@ -788,6 +790,8 @@ tp_usrreq(so, req, m, nam, controlp) splx(s); return error; } + +void tp_ltrace(so, uio) struct socket *so; struct uio *uio; @@ -801,6 +805,7 @@ struct uio *uio; ENDTRACE } +int tp_confirm(tpcb) register struct tp_pcb *tpcb; { @@ -815,6 +820,7 @@ register struct tp_pcb *tpcb; /* * Process control data sent with sendmsg() */ +int tp_snd_control(m, so, data) struct mbuf *m; struct socket *so; diff --git a/sys/netns/idp_usrreq.c b/sys/netns/idp_usrreq.c index de278a145c..0f259b5445 100644 --- a/sys/netns/idp_usrreq.c +++ b/sys/netns/idp_usrreq.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)idp_usrreq.c 7.11 (Berkeley) 6/27/91 - * $Id: idp_usrreq.c,v 1.2 1993/10/16 19:54:11 rgrimes Exp $ + * $Id: idp_usrreq.c,v 1.3 1993/11/07 17:50:20 wollman Exp $ */ #include "param.h" @@ -63,6 +63,7 @@ struct sockaddr_ns idp_ns = { sizeof(idp_ns), AF_NS }; /* * This may also be called for raw listeners. */ +void idp_input(m, nsp) struct mbuf *m; register struct nspcb *nsp; @@ -103,6 +104,7 @@ bad: m_freem(m); } +void idp_abort(nsp) struct nspcb *nsp; { @@ -134,9 +136,12 @@ idp_drop(nsp, errno) so->so_error = errno; ns_pcbdisconnect(nsp); soisdisconnected(so); + return nsp; } int noIdpRoute; + +int idp_output(nsp, m0) struct nspcb *nsp; struct mbuf *m0; @@ -146,7 +151,7 @@ idp_output(nsp, m0) register struct socket *so; register int len = 0; register struct route *ro; - struct mbuf *mprev; + struct mbuf *mprev = 0; extern int idpcksum; /* @@ -260,6 +265,7 @@ idp_output(nsp, m0) return (ns_output(m, ro, so->so_options & SO_BROADCAST)); } /* ARGSUSED */ +int idp_ctloutput(req, so, level, name, value) int req, level; struct socket *so; @@ -371,6 +377,7 @@ idp_ctloutput(req, so, level, name, value) } /*ARGSUSED*/ +int idp_usrreq(so, req, m, nam, control) struct socket *so; int req; @@ -455,7 +462,7 @@ idp_usrreq(so, req, m, nam, control) case PRU_SEND: { struct ns_addr laddr; - int s; + int s = 0; if (nam) { laddr = nsp->nsp_laddr; @@ -533,6 +540,7 @@ release: return (error); } /*ARGSUSED*/ +int idp_raw_usrreq(so, req, m, nam, control) struct socket *so; int req; diff --git a/sys/netns/ns.c b/sys/netns/ns.c index 5b78fc812c..61c145b701 100644 --- a/sys/netns/ns.c +++ b/sys/netns/ns.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)ns.c 7.8 (Berkeley) 6/27/91 - * $Id: ns.c,v 1.2 1993/10/16 19:54:14 rgrimes Exp $ + * $Id: ns.c,v 1.3 1993/11/07 17:50:23 wollman Exp $ */ #include "param.h" @@ -51,6 +51,8 @@ #ifdef NS +static void ns_ifscrub(struct ifnet *, struct ns_ifaddr *); + struct ns_ifaddr *ns_ifaddr; struct ifqueue nsintrq; @@ -66,6 +68,7 @@ union ns_net ns_broadnet; * Generic internet control operations (ioctl's). */ /* ARGSUSED */ +int ns_control(so, cmd, data, ifp) struct socket *so; int cmd; @@ -179,7 +182,8 @@ ns_control(so, cmd, data, ifp) ia->ia_flags &= ~IFA_ROUTE; } if (ifp->if_ioctl) { - error = (*ifp->if_ioctl)(ifp, SIOCSIFDSTADDR, ia); + error = (*ifp->if_ioctl)(ifp, SIOCSIFDSTADDR, + (caddr_t)ia); if (error) return (error); } @@ -191,6 +195,7 @@ ns_control(so, cmd, data, ifp) (struct sockaddr_ns *)&ifr->ifr_addr, 1)); case SIOCDIFADDR: + error = 0; ns_ifscrub(ifp, ia); if ((ifa = ifp->if_addrlist) == (struct ifaddr *)ia) ifp->if_addrlist = ifa->ifa_next; @@ -225,6 +230,7 @@ ns_control(so, cmd, data, ifp) return (0); case SIOCAIFADDR: + error = 0; dstIsNew = 0; hostIsNew = 1; if (ia->ia_addr.sns_family == AF_NS) { if (ifra->ifra_addr.sns_len == 0) { @@ -256,6 +262,7 @@ ns_control(so, cmd, data, ifp) /* * Delete any previous route for an old address. */ +static void ns_ifscrub(ifp, ia) register struct ifnet *ifp; register struct ns_ifaddr *ia; @@ -272,10 +279,12 @@ ns_ifscrub(ifp, ia) * Initialize an interface's internet address * and routing table entry. */ +int ns_ifinit(ifp, ia, sns, scrub) register struct ifnet *ifp; register struct ns_ifaddr *ia; register struct sockaddr_ns *sns; + int scrub; { struct sockaddr_ns oldaddr; register union ns_host *h = &ia->ia_addr.sns_addr.x_host; @@ -300,7 +309,8 @@ ns_ifinit(ifp, ia, sns, scrub) */ if (ns_hosteqnh(ns_thishost, ns_zerohost)) { if (ifp->if_ioctl && - (error = (*ifp->if_ioctl)(ifp, SIOCSIFADDR, ia))) { + (error = (*ifp->if_ioctl)(ifp, SIOCSIFADDR, + (caddr_t)ia))) { ia->ia_addr = oldaddr; splx(s); return (error); @@ -310,7 +320,8 @@ ns_ifinit(ifp, ia, sns, scrub) || ns_hosteqnh(sns->sns_addr.x_host, ns_thishost)) { *h = ns_thishost; if (ifp->if_ioctl && - (error = (*ifp->if_ioctl)(ifp, SIOCSIFADDR, ia))) { + (error = (*ifp->if_ioctl)(ifp, SIOCSIFADDR, + (caddr_t)ia))) { ia->ia_addr = oldaddr; splx(s); return (error); diff --git a/sys/netns/ns_error.c b/sys/netns/ns_error.c index fba0600008..e4af001f3e 100644 --- a/sys/netns/ns_error.c +++ b/sys/netns/ns_error.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)ns_error.c 7.8 (Berkeley) 6/28/90 - * $Id: ns_error.c,v 1.3 1993/10/16 19:55:12 rgrimes Exp $ + * $Id: ns_error.c,v 1.4 1993/11/07 17:50:25 wollman Exp $ */ #include "param.h" @@ -64,7 +64,9 @@ struct ns_errstat ns_errstat; int ns_errprintfs = 0; #endif +int ns_err_x(c) + int c; { register u_short *w, *lim, *base = ns_errstat.ns_es_codes; u_short x = c; @@ -88,10 +90,11 @@ ns_err_x(c) * Generate an error packet of type error * in response to bad packet. */ - +void ns_error(om, type, param) struct mbuf *om; int type; + int param; { register struct ns_epidp *ep; struct mbuf *m; @@ -167,8 +170,9 @@ freeit: m_freem(om); } +void ns_printhost(p) -register struct ns_addr *p; + register struct ns_addr *p; { printf("", @@ -184,6 +188,7 @@ register struct ns_addr *p; /* * Process a received NS_ERR message. */ +void ns_err_input(m) struct mbuf *m; { @@ -297,8 +302,9 @@ nstime() } #endif +int ns_echo(m) -struct mbuf *m; + struct mbuf *m; { register struct idp *idp = mtod(m, struct idp *); register struct echo { diff --git a/sys/netns/ns_input.c b/sys/netns/ns_input.c index 8729ae5590..6ba649360a 100644 --- a/sys/netns/ns_input.c +++ b/sys/netns/ns_input.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)ns_input.c 7.8 (Berkeley) 6/27/91 - * $Id: ns_input.c,v 1.2 1993/10/16 19:54:23 rgrimes Exp $ + * $Id: ns_input.c,v 1.3 1993/11/18 00:10:53 wollman Exp $ */ #include "param.h" @@ -57,6 +57,9 @@ #include "idp_var.h" #include "ns_error.h" +static void idp_forward(struct mbuf *); +static void idp_undo_route(struct route *); + /* * NS initialization. */ @@ -78,6 +81,7 @@ int nsqmaxlen = IFQ_MAXLEN; int idpcksum = 1; long ns_pexseq; +void ns_init() { extern struct timeval time; @@ -100,6 +104,8 @@ ns_init() */ int nsintr_getpck = 0; int nsintr_swtch = 0; + +void nsintr() { register struct idp *idp; @@ -269,13 +275,14 @@ u_char nsctlerrmap[PRC_NCMDS] = { int idp_donosocks = 1; +void idp_ctlinput(cmd, arg) int cmd; caddr_t arg; { struct ns_addr *ns; struct nspcb *nsp; - struct ns_errp *errp; + struct ns_errp *errp = 0; int idp_abort(); extern struct nspcb *idp_drop(); int type; @@ -328,8 +335,9 @@ int idpforwarding = 1; struct route idp_droute; struct route idp_sroute; +static void idp_forward(m) -struct mbuf *m; + struct mbuf *m; { register struct idp *idp = mtod(m, struct idp *); register int error, type, code; @@ -447,6 +455,7 @@ cleanup: m_freem(mcopy); } +int idp_do_route(src, ro) struct ns_addr *src; struct route *ro; @@ -469,12 +478,14 @@ struct route *ro; return (1); } +static void idp_undo_route(ro) -register struct route *ro; + register struct route *ro; { if (ro->ro_rt) {RTFREE(ro->ro_rt);} } +void ns_watch_output(m, ifp) struct mbuf *m; struct ifnet *ifp; diff --git a/sys/netns/ns_output.c b/sys/netns/ns_output.c index 49ec4ccad8..af87b7c034 100644 --- a/sys/netns/ns_output.c +++ b/sys/netns/ns_output.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)ns_output.c 7.8 (Berkeley) 12/16/90 - * $Id$ + * $Id: ns_output.c,v 1.2 1993/10/16 19:54:26 rgrimes Exp $ */ #include "param.h" @@ -57,6 +57,7 @@ int ns_copy_output = 0; int ns_output_cnt = 0; struct mbuf *ns_lastout; +int ns_output(m0, ro, flags) struct mbuf *m0; struct route *ro; diff --git a/sys/netns/ns_pcb.c b/sys/netns/ns_pcb.c index ada26fd723..ca64e29e20 100644 --- a/sys/netns/ns_pcb.c +++ b/sys/netns/ns_pcb.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)ns_pcb.c 7.11 (Berkeley) 6/27/91 - * $Id: ns_pcb.c,v 1.2 1993/10/16 19:54:28 rgrimes Exp $ + * $Id: ns_pcb.c,v 1.3 1993/11/07 17:50:30 wollman Exp $ */ #include "param.h" @@ -52,7 +52,7 @@ struct ns_addr zerons_addr; struct nspcb nspcb; - +int ns_pcballoc(so, head) struct socket *so; struct nspcb *head; @@ -70,6 +70,7 @@ ns_pcballoc(so, head) return (0); } +int ns_pcbbind(nsp, nam) register struct nspcb *nsp; struct mbuf *nam; @@ -120,6 +121,7 @@ noname: * If don't have a local address for this socket yet, * then pick one. */ +int ns_pcbconnect(nsp, nam) struct nspcb *nsp; struct mbuf *nam; @@ -219,6 +221,7 @@ ns_pcbconnect(nsp, nam) return (0); } +void ns_pcbdisconnect(nsp) struct nspcb *nsp; { @@ -228,6 +231,7 @@ ns_pcbdisconnect(nsp) ns_pcbdetach(nsp); } +void ns_pcbdetach(nsp) struct nspcb *nsp; { @@ -241,6 +245,7 @@ ns_pcbdetach(nsp) (void) m_free(dtom(nsp)); } +void ns_setsockaddr(nsp, nam) register struct nspcb *nsp; struct mbuf *nam; @@ -255,6 +260,7 @@ ns_setsockaddr(nsp, nam) sns->sns_addr = nsp->nsp_laddr; } +void ns_setpeeraddr(nsp, nam) register struct nspcb *nsp; struct mbuf *nam; @@ -276,6 +282,7 @@ ns_setpeeraddr(nsp, nam) * Also pass an extra paramter via the nspcb. (which may in fact * be a parameter list!) */ +void ns_pcbnotify(dst, errno, notify, param) register struct ns_addr *dst; long param; @@ -326,6 +333,7 @@ struct nspcb * ns_pcblookup(faddr, lport, wildp) struct ns_addr *faddr; u_short lport; + int wildp; { register struct nspcb *nsp, *match = 0; int matchwild = 3, wildcard; diff --git a/sys/netns/ns_pcb.h b/sys/netns/ns_pcb.h index 1447d6ec07..c409d7e2f4 100644 --- a/sys/netns/ns_pcb.h +++ b/sys/netns/ns_pcb.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)ns_pcb.h 7.4 (Berkeley) 6/28/90 - * $Id: ns_pcb.h,v 1.2 1993/10/16 19:54:30 rgrimes Exp $ + * $Id: ns_pcb.h,v 1.3 1993/11/07 17:50:31 wollman Exp $ */ #ifndef _NETNS_NS_PCB_H_ @@ -81,5 +81,7 @@ struct nspcb { #ifdef KERNEL extern struct nspcb nspcb; /* head of list */ struct nspcb *ns_pcblookup(); +extern void ns_pcbdetach(struct nspcb *); + #endif #endif /* _NETNS_NS_PCB_H_ */ diff --git a/sys/netns/spp_debug.c b/sys/netns/spp_debug.c index 572915bc7a..6131af2c6d 100644 --- a/sys/netns/spp_debug.c +++ b/sys/netns/spp_debug.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)spp_debug.c 7.7 (Berkeley) 6/28/90 - * $Id: spp_debug.c,v 1.2 1993/10/16 19:54:35 rgrimes Exp $ + * $Id: spp_debug.c,v 1.3 1993/11/07 17:50:35 wollman Exp $ */ #include "param.h" @@ -65,6 +65,7 @@ int sppconsdebug = 0; /* * spp debug routines */ +void spp_trace(act, ostate, sp, si, req) short act; u_char ostate; diff --git a/sys/netns/spp_usrreq.c b/sys/netns/spp_usrreq.c index 7f9d3c68ff..24156548b3 100644 --- a/sys/netns/spp_usrreq.c +++ b/sys/netns/spp_usrreq.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)spp_usrreq.c 7.15 (Berkeley) 6/27/91 - * $Id: spp_usrreq.c,v 1.2 1993/10/16 19:54:39 rgrimes Exp $ + * $Id: spp_usrreq.c,v 1.3 1993/11/07 17:50:39 wollman Exp $ */ #include "param.h" @@ -58,12 +58,18 @@ #include "spp_var.h" #include "spp_debug.h" +static void spp_quench(struct nspcb *); +static void spp_abort(struct nspcb *); +static void spp_setpersist(struct sppcb *); +static void spp_template(struct sppcb *); + struct spp_istat spp_istat; u_short spp_iss; /* * SP protocol implementation. */ +void spp_init() { @@ -77,6 +83,7 @@ int spp_use_delack = 0; u_short spp_newchecks[50]; /*ARGSUSED*/ +void spp_input(m, nsp) register struct mbuf *m; register struct nspcb *nsp; @@ -84,7 +91,7 @@ spp_input(m, nsp) register struct sppcb *cb; register struct spidp *si = mtod(m, struct spidp *); register struct socket *so; - short ostate; + short ostate = 0; int dropsocket = 0; @@ -290,6 +297,7 @@ int spprexmtthresh = 3; * but its function is somewhat different: It merely queues * packets up, and suppresses duplicates. */ +int spp_reass(cb, si) register struct sppcb *cb; register struct spidp *si; @@ -578,15 +586,15 @@ present: return (0); } +void spp_ctlinput(cmd, arg) int cmd; caddr_t arg; { struct ns_addr *na; extern u_char nsctlerrmap[]; - extern spp_abort(), spp_quench(); extern struct nspcb *idp_drop(); - struct ns_errp *errp; + struct ns_errp *errp = 0; struct nspcb *nsp; struct sockaddr_ns *sns; int type; @@ -642,6 +650,7 @@ spp_ctlinput(cmd, arg) * When a source quench is received, close congestion window * to one packet. We will gradually open it again as we proceed. */ +static void spp_quench(nsp) struct nspcb *nsp; { @@ -700,6 +709,7 @@ register struct nspcb *nsp; } #endif +int spp_output(cb, m0) register struct sppcb *cb; struct mbuf *m0; @@ -1115,6 +1125,7 @@ send: int spp_do_persist_panics = 0; +static void spp_setpersist(cb) register struct sppcb *cb; { @@ -1132,10 +1143,13 @@ spp_setpersist(cb) if (cb->s_rxtshift < SPP_MAXRXTSHIFT) cb->s_rxtshift++; } + /*ARGSUSED*/ +int spp_ctloutput(req, so, level, name, value) int req; struct socket *so; + int level; int name; struct mbuf **value; { @@ -1258,13 +1272,14 @@ spp_ctloutput(req, so, level, name, value) } /*ARGSUSED*/ +int spp_usrreq(so, req, m, nam, controlp) struct socket *so; int req; struct mbuf *m, *nam, *controlp; { struct nspcb *nsp = sotonspcb(so); - register struct sppcb *cb; + register struct sppcb *cb = 0; int s = splnet(); int error = 0, ostate; struct mbuf *mm; @@ -1510,6 +1525,7 @@ release: return (error); } +int spp_usrreq_sp(so, req, m, nam, controlp) struct socket *so; int req; @@ -1531,6 +1547,7 @@ spp_usrreq_sp(so, req, m, nam, controlp) * in a skeletal spp header (choosing connection id), * minimizing the amount of work necessary when the connection is used. */ +static void spp_template(cb) register struct sppcb *cb; { @@ -1625,6 +1642,7 @@ spp_drop(cb, errno) return (spp_close(cb)); } +static void spp_abort(nsp) struct nspcb *nsp; { @@ -1637,6 +1655,7 @@ int spp_backoff[SPP_MAXRXTSHIFT+1] = /* * Fast timeout routine for processing delayed acks */ +void spp_fasttimo() { register struct nspcb *nsp; @@ -1661,6 +1680,7 @@ spp_fasttimo() * Updates the timers in all active pcb's and * causes finite state machine actions if timers expire. */ +void spp_slowtimo() { register struct nspcb *ip, *ipnxt; diff --git a/sys/netrmp/rmp.c b/sys/netrmp/rmp.c index 382f4c5700..7d74cee09c 100644 --- a/sys/netrmp/rmp.c +++ b/sys/netrmp/rmp.c @@ -38,7 +38,7 @@ * from: Utah $Hdr: rmp.c 1.3 89/06/07$ * * From: @(#)rmp.c 7.1 (Berkeley) 5/8/90 - * $Id$ + * $Id: rmp.c,v 1.1 1993/11/07 22:55:07 wollman Exp $ */ #include "param.h" @@ -57,9 +57,10 @@ ** rmp_output: route packet to proper network interface. */ +int rmp_output(m, so) -struct mbuf *m; -struct socket *so; + struct mbuf *m; + struct socket *so; { struct ifnet *ifp; struct rawcb *rp = sotorawcb(so); @@ -82,5 +83,6 @@ struct socket *so; /* * Send the packet. */ - return ((*ifp->if_output) (ifp, m, &rp->rcb_faddr)); + return (*ifp->if_output) (ifp, m, (struct sockaddr *)&rp->rcb_faddr, + (struct rtentry *)0); } diff --git a/sys/nfs/nfs_node.c b/sys/nfs/nfs_node.c index d46f7d0680..c83fab3d9e 100644 --- a/sys/nfs/nfs_node.c +++ b/sys/nfs/nfs_node.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * From: @(#)nfs_node.c 7.34 (Berkeley) 5/15/91 - * $Id$ + * $Id: nfs_node.c,v 1.2 1993/09/09 22:06:02 rgrimes Exp $ */ #include "param.h" @@ -249,6 +249,7 @@ nfs_reclaim(vp) * for doing it just in case it is needed. */ int donfslocking = 0; + /* * Lock an nfsnode */ @@ -259,7 +260,7 @@ nfs_lock(vp) register struct nfsnode *np = VTONFS(vp); if (!donfslocking) - return; + return 0; while (np->n_flag & NLOCKED) { np->n_flag |= NWANT; if (np->n_lockholder == curproc->p_pid) diff --git a/sys/nfs/nfs_serv.c b/sys/nfs/nfs_serv.c index 927960451c..79232e7fd0 100644 --- a/sys/nfs/nfs_serv.c +++ b/sys/nfs/nfs_serv.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * From: @(#)nfs_serv.c 7.40 (Berkeley) 5/15/91 - * $Id$ + * $Id: nfs_serv.c,v 1.3 1993/09/09 22:06:03 rgrimes Exp $ */ /* @@ -270,7 +270,7 @@ nfsrv_readlink(mrep, md, dpos, cred, xid, mrq, repstat, p) caddr_t bpos; int error = 0; char *cp2; - struct mbuf *mb, *mb2, *mp2, *mp3, *mreq; + struct mbuf *mb, *mb2, *mp2 = 0, *mp3 = 0, *mreq; struct vnode *vp; nfsv2fh_t nfh; fhandle_t *fhp; @@ -356,7 +356,7 @@ nfsrv_read(mrep, md, dpos, cred, xid, mrq, repstat, p) int error = 0; char *cp2; struct mbuf *mb, *mb2, *mreq; - struct mbuf *m2, *m3; + struct mbuf *m2 = 0, *m3; struct vnode *vp; nfsv2fh_t nfh; fhandle_t *fhp; @@ -781,7 +781,7 @@ nfsrv_rename(mrep, md, dpos, cred, xid, mrq, repstat, p) char *cp2; struct mbuf *mb, *mreq; struct nameidata fromnd, tond; - struct vnode *fvp, *tvp, *tdvp; + struct vnode *fvp = 0, *tvp, *tdvp; nfsv2fh_t fnfh, tnfh; fhandle_t *ffhp, *tfhp; long len, len2; @@ -1204,7 +1204,7 @@ nfsrv_readdir(mrep, md, dpos, cred, xid, mrq, repstat, p) struct proc *p; { register char *bp, *be; - register struct mbuf *mp; + register struct mbuf *mp = 0; register struct direct *dp; register caddr_t cp; register u_long *tl; @@ -1216,7 +1216,7 @@ nfsrv_readdir(mrep, md, dpos, cred, xid, mrq, repstat, p) char *cpos, *cend; int len, nlen, rem, xfer, tsiz, i; struct vnode *vp; - struct mbuf *mp2, *mp3; + struct mbuf *mp2 = 0, *mp3; nfsv2fh_t nfh; fhandle_t *fhp; struct uio io; diff --git a/sys/nfs/nfs_subs.c b/sys/nfs/nfs_subs.c index f566b57ea7..bb63d4ed9e 100644 --- a/sys/nfs/nfs_subs.c +++ b/sys/nfs/nfs_subs.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * From: @(#)nfs_subs.c 7.41 (Berkeley) 5/15/91 - * $Id: nfs_subs.c,v 1.2 1993/09/09 22:06:08 rgrimes Exp $ + * $Id: nfs_subs.c,v 1.3 1993/11/07 17:50:57 wollman Exp $ */ /* @@ -273,8 +273,8 @@ nfsm_uiotombuf(uiop, mq, siz, bpos) caddr_t *bpos; { register char *uiocp; - register struct mbuf *mp, *mp2; - register int xfer, left, len; + register struct mbuf *mp = 0, *mp2; + register int xfer, left, len = 0; int uiosiz, clflg, rem; char *cp; @@ -454,7 +454,7 @@ nfsm_strtmbuf(mb, bpos, cp, siz) char *cp; long siz; { - register struct mbuf *m1, *m2; + register struct mbuf *m1 = 0, *m2; long left, xfer, len, tlen; u_long *tl; int putsize; diff --git a/sys/nfs/nfs_vnops.c b/sys/nfs/nfs_vnops.c index b52aa5d4da..6b37bcb38f 100644 --- a/sys/nfs/nfs_vnops.c +++ b/sys/nfs/nfs_vnops.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * From: @(#)nfs_vnops.c 7.60 (Berkeley) 5/24/91 - * $Id: nfs_vnops.c,v 1.3 1993/10/20 07:31:12 davidg Exp $ + * $Id: nfs_vnops.c,v 1.4 1993/10/25 17:56:56 davidg Exp $ */ /* @@ -1258,11 +1258,11 @@ nfs_readdirrpc(vp, uiop, cred) struct ucred *cred; { register long len; - register struct direct *dp; + register struct direct *dp = 0; register u_long *tl; register caddr_t cp; register long t1; - long tlen, lastlen; + long tlen, lastlen = 0; caddr_t bpos, dpos, cp2; u_long xid; int error = 0; @@ -1271,8 +1271,8 @@ nfs_readdirrpc(vp, uiop, cred) caddr_t dpos2; int siz; int more_dirs = 1; - off_t off, savoff; - struct direct *savdp; + off_t off, savoff = 0; + struct direct *savdp = 0; struct nfsmount *nmp; struct nfsnode *np = VTONFS(vp); long tresid; @@ -1755,7 +1755,7 @@ nfs_advlock(vp, id, op, fl, flags) /* * Print out the contents of an nfsnode. */ -int +void nfs_print(vp) struct vnode *vp; { @@ -1774,5 +1774,4 @@ nfs_print(vp) if (np->n_lockwaiter) printf(" waiting pid %d", np->n_lockwaiter); printf("\n"); - return(0); } diff --git a/sys/nfs/nfsmount.h b/sys/nfs/nfsmount.h index fd7b33beaa..3efc894284 100644 --- a/sys/nfs/nfsmount.h +++ b/sys/nfs/nfsmount.h @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * From: @(#)nfsmount.h 7.7 (Berkeley) 4/16/91 - * $Id$ + * $Id: nfsmount.h,v 1.2 1993/09/09 22:06:23 rgrimes Exp $ */ #ifndef __h_nfsmount @@ -118,6 +118,6 @@ int nfs_fhtovp __P(( int nfs_vptofh __P(( struct vnode *vp, struct fid *fhp)); -int nfs_init __P(()); +void nfs_init __P(()); #endif /* __h_nfsmount */ diff --git a/sys/nfs/nfsnode.h b/sys/nfs/nfsnode.h index d0499d14b7..9e58000f23 100644 --- a/sys/nfs/nfsnode.h +++ b/sys/nfs/nfsnode.h @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * From: @(#)nfsnode.h 7.12 (Berkeley) 4/16/91 - * $Id: nfsnode.h,v 1.3 1993/10/20 07:31:16 davidg Exp $ + * $Id: nfsnode.h,v 1.4 1993/11/07 17:50:59 wollman Exp $ */ #ifndef __h_nfsnode @@ -215,7 +215,7 @@ int nfs_bmap __P(( daddr_t *bnp)); int nfs_strategy __P(( struct buf *bp)); -int nfs_print __P(( +void nfs_print __P(( struct vnode *vp)); int nfs_islocked __P(( struct vnode *vp)); diff --git a/sys/pcfs/denode.h b/sys/pcfs/denode.h index 750685f602..cee62d9359 100644 --- a/sys/pcfs/denode.h +++ b/sys/pcfs/denode.h @@ -15,7 +15,7 @@ * * October 1992 * - * $Id: denode.h,v 1.3 1993/11/07 17:51:13 wollman Exp $ + * $Id: denode.h,v 1.4 1993/11/17 23:26:16 wollman Exp $ */ #ifndef _PCFS_DENODE_H_ @@ -238,7 +238,7 @@ int pcfs_unlock __P((struct vnode *vp)); int pcfs_bmap __P((struct vnode *vp, daddr_t bn, struct vnode **vpp, daddr_t *bnp)); int pcfs_strategy __P((struct buf *bp)); -int pcfs_print __P((struct vnode *vp)); +void pcfs_print __P((struct vnode *vp)); int pcfs_islocked __P((struct vnode *vp)); int pcfs_advlock __P((struct vnode *vp, caddr_t id, int op, struct flock *fl, int flags)); diff --git a/sys/pcfs/pcfs_conv.c b/sys/pcfs/pcfs_conv.c index b78925cd99..8cf15e8338 100644 --- a/sys/pcfs/pcfs_conv.c +++ b/sys/pcfs/pcfs_conv.c @@ -15,7 +15,7 @@ * * October 1992 * - * $Id$ + * $Id: pcfs_conv.c,v 1.2 1993/10/16 19:29:31 rgrimes Exp $ */ /* @@ -283,7 +283,7 @@ unix2dosfn(un, dn, unlen) int unlen; { int i; - u_char c; + u_char c = 0; /* * Fill the dos filename string with blanks. diff --git a/sys/pcfs/pcfs_denode.c b/sys/pcfs/pcfs_denode.c index 5546d38225..9d799e56a6 100644 --- a/sys/pcfs/pcfs_denode.c +++ b/sys/pcfs/pcfs_denode.c @@ -15,7 +15,7 @@ * * October 1992 * - * $Id: pcfs_denode.c,v 1.2 1993/10/16 19:29:32 rgrimes Exp $ + * $Id: pcfs_denode.c,v 1.3 1993/11/07 21:48:09 wollman Exp $ */ #include "param.h" @@ -44,7 +44,8 @@ union dehead { struct denode *deh_chain[2]; } dehead[DEHSZ]; -pcfs_init() +void +pcfs_init(void) { int i; union dehead *deh; @@ -468,6 +469,7 @@ printf("detrunc(): fatentry errors %d\n", error); * the file it represents has been moved to a new * directory. */ +void reinsert(dep) struct denode *dep; { diff --git a/sys/pcfs/pcfs_fat.c b/sys/pcfs/pcfs_fat.c index eea358fc1f..43931ba500 100644 --- a/sys/pcfs/pcfs_fat.c +++ b/sys/pcfs/pcfs_fat.c @@ -15,7 +15,7 @@ * * October 1992 * - * $Id$ + * $Id: pcfs_fat.c,v 1.2 1993/10/16 19:29:34 rgrimes Exp $ */ /* @@ -39,6 +39,8 @@ #include "denode.h" #include "fat.h" +static void fc_lookup(struct denode *, u_long, u_long *, u_long *); + /* * Fat cache stats. */ @@ -106,7 +108,7 @@ pcbmap(dep, findcn, bnp, cnp) int error; u_long i; u_long cn; - u_long prevcn; + u_long prevcn = 0; u_long byteoffset; u_long bn; u_long bo; @@ -224,6 +226,7 @@ hiteof:; * Find the closest entry in the fat cache to the * cluster we are looking for. */ +static void fc_lookup(dep, findcn, frcnp, fsrcnp) struct denode *dep; u_long findcn; @@ -251,6 +254,7 @@ fc_lookup(dep, findcn, frcnp, fsrcnp) * Purge the fat cache in denode dep of all entries * relating to file relative cluster frcn and beyond. */ +void fc_purge(dep, frcn) struct denode *dep; u_int frcn; diff --git a/sys/pcfs/pcfs_lookup.c b/sys/pcfs/pcfs_lookup.c index 2eb0bc6351..72d2625690 100644 --- a/sys/pcfs/pcfs_lookup.c +++ b/sys/pcfs/pcfs_lookup.c @@ -15,7 +15,7 @@ * * October 1992 * - * $Id: pcfs_lookup.c,v 1.4 1993/10/17 01:48:37 rgrimes Exp $ + * $Id: pcfs_lookup.c,v 1.5 1993/11/17 23:26:17 wollman Exp $ */ #include "param.h" @@ -63,8 +63,8 @@ pcfs_lookup(vdp, ndp, p) int slotstatus; #define NONE 0 #define FOUND 1 - int slotoffset; - int slotcluster; + int slotoffset = 0; + int slotcluster = 0; int frcn; u_long cluster; int rootreloff; @@ -76,7 +76,7 @@ pcfs_lookup(vdp, ndp, p) struct denode *tdp; struct pcfsmount *pmp; struct buf *bp = 0; - struct direntry *dep; + struct direntry *dep = 0; u_char dosfilename[12]; #if defined(PCFSDEBUG) @@ -165,7 +165,7 @@ printf("pcfs_lookup(): cache hit, vnode %08x, file %s\n", vdp, dp->de_Name); #if defined(PCFSDEBUG) printf("pcfs_lookup(): looking for . or .. in root directory\n"); #endif /* defined(PCFSDEBUG) */ - cluster == PCFSROOT; + cluster = PCFSROOT; diroff = PCFSROOT_OFS; goto foundroot; } diff --git a/sys/pcfs/pcfs_vfsops.c b/sys/pcfs/pcfs_vfsops.c index a71deaca8b..028c75bcbe 100644 --- a/sys/pcfs/pcfs_vfsops.c +++ b/sys/pcfs/pcfs_vfsops.c @@ -15,7 +15,7 @@ * * October 1992 * - * $Id$ + * $Id: pcfs_vfsops.c,v 1.3 1993/10/16 19:29:37 rgrimes Exp $ */ #include "param.h" @@ -57,7 +57,7 @@ pcfs_mount(mp, path, data, ndp, p) { struct vnode *devvp; /* vnode for blk device to mount */ struct pcfs_args args; /* will hold data from mount request */ - struct pcfsmount *pmp; /* pcfs specific mount control block */ + struct pcfsmount *pmp = 0; /* pcfs specific mount control block */ int error; u_int size; @@ -488,10 +488,7 @@ pcfs_quotactl(mp, cmds, uid, arg, p) caddr_t arg; struct proc *p; { -#if defined(QUOTA) -#else return EOPNOTSUPP; -#endif /* defined(QUOTA) */ } int diff --git a/sys/pcfs/pcfs_vnops.c b/sys/pcfs/pcfs_vnops.c index b508ec2903..7cd5934a68 100644 --- a/sys/pcfs/pcfs_vnops.c +++ b/sys/pcfs/pcfs_vnops.c @@ -15,7 +15,7 @@ * * October 1992 * - * $Id$ + * $Id: pcfs_vnops.c,v 1.2 1993/10/16 19:29:39 rgrimes Exp $ */ #include "param.h" @@ -585,6 +585,7 @@ pcfs_ioctl(vp, com, data, fflag, cred, p) struct vnode *vp; int com; caddr_t data; + int fflag; struct ucred *cred; struct proc *p; { @@ -970,7 +971,7 @@ printf("pcfs_rename(fndp %08x, tndp %08x, p %08x\n", fndp, tndp, p); * tdep is unlocked and unreferenced */ } else { - u_long dirsize; + u_long dirsize = 0; /* * If the source and destination are in different * directories, then mark the entry in the source @@ -1591,7 +1592,7 @@ pcfs_strategy(bp) return 0; } -int +void pcfs_print(vp) struct vnode *vp; { diff --git a/sys/pcfs/pcfsmount.h b/sys/pcfs/pcfsmount.h index a63962f1c5..c771d063be 100644 --- a/sys/pcfs/pcfsmount.h +++ b/sys/pcfs/pcfsmount.h @@ -15,7 +15,7 @@ * * October 1992 * - * $Id: pcfsmount.h,v 1.2 1993/10/16 19:29:41 rgrimes Exp $ + * $Id: pcfsmount.h,v 1.3 1993/11/07 17:51:17 wollman Exp $ */ #ifndef _PCFS_PCFSMOUNT_H_ @@ -142,5 +142,5 @@ int pcfs_statfs __P((struct mount *mp, struct statfs *sbp, struct proc *p)); int pcfs_sync __P((struct mount *mp, int waitfor)); int pcfs_fhtovp __P((struct mount *mp, struct fid *fhp, struct vnode **vpp)); int pcfs_vptofh __P((struct vnode *vp, struct fid *fhp)); -int pcfs_init __P(()); +void pcfs_init __P((void)); #endif /* _PCFS_PCFSMOUNT_H_ */ diff --git a/sys/scsi/cd.c b/sys/scsi/cd.c index 68b09ba716..46e9e3ba21 100644 --- a/sys/scsi/cd.c +++ b/sys/scsi/cd.c @@ -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]; diff --git a/sys/scsi/ch.c b/sys/scsi/ch.c index c403fe5971..fd7b1eb55a 100644 --- a/sys/scsi/ch.c +++ b/sys/scsi/ch.c @@ -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 @@ -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; { diff --git a/sys/scsi/scsi_ioctl.c b/sys/scsi/scsi_ioctl.c index c1b576ded9..0e50b49a22 100644 --- a/sys/scsi/scsi_ioctl.c +++ b/sys/scsi/scsi_ioctl.c @@ -20,6 +20,7 @@ #include #include +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; diff --git a/sys/scsi/sd.c b/sys/scsi/sd.c index b3320aa399..660d194efd 100644 --- a/sys/scsi/sd.c +++ b/sys/scsi/sd.c @@ -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 @@ done: */ bp->b_resid = bp->b_bcount; biodone(bp); - return 0; + return /*0*/; } /* diff --git a/sys/scsi/uk.c b/sys/scsi/uk.c index 5c48d0149a..b503593b11 100644 --- a/sys/scsi/uk.c +++ b/sys/scsi/uk.c @@ -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; diff --git a/sys/sys/buf.h b/sys/sys/buf.h index 60316832e0..1c2b16a36a 100644 --- a/sys/sys/buf.h +++ b/sys/sys/buf.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)buf.h 7.11 (Berkeley) 5/9/90 - * $Id: buf.h,v 1.3 1993/11/07 17:52:21 wollman Exp $ + * $Id: buf.h,v 1.4 1993/11/18 05:03:22 rgrimes Exp $ */ #ifndef _SYS_BUF_H_ @@ -67,6 +67,12 @@ struct bufhd long b_flags; /* see defines below */ struct buf *b_forw, *b_back; /* fwd/bkwd pointer in chain */ }; + +#ifdef __STDC__ +struct buf; +#endif +typedef void b_iodone_t __P((struct buf *)); + struct buf { long b_flags; /* too much goes here to describe */ @@ -94,7 +100,7 @@ struct buf long b_resid; /* words not transferred after error */ #define b_errcnt b_resid /* while i/o in progress: # retries */ struct proc *b_proc; /* proc doing physical or swap I/O */ - int (*b_iodone)(); /* function called by iodone */ + b_iodone_t *b_iodone; /* function called by iodone */ struct vnode *b_vp; /* vnode for dev */ int b_pfcent; /* center page when swapping cluster */ struct ucred *b_rcred; /* ref to read credentials */ @@ -136,7 +142,7 @@ extern struct buf bfreelist[BQUEUES]; /* heads of available lists */ extern struct buf bswlist; /* head of free swap header list */ extern struct buf *bclnlist; /* head of cleaned page list */ -void bufinit(); +void bufinit(void); int bread(struct vnode *, daddr_t, int, struct ucred *, struct buf **); int breada(struct vnode *, daddr_t, int, daddr_t, int, struct ucred *, struct buf **); @@ -148,10 +154,16 @@ struct buf *incore(struct vnode *, daddr_t); struct buf *getblk(struct vnode *, daddr_t, int); struct buf *geteblk(int); int biowait(struct buf *); -int biodone(struct buf *); +void biodone(struct buf *); void allocbuf(struct buf *, int); -#endif +extern void vwakeup(struct buf *); +extern void bgetvp(struct vnode *, struct buf *); +extern void brelvp(struct buf *); +extern void reassignbuf(struct buf *, struct vnode *); +extern void bufstats(void); + +#endif /* KERNEL */ /* * These flags are kept in b_flags. diff --git a/sys/sys/callout.h b/sys/sys/callout.h index 0db2bb6646..49ad4ac26b 100644 --- a/sys/sys/callout.h +++ b/sys/sys/callout.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)callout.h 7.2 (Berkeley) 2/15/91 - * $Id: callout.h,v 1.2 1993/10/16 17:16:23 rgrimes Exp $ + * $Id: callout.h,v 1.3 1993/11/07 17:52:22 wollman Exp $ */ #ifndef _SYS_CALLOUT_H_ @@ -40,7 +40,7 @@ struct callout { struct callout *c_next; /* next callout in queue */ caddr_t c_arg; /* function argument */ - int (*c_func)(); /* function to call */ + void (*c_func)(caddr_t, int); /* function to call */ int c_time; /* ticks to the event */ }; diff --git a/sys/sys/conf.h b/sys/sys/conf.h index bfce9e83c1..d4afff5a20 100644 --- a/sys/sys/conf.h +++ b/sys/sys/conf.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)conf.h 7.9 (Berkeley) 5/5/91 - * $Id: conf.h,v 1.2 1993/10/16 17:16:30 rgrimes Exp $ + * $Id: conf.h,v 1.3 1993/11/07 17:52:26 wollman Exp $ */ #ifndef _SYS_CONF_H_ @@ -42,19 +42,24 @@ */ #ifdef __STDC__ -struct tty; +struct tty; struct buf; +struct uio; #endif +typedef int d_open_t __P((int /*dev_t*/, int, int, struct proc *)); +typedef int d_close_t __P((int /*dev_t*/, int, int, struct proc *)); +typedef void d_strategy_t __P((struct buf *)); +typedef int d_ioctl_t __P((int /*dev_t*/, int, caddr_t, int, struct proc *)); +typedef int d_dump_t __P((int /*dev_t*/)); +typedef int d_psize_t __P((int /*dev_t*/)); + struct bdevsw { - int (*d_open) __P((dev_t dev, int oflags, int devtype, - struct proc *p)); - int (*d_close) __P((dev_t dev, int fflag, int devtype, - struct proc *)); - int (*d_strategy) __P((struct buf *bp)); - int (*d_ioctl) __P((dev_t dev, int cmd, caddr_t data, - int fflag, struct proc *p)); - int (*d_dump) __P((dev_t dev)); - int (*d_psize) __P((dev_t dev)); + d_open_t *d_open; + d_close_t *d_close; + d_strategy_t *d_strategy; + d_ioctl_t *d_ioctl; + d_dump_t *d_dump; + d_psize_t *d_psize; int d_flags; }; @@ -62,42 +67,45 @@ struct bdevsw { extern struct bdevsw bdevsw[]; #endif +typedef int d_rdwr_t __P((int /*dev_t*/, struct uio *, int)); +typedef int d_stop_t __P((struct tty *, int)); +typedef int d_reset_t __P((int)); +typedef int d_select_t __P((int /*dev_t*/, int, struct proc *)); +typedef int d_mmap_t __P((/* XXX */)); + struct cdevsw { - int (*d_open) __P((dev_t dev, int oflags, int devtype, - struct proc *p)); - int (*d_close) __P((dev_t dev, int fflag, int devtype, - struct proc *)); - int (*d_read) __P((dev_t dev, struct uio *uio, int ioflag)); - int (*d_write) __P((dev_t dev, struct uio *uio, int ioflag)); - int (*d_ioctl) __P((dev_t dev, int cmd, caddr_t data, - int fflag, struct proc *p)); - int (*d_stop) __P((struct tty *tp, int rw)); - int (*d_reset) __P((int uban)); /* XXX */ + d_open_t *d_open; + d_close_t *d_close; + d_rdwr_t *d_read; + d_rdwr_t *d_write; + d_ioctl_t *d_ioctl; + d_stop_t *d_stop; + d_reset_t *d_reset; struct tty *d_ttys; - int (*d_select) __P((dev_t dev, int which, struct proc *p)); - int (*d_mmap) __P(()); - int (*d_strategy) __P((struct buf *bp)); + d_select_t *d_select; + d_mmap_t *d_mmap; + d_strategy_t *d_strategy; }; #ifdef KERNEL extern struct cdevsw cdevsw[]; /* symbolic sleep message strings */ -extern char devopn[], devio[], devwait[], devin[], devout[]; -extern char devioc[], devcls[]; +extern const char devopn[], devio[], devwait[], devin[], devout[]; +extern const char devioc[], devcls[]; #endif struct linesw { - int (*l_open)(); - int (*l_close)(); - int (*l_read)(); - int (*l_write)(); - int (*l_ioctl)(); - int (*l_rint)(); - int (*l_rend)(); - int (*l_meta)(); - int (*l_start)(); - int (*l_modem)(); + int (*l_open)(int /*dev_t*/, struct tty *, int); + void (*l_close)(struct tty *, int); + int (*l_read)(struct tty *, struct uio *, int); + int (*l_write)(struct tty *, struct uio *, int); + int (*l_ioctl)(struct tty *, int, caddr_t, int); + void (*l_rint)(int, struct tty *); + int (*l_rend)(); /* XXX - to be deleted */ + int (*l_meta)(); /* XXX - to be deleted */ + void (*l_start)(struct tty *); + int (*l_modem)(struct tty *, int); }; #ifdef KERNEL diff --git a/sys/sys/disklabel.h b/sys/sys/disklabel.h index fc048b6bc0..a25fb5327c 100644 --- a/sys/sys/disklabel.h +++ b/sys/sys/disklabel.h @@ -31,12 +31,18 @@ * SUCH DAMAGE. * * from: @(#)disklabel.h 7.19 (Berkeley) 5/7/91 - * $Id: disklabel.h,v 1.2 1993/10/16 17:16:33 rgrimes Exp $ + * $Id: disklabel.h,v 1.3 1993/11/07 17:52:27 wollman Exp $ */ #ifndef _SYS_DISKLABEL_H_ #define _SYS_DISKLABEL_H_ 1 +#ifndef KERNEL +#include +#else +#include "conf.h" +#endif + /* * Disk description table, see disktab(5) */ @@ -311,7 +317,9 @@ struct dos_partition { unsigned char dp_ecyl; /* end cylinder */ unsigned long dp_start; /* absolute starting sector number */ unsigned long dp_size; /* partition size in sectors */ -} dos_partitions[NDOSPART]; +}; + +extern struct dos_partition dos_partitions[NDOSPART]; #define DPSECT(s) ((s) & 0x3f) /* isolate relevant bits of sector */ #define DPCYL(c, s) ((c) + (((s) & 0xc0)<<2)) /* and those that are cylinder */ @@ -336,21 +344,18 @@ struct dos_partition { #define DIOCSBAD _IOW('d', 110, struct dkbad) /* set kernel dkbad */ #if defined(KERNEL) - - void diskerr(struct buf *, char *, char *, int, int, struct disklabel *); - int dkcksum(struct disklabel *); int setdisklabel(struct disklabel *, struct disklabel *, u_long, struct dos_partition *); -char *readdisklabel(int, int (*)(), struct disklabel *, +char *readdisklabel(int, d_strategy_t *, struct disklabel *, struct dos_partition *, struct dkbad *, struct buf **); void disksort(struct buf *, struct buf *); -int writedisklabel(int, int (*)(), struct disklabel *, +int writedisklabel(int, d_strategy_t *, struct disklabel *, struct dos_partition *); int bounds_check_with_label(struct buf *, struct disklabel *, int); diff --git a/sys/sys/fifo.h b/sys/sys/fifo.h index 92a4791959..810bc23b3f 100644 --- a/sys/sys/fifo.h +++ b/sys/sys/fifo.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)fifo.h 7.1 (Berkeley) 4/15/91 - * $Id: fifo.h,v 1.2 1993/10/16 17:16:45 rgrimes Exp $ + * $Id: fifo.h,v 1.3 1993/11/07 17:52:34 wollman Exp $ */ #ifndef _SYS_FIFO_H_ @@ -171,7 +171,7 @@ int fifo_bmap __P(( daddr_t *bnp)); #define fifo_strategy ((int (*) __P(( \ struct buf *bp))) fifo_badop) -int fifo_print __P(( +void fifo_print __P(( struct vnode *vp)); #define fifo_islocked ((int (*) __P(( \ struct vnode *vp))) nullop) @@ -181,5 +181,8 @@ int fifo_advlock __P(( int op, struct flock *fl, int flags)); + +void fifo_printinfo(struct vnode *); + #endif /* FIFO */ #endif /* _SYS_FIFO_H_ */ diff --git a/sys/sys/kernel.h b/sys/sys/kernel.h index 8cd0063091..598b7899ec 100644 --- a/sys/sys/kernel.h +++ b/sys/sys/kernel.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)kernel.h 7.4 (Berkeley) 2/15/91 - * $Id: kernel.h,v 1.3 1993/10/24 06:23:11 paul Exp $ + * $Id: kernel.h,v 1.4 1993/11/07 17:52:39 wollman Exp $ */ #ifndef _SYS_KERNEL_H_ @@ -56,7 +56,6 @@ extern int hz; /* clock frequency */ extern int phz; /* alternate clock's frequency */ extern int tick; /* usec per clock tick */ extern int lbolt; /* once a second sleep address */ -int realitexpire(); /* XXX why is this here? */ extern fixpt_t averunnable[3]; #if defined(COMPAT_43) && (defined(vax) || defined(tahoe)) diff --git a/sys/sys/mbuf.h b/sys/sys/mbuf.h index 44ea417ab8..fd8d1e448a 100644 --- a/sys/sys/mbuf.h +++ b/sys/sys/mbuf.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)mbuf.h 7.14 (Berkeley) 12/5/90 - * $Id: mbuf.h,v 1.3 1993/11/07 17:52:48 wollman Exp $ + * $Id: mbuf.h,v 1.4 1993/11/17 20:24:25 wollman Exp $ */ #ifndef _SYS_MBUF_H_ @@ -346,6 +346,8 @@ struct mbstat { }; #ifdef KERNEL +void m_copyback(struct mbuf *, int, int, caddr_t); + extern struct mbuf *mbutl; /* virtual address of mclusters */ extern char *mclrefcnt; /* cluster reference counts */ extern struct mbstat mbstat; diff --git a/sys/sys/mount.h b/sys/sys/mount.h index ecff1783e1..7bb0f61449 100644 --- a/sys/sys/mount.h +++ b/sys/sys/mount.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)mount.h 7.22 (Berkeley) 6/3/91 - * $Id: mount.h,v 1.6 1993/11/07 17:52:51 wollman Exp $ + * $Id: mount.h,v 1.7 1993/11/12 10:14:37 chmr Exp $ */ #ifndef _SYS_MOUNT_H_ @@ -169,7 +169,7 @@ struct vfsops { int (*vfs_fhtovp) __P((struct mount *mp, struct fid *fhp, struct vnode **vpp)); int (*vfs_vptofh) __P((struct vnode *vp, struct fid *fhp)); - int (*vfs_init) __P(()); + void (*vfs_init) __P((void)); }; #define VFS_MOUNT(MP, PATH, DATA, NDP, P) \ @@ -292,6 +292,11 @@ struct mount *getvfs __P((fsid_t *fsid)); /* return vfs given fsid */ extern struct mount *rootfs; /* ptr to root mount structure */ extern struct vfsops *vfssw[]; /* mount filesystem type table */ +extern int vfs_busy(struct mount *); +extern void vfs_unbusy(struct mount *); +extern void mntflushbuf(struct mount *, int); +extern int vflush(struct mount *, struct vnode *, int); + #else /* KERNEL */ #include diff --git a/sys/sys/proc.h b/sys/sys/proc.h index 9f5740b278..1a277d8d34 100644 --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)proc.h 7.28 (Berkeley) 5/30/91 - * $Id: proc.h,v 1.2 1993/10/16 17:17:20 rgrimes Exp $ + * $Id: proc.h,v 1.3 1993/11/07 17:52:55 wollman Exp $ */ #ifndef _PROC_H_ @@ -138,8 +138,8 @@ struct proc { char p_comm[MAXCOMLEN+1]; /* end area that is copied on creation */ -#define p_endcopy p_wmesg - char *p_wmesg; /* reason for sleep */ +#define p_endcopy p_wmesg + const char *p_wmesg; /* reason for sleep */ int p_thread; /* id for this "thread" (Mach glue) XXX */ struct user *p_addr; /* kernel virtual addr of u-area (PROC ONLY) */ swblk_t p_swaddr; /* disk address of u area when swapped */ @@ -228,9 +228,7 @@ struct pcred { extern int pidhashmask; /* in param.c */ extern struct proc *pidhash[]; /* in param.c */ -struct proc *pfind(); /* find process by id */ extern struct pgrp *pgrphash[]; /* in param.c */ -struct pgrp *pgfind(); /* find process group by id */ struct proc *zombproc, *allproc; /* lists of procs in various states */ extern struct proc proc0; /* process slot for swapper */ extern struct proc *initproc, *pageproc; /* process slots for init, pager */ @@ -244,6 +242,12 @@ struct prochd { } qs[NQS]; extern int whichqs; /* bit mask summarizing non-empty qs's */ + +extern struct pgrp *pgfind(); /* find process group by id */ +extern struct proc *pfind(); /* find process by id */ + +void fixjobc(struct proc *, struct pgrp *, int); + #endif /* KERNEL */ #endif /* !_PROC_H_ */ diff --git a/sys/sys/rlist.h b/sys/sys/rlist.h index 77956723be..f241f0fd3a 100644 --- a/sys/sys/rlist.h +++ b/sys/sys/rlist.h @@ -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 */ diff --git a/sys/sys/socketvar.h b/sys/sys/socketvar.h index 4f71cf0cd8..90f7a92a7a 100644 --- a/sys/sys/socketvar.h +++ b/sys/sys/socketvar.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)socketvar.h 7.17 (Berkeley) 5/5/91 - * $Id: socketvar.h,v 1.2 1993/10/16 17:17:45 rgrimes Exp $ + * $Id: socketvar.h,v 1.3 1993/11/07 17:53:03 wollman Exp $ */ #ifndef _SYS_SOCKETVAR_H_ @@ -190,7 +190,7 @@ extern u_long sb_max; struct socket *sonewconn1 __P((struct socket *head, int connstatus)); /* strings for sleep message: */ -extern char netio[], netcon[], netcls[]; +extern const char netio[], netcon[], netcls[]; /* * File operations on sockets. @@ -200,5 +200,54 @@ int soo_write __P((struct file *fp, struct uio *uio, struct ucred *cred)); int soo_ioctl __P((struct file *fp, int com, caddr_t data, struct proc *p)); int soo_select __P((struct file *fp, int which, struct proc *p)); int soo_close __P((struct file *fp, struct proc *p)); -#endif + +/* From uipc_socket.c: */ +struct sockaddr; +struct mbuf; + +extern int socreate(int, struct socket **, int, int); /* XXX */ +extern int sobind(struct socket *, struct mbuf *); +extern int solisten(struct socket *, int); +extern void sofree(struct socket *); +extern int soclose(struct socket *); +extern int soabort(struct socket *); +extern int soaccept(struct socket *, struct mbuf *); +extern int soconnect(struct socket *, struct mbuf *); +extern int soconnect2(struct socket *, struct socket *); +extern int sodisconnect(struct socket *); +extern int sosend(struct socket *, struct mbuf *, struct uio *, struct mbuf *, struct mbuf *, int); /* XXX */ +extern int soreceive(struct socket *, struct mbuf **, struct uio *, struct mbuf **, struct mbuf **, int *); /* XXX */ +extern int soshutdown(struct socket *, int); +extern void sorflush(struct socket *); +extern int sosetopt(struct socket *, int, int, struct mbuf *); +extern int sogetopt(struct socket *, int, int, struct mbuf **); +extern void sohasoutofband(struct socket *); + +/* From uipc_socket2.c: */ +extern void soisconnecting(struct socket *); +extern void soisconnected(struct socket *); +extern void soisdisconnecting(struct socket *); +extern void soisdisconnected(struct socket *); +extern void soqinsque(struct socket *, struct socket *, int); +extern int soqremque(struct socket *, int); +extern void socantsendmore(struct socket *); +extern void socantrcvmore(struct socket *); +extern void sbselqueue(struct sockbuf *, struct proc *); +extern int sbwait(struct sockbuf *); +extern int sb_lock(struct sockbuf *); +extern void sowakeup(struct socket *, struct sockbuf *); +extern int soreserve(struct socket *, u_long, u_long); +extern int sbreserve(struct sockbuf *, u_long); +extern void sbrelease(struct sockbuf *); +extern void sbappend(struct sockbuf *, struct mbuf *); +extern void sbappendrecord(struct sockbuf *, struct mbuf *); +extern void sbinsertoob(struct sockbuf *, struct mbuf *); +extern int sbappendaddr(struct sockbuf *, struct sockaddr *, struct mbuf *, struct mbuf *); +extern int sbappendcontrol(struct sockbuf *, struct mbuf *, struct mbuf *); +extern void sbcompress(struct sockbuf *, struct mbuf *, struct mbuf *); +extern void sbflush(struct sockbuf *); +extern void sbdrop(struct sockbuf *, int); +extern void sbdroprecord(struct sockbuf *); + +#endif /* KERNEL */ #endif /* _SYS_SOCKETVAR_H_ */ diff --git a/sys/sys/specdev.h b/sys/sys/specdev.h index 8997378214..19b8b4408f 100644 --- a/sys/sys/specdev.h +++ b/sys/sys/specdev.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)specdev.h 7.4 (Berkeley) 4/19/91 - * $Id: specdev.h,v 1.2 1993/10/16 17:17:47 rgrimes Exp $ + * $Id: specdev.h,v 1.3 1993/11/07 17:53:04 wollman Exp $ */ #ifndef _SYS_SPECDEV_H_ @@ -212,7 +212,7 @@ int spec_bmap __P(( daddr_t *bnp)); int spec_strategy __P(( struct buf *bp)); -int spec_print __P(( +void spec_print __P(( struct vnode *vp)); #define spec_islocked ((int (*) __P(( \ struct vnode *vp))) nullop) diff --git a/sys/sys/systm.h b/sys/sys/systm.h index 85d5e9fac7..5ab4e8ebc7 100644 --- a/sys/sys/systm.h +++ b/sys/sys/systm.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)systm.h 7.17 (Berkeley) 5/25/91 - * $Id$ + * $Id: systm.h,v 1.7 1993/10/08 20:59:39 rgrimes Exp $ */ #ifndef _SYS_SYSTM_H_ @@ -97,8 +97,8 @@ int enxio __P((void)); int eopnotsupp __P((void)); int selscan __P((struct proc *p, fd_set *ibits, fd_set *obits, int nfd, int *retval)); -int seltrue __P((dev_t dev, int which, struct proc *p)); -void selwakeup __P((pid_t pid, int coll)); +int seltrue __P((int /*dev_t*/ dev, int which, struct proc *p)); +void selwakeup __P((int /*pid_t*/ pid, int coll)); __dead void panic __P((const char *)); void tablefull __P((char *)); @@ -111,8 +111,10 @@ void ttyprintf __P((struct tty *, const char *, ...)); void bcopy __P((void *from, void *to, u_int len)); void ovbcopy __P((void *from, void *to, u_int len)); void bzero __P((void *buf, u_int len)); -static int bcmp __P((void *str1, void *str2, u_int len)); -static size_t strlen __P((const char *string)); +#ifndef __GNUC__ +int bcmp __P((void *str1, void *str2, u_int len)); +#endif +size_t strlen __P((const char *string)); int copystr __P((void *kfaddr, void *kdaddr, u_int len, u_int *done)); int copyinstr __P((void *udaddr, void *kaddr, u_int len, u_int *done)); @@ -134,47 +136,31 @@ int suiword __P((void *base, int word)); int scanc __P((unsigned size, u_char *cp, u_char *table, int mask)); int skpc __P((int mask, int size, char *cp)); int locc __P((int mask, char *cp, unsigned size)); -static int ffs __P((long value)); +int ffs __P((long value)); /* * XXX - a lot were missing. A lot are still missing. Some of the above * are inconsistent with ANSI C. I fixed strlen. Others are inconsistent * with with non-ANSI C due to having unpromoted args. */ -#define nonint int /* really void */ struct proc; -struct ringb; -struct speedtab; -typedef nonint (*timeout_func_t) __P((caddr_t arg, int ticks)); +typedef void (*timeout_func_t) __P((caddr_t arg, int ticks)); -nonint DELAY __P((int count)); -int getc __P((struct ringb *rbp)); +void DELAY __P((int count)); void psignal __P((struct proc *p, int sig)); -size_t rb_write __P((struct ringb *to, char *buf, size_t nfrom)); void spinwait __P((int millisecs)); int splhigh __P((void)); int spltty __P((void)); int splx __P((int new_pri)); -#ifdef notyet -nonint timeout __P((timeout_func_t func, caddr_t arg, int t)); -#endif +void timeout __P((timeout_func_t func, caddr_t arg, int t)); void trapsignal __P((struct proc *p, int sig, unsigned code)); -int ttioctl __P((struct tty *tp, int com, caddr_t data, int flag)); -nonint ttsetwater __P((struct tty *tp)); -nonint ttstart __P((struct tty *tp)); -nonint ttychars __P((struct tty *tp)); -int ttyclose __P((struct tty *tp)); -nonint ttyinput __P((int c, struct tty *tp)); -int ttysleep __P((struct tty *tp, caddr_t chan, int pri, - char *wmesg, int timo)); -int ttspeedtab __P((int speed, struct speedtab *table)); -nonint ttwakeup __P((struct tty *tp)); -#ifdef notyet -nonint wakeup __P((caddr_t chan)); -#endif - -#undef nonint +void wakeup __P((caddr_t chan)); +int tsleep(caddr_t, int, const char *, int); +void unsleep(struct proc *); +void wakeup(caddr_t); +void setrun(struct proc *); /* xxx move to proc.h */ +void setpri(struct proc *); /* xxx move to proc.h */ /* * Machine-dependent function declarations. diff --git a/sys/sys/time.h b/sys/sys/time.h index 217c063c93..d01f7772d7 100644 --- a/sys/sys/time.h +++ b/sys/sys/time.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)time.h 7.6 (Berkeley) 2/22/91 - * $Id$ + * $Id: time.h,v 1.2 1993/10/16 17:17:59 rgrimes Exp $ */ #ifndef _SYS_TIME_H_ @@ -82,7 +82,13 @@ struct itimerval { struct timeval it_value; /* current value */ }; -#ifndef KERNEL +#ifdef KERNEL +extern void timevaladd(struct timeval *, struct timeval *); +extern void timevalsub(struct timeval *, struct timeval *); +extern void timevalfix(struct timeval *); +extern void realitexpire(caddr_t, int); + +#else /* not KERNEL */ #include #ifndef _POSIX_SOURCE diff --git a/sys/sys/tty.h b/sys/sys/tty.h index 15a461e68f..ea9f65dfb7 100644 --- a/sys/sys/tty.h +++ b/sys/sys/tty.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)tty.h 7.10 (Berkeley) 6/26/91 - * $Id: tty.h,v 1.4 1993/10/16 17:18:06 rgrimes Exp $ + * $Id: tty.h,v 1.5 1993/11/14 23:29:50 ache Exp $ */ #ifndef _SYS_TTY_H_ @@ -81,8 +81,8 @@ struct ringb { * (low, high, timeout). */ struct tty { - int (*t_oproc)(); /* device */ - int (*t_param)(); /* device */ + void (*t_oproc)(struct tty *); /* device */ + int (*t_param)(struct tty *, struct termios *); /* device */ pid_t t_rsel; /* tty */ pid_t t_wsel; caddr_t T_LINEP; /* XXX */ @@ -204,7 +204,51 @@ struct speedtab { #ifdef KERNEL /* symbolic sleep message strings */ -extern char ttyin[], ttyout[], ttopen[], ttclos[], ttybg[], ttybuf[]; -#endif +extern const char ttyin[], ttyout[], ttopen[], ttclos[], ttybg[], ttybuf[]; + +struct uio; + +/* From tty.c: */ +extern void ttychars(struct tty *); +extern int ttwflush(struct tty *); +extern int ttywait(struct tty *); +extern void ttyflush(struct tty *, int); +extern void ttyblock(struct tty *); +extern void ttyunblock(struct tty *); +extern void ttstart(struct tty *); +extern void ttrstrt(struct tty *); +extern int ttioctl(struct tty *, int, caddr_t, int); +extern int ttnread(struct tty *); +extern int ttselect(int /*dev_t*/, int, struct proc *); +extern int ttyopen(int /*dev_t*/, struct tty *, int); +extern void ttylclose(struct tty *, int); +extern int ttyclose(struct tty *); +extern int ttymodem(struct tty *, int); +extern int nullmodem(struct tty *, int); +extern void ttypend(struct tty *); +extern void ttyinput(int, struct tty *); +extern int ttyoutput(int, struct tty *); +extern int ttread(struct tty *, struct uio *, int); +extern int ttycheckoutq(struct tty *, int); +extern int ttwrite(struct tty *, struct uio *, int); +extern void ttyrub(int, struct tty *); +extern void ttyrubo(struct tty *, int); +extern void ttyretype(struct tty *); +extern void ttyecho(int, struct tty *); +extern void ttyoutstr(char *, struct tty *); +extern void ttwakeup(struct tty *); +extern int ttspeedtab(int, struct speedtab *); +extern void ttsetwater(struct tty *); +extern void ttyinfo(struct tty *); +extern int tputchar(int, struct tty *); +extern int ttysleep(struct tty *, caddr_t, int, const char *, int); + +/* From tty_ring.c: */ +extern int getc(struct ringb *); +extern size_t rb_write(struct ringb *, char *, size_t); + +/* From tty_compat.c: */ +extern int ttcompat(struct tty *, int, caddr_t, int); +#endif /* KERNEL */ #endif /* _SYS_TTY_H_ */ diff --git a/sys/sys/un.h b/sys/sys/un.h index 43893ee711..d47075814f 100644 --- a/sys/sys/un.h +++ b/sys/sys/un.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)un.h 7.7 (Berkeley) 6/28/90 - * $Id: un.h,v 1.2 1993/10/16 17:18:16 rgrimes Exp $ + * $Id: un.h,v 1.3 1993/11/07 17:53:14 wollman Exp $ */ #ifndef _SYS_UN_H_ @@ -46,10 +46,7 @@ struct sockaddr_un { char sun_path[104]; /* path name (gag) */ }; -#ifdef KERNEL -int unp_discard(); -#else - +#ifndef KERNEL /* actual length of an initialized sockaddr_un */ #define SUN_LEN(su) \ (sizeof(*(su)) - sizeof((su)->sun_path) + strlen((su)->sun_path)) diff --git a/sys/sys/unpcb.h b/sys/sys/unpcb.h index 802aba7c79..aba7acc571 100644 --- a/sys/sys/unpcb.h +++ b/sys/sys/unpcb.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)unpcb.h 7.6 (Berkeley) 6/28/90 - * $Id: unpcb.h,v 1.2 1993/10/16 17:18:19 rgrimes Exp $ + * $Id: unpcb.h,v 1.3 1993/11/07 17:53:16 wollman Exp $ */ #ifndef _SYS_UNPCB_H_ @@ -75,4 +75,30 @@ struct unpcb { }; #define sotounpcb(so) ((struct unpcb *)((so)->so_pcb)) + +#ifdef KERNEL +struct file; + +/* From uipc_usrreq.c: */ +/* XXX - most if not all of these should be be static to unpcb.h but this + * was easer to do in emacs -GAW */ + +extern int uipc_usrreq(struct socket *, int, struct mbuf *, struct mbuf *, struct mbuf *); +extern int unp_attach(struct socket *); +extern void unp_detach(struct unpcb *); +extern int unp_bind(struct unpcb *, struct mbuf *, struct proc *); +extern int unp_connect(struct socket *, struct mbuf *, struct proc *); +extern int unp_connect2(struct socket *, struct socket *); +extern void unp_disconnect(struct unpcb *); +extern void unp_shutdown(struct unpcb *); +extern void unp_drop(struct unpcb *, int); +extern int unp_externalize(struct mbuf *); /* XXX */ +extern int unp_internalize(struct mbuf *, struct proc *); +extern void unp_gc(void); +extern void unp_dispose(struct mbuf *); +extern void unp_scan(struct mbuf *, void (*)(struct file *)); +extern void unp_mark(struct file *); +extern void unp_discard(struct file *); + +#endif /* KERNEL */ #endif /* _SYS_UNPCB_H_ */ diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h index ec843374ad..3300d1a0b5 100644 --- a/sys/sys/vnode.h +++ b/sys/sys/vnode.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)vnode.h 7.39 (Berkeley) 6/27/91 - * $Id: vnode.h,v 1.3 1993/10/16 17:18:27 rgrimes Exp $ + * $Id: vnode.h,v 1.4 1993/11/07 17:53:23 wollman Exp $ */ #ifndef _SYS_VNODE_H_ @@ -209,7 +209,7 @@ struct vnodeops { int (*vop_bmap) __P((struct vnode *vp, daddr_t bn, struct vnode **vpp, daddr_t *bnp)); int (*vop_strategy) __P((struct buf *bp)); - int (*vop_print) __P((struct vnode *vp)); + void (*vop_print) __P((struct vnode *vp)); int (*vop_islocked) __P((struct vnode *vp)); int (*vop_advlock) __P((struct vnode *vp, caddr_t id, int op, struct flock *fl, int flags)); @@ -306,6 +306,16 @@ void vput __P((struct vnode *vp)); /* unlock and release vnode */ void vrele __P((struct vnode *vp)); /* release vnode */ void vgone __P((struct vnode *vp)); /* completely recycle vnode */ void vgoneall __P((struct vnode *vp));/* recycle vnode and all its aliases */ +extern void vflushbuf(struct vnode *, int); +extern int vinvalbuf(struct vnode *, int); +extern int bdevvp(int /*dev_t*/ dev, struct vnode **); +extern struct vnode *checkalias(struct vnode *, int /*dev_t*/, struct mount *); +extern void vhold(struct vnode *); +extern void holdrele(struct vnode *); +extern void vclean(struct vnode *, int); +extern int vfinddev(int /*dev_t*/, enum vtype, struct vnode **); +extern void vprint(const char *, struct vnode *); +extern int kinfo_vnode(int, char *, int *, int, int *); /* * Flags to various vnode functions. diff --git a/sys/ufs/fs.h b/sys/ufs/fs.h index 93005d75e1..ed21894d9c 100644 --- a/sys/ufs/fs.h +++ b/sys/ufs/fs.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)fs.h 7.12 (Berkeley) 5/8/91 - * $Id: fs.h,v 1.2 1993/10/16 18:17:38 rgrimes Exp $ + * $Id: fs.h,v 1.3 1993/11/07 17:53:36 wollman Exp $ */ #ifndef _UFS_FS_H_ @@ -442,4 +442,10 @@ struct ocg { * NINDIR is the number of indirects in a file system block. */ #define NINDIR(fs) ((fs)->fs_nindir) + +#ifdef KERNEL + +extern void fserr(struct fs *, int /*uid_t*/, const char *); + +#endif /* KERNEL */ #endif /* _UFS_FS_H_ */ diff --git a/sys/ufs/inode.h b/sys/ufs/inode.h index b0d6480c97..5cd2aeb2fa 100644 --- a/sys/ufs/inode.h +++ b/sys/ufs/inode.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)inode.h 7.17 (Berkeley) 5/8/91 - * $Id: inode.h,v 1.3 1993/10/16 18:17:40 rgrimes Exp $ + * $Id: inode.h,v 1.4 1993/11/07 17:53:38 wollman Exp $ */ #ifndef _UFS_INODE_H_ @@ -230,9 +230,17 @@ int ufs_unlock __P((struct vnode *vp)); int ufs_bmap __P((struct vnode *vp, daddr_t bn, struct vnode **vpp, daddr_t *bnp)); int ufs_strategy __P((struct buf *bp)); -int ufs_print __P((struct vnode *vp)); +void ufs_print __P((struct vnode *vp)); int ufs_islocked __P((struct vnode *vp)); int ufs_advlock __P((struct vnode *vp, caddr_t id, int op, struct flock *fl, int flags)); + +extern void blkfree(struct inode *, daddr_t, off_t); +extern void ifree(struct inode *, ino_t, int); +extern void iput(struct inode *); +extern void ilock(struct inode *); +extern void iunlock(struct inode *); +extern void dirbad(struct inode *, off_t, char *); + #endif /* KERNEL */ #endif /* _UFS_INODE_H_ */ diff --git a/sys/ufs/mfs_vfsops.c b/sys/ufs/mfs_vfsops.c index 7e9561eae5..6c56909d2f 100644 --- a/sys/ufs/mfs_vfsops.c +++ b/sys/ufs/mfs_vfsops.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)mfs_vfsops.c 7.19 (Berkeley) 4/16/91 - * $Id: mfs_vfsops.c,v 1.3 1993/10/16 18:17:42 rgrimes Exp $ + * $Id: mfs_vfsops.c,v 1.4 1993/11/12 10:15:41 chmr Exp $ */ #include "param.h" @@ -63,7 +63,7 @@ int mfs_statfs(); int ufs_sync(); int ufs_fhtovp(); int ufs_vptofh(); -int mfs_init(); +void mfs_init(); struct vfsops mfs_vfsops = { mfs_mount, @@ -84,6 +84,7 @@ struct vfsops mfs_vfsops = { * mount system call */ /* ARGSUSED */ +int mfs_mount(mp, path, data, ndp, p) register struct mount *mp; char *path; @@ -153,6 +154,7 @@ int mfs_pri = PWAIT | PCATCH; /* XXX prob. temp */ * address space. */ /* ARGSUSED */ +int mfs_start(mp, flags, p) struct mount *mp; int flags; @@ -187,6 +189,7 @@ mfs_start(mp, flags, p) /* * Get file system statistics. */ +int mfs_statfs(mp, sbp, p) struct mount *mp; struct statfs *sbp; diff --git a/sys/ufs/mfs_vnops.c b/sys/ufs/mfs_vnops.c index c8f5fa4d50..b349d6e421 100644 --- a/sys/ufs/mfs_vnops.c +++ b/sys/ufs/mfs_vnops.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)mfs_vnops.c 7.22 (Berkeley) 4/16/91 - * $Id$ + * $Id: mfs_vnops.c,v 1.2 1993/10/16 18:17:44 rgrimes Exp $ */ #include "param.h" @@ -94,6 +94,7 @@ struct vnodeops mfs_vnodeops = { * so we can tell when we are doing I/O to ourself. */ /* ARGSUSED */ +int mfs_open(vp, mode, cred, p) register struct vnode *vp; int mode; @@ -112,6 +113,7 @@ mfs_open(vp, mode, cred, p) * Ioctl operation. */ /* ARGSUSED */ +int mfs_ioctl(vp, com, data, fflag, cred, p) struct vnode *vp; int com; @@ -127,6 +129,7 @@ mfs_ioctl(vp, com, data, fflag, cred, p) /* * Pass I/O requests to the memory filesystem process. */ +int mfs_strategy(bp) register struct buf *bp; { @@ -152,6 +155,7 @@ mfs_strategy(bp) * * Trivial since buffer has already been mapping into KVA space. */ +void mfs_doio(bp, base) register struct buf *bp; caddr_t base; @@ -169,6 +173,7 @@ mfs_doio(bp, base) /* * This is a noop, simply returning what one has been given. */ +int mfs_bmap(vp, bn, vpp, bnp) struct vnode *vp; daddr_t bn; @@ -187,6 +192,7 @@ mfs_bmap(vp, bn, vpp, bnp) * Memory filesystem close routine */ /* ARGSUSED */ +int mfs_close(vp, flag, cred, p) register struct vnode *vp; int flag; @@ -232,6 +238,7 @@ mfs_close(vp, flag, cred, p) * Memory filesystem inactive routine */ /* ARGSUSED */ +int mfs_inactive(vp, p) struct vnode *vp; struct proc *p; @@ -245,6 +252,7 @@ mfs_inactive(vp, p) /* * Print out the contents of an mfsnode. */ +void mfs_print(vp) struct vnode *vp; { @@ -257,6 +265,7 @@ mfs_print(vp) /* * Block device bad operation */ +int mfs_badop() { @@ -267,6 +276,7 @@ mfs_badop() /* * Memory based filesystem initialization. */ +void mfs_init() { diff --git a/sys/ufs/mfsnode.h b/sys/ufs/mfsnode.h index a52e21f986..a58423f219 100644 --- a/sys/ufs/mfsnode.h +++ b/sys/ufs/mfsnode.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)mfsnode.h 7.3 (Berkeley) 4/16/91 - * $Id: mfsnode.h,v 1.2 1993/10/16 18:17:46 rgrimes Exp $ + * $Id: mfsnode.h,v 1.3 1993/11/07 17:53:42 wollman Exp $ */ #ifndef _UFS_MFSNODE_H_ @@ -188,7 +188,7 @@ int mfs_bmap __P(( daddr_t *bnp)); int mfs_strategy __P(( struct buf *bp)); -int mfs_print __P(( +void mfs_print __P(( struct vnode *vp)); #define mfs_islocked ((int (*) __P(( \ struct vnode *vp))) nullop) @@ -198,4 +198,7 @@ int mfs_print __P(( int op, \ struct flock *fl, \ int flags))) mfs_badop) + +void mfs_doio(struct buf *, caddr_t); + #endif /* _UFS_MFSNODE_H_ */ diff --git a/sys/ufs/quota.h b/sys/ufs/quota.h index e847050666..1cdba53453 100644 --- a/sys/ufs/quota.h +++ b/sys/ufs/quota.h @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)quota.h 7.9 (Berkeley) 2/22/91 - * $Id$ + * $Id: quota.h,v 1.2 1993/10/16 18:17:47 rgrimes Exp $ */ #ifndef _QUOTA_ @@ -60,9 +60,11 @@ * generically and need not be inspected when changing the size of * the array. */ -#define MAXQUOTAS 2 -#define USRQUOTA 0 /* element used for user quotas */ -#define GRPQUOTA 1 /* element used for group quotas */ +enum quotatype { + USRQUOTA = 0, /* element used for user quotas */ + GRPQUOTA = 1, /* element used for group quotas */ + MAXQUOTAS = 2 +}; /* * Definitions for the default names of the quotas files. @@ -171,6 +173,29 @@ struct dquot { #define DQREF(dq) dqref(dq) #endif /* DIAGNOSTIC */ +struct inode; struct ucred; struct mount; struct vnode; + +int getinoquota(struct inode *); +int chkdq(struct inode *, long, struct ucred *, int); +int chkdqchg(struct inode *, long, struct ucred *, enum quotatype); +int chkiq(struct inode *, long, struct ucred *, int); +int chkiqchg(struct inode *, long, struct ucred *, enum quotatype); +#ifdef DIAGNOSTIC +void chkdquot(struct inode *); +#endif +int quotaon(struct proc *, struct mount *, enum quotatype, caddr_t); +int quotaoff(struct proc *, struct mount *, enum quotatype); +int getquota(struct mount *, u_long, enum quotatype, caddr_t); +int setquota(struct mount *, u_long, enum quotatype, caddr_t); +int setuse(struct mount *, u_long, enum quotatype, caddr_t); +int qsync(struct mount *); +void dqinit(void); +int dqget(struct vnode *, u_long, struct ufsmount *, enum quotatype, struct dquot **); +void dqref(struct dquot *); +void dqrele(struct vnode *, struct dquot *); +int dqsync(struct vnode *, struct dquot *); +void dqflush(struct vnode *); + #else #include diff --git a/sys/ufs/ufs_alloc.c b/sys/ufs/ufs_alloc.c index 343055bf71..8c40f9670b 100644 --- a/sys/ufs/ufs_alloc.c +++ b/sys/ufs/ufs_alloc.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)ufs_alloc.c 7.26 (Berkeley) 5/2/91 - * $Id$ + * $Id: ufs_alloc.c,v 1.2 1993/10/16 18:17:49 rgrimes Exp $ */ #include "param.h" @@ -75,6 +75,7 @@ extern unsigned char *fragtbl[]; * 2) quadradically rehash into other cylinder groups, until an * available block is located. */ +int alloc(ip, lbn, bpref, size, bnp) register struct inode *ip; daddr_t lbn, bpref; @@ -136,6 +137,7 @@ nospace: * the original block. Failing that, the regular block allocator is * invoked to get an appropriate block. */ +int realloccg(ip, lbprev, bpref, osize, nsize, bpp) register struct inode *ip; off_t lbprev; @@ -288,6 +290,7 @@ nospace: * 2) quadradically rehash into other cylinder groups, until an * available inode is located. */ +int ialloc(pip, ipref, mode, cred, ipp) register struct inode *pip; ino_t ipref; @@ -867,6 +870,7 @@ gotit: * free map. If a fragment is deallocated, a possible * block reassembly is checked. */ +void blkfree(ip, bno, size) register struct inode *ip; daddr_t bno; @@ -969,6 +973,7 @@ blkfree(ip, bno, size) * * The specified inode is placed back in the free map. */ +void ifree(ip, ino, mode) struct inode *ip; ino_t ino; @@ -1091,10 +1096,11 @@ mapsearch(fs, cgp, bpref, allocsiz) * The form of the error message is: * fs: error message */ +void fserr(fs, uid, cp) struct fs *fs; uid_t uid; - char *cp; + const char *cp; { log(LOG_ERR, "uid %d on %s: %s\n", uid, fs->fs_fsmnt, cp); diff --git a/sys/ufs/ufs_bmap.c b/sys/ufs/ufs_bmap.c index d50b2ab388..89ff289f03 100644 --- a/sys/ufs/ufs_bmap.c +++ b/sys/ufs/ufs_bmap.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)ufs_bmap.c 7.13 (Berkeley) 5/8/91 - * $Id$ + * $Id: ufs_bmap.c,v 1.2 1993/10/16 18:17:51 rgrimes Exp $ */ #include "param.h" @@ -51,6 +51,7 @@ * is done by using the logical block number to index into * the array of block pointers described by the dinode. */ +int bmap(ip, bn, bnp) register struct inode *ip; register daddr_t bn; @@ -126,6 +127,7 @@ bmap(ip, bn, bnp) * by allocating the physical blocks on a device given * the inode and the logical block number in a file. */ +int balloc(ip, bn, size, bpp, flags) register struct inode *ip; register daddr_t bn; diff --git a/sys/ufs/ufs_disksubr.c b/sys/ufs/ufs_disksubr.c index dbd02fed7e..8930afd722 100644 --- a/sys/ufs/ufs_disksubr.c +++ b/sys/ufs/ufs_disksubr.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)ufs_disksubr.c 7.16 (Berkeley) 5/4/91 - * $Id$ + * $Id: ufs_disksubr.c,v 1.3 1993/10/08 21:00:37 rgrimes Exp $ */ #include "param.h" @@ -167,7 +167,7 @@ insert: char * readdisklabel(dev, strat, lp, dp, bdp, bpp) dev_t dev; - int (*strat)(); + d_strategy_t *strat; register struct disklabel *lp; struct dos_partition *dp; struct dkbad *bdp; @@ -321,6 +321,7 @@ done: * Check new disk label for sensibility * before setting it. */ +int setdisklabel(olp, nlp, openmask, dp) register struct disklabel *olp, *nlp; u_long openmask; @@ -376,9 +377,10 @@ setdisklabel(olp, nlp, openmask, dp) /* * Write disk label back to device after modification. */ +int writedisklabel(dev, strat, lp, dp) dev_t dev; - int (*strat)(); + d_strategy_t *strat; register struct disklabel *lp; struct dos_partition *dp; { @@ -464,6 +466,7 @@ done: /* * Compute checksum for disk label. */ +int dkcksum(lp) register struct disklabel *lp; { diff --git a/sys/ufs/ufs_inode.c b/sys/ufs/ufs_inode.c index ee483c0824..84839fca0a 100644 --- a/sys/ufs/ufs_inode.c +++ b/sys/ufs/ufs_inode.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)ufs_inode.c 7.40 (Berkeley) 5/8/91 - * $Id: ufs_inode.c,v 1.4 1993/11/07 17:53:44 wollman Exp $ + * $Id: ufs_inode.c,v 1.5 1993/11/07 21:48:19 wollman Exp $ */ #include "param.h" @@ -68,6 +68,7 @@ int prtactive; /* 1 => print out reclaim of active vnodes */ /* * Initialize hash links for inodes. */ +void ufs_init() { register int i; @@ -93,6 +94,7 @@ ufs_init() * return the inode locked. Detection and handling of mount * points must be done by the calling routine. */ +int iget(xp, ino, ipp) struct inode *xp; ino_t ino; @@ -244,6 +246,7 @@ loop: /* * Unlock and decrement the reference count of an inode structure. */ +void iput(ip) register struct inode *ip; { @@ -258,6 +261,7 @@ iput(ip) * Last reference to an inode, write the inode out and if necessary, * truncate and deallocate the file. */ +int ufs_inactive(vp, p) struct vnode *vp; struct proc *p; @@ -303,6 +307,7 @@ ufs_inactive(vp, p) /* * Reclaim an inode so that it can be used for other purposes. */ +int ufs_reclaim(vp) register struct vnode *vp; { @@ -346,6 +351,7 @@ ufs_reclaim(vp) * time is always taken from the current time. If waitfor is set, * then wait for the disk write of the inode to complete. */ +int iupdat(ip, ta, tm, waitfor) register struct inode *ip; struct timeval *ta, *tm; @@ -394,6 +400,7 @@ iupdat(ip, ta, tm, waitfor) * * NB: triple indirect blocks are untested. */ +int itrunc(oip, length, flags) register struct inode *oip; u_long length; @@ -585,6 +592,7 @@ done: * * NB: triple indirect blocks are untested. */ +int indirtrunc(ip, bn, lastbn, level, countp) register struct inode *ip; daddr_t bn, lastbn; @@ -675,6 +683,7 @@ indirtrunc(ip, bn, lastbn, level, countp) /* * Lock an inode. If its already locked, set the WANT bit and sleep. */ +void ilock(ip) register struct inode *ip; { @@ -694,6 +703,7 @@ ilock(ip) /* * Unlock an inode. If WANT bit is on, wakeup. */ +void iunlock(ip) register struct inode *ip; { diff --git a/sys/ufs/ufs_lockf.c b/sys/ufs/ufs_lockf.c index f5e416032c..042c64407e 100644 --- a/sys/ufs/ufs_lockf.c +++ b/sys/ufs/ufs_lockf.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)ufs_lockf.c 7.7 (Berkeley) 7/2/91 - * $Id: ufs_lockf.c,v 1.4 1993/10/20 07:31:39 davidg Exp $ + * $Id: ufs_lockf.c,v 1.5 1993/10/25 03:19:43 davidg Exp $ */ #include "param.h" @@ -51,10 +51,14 @@ #include "inode.h" +static void lf_addblock(struct lockf *, struct lockf *); +static void lf_split(struct lockf *, struct lockf *); +static void lf_wakelock(struct lockf *); /* * Advisory record locking support */ +int lf_advlock(head, size, id, op, fl, flags) struct lockf **head; u_long size; @@ -157,6 +161,7 @@ int lockf_debug = 0; /* * Set a byte-range lock. */ +int lf_setlock(lock) register struct lockf *lock; { @@ -402,6 +407,7 @@ lf_setlock(lock) * Generally, find the lock (or an overlap to that lock) * and remove it (or shrink it), then wakeup anyone we can. */ +int lf_clearlock(unlock) register struct lockf *unlock; { @@ -470,6 +476,7 @@ lf_clearlock(unlock) * Check whether there is a blocking lock, * and if so return its process identifier. */ +int lf_getlock(lock, fl) register struct lockf *lock; register struct flock *fl; @@ -534,6 +541,7 @@ lf_getblock(lock) * NOTE: this returns only the FIRST overlapping lock. There * may be more than one. */ +int lf_findoverlap(lf, lock, type, prev, overlap) register struct lockf *lf; struct lockf *lock; @@ -642,6 +650,7 @@ lf_findoverlap(lf, lock, type, prev, overlap) /* * Add a lock to the end of the blocked list. */ +static void lf_addblock(lock, blocked) struct lockf *lock; struct lockf *blocked; @@ -670,6 +679,7 @@ lf_addblock(lock, blocked) * Split a lock and a contained region into * two or three locks as necessary. */ +static void lf_split(lock1, lock2) register struct lockf *lock1; register struct lockf *lock2; @@ -716,6 +726,7 @@ lf_split(lock1, lock2) /* * Wakeup a blocklist */ +void lf_wakelock(listhead) struct lockf *listhead; { diff --git a/sys/ufs/ufs_lookup.c b/sys/ufs/ufs_lookup.c index a4aa3d8ae7..44065e0ef0 100644 --- a/sys/ufs/ufs_lookup.c +++ b/sys/ufs/ufs_lookup.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)ufs_lookup.c 7.33 (Berkeley) 5/19/91 - * $Id$ + * $Id: ufs_lookup.c,v 1.4 1993/10/16 18:17:55 rgrimes Exp $ */ #include "param.h" @@ -88,6 +88,7 @@ int dirchk = 0; * * NOTE: (LOOKUP | LOCKPARENT) currently returns the parent inode unlocked. */ +int ufs_lookup(vdp, ndp, p) register struct vnode *vdp; register struct nameidata *ndp; @@ -97,15 +98,15 @@ ufs_lookup(vdp, ndp, p) register struct fs *fs; /* file system that directory is in */ struct buf *bp = 0; /* a buffer of directory entries */ register struct direct *ep; /* the current directory entry */ - int entryoffsetinblock; /* offset of ep in bp's buffer */ + int entryoffsetinblock = 0; /* offset of ep in bp's buffer */ enum {NONE, COMPACT, FOUND} slotstatus; int slotoffset = -1; /* offset of area with free space */ - int slotsize; /* size of area at slotoffset */ - int slotfreespace; /* amount of space free in slot */ - int slotneeded; /* size of the entry we're seeking */ + int slotsize = 0; /* size of area at slotoffset */ + int slotfreespace = 0; /* amount of space free in slot */ + int slotneeded = 0; /* size of the entry we're seeking */ int numdirpasses; /* strategy for directory search */ int endsearch; /* offset to end directory search */ - int prevoff; /* ndp->ni_ufs.ufs_offset of previous entry */ + int prevoff = 0; /* ndp->ni_ufs.ufs_offset of previous entry */ struct inode *pdp; /* saved dp during symlink work */ struct inode *tdp; /* returned by iget */ off_t enduseful; /* pointer past last used dir slot */ @@ -539,7 +540,7 @@ found: return (0); } - +void dirbad(ip, offset, how) struct inode *ip; off_t offset; @@ -560,6 +561,7 @@ dirbad(ip, offset, how) * name is not longer than MAXNAMLEN * name must be as long as advertised, and null terminated */ +int dirbadentry(ep, entryoffsetinblock) register struct direct *ep; int entryoffsetinblock; @@ -584,6 +586,7 @@ dirbadentry(ep, entryoffsetinblock) * Remaining parameters (ndp->ni_ufs.ufs_offset, ndp->ni_ufs.ufs_count) * indicate how the space for the new entry is to be obtained. */ +int direnter(ip, ndp) struct inode *ip; register struct nameidata *ndp; @@ -720,6 +723,7 @@ direnter(ip, ndp) * the space of the now empty record by adding the record size * to the size of the previous entry. */ +int dirremove(ndp) register struct nameidata *ndp; { @@ -758,6 +762,7 @@ dirremove(ndp) * supplied. The parameters describing the directory entry are * set up by a call to namei. */ +int dirrewrite(dp, ip, ndp) struct inode *dp, *ip; struct nameidata *ndp; @@ -780,6 +785,7 @@ dirrewrite(dp, ip, ndp) * is non-zero, fill it in with a pointer to the * remaining space in the directory. */ +int blkatoff(ip, offset, res, bpp) struct inode *ip; off_t offset; @@ -813,6 +819,7 @@ blkatoff(ip, offset, res, bpp) * * NB: does not handle corrupted directories. */ +int dirempty(ip, parentino, cred) register struct inode *ip; ino_t parentino; @@ -863,6 +870,7 @@ dirempty(ip, parentino, cred) * Target is supplied locked, source is unlocked. * The target is always iput() before returning. */ +int checkpath(source, target, cred) struct inode *source, *target; struct ucred *cred; diff --git a/sys/ufs/ufs_quota.c b/sys/ufs/ufs_quota.c index 70f7dea522..9efb46b2d1 100644 --- a/sys/ufs/ufs_quota.c +++ b/sys/ufs/ufs_quota.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)ufs_quota.c 7.11 (Berkeley) 6/21/91 - * $Id: ufs_quota.c,v 1.2 1993/10/16 18:17:57 rgrimes Exp $ + * $Id: ufs_quota.c,v 1.3 1993/11/07 21:48:21 wollman Exp $ */ #include "param.h" @@ -65,6 +65,7 @@ static char *quotatypes[] = INITQFNAMES; * MAXQUOTAS value in quotas.h should be increased, and the * additional dquots set up here. */ +int getinoquota(ip) register struct inode *ip; { @@ -97,6 +98,7 @@ getinoquota(ip) /* * Update disk usage, and take corrective action. */ +int chkdq(ip, change, cred, flags) register struct inode *ip; long change; @@ -156,11 +158,12 @@ chkdq(ip, change, cred, flags) * Check for a valid change to a users allocation. * Issue an error message if appropriate. */ +int chkdqchg(ip, change, cred, type) struct inode *ip; long change; struct ucred *cred; - int type; + enum quotatype type; { register struct dquot *dq = ip->i_dquot[type]; long ncurblocks = dq->dq_curblocks + change; @@ -208,6 +211,7 @@ chkdqchg(ip, change, cred, type) /* * Check the inode limit, applying corrective action. */ +int chkiq(ip, change, cred, flags) register struct inode *ip; long change; @@ -267,11 +271,12 @@ chkiq(ip, change, cred, flags) * Check for a valid change to a users allocation. * Issue an error message if appropriate. */ +int chkiqchg(ip, change, cred, type) struct inode *ip; long change; struct ucred *cred; - int type; + enum quotatype type; { register struct dquot *dq = ip->i_dquot[type]; long ncurinodes = dq->dq_curinodes + change; @@ -322,6 +327,7 @@ chkiqchg(ip, change, cred, type) * it is an error for a file to change size and not * to have a dquot structure associated with it. */ +void chkdquot(ip) register struct inode *ip; { @@ -347,10 +353,11 @@ chkdquot(ip) /* * Q_QUOTAON - set up a quota file for a particular file system. */ +int quotaon(p, mp, type, fname) struct proc *p; struct mount *mp; - register int type; + enum quotatype type; caddr_t fname; { register struct ufsmount *ump = VFSTOUFS(mp); @@ -426,10 +433,11 @@ again: /* * Q_QUOTAOFF - turn off disk quotas for a filesystem. */ +int quotaoff(p, mp, type) struct proc *p; struct mount *mp; - register int type; + enum quotatype type; { register struct vnode *vp; struct vnode *qvp, *nextvp; @@ -478,10 +486,11 @@ again: /* * Q_GETQUOTA - return current values in a dqblk structure. */ +int getquota(mp, id, type, addr) struct mount *mp; u_long id; - int type; + enum quotatype type; caddr_t addr; { struct dquot *dq; @@ -497,10 +506,11 @@ getquota(mp, id, type, addr) /* * Q_SETQUOTA - assign an entire dqblk structure. */ +int setquota(mp, id, type, addr) struct mount *mp; u_long id; - int type; + enum quotatype type; caddr_t addr; { register struct dquot *dq; @@ -555,10 +565,11 @@ setquota(mp, id, type, addr) /* * Q_SETUSE - set current inode and block usage. */ +int setuse(mp, id, type, addr) struct mount *mp; u_long id; - int type; + enum quotatype type; caddr_t addr; { register struct dquot *dq; @@ -600,6 +611,7 @@ setuse(mp, id, type, addr) /* * Q_SYNC - sync quota files to disk. */ +int qsync(mp) struct mount *mp; { @@ -669,6 +681,7 @@ long numdquot, desireddquot = DQUOTINC; /* * Initialize the quota system. */ +void dqinit() { register union dqhead *dhp; @@ -690,11 +703,12 @@ dqinit() * Obtain a dquot structure for the specified identifier and quota file * reading the information from the file if necessary. */ +int dqget(vp, id, ump, type, dqp) struct vnode *vp; u_long id; register struct ufsmount *ump; - register int type; + enum quotatype type; struct dquot **dqp; { register struct dquot *dq; @@ -820,6 +834,7 @@ dqget(vp, id, ump, type, dqp) /* * Obtain a reference to a dquot. */ +void dqref(dq) struct dquot *dq; { @@ -830,6 +845,7 @@ dqref(dq) /* * Release a reference to a dquot. */ +void dqrele(vp, dq) struct vnode *vp; register struct dquot *dq; @@ -859,6 +875,7 @@ dqrele(vp, dq) /* * Update the disk quota in the quota file. */ +int dqsync(vp, dq) struct vnode *vp; register struct dquot *dq; @@ -909,6 +926,7 @@ dqsync(vp, dq) /* * Flush all entries from the cache for a particular vnode. */ +void dqflush(vp) register struct vnode *vp; { diff --git a/sys/ufs/ufs_subr.c b/sys/ufs/ufs_subr.c index 2fb344acdf..457651f379 100644 --- a/sys/ufs/ufs_subr.c +++ b/sys/ufs/ufs_subr.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)ufs_subr.c 7.13 (Berkeley) 6/28/90 - * $Id$ + * $Id: ufs_subr.c,v 1.2 1993/10/16 18:17:59 rgrimes Exp $ */ #ifdef KERNEL @@ -50,6 +50,7 @@ extern u_char *fragtbl[]; * Update the frsum fields to reflect addition or deletion * of some frags. */ +void fragacct(fs, fragmap, fraglist, cnt) struct fs *fs; int fragmap; @@ -85,6 +86,7 @@ fragacct(fs, fragmap, fraglist, cnt) * * check if a block is available */ +int isblock(fs, cp, h) struct fs *fs; unsigned char *cp; @@ -113,6 +115,7 @@ isblock(fs, cp, h) /* * take a block out of the map */ +void clrblock(fs, cp, h) struct fs *fs; u_char *cp; @@ -140,6 +143,7 @@ clrblock(fs, cp, h) /* * put a block into the map */ +void setblock(fs, cp, h) struct fs *fs; unsigned char *cp; @@ -171,6 +175,7 @@ setblock(fs, cp, h) * C definitions of special instructions. * Normally expanded with inline. */ +int scanc(size, cp, table, mask) u_int size; register u_char *cp, table[]; @@ -185,6 +190,7 @@ scanc(size, cp, table, mask) #endif #if !defined(vax) && !defined(tahoe) && !defined(hp300) +int skpc(mask, size, cp) register u_char mask; u_int size; @@ -197,6 +203,7 @@ skpc(mask, size, cp) return (end - cp); } +int locc(mask, size, cp) register u_char mask; u_int size; diff --git a/sys/ufs/ufs_vfsops.c b/sys/ufs/ufs_vfsops.c index af663dccff..fda1f79233 100644 --- a/sys/ufs/ufs_vfsops.c +++ b/sys/ufs/ufs_vfsops.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)ufs_vfsops.c 7.56 (Berkeley) 6/28/91 - * $Id$ + * $Id: ufs_vfsops.c,v 1.4 1993/10/16 18:18:01 rgrimes Exp $ */ #include "param.h" @@ -80,6 +80,7 @@ int doforce = 1; */ #define ROOTNAME "root_device" +int ufs_mountroot() { register struct mount *mp; @@ -130,6 +131,7 @@ ufs_mountroot() * * mount system call */ +int ufs_mount(mp, path, data, ndp, p) register struct mount *mp; char *path; @@ -139,7 +141,7 @@ ufs_mount(mp, path, data, ndp, p) { struct vnode *devvp; struct ufs_args args; - struct ufsmount *ump; + struct ufsmount *ump = 0; register struct fs *fs; u_int size; int error; @@ -219,6 +221,7 @@ ufs_mount(mp, path, data, ndp, p) /* * Common code for mount and mountroot */ +int mountfs(devvp, mp, p) register struct vnode *devvp; struct mount *mp; @@ -337,6 +340,7 @@ out: * Nothing to do at the moment. */ /* ARGSUSED */ +int ufs_start(mp, flags, p) struct mount *mp; int flags; @@ -349,6 +353,7 @@ ufs_start(mp, flags, p) /* * unmount system call */ +int ufs_unmount(mp, mntflags, p) struct mount *mp; int mntflags; @@ -401,6 +406,7 @@ ufs_unmount(mp, mntflags, p) /* * Check to see if a filesystem is mounted on a block device. */ +int mountedon(vp) register struct vnode *vp; { @@ -423,6 +429,7 @@ mountedon(vp) /* * Return root of a filesystem */ +int ufs_root(mp, vpp) struct mount *mp; struct vnode **vpp; @@ -446,6 +453,7 @@ ufs_root(mp, vpp) /* * Do operations associated with quotas */ +int ufs_quotactl(mp, cmds, uid, arg, p) struct mount *mp; int cmds; @@ -516,6 +524,7 @@ ufs_quotactl(mp, cmds, uid, arg, p) /* * Get file system statistics. */ +int ufs_statfs(mp, sbp, p) struct mount *mp; register struct statfs *sbp; @@ -556,6 +565,7 @@ int syncprt = 0; * * Note: we are always called with the filesystem marked `MPBUSY'. */ +int ufs_sync(mp, waitfor) struct mount *mp; int waitfor; @@ -622,6 +632,7 @@ loop: /* * Write a superblock and associated information back to disk. */ +int sbupdate(mp, waitfor) struct ufsmount *mp; int waitfor; @@ -658,36 +669,6 @@ sbupdate(mp, waitfor) return (error); } -/* - * Print out statistics on the current allocation of the buffer pool. - * Can be enabled to print out on every ``sync'' by setting "syncprt" - * above. - */ -bufstats() -{ - int s, i, j, count; - register struct buf *bp, *dp; - int counts[MAXBSIZE/CLBYTES+1]; - static char *bname[BQUEUES] = { "LOCKED", "LRU", "AGE", "EMPTY" }; - - for (bp = bfreelist, i = 0; bp < &bfreelist[BQUEUES]; bp++, i++) { - count = 0; - for (j = 0; j <= MAXBSIZE/CLBYTES; j++) - counts[j] = 0; - s = splbio(); - for (dp = bp->av_forw; dp != bp; dp = dp->av_forw) { - counts[dp->b_bufsize/CLBYTES]++; - count++; - } - splx(s); - printf("%s: total-%d", bname[i], count); - for (j = 0; j <= MAXBSIZE/CLBYTES; j++) - if (counts[j] != 0) - printf(", %d-%d", j * CLBYTES, counts[j]); - printf("\n"); - } -} - /* * File handle to vnode * @@ -697,6 +678,7 @@ bufstats() * - check for an unallocated inode (i_mode == 0) * - check that the generation number matches */ +int ufs_fhtovp(mp, fhp, vpp) register struct mount *mp; struct fid *fhp; @@ -743,6 +725,7 @@ ufs_fhtovp(mp, fhp, vpp) * Vnode pointer to File handle */ /* ARGSUSED */ +int ufs_vptofh(vp, fhp) struct vnode *vp; struct fid *fhp; diff --git a/sys/ufs/ufs_vnops.c b/sys/ufs/ufs_vnops.c index 9b7c305622..e06f4da2d8 100644 --- a/sys/ufs/ufs_vnops.c +++ b/sys/ufs/ufs_vnops.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)ufs_vnops.c 7.64 (Berkeley) 5/16/91 - * $Id: ufs_vnops.c,v 1.6 1993/11/10 05:33:56 wollman Exp $ + * $Id: ufs_vnops.c,v 1.7 1993/11/13 22:46:40 rgrimes Exp $ */ #include "param.h" @@ -62,6 +62,7 @@ /* * Create a regular file */ +int ufs_create(ndp, vap, p) struct nameidata *ndp; struct vattr *vap; @@ -80,6 +81,7 @@ ufs_create(ndp, vap, p) * Mknod vnode call */ /* ARGSUSED */ +int ufs_mknod(ndp, vap, cred, p) struct nameidata *ndp; struct ucred *cred; @@ -118,6 +120,7 @@ ufs_mknod(ndp, vap, cred, p) * Nothing to do. */ /* ARGSUSED */ +int ufs_open(vp, mode, cred, p) struct vnode *vp; int mode; @@ -134,6 +137,7 @@ ufs_open(vp, mode, cred, p) * Update the times on the inode. */ /* ARGSUSED */ +int ufs_close(vp, fflag, cred, p) struct vnode *vp; int fflag; @@ -152,6 +156,7 @@ ufs_close(vp, fflag, cred, p) * The mode is shifted to select the owner/group/other fields. The * super user is granted all permissions. */ +int ufs_access(vp, mode, cred, p) struct vnode *vp; register int mode; @@ -203,6 +208,7 @@ found: } /* ARGSUSED */ +int ufs_getattr(vp, vap, cred, p) struct vnode *vp; register struct vattr *vap; @@ -252,6 +258,7 @@ ufs_getattr(vp, vap, cred, p) /* * Set attribute vnode op. called from several syscalls */ +int ufs_setattr(vp, vap, cred, p) register struct vnode *vp; register struct vattr *vap; @@ -315,6 +322,7 @@ ufs_setattr(vp, vap, cred, p) * Change the mode on a file. * Inode must be locked before calling. */ +int chmod1(vp, mode, p) register struct vnode *vp; register int mode; @@ -345,6 +353,7 @@ chmod1(vp, mode, p) * Perform chown operation on inode ip; * inode must be locked prior to call. */ +int chown1(vp, uid, gid, p) register struct vnode *vp; uid_t uid; @@ -457,6 +466,7 @@ good: * Vnode op for reading. */ /* ARGSUSED */ +int ufs_read(vp, uio, ioflag, cred) struct vnode *vp; register struct uio *uio; @@ -519,6 +529,7 @@ ufs_read(vp, uio, ioflag, cred) /* * Vnode op for writing. */ +int ufs_write(vp, uio, ioflag, cred) register struct vnode *vp; struct uio *uio; @@ -616,6 +627,7 @@ ufs_write(vp, uio, ioflag, cred) } /* ARGSUSED */ +int ufs_ioctl(vp, com, data, fflag, cred, p) struct vnode *vp; int com; @@ -629,6 +641,7 @@ ufs_ioctl(vp, com, data, fflag, cred, p) } /* ARGSUSED */ +int ufs_select(vp, which, fflags, cred, p) struct vnode *vp; int which, fflags; @@ -648,6 +661,7 @@ ufs_select(vp, which, fflags, cred, p) * NB Currently unsupported. */ /* ARGSUSED */ +int ufs_mmap(vp, fflags, cred, p) struct vnode *vp; int fflags; @@ -662,6 +676,7 @@ ufs_mmap(vp, fflags, cred, p) * Synch an open file. */ /* ARGSUSED */ +int ufs_fsync(vp, fflags, cred, waitfor, p) struct vnode *vp; int fflags; @@ -683,6 +698,7 @@ ufs_fsync(vp, fflags, cred, waitfor, p) * Nothing to do, so just return. */ /* ARGSUSED */ +int ufs_seek(vp, oldoff, newoff, cred) struct vnode *vp; off_t oldoff, newoff; @@ -697,6 +713,7 @@ ufs_seek(vp, oldoff, newoff, cred) * Hard to avoid races here, especially * in unlinking directories. */ +int ufs_remove(ndp, p) struct nameidata *ndp; struct proc *p; @@ -722,6 +739,7 @@ ufs_remove(ndp, p) /* * link vnode call */ +int ufs_link(vp, ndp, p) register struct vnode *vp; register struct nameidata *ndp; @@ -780,6 +798,7 @@ ufs_link(vp, ndp, p) * is different from the source, patch the ".." entry in the * directory. */ +int ufs_rename(fndp, tndp, p) register struct nameidata *fndp, *tndp; struct proc *p; @@ -1094,6 +1113,7 @@ struct dirtemplate mastertemplate = { /* * Mkdir system call */ +int ufs_mkdir(ndp, vap, p) struct nameidata *ndp; struct vattr *vap; @@ -1209,6 +1229,7 @@ bad: /* * Rmdir system call. */ +int ufs_rmdir(ndp, p) register struct nameidata *ndp; struct proc *p; @@ -1273,6 +1294,7 @@ out: /* * symlink -- make a symbolic link */ +int ufs_symlink(ndp, vap, target, p) struct nameidata *ndp; struct vattr *vap; @@ -1305,6 +1327,7 @@ ufs_symlink(ndp, vap, target, p) /* * Vnode op for read and write */ +int ufs_readdir(vp, uio, cred, eofflagp) struct vnode *vp; register struct uio *uio; @@ -1332,6 +1355,7 @@ ufs_readdir(vp, uio, cred, eofflagp) /* * Return target name of a symbolic link */ +int ufs_readlink(vp, uiop, cred) struct vnode *vp; struct uio *uiop; @@ -1349,6 +1373,7 @@ ufs_readlink(vp, uiop, cred) * done. If a buffer has been saved in anticipation of a CREATE, delete it. */ /* ARGSUSED */ +int ufs_abortop(ndp) struct nameidata *ndp; { @@ -1361,6 +1386,7 @@ ufs_abortop(ndp) /* * Lock an inode. */ +int ufs_lock(vp) struct vnode *vp; { @@ -1373,6 +1399,7 @@ ufs_lock(vp) /* * Unlock an inode. */ +int ufs_unlock(vp) struct vnode *vp; { @@ -1387,6 +1414,7 @@ ufs_unlock(vp) /* * Check for a locked inode. */ +int ufs_islocked(vp) struct vnode *vp; { @@ -1399,6 +1427,7 @@ ufs_islocked(vp) /* * Get access to bmap */ +int ufs_bmap(vp, bn, vpp, bnp) struct vnode *vp; daddr_t bn; @@ -1420,6 +1449,7 @@ ufs_bmap(vp, bn, vpp, bnp) */ int checkoverlap = 0; +int ufs_strategy(bp) register struct buf *bp; { @@ -1477,6 +1507,7 @@ ufs_strategy(bp) /* * Print out the contents of an inode. */ +void ufs_print(vp) struct vnode *vp; { @@ -1500,6 +1531,7 @@ ufs_print(vp) /* * Read wrapper for special devices. */ +int ufsspec_read(vp, uio, ioflag, cred) struct vnode *vp; struct uio *uio; @@ -1517,6 +1549,7 @@ ufsspec_read(vp, uio, ioflag, cred) /* * Write wrapper for special devices. */ +int ufsspec_write(vp, uio, ioflag, cred) struct vnode *vp; struct uio *uio; @@ -1536,6 +1569,7 @@ ufsspec_write(vp, uio, ioflag, cred) * * Update the times on the inode then do device close. */ +int ufsspec_close(vp, fflag, cred, p) struct vnode *vp; int fflag; @@ -1553,6 +1587,7 @@ ufsspec_close(vp, fflag, cred, p) /* * Read wrapper for fifo's */ +int ufsfifo_read(vp, uio, ioflag, cred) struct vnode *vp; struct uio *uio; @@ -1570,6 +1605,7 @@ ufsfifo_read(vp, uio, ioflag, cred) /* * Write wrapper for fifo's. */ +int ufsfifo_write(vp, uio, ioflag, cred) struct vnode *vp; struct uio *uio; @@ -1589,6 +1625,7 @@ ufsfifo_write(vp, uio, ioflag, cred) * * Update the times on the inode then do device close. */ +int ufsfifo_close(vp, fflag, cred, p) struct vnode *vp; int fflag; @@ -1606,6 +1643,7 @@ ufsfifo_close(vp, fflag, cred, p) /* * Allocate a new inode. */ +int maknode(mode, ndp, ipp) int mode; register struct nameidata *ndp; @@ -1683,6 +1721,7 @@ bad: /* * Advisory record locking support */ +int ufs_advlock(vp, id, op, fl, flags) struct vnode *vp; caddr_t id; diff --git a/sys/ufs/ufsmount.h b/sys/ufs/ufsmount.h index bd26458f5a..436e4f798f 100644 --- a/sys/ufs/ufsmount.h +++ b/sys/ufs/ufsmount.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)ufsmount.h 7.9 (Berkeley) 5/8/91 - * $Id: ufsmount.h,v 1.2 1993/10/16 18:18:05 rgrimes Exp $ + * $Id: ufsmount.h,v 1.3 1993/11/07 17:53:47 wollman Exp $ */ #ifndef _UFS_UFSMOUNT_H_ @@ -77,6 +77,6 @@ int ufs_statfs __P((struct mount *mp, struct statfs *sbp, struct proc *p)); int ufs_sync __P((struct mount *mp, int waitfor)); int ufs_fhtovp __P((struct mount *mp, struct fid *fhp, struct vnode **vpp)); int ufs_vptofh __P((struct vnode *vp, struct fid *fhp)); -int ufs_init __P(()); +void ufs_init __P(()); #endif /* KERNEL */ #endif /* _UFS_UFSMOUNT_H_ */ diff --git a/sys/vm/device_pager.c b/sys/vm/device_pager.c index 7a54e5a184..f12745f917 100644 --- a/sys/vm/device_pager.c +++ b/sys/vm/device_pager.c @@ -310,7 +310,7 @@ dev_pager_putpage(pager, m, sync) printf("dev_pager_putpage(%x, %x)\n", pager, m); #endif if (pager == NULL) - return; + return 0; panic("dev_pager_putpage called"); } diff --git a/sys/vm/lock.h b/sys/vm/lock.h index 8642c088cb..85782a46d1 100644 --- a/sys/vm/lock.h +++ b/sys/vm/lock.h @@ -172,4 +172,17 @@ boolean_t lock_try_read_to_write(); void lock_set_recursive(); void lock_clear_recursive(); +/* + * Try to get semi-meaningful wait messages into thread_sleep... + */ +extern void thread_sleep_(int, simple_lock_t, const char *); +#if __GNUC__ > 2 +# define thread_sleep(a,b,c) thread_sleep_((a), (b), __FUNCTION__) +#else +# define thread_sleep(a,b,c) thread_sleep_((a), (b), "vmsleep") +#endif +#define thread_sleep_new thread_sleep_ +extern void thread_wakeup(int); + + #endif /* !_LOCK_H_ */ diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c index c1e01cd53b..9369104c7d 100644 --- a/sys/vm/swap_pager.c +++ b/sys/vm/swap_pager.c @@ -37,7 +37,7 @@ * * from: Utah $Hdr: swap_pager.c 1.4 91/04/30$ * from: @(#)swap_pager.c 7.4 (Berkeley) 5/7/91 - * $Id: swap_pager.c,v 1.3 1993/11/07 17:54:05 wollman Exp $ + * $Id: swap_pager.c,v 1.4 1993/11/07 21:48:34 wollman Exp $ */ /* @@ -126,6 +126,8 @@ struct swtab { #endif } swtab[NSWSIZES+1]; +static int swap_pager_finish(swp_clean_t); + #ifdef DEBUG int swap_pager_pendingio; /* max pending async "clean" ops */ int swap_pager_poip; /* pageouts in progress */ @@ -377,6 +379,7 @@ swap_pager_dealloc(pager) free((caddr_t)pager, M_VMPAGER); } +int swap_pager_getpage(pager, m, sync) vm_pager_t pager; vm_page_t m; @@ -389,6 +392,7 @@ swap_pager_getpage(pager, m, sync) return(swap_pager_io((sw_pager_t)pager->pg_data, m, B_READ)); } +int swap_pager_putpage(pager, m, sync) vm_pager_t pager; vm_page_t m; @@ -402,7 +406,7 @@ swap_pager_putpage(pager, m, sync) #endif if (pager == NULL) { (void) swap_pager_clean(NULL, B_WRITE); - return; + return 0; } flags = B_WRITE; if (!sync) @@ -454,6 +458,7 @@ swap_pager_haspage(pager, offset) * BOGUS: lower level IO routines expect a KVA so we have to map our * provided physical page into the KVA to keep them happy. */ +int swap_pager_io(swp, m, flags) register sw_pager_t swp; vm_page_t m; @@ -793,6 +798,7 @@ swap_pager_clean(m, rw) return(tspc ? TRUE : FALSE); } +int swap_pager_finish(spc) register swp_clean_t spc; { @@ -849,6 +855,7 @@ swap_pager_finish(spc) return(1); } +void swap_pager_iodone(bp) register struct buf *bp; { diff --git a/sys/vm/swap_pager.h b/sys/vm/swap_pager.h index 1a032c4be5..aa0d80d054 100644 --- a/sys/vm/swap_pager.h +++ b/sys/vm/swap_pager.h @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * from: @(#)swap_pager.h 7.1 (Berkeley) 12/5/90 - * $Id: swap_pager.h,v 1.2 1993/10/16 16:20:21 rgrimes Exp $ + * $Id: swap_pager.h,v 1.3 1993/11/07 17:54:06 wollman Exp $ */ #ifndef _SWAP_PAGER_ @@ -90,17 +90,18 @@ typedef struct swpager *sw_pager_t; #ifdef KERNEL -void swap_pager_init(); -vm_pager_t swap_pager_alloc(); -void swap_pager_dealloc(); -boolean_t swap_pager_getpage(), swap_pager_putpage(); -boolean_t swap_pager_haspage(); +void swap_pager_init(void); +vm_pager_t swap_pager_alloc(caddr_t, vm_size_t, vm_prot_t); +void swap_pager_dealloc(vm_pager_t); +boolean_t swap_pager_getpage(vm_pager_t, vm_page_t, boolean_t); +boolean_t swap_pager_putpage(vm_pager_t, vm_page_t, boolean_t); +boolean_t swap_pager_haspage(vm_pager_t, vm_offset_t); +extern int swap_pager_io(sw_pager_t, vm_page_t, int); +void swap_pager_iodone(struct buf *); +boolean_t swap_pager_clean(vm_page_t, int); extern struct pagerops swappagerops; -int swap_pager_iodone(); -boolean_t swap_pager_clean(); - #endif #endif /* _SWAP_PAGER_ */ diff --git a/sys/vm/vm.h b/sys/vm/vm.h index bfbf434bf3..325bd44ecb 100644 --- a/sys/vm/vm.h +++ b/sys/vm/vm.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)vm.h 7.1 (Berkeley) 5/5/91 - * $Id: vm.h,v 1.2 1993/10/16 16:20:22 rgrimes Exp $ + * $Id: vm.h,v 1.3 1993/11/07 17:54:08 wollman Exp $ */ #ifndef _VM_H_ @@ -73,4 +73,7 @@ struct vmspace *vmspace_alloc __P((vm_offset_t min, vm_offset_t max, int pageable)); struct vmspace *vmspace_fork __P((struct vmspace *)); void vmspace_free __P((struct vmspace *)); + +extern void thread_block(const char *); + #endif /* _VM_H_ */ diff --git a/sys/vm/vm_fault.c b/sys/vm/vm_fault.c index c351f0a2cb..6f3a9fad9a 100644 --- a/sys/vm/vm_fault.c +++ b/sys/vm/vm_fault.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)vm_fault.c 7.6 (Berkeley) 5/7/91 - * $Id: vm_fault.c,v 1.5 1993/10/16 16:20:24 rgrimes Exp $ + * $Id: vm_fault.c,v 1.6 1993/11/07 17:54:09 wollman Exp $ */ /* @@ -94,6 +94,7 @@ vm_statistics_data_t vm_stat; * The map in question must be referenced, and remains so. * Caller may hold no locks. */ +int vm_fault(map, vaddr, fault_type, change_wiring) vm_map_t map; vm_offset_t vaddr; @@ -248,7 +249,7 @@ vm_fault(map, vaddr, fault_type, change_wiring) PAGE_ASSERT_WAIT(m, !change_wiring); UNLOCK_THINGS; - thread_block(); + thread_block("pagein"); wait_result = current_thread()->wait_result; vm_object_deallocate(first_object); if (wait_result != THREAD_AWAKENED) @@ -257,8 +258,8 @@ vm_fault(map, vaddr, fault_type, change_wiring) #else PAGE_ASSERT_WAIT(m, !change_wiring); UNLOCK_THINGS; -thread_wakeup(&vm_pages_needed); /* XXX! */ - thread_block(); + thread_wakeup((int)&vm_pages_needed);/* XXX! */ + thread_block("pagein"); vm_object_deallocate(first_object); goto RetryFault; #endif @@ -281,7 +282,7 @@ thread_wakeup(&vm_pages_needed); /* XXX! */ PAGE_ASSERT_WAIT(m, !change_wiring); UNLOCK_THINGS; - thread_block(); + thread_block("pgunlck"); wait_result = current_thread()->wait_result; vm_object_deallocate(first_object); if (wait_result != THREAD_AWAKENED) @@ -293,8 +294,8 @@ thread_wakeup(&vm_pages_needed); /* XXX! */ PAGE_ASSERT_WAIT(m, !change_wiring); UNLOCK_THINGS; -thread_wakeup(&vm_pages_needed); /* XXX */ - thread_block(); + thread_wakeup((int)&vm_pages_needed); /* XXX */ + thread_block("pgunlck"); vm_object_deallocate(first_object); goto RetryFault; #endif @@ -628,7 +629,7 @@ thread_wakeup(&vm_pages_needed); /* XXX */ copy_object->ref_count--; vm_object_unlock(copy_object); UNLOCK_THINGS; - thread_block(); + thread_block("pagein"); wait_result = current_thread()->wait_result; vm_object_deallocate(first_object); if (wait_result != THREAD_AWAKENED) @@ -644,8 +645,9 @@ thread_wakeup(&vm_pages_needed); /* XXX */ copy_object->ref_count--; vm_object_unlock(copy_object); UNLOCK_THINGS; -thread_wakeup(&vm_pages_needed); /* XXX */ - thread_block(); + thread_wakeup((int)&vm_pages_needed); + /* XXX ^^^^^*/ + thread_block("pagein"); vm_object_deallocate(first_object); goto RetryFault; #endif diff --git a/sys/vm/vm_glue.c b/sys/vm/vm_glue.c index 32b73480a3..603446cf04 100644 --- a/sys/vm/vm_glue.c +++ b/sys/vm/vm_glue.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)vm_glue.c 7.8 (Berkeley) 5/15/91 - * $Id: vm_glue.c,v 1.10 1993/11/07 17:54:11 wollman Exp $ + * $Id: vm_glue.c,v 1.11 1993/11/07 21:48:36 wollman Exp $ */ /* @@ -75,9 +75,12 @@ #include "vm_kern.h" #include "machine/stdarg.h" +static void swapout(struct proc *); + int avefree = 0; /* XXX */ int readbuffers = 0; /* XXX allow kgdb to read kernel buffer pool */ +int kernacc(addr, len, rw) caddr_t addr; int len, rw; @@ -104,6 +107,7 @@ kernacc(addr, len, rw) return(rv == TRUE); } +int useracc(addr, len, rw) caddr_t addr; int len, rw; @@ -149,6 +153,7 @@ chgkprot(addr, len, rw) } #endif +void vslock(addr, len) caddr_t addr; u_int len; @@ -157,6 +162,7 @@ vslock(addr, len) round_page(addr+len), FALSE); } +void vsunlock(addr, len, dirtied) caddr_t addr; u_int len; @@ -180,6 +186,7 @@ vsunlock(addr, len, dirtied) * after cpu_fork returns in the child process. We do nothing here * after cpu_fork returns. */ +int vm_fork(p1, p2, isvfork) register struct proc *p1, *p2; int isvfork; @@ -254,6 +261,7 @@ vm_fork(p1, p2, isvfork) * Set default limits for VM system. * Called for proc 0, and then inherited by all others. */ +void vm_init_limits(p) register struct proc *p; { @@ -290,6 +298,7 @@ int swapdebug = 0; * 2. If not enough memory, wake the pageout daemon and let it * clear some space. */ +void /* XXX should be __dead, too */ sched() { register struct proc *p; @@ -382,6 +391,7 @@ noswap: * they are swapped. Else, we swap the longest-sleeping or stopped process, * if any, otherwise the longest-resident process. */ +void swapout_threads() { register struct proc *p; @@ -438,6 +448,7 @@ swapout_threads() } } +static void swapout(p) register struct proc *p; { @@ -501,39 +512,44 @@ assert_wait(event, ruptible) } void -thread_block() +thread_block(const char *wmesg) { int s = splhigh(); - if (curproc->p_thread) - tsleep((caddr_t)curproc->p_thread, PVM, "vmblock", 0); + if (curproc->p_thread) { + tsleep((caddr_t)curproc->p_thread, PVM, wmesg, 0); + } splx(s); } -thread_sleep(event, lock, ruptible) +void +thread_sleep_(event, lock, wmesg) int event; simple_lock_t lock; - boolean_t ruptible; + const char *wmesg; { -#ifdef lint - ruptible++; -#endif int s = splhigh(); curproc->p_thread = event; simple_unlock(lock); - if (curproc->p_thread) - tsleep((caddr_t)event, PVM, "vmsleep", 0); + if (curproc->p_thread) { + tsleep((caddr_t)event, PVM, wmesg, 0); + } splx(s); } +void thread_wakeup(event) int event; { - int s = splhigh(); +#if 0 + int s = splhigh(); /* XXX is this really necessary??? */ +#endif wakeup((caddr_t)event); +#if 0 splx(s); +#endif } /* diff --git a/sys/vm/vm_kern.c b/sys/vm/vm_kern.c index ffd017827c..cbeea58e5c 100644 --- a/sys/vm/vm_kern.c +++ b/sys/vm/vm_kern.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)vm_kern.c 7.4 (Berkeley) 5/7/91 - * $Id: vm_kern.c,v 1.3 1993/10/16 16:20:30 rgrimes Exp $ + * $Id: vm_kern.c,v 1.4 1993/11/07 17:54:13 wollman Exp $ */ /* @@ -514,8 +514,8 @@ vm_offset_t kmem_alloc_wait(map, size) assert_wait((int)map, TRUE); vm_map_unlock(map); -thread_wakeup(&vm_pages_needed); /* XXX */ - thread_block(); + thread_wakeup((int)&vm_pages_needed); /* XXX */ + thread_block("vmalloc"); } else { vm_map_unlock(map); @@ -565,8 +565,8 @@ vm_offset_t kmem_alloc_wired_wait(map, size) assert_wait((int)map, TRUE); vm_map_unlock(map); -thread_wakeup(&vm_pages_needed); /* XXX */ - thread_block(); + thread_wakeup((int)&vm_pages_needed); /* XXX */ + thread_block("kmalloc"); } else { vm_map_unlock(map); diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c index 74f3b1f337..fb91152b89 100644 --- a/sys/vm/vm_map.c +++ b/sys/vm/vm_map.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)vm_map.c 7.3 (Berkeley) 4/21/91 - * $Id$ + * $Id: vm_map.c,v 1.7 1993/10/16 16:20:33 rgrimes Exp $ */ /* @@ -393,6 +393,7 @@ void vm_map_deallocate(map) * * Requires that the map be locked, and leaves it so. */ +int vm_map_insert(map, object, offset, start, end) vm_map_t map; vm_object_t object; @@ -606,6 +607,7 @@ boolean_t vm_map_lookup_entry(map, address, entry) * returned in the same parameter. * */ +int vm_map_find(map, object, offset, addr, length, find_space) vm_map_t map; vm_object_t object; @@ -903,6 +905,7 @@ void _vm_map_clip_end(map, entry, end) * range from the superior map, and then destroy the * submap (if desired). [Better yet, don't try it.] */ +int vm_map_submap(map, start, end, submap) register vm_map_t map; register vm_offset_t start; @@ -946,6 +949,7 @@ vm_map_submap(map, start, end, submap) * specified, the maximum protection is to be set; * otherwise, only the current protection is affected. */ +int vm_map_protect(map, start, end, new_prot, set_max) register vm_map_t map; register vm_offset_t start; @@ -1067,6 +1071,7 @@ vm_map_protect(map, start, end, new_prot, set_max) * affects how the map will be shared with * child maps at the time of vm_map_fork. */ +int vm_map_inherit(map, start, end, new_inheritance) register vm_map_t map; register vm_offset_t start; @@ -1119,6 +1124,7 @@ vm_map_inherit(map, start, end, new_inheritance) * The map must not be locked, but a reference * must remain to the map throughout the call. */ +int vm_map_pageable(map, start, end, new_pageable) register vm_map_t map; register vm_offset_t start; @@ -1348,6 +1354,7 @@ void vm_map_entry_delete(map, entry) * When called with a sharing map, removes pages from * that region from all physical maps. */ +int vm_map_delete(map, start, end) register vm_map_t map; vm_offset_t start; @@ -1443,6 +1450,7 @@ vm_map_delete(map, start, end) * Remove the given address range from the target map. * This is the exported form of vm_map_delete. */ +int vm_map_remove(map, start, end) register vm_map_t map; register vm_offset_t start; @@ -1652,6 +1660,7 @@ void vm_map_copy_entry(src_map, dst_map, src_entry, dst_entry) * map to make copies. This also reduces map * fragmentation.] */ +int vm_map_copy(dst_map, src_map, dst_addr, len, src_addr, dst_alloc, src_destroy) @@ -2113,6 +2122,7 @@ vmspace_fork(vm1) * copying operations, although the data referenced will * remain the same. */ +int vm_map_lookup(var_map, vaddr, fault_type, out_entry, object, offset, out_prot, wired, single_use) vm_map_t *var_map; /* IN/OUT */ diff --git a/sys/vm/vm_meter.c b/sys/vm/vm_meter.c index 7408471364..e974f149aa 100644 --- a/sys/vm/vm_meter.c +++ b/sys/vm/vm_meter.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)vm_meter.c 7.11 (Berkeley) 4/20/91 - * $Id: vm_meter.c,v 1.2 1993/10/16 16:20:37 rgrimes Exp $ + * $Id: vm_meter.c,v 1.3 1993/11/07 17:54:17 wollman Exp $ */ #include "param.h" @@ -60,10 +60,14 @@ long tk_rawcc; /* total raw characters */ fixpt_t averunnable[3]; /* load average, of runnable procs */ +static void vmtotal(void); +static void loadav(fixpt_t *, int); + int maxslp = MAXSLP; int saferss = SAFERSS; +void vmmeter() { register unsigned *cp, *rp, *sp; @@ -74,6 +78,7 @@ vmmeter() wakeup((caddr_t)&proc0); } +static void vmtotal() { register struct proc *p; @@ -144,6 +149,7 @@ fixpt_t cexp[3] = { * Compute a tenex style load average of a quantity on * 1, 5 and 15 minute intervals. */ +void loadav(avg, n) register fixpt_t *avg; int n; diff --git a/sys/vm/vm_mmap.c b/sys/vm/vm_mmap.c index 4e21080549..2f5b6fe149 100644 --- a/sys/vm/vm_mmap.c +++ b/sys/vm/vm_mmap.c @@ -37,7 +37,7 @@ * * from: Utah $Hdr: vm_mmap.c 1.3 90/01/21$ * from: @(#)vm_mmap.c 7.5 (Berkeley) 6/28/91 - * $Id: vm_mmap.c,v 1.9 1993/11/20 22:27:44 davidg Exp $ + * $Id: vm_mmap.c,v 1.10 1993/11/22 09:49:53 davidg Exp $ */ /* @@ -67,6 +67,7 @@ int mmapdebug = 0; #endif /* ARGSUSED */ +int getpagesize(p, uap, retval) struct proc *p; void *uap; @@ -82,6 +83,7 @@ struct sbrk_args { }; /* ARGSUSED */ +int sbrk(p, uap, retval) struct proc *p; struct sbrk_args *uap; @@ -97,6 +99,7 @@ struct sstk_args { }; /* ARGSUSED */ +int sstk(p, uap, retval) struct proc *p; struct sstk_args *uap; @@ -116,13 +119,14 @@ struct smmap_args { off_t pos; }; +int smmap(p, uap, retval) struct proc *p; register struct smmap_args *uap; int *retval; { register struct filedesc *fdp = p->p_fd; - register struct file *fp; + register struct file *fp = 0; struct vnode *vp; vm_offset_t addr; vm_size_t size; @@ -243,6 +247,7 @@ struct msync_args { int len; }; +int msync(p, uap, retval) struct proc *p; struct msync_args *uap; @@ -317,6 +322,7 @@ struct munmap_args { int len; }; +int munmap(p, uap, retval) register struct proc *p; register struct munmap_args *uap; @@ -349,8 +355,10 @@ munmap(p, uap, retval) return(0); } +int munmapfd(p, fd) register struct proc *p; + int fd; { #ifdef DEBUG if (mmapdebug & MDB_FOLLOW) @@ -361,6 +369,7 @@ munmapfd(p, fd) * XXX -- should vm_deallocate any regions mapped to this file */ p->p_fd->fd_ofileflags[fd] &= ~UF_MAPPED; + return 0; } struct mprotect_args { @@ -369,6 +378,7 @@ struct mprotect_args { int prot; }; +int mprotect(p, uap, retval) struct proc *p; struct mprotect_args *uap; @@ -416,6 +426,7 @@ struct madvise_args { }; /* ARGSUSED */ +int madvise(p, uap, retval) struct proc *p; struct madvise_args *uap; @@ -433,6 +444,7 @@ struct mincore_args { }; /* ARGSUSED */ +int mincore(p, uap, retval) struct proc *p; struct mincore_args *uap; @@ -450,6 +462,7 @@ mincore(p, uap, retval) * MAP_FILE: a vnode pointer * MAP_ANON: NULL or a file pointer */ +int vm_mmap(map, addr, size, prot, maxprot, flags, handle, foff) register vm_map_t map; register vm_offset_t *addr; @@ -463,7 +476,7 @@ vm_mmap(map, addr, size, prot, maxprot, flags, handle, foff) register vm_pager_t pager; boolean_t fitit; vm_object_t object; - struct vnode *vp; + struct vnode *vp = 0; int type; int rv = KERN_SUCCESS; @@ -727,6 +740,7 @@ out: * Given address and size it returns map attributes as well * as the (locked) object mapped at that location. */ +int vm_region(map, addr, size, prot, max_prot, inheritance, shared, object, objoff) vm_map_t map; vm_offset_t *addr; /* IN/OUT */ @@ -802,6 +816,7 @@ vm_region(map, addr, size, prot, max_prot, inheritance, shared, object, objoff) /* * Yet another bastard routine. */ +int vm_allocate_with_pager(map, addr, size, fitit, pager, poffset, internal) register vm_map_t map; register vm_offset_t *addr; diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c index 11298b7773..4e15dc5590 100644 --- a/sys/vm/vm_object.c +++ b/sys/vm/vm_object.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)vm_object.c 7.4 (Berkeley) 5/7/91 - * $Id: vm_object.c,v 1.7 1993/11/07 17:54:18 wollman Exp $ + * $Id: vm_object.c,v 1.8 1993/11/14 03:07:03 jkh Exp $ */ /* @@ -76,6 +76,11 @@ #include "vm.h" #include "vm_page.h" +static void _vm_object_allocate(vm_size_t, vm_object_t); +static void vm_object_deactivate_pages(vm_object_t); +static void vm_object_cache_trim(void); +static void vm_object_remove(vm_pager_t); + /* * Virtual memory objects maintain the actual data * associated with allocated virtual memory. A given @@ -170,6 +175,7 @@ vm_object_t vm_object_allocate(size) return(result); } +static void _vm_object_allocate(size, object) vm_size_t size; register vm_object_t object; @@ -347,7 +353,7 @@ void vm_object_terminate(object) */ while (object->paging_in_progress != 0) { - vm_object_sleep(object, object, FALSE); + vm_object_sleep((int)object, object, FALSE); vm_object_lock(object); } @@ -442,6 +448,7 @@ void vm_object_terminate(object) * * The object must be locked. */ +void vm_object_page_clean(object, start, end) register vm_object_t object; register vm_offset_t start; @@ -484,6 +491,7 @@ again: * * The object must be locked. */ +static void vm_object_deactivate_pages(object) register vm_object_t object; { @@ -506,6 +514,7 @@ vm_object_deactivate_pages(object) /* * Trim the object cache to size. */ +static void vm_object_cache_trim() { register vm_object_t object; @@ -999,6 +1008,7 @@ void vm_object_enter(object, pager) * is locked. XXX this should be fixed * by reorganizing vm_object_deallocate. */ +static void vm_object_remove(pager) register vm_pager_t pager; { diff --git a/sys/vm/vm_object.h b/sys/vm/vm_object.h index 3fffb86767..845874b6e6 100644 --- a/sys/vm/vm_object.h +++ b/sys/vm/vm_object.h @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)vm_object.h 7.3 (Berkeley) 4/21/91 - * $Id: vm_object.h,v 1.2 1993/10/16 16:20:43 rgrimes Exp $ + * $Id: vm_object.h,v 1.3 1993/11/07 17:54:20 wollman Exp $ */ /* @@ -170,4 +170,6 @@ void vm_object_print(); thread_sleep((event), &(object)->Lock, (interruptible)) #endif /* VM_OBJECT_DEBUG */ +extern void vm_object_page_clean(vm_object_t, vm_offset_t, vm_offset_t); + #endif /* _VM_OBJECT_ */ diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index bcc7b546ec..a61e494354 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)vm_page.c 7.4 (Berkeley) 5/7/91 - * $Id$ + * $Id: vm_page.c,v 1.2 1993/10/16 16:20:44 rgrimes Exp $ */ /* @@ -585,7 +585,7 @@ vm_page_t vm_page_alloc(object, offset) if ((vm_page_free_count < vm_page_free_min) || ((vm_page_free_count < vm_page_free_target) && (vm_page_inactive_count < vm_page_inactive_target))) - thread_wakeup(&vm_pages_needed); + thread_wakeup((int)&vm_pages_needed); return(mem); } diff --git a/sys/vm/vm_pageout.c b/sys/vm/vm_pageout.c index d27b7288f5..96a9ee6f41 100644 --- a/sys/vm/vm_pageout.c +++ b/sys/vm/vm_pageout.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)vm_pageout.c 7.4 (Berkeley) 5/7/91 - * $Id: vm_pageout.c,v 1.3 1993/11/07 17:54:23 wollman Exp $ + * $Id: vm_pageout.c,v 1.4 1993/11/22 09:49:54 davidg Exp $ */ /* @@ -86,6 +86,7 @@ int vm_page_pagesfreed; /* Pages freed by page daemon */ /* * vm_pageout_scan does the dirty work for the pageout daemon. */ +void vm_pageout_scan() { register vm_page_t m; diff --git a/sys/vm/vm_pager.c b/sys/vm/vm_pager.c index 2d5600271c..033afd161d 100644 --- a/sys/vm/vm_pager.c +++ b/sys/vm/vm_pager.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)vm_pager.c 7.4 (Berkeley) 5/7/91 - * $Id: vm_pager.c,v 1.3 1993/10/16 16:20:50 rgrimes Exp $ + * $Id: vm_pager.c,v 1.4 1993/11/22 09:49:54 davidg Exp $ */ /* @@ -161,6 +161,7 @@ vm_pager_deallocate(pager) VM_PAGER_DEALLOC(pager); } +int vm_pager_get(pager, m, sync) vm_pager_t pager; vm_page_t m; @@ -173,6 +174,7 @@ vm_pager_get(pager, m, sync) return(VM_PAGER_GET(pager, m, sync)); } +int vm_pager_put(pager, m, sync) vm_pager_t pager; vm_page_t m; @@ -266,6 +268,7 @@ vm_pager_lookup(list, handle) * This routine gains a reference to the object. * Explicit deallocation is necessary. */ +int pager_cache(object, should_cache) vm_object_t object; boolean_t should_cache; diff --git a/sys/vm/vm_swap.c b/sys/vm/vm_swap.c index 4db1545af2..bb1b0a1ef4 100644 --- a/sys/vm/vm_swap.c +++ b/sys/vm/vm_swap.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)vm_swap.c 7.18 (Berkeley) 5/6/91 - * $Id: vm_swap.c,v 1.4 1993/10/16 16:20:56 rgrimes Exp $ + * $Id: vm_swap.c,v 1.5 1993/11/17 23:27:04 wollman Exp $ */ #include "param.h" @@ -59,6 +59,7 @@ int nswap, nswdev; * to buffers, but rather to pages that * are being swapped in and out. */ +void swapinit() { register int i; @@ -100,6 +101,7 @@ swapinit() sp->av_forw = NULL; } +void swstrategy(bp) register struct buf *bp; { @@ -173,6 +175,7 @@ struct swapon_args { }; /* ARGSUSED */ +int swapon(p, uap, retval) struct proc *p; struct swapon_args *uap; @@ -227,6 +230,7 @@ swapon(p, uap, retval) * space, which is laid out with blocks of dmmax pages circularly * among the devices. */ +int swfree(p, index) struct proc *p; int index; diff --git a/sys/vm/vm_unix.c b/sys/vm/vm_unix.c index 971680371d..d03e51d0b4 100644 --- a/sys/vm/vm_unix.c +++ b/sys/vm/vm_unix.c @@ -37,7 +37,7 @@ * * from: Utah $Hdr: vm_unix.c 1.1 89/11/07$ * from: @(#)vm_unix.c 7.2 (Berkeley) 4/20/91 - * $Id$ + * $Id: vm_unix.c,v 1.3 1993/10/16 16:20:58 rgrimes Exp $ */ /* @@ -55,6 +55,7 @@ struct obreak_args { }; /* ARGSUSED */ +int obreak(p, uap, retval) struct proc *p; struct obreak_args *uap; @@ -94,6 +95,7 @@ obreak(p, uap, retval) * Enlarge the "stack segment" to include the specified * stack pointer for the process. */ +int grow(p, sp) struct proc *p; unsigned sp; @@ -126,6 +128,7 @@ struct ovadvise_args { }; /* ARGSUSED */ +int ovadvise(p, uap, retval) struct proc *p; struct ovadvise_args *uap; diff --git a/sys/vm/vm_user.c b/sys/vm/vm_user.c index 52d0d8dfe2..8b23232b14 100644 --- a/sys/vm/vm_user.c +++ b/sys/vm/vm_user.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)vm_user.c 7.3 (Berkeley) 4/21/91 - * $Id: vm_user.c,v 1.3 1993/10/16 16:20:59 rgrimes Exp $ + * $Id: vm_user.c,v 1.4 1993/11/07 21:26:50 wollman Exp $ */ /* @@ -91,6 +91,7 @@ struct svm_allocate_args { }; /* ARGSUSED */ +int svm_allocate(p, uap, retval) struct proc *p; struct svm_allocate_args *uap; @@ -119,6 +120,7 @@ struct svm_deallocate_args { }; /* ARGSUSED */ +int svm_deallocate(p, uap, retval) struct proc *p; struct svm_deallocate_args *uap; @@ -139,6 +141,7 @@ struct svm_inherit_args { }; /* ARGSUSED */ +int svm_inherit(p, uap, retval) struct proc *p; struct svm_inherit_args *uap; @@ -160,6 +163,7 @@ struct svm_protect_args { }; /* ARGSUSED */ +int svm_protect(p, uap, retval) struct proc *p; struct svm_protect_args *uap; @@ -177,6 +181,7 @@ svm_protect(p, uap, retval) * vm_allocate allocates "zero fill" memory in the specfied * map. */ +int vm_allocate(map, addr, size, anywhere) register vm_map_t map; register vm_offset_t *addr; @@ -208,6 +213,7 @@ vm_allocate(map, addr, size, anywhere) * vm_deallocate deallocates the specified range of addresses in the * specified address map. */ +int vm_deallocate(map, start, size) register vm_map_t map; vm_offset_t start; @@ -226,6 +232,7 @@ vm_deallocate(map, start, size) * vm_inherit sets the inheritence of the specified range in the * specified map. */ +int vm_inherit(map, start, size, new_inheritance) register vm_map_t map; vm_offset_t start; @@ -243,6 +250,7 @@ vm_inherit(map, start, size, new_inheritance) * specified map. */ +int vm_protect(map, start, size, set_maximum, new_protection) register vm_map_t map; vm_offset_t start; diff --git a/sys/vm/vnode_pager.c b/sys/vm/vnode_pager.c index 7a40fe180e..e102e06b25 100644 --- a/sys/vm/vnode_pager.c +++ b/sys/vm/vnode_pager.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * from: @(#)vnode_pager.c 7.5 (Berkeley) 4/20/91 - * $Id: vnode_pager.c,v 1.2 1993/10/16 16:21:02 rgrimes Exp $ + * $Id: vnode_pager.c,v 1.3 1993/11/07 17:54:30 wollman Exp $ */ /* @@ -209,6 +209,7 @@ vnode_pager_dealloc(pager) free((caddr_t)pager, M_VMPAGER); } +int vnode_pager_getpage(pager, m, sync) vm_pager_t pager; vm_page_t m; @@ -235,7 +236,7 @@ vnode_pager_putpage(pager, m, sync) printf("vnode_pager_putpage(%x, %x)\n", pager, m); #endif if (pager == NULL) - return; + return 0; err = vnode_pager_io((vn_pager_t)pager->pg_data, m, UIO_WRITE); if (err == VM_PAGER_OK) { m->clean = TRUE; /* XXX - wrong place */ @@ -301,6 +302,7 @@ vnode_pager_haspage(pager, offset) * Note: this routine may be invoked as a result of a pager put * operation (possibly at object termination time), so we must be careful. */ +void vnode_pager_setsize(vp, nsize) struct vnode *vp; u_long nsize; @@ -352,6 +354,7 @@ vnode_pager_setsize(vp, nsize) vm_object_deallocate(object); } +void vnode_pager_umount(mp) register struct mount *mp; { @@ -416,6 +419,7 @@ vnode_pager_uncache(vp) return(uncached); } +int vnode_pager_io(vnp, m, rw) register vn_pager_t vnp; vm_page_t m; -- 2.20.1