Date: Wed, 17 Sep 2003 15:42:38 -0700 (PDT) From: Marcel Moolenaar <marcel@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 38202 for review Message-ID: <200309172242.h8HMgcWx036599@repoman.freebsd.org>
index | next in thread | raw e-mail
http://perforce.freebsd.org/chv.cgi?CH=38202 Change 38202 by marcel@marcel_nfs on 2003/09/17 15:42:29 IFC @38201 Affected files ... .. //depot/projects/ia64/contrib/sendmail/src/parseaddr.c#11 integrate .. //depot/projects/ia64/crypto/openssh/deattack.c#3 integrate .. //depot/projects/ia64/crypto/openssh/misc.c#5 integrate .. //depot/projects/ia64/crypto/openssh/session.c#17 integrate .. //depot/projects/ia64/crypto/openssh/ssh-agent.c#8 integrate .. //depot/projects/ia64/crypto/openssh/version.h#12 integrate .. //depot/projects/ia64/sbin/ifconfig/ifieee80211.c#5 integrate .. //depot/projects/ia64/sys/crypto/rijndael/rijndael-api-fst.c#5 integrate .. //depot/projects/ia64/sys/dev/acpica/acpi_pci.c#6 integrate .. //depot/projects/ia64/sys/dev/pci/pci.c#34 integrate .. //depot/projects/ia64/sys/dev/pci/pci_private.h#9 integrate .. //depot/projects/ia64/sys/dev/sio/sio.c#52 integrate .. //depot/projects/ia64/sys/i386/acpica/acpi_machdep.c#13 integrate .. //depot/projects/ia64/sys/isa/fd.c#22 integrate .. //depot/projects/ia64/sys/net/bridge.c#21 integrate .. //depot/projects/ia64/sys/netinet/ip_fw2.c#27 integrate .. //depot/projects/ia64/sys/netinet/raw_ip.c#28 integrate .. //depot/projects/ia64/sys/sys/param.h#42 integrate .. //depot/projects/ia64/sys/vm/vm_object.c#67 integrate .. //depot/projects/ia64/sys/vm/vm_pageout.c#46 integrate .. //depot/projects/ia64/usr.bin/window/main.c#3 integrate .. //depot/projects/ia64/usr.sbin/sysinstall/dmenu.c#3 integrate Differences ... ==== //depot/projects/ia64/contrib/sendmail/src/parseaddr.c#11 (text+ko) ==== @@ -700,7 +700,11 @@ addr[MAXNAME] = '\0'; returnnull: if (delimptr != NULL) + { + if (p > addr) + p--; *delimptr = p; + } CurEnv->e_to = saveto; return NULL; } ==== //depot/projects/ia64/crypto/openssh/deattack.c#3 (text+ko) ==== @@ -100,12 +100,12 @@ if (h == NULL) { debug("Installing crc compensation attack detector."); + h = (u_int16_t *) xmalloc(l * HASH_ENTRYSIZE); n = l; - h = (u_int16_t *) xmalloc(n * HASH_ENTRYSIZE); } else { if (l > n) { + h = (u_int16_t *) xrealloc(h, l * HASH_ENTRYSIZE); n = l; - h = (u_int16_t *) xrealloc(h, n * HASH_ENTRYSIZE); } } ==== //depot/projects/ia64/crypto/openssh/misc.c#5 (text+ko) ==== @@ -308,18 +308,21 @@ { va_list ap; char buf[1024]; + int nalloc; va_start(ap, fmt); vsnprintf(buf, sizeof(buf), fmt, ap); va_end(ap); + nalloc = args->nalloc; if (args->list == NULL) { - args->nalloc = 32; + nalloc = 32; args->num = 0; - } else if (args->num+2 >= args->nalloc) - args->nalloc *= 2; + } else if (args->num+2 >= nalloc) + nalloc *= 2; - args->list = xrealloc(args->list, args->nalloc * sizeof(char *)); + args->list = xrealloc(args->list, nalloc * sizeof(char *)); + args->nalloc = nalloc; args->list[args->num++] = xstrdup(buf); args->list[args->num] = NULL; } ==== //depot/projects/ia64/crypto/openssh/session.c#17 (text+ko) ==== @@ -34,7 +34,7 @@ #include "includes.h" RCSID("$OpenBSD: session.c,v 1.154 2003/03/05 22:33:43 markus Exp $"); -RCSID("$FreeBSD: src/crypto/openssh/session.c,v 1.40 2003/04/23 17:10:53 des Exp $"); +RCSID("$FreeBSD: src/crypto/openssh/session.c,v 1.41 2003/09/17 14:36:14 nectar Exp $"); #include "ssh.h" #include "ssh1.h" @@ -863,8 +863,9 @@ child_set_env(char ***envp, u_int *envsizep, const char *name, const char *value) { + char **env; + u_int envsize; u_int i, namelen; - char **env; /* * Find the slot where the value should be stored. If the variable @@ -881,12 +882,13 @@ xfree(env[i]); } else { /* New variable. Expand if necessary. */ - if (i >= (*envsizep) - 1) { - if (*envsizep >= 1000) - fatal("child_set_env: too many env vars," - " skipping: %.100s", name); - (*envsizep) += 50; - env = (*envp) = xrealloc(env, (*envsizep) * sizeof(char *)); + envsize = *envsizep; + if (i >= envsize - 1) { + if (envsize >= 1000) + fatal("child_set_env: too many env vars"); + envsize += 50; + env = (*envp) = xrealloc(env, envsize * sizeof(char *)); + *envsizep = envsize; } /* Need to set the NULL pointer at end of array beyond the new slot. */ env[i + 1] = NULL; ==== //depot/projects/ia64/crypto/openssh/ssh-agent.c#8 (text+ko) ==== @@ -36,7 +36,7 @@ #include "includes.h" #include "openbsd-compat/sys-queue.h" RCSID("$OpenBSD: ssh-agent.c,v 1.108 2003/03/13 11:44:50 markus Exp $"); -RCSID("$FreeBSD: src/crypto/openssh/ssh-agent.c,v 1.18 2003/04/23 17:10:53 des Exp $"); +RCSID("$FreeBSD: src/crypto/openssh/ssh-agent.c,v 1.19 2003/09/17 14:36:14 nectar Exp $"); #include <openssl/evp.h> #include <openssl/md5.h> @@ -768,7 +768,7 @@ static void new_socket(sock_type type, int fd) { - u_int i, old_alloc; + u_int i, old_alloc, new_alloc; if (fcntl(fd, F_SETFL, O_NONBLOCK) < 0) error("fcntl O_NONBLOCK: %s", strerror(errno)); @@ -779,25 +779,26 @@ for (i = 0; i < sockets_alloc; i++) if (sockets[i].type == AUTH_UNUSED) { sockets[i].fd = fd; - sockets[i].type = type; buffer_init(&sockets[i].input); buffer_init(&sockets[i].output); buffer_init(&sockets[i].request); + sockets[i].type = type; return; } old_alloc = sockets_alloc; - sockets_alloc += 10; + new_alloc = sockets_alloc + 10; if (sockets) - sockets = xrealloc(sockets, sockets_alloc * sizeof(sockets[0])); + sockets = xrealloc(sockets, new_alloc * sizeof(sockets[0])); else - sockets = xmalloc(sockets_alloc * sizeof(sockets[0])); - for (i = old_alloc; i < sockets_alloc; i++) + sockets = xmalloc(new_alloc * sizeof(sockets[0])); + for (i = old_alloc; i < new_alloc; i++) sockets[i].type = AUTH_UNUSED; - sockets[old_alloc].type = type; + sockets_alloc = new_alloc; sockets[old_alloc].fd = fd; buffer_init(&sockets[old_alloc].input); buffer_init(&sockets[old_alloc].output); buffer_init(&sockets[old_alloc].request); + sockets[old_alloc].type = type; } static int ==== //depot/projects/ia64/crypto/openssh/version.h#12 (text+ko) ==== @@ -1,11 +1,11 @@ /* $OpenBSD: version.h,v 1.37 2003/04/01 10:56:46 markus Exp $ */ -/* $FreeBSD: src/crypto/openssh/version.h,v 1.21 2003/09/16 14:31:46 nectar Exp $ */ +/* $FreeBSD: src/crypto/openssh/version.h,v 1.22 2003/09/17 14:36:14 nectar Exp $ */ #ifndef SSH_VERSION #define SSH_VERSION (ssh_version_get()) #define SSH_VERSION_BASE "OpenSSH_3.6.1p1" -#define SSH_VERSION_ADDENDUM "FreeBSD-20030916" +#define SSH_VERSION_ADDENDUM "FreeBSD-20030917" const char *ssh_version_get(void); void ssh_version_set_addendum(const char *add); ==== //depot/projects/ia64/sbin/ifconfig/ifieee80211.c#5 (text+ko) ==== @@ -24,7 +24,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sbin/ifconfig/ifieee80211.c,v 1.6 2003/06/28 06:23:40 sam Exp $ + * $FreeBSD: src/sbin/ifconfig/ifieee80211.c,v 1.7 2003/09/17 19:27:43 sam Exp $ */ /*- @@ -76,6 +76,7 @@ #include <net/if_types.h> #include <net/route.h> #include <net80211/ieee80211.h> +#include <net80211/ieee80211_crypto.h> #include <net80211/ieee80211_ioctl.h> #include <ctype.h> @@ -229,7 +230,7 @@ { int key = 0; int len; - u_int8_t data[14]; + u_int8_t data[IEEE80211_KEYBUF_SIZE]; if (isdigit(val[0]) && val[1] == ':') { key = atoi(val)-1; @@ -253,7 +254,7 @@ { int txkey; int i, len; - u_int8_t data[14]; + u_int8_t data[IEEE80211_KEYBUF_SIZE]; set80211(s, IEEE80211_IOC_WEP, IEEE80211_WEP_ON, 0, NULL); @@ -427,10 +428,12 @@ warn("WEP support, but can get keys!"); goto end; } - if (ireq.i_len == 0 || ireq.i_len > 13) + if (ireq.i_len == 0 || + ireq.i_len > IEEE80211_KEYBUF_SIZE) continue; printf("%cwepkey %d:%s", spacer, i+1, - ireq.i_len <= 5 ? "64-bit" : "128-bit"); + ireq.i_len <= 5 ? "40-bit" : + ireq.i_len <= 13 ? "104-bit" : "128-bit"); if (spacer == '\t') spacer = ' '; } ==== //depot/projects/ia64/sys/crypto/rijndael/rijndael-api-fst.c#5 (text+ko) ==== @@ -16,7 +16,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/crypto/rijndael/rijndael-api-fst.c,v 1.5 2003/06/10 21:43:49 obrien Exp $"); +__FBSDID("$FreeBSD: src/sys/crypto/rijndael/rijndael-api-fst.c,v 1.6 2003/09/17 08:51:43 ume Exp $"); #include <sys/param.h> #include <sys/types.h> @@ -225,7 +225,7 @@ outBuffer += 16; } padLen = 16 - (inputOctets - 16*numBlocks); - if (padLen > 0 && padLen <= 16) + if (padLen <= 0 || padLen > 16) return BAD_CIPHER_STATE; bcopy(input, block, 16 - padLen); for (cp = block + 16 - padLen; cp < block + 16; cp++) ==== //depot/projects/ia64/sys/dev/acpica/acpi_pci.c#6 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_pci.c,v 1.5 2003/08/24 17:48:01 obrien Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_pci.c,v 1.6 2003/09/17 08:32:44 iwasaki Exp $"); #include "opt_bus.h" @@ -79,7 +79,7 @@ DEVMETHOD(device_attach, acpi_pci_attach), DEVMETHOD(device_shutdown, bus_generic_shutdown), DEVMETHOD(device_suspend, bus_generic_suspend), - DEVMETHOD(device_resume, bus_generic_resume), + DEVMETHOD(device_resume, pci_resume), /* Bus interface */ DEVMETHOD(bus_print_child, pci_print_child), ==== //depot/projects/ia64/sys/dev/pci/pci.c#34 (text+ko) ==== @@ -25,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/pci/pci.c,v 1.232 2003/09/14 19:30:00 scottl Exp $ + * $FreeBSD: src/sys/dev/pci/pci.c,v 1.233 2003/09/17 08:32:44 iwasaki Exp $ * */ @@ -89,7 +89,7 @@ DEVMETHOD(device_attach, pci_attach), DEVMETHOD(device_shutdown, bus_generic_shutdown), DEVMETHOD(device_suspend, bus_generic_suspend), - DEVMETHOD(device_resume, bus_generic_resume), + DEVMETHOD(device_resume, pci_resume), /* Bus interface */ DEVMETHOD(bus_print_child, pci_print_child), @@ -1509,3 +1509,35 @@ return (0); } + +int +pci_resume(device_t dev) +{ + int numdevs; + int i; + device_t *children; + device_t child; + struct pci_devinfo *dinfo; + pcicfgregs *cfg; + + device_get_children(dev, &children, &numdevs); + + for (i = 0; i < numdevs; i++) { + child = children[i]; + + dinfo = device_get_ivars(child); + cfg = &dinfo->cfg; + if (cfg->intpin > 0 && PCI_INTERRUPT_VALID(cfg->intline)) { + cfg->intline = PCI_ASSIGN_INTERRUPT(dev, child); + if (PCI_INTERRUPT_VALID(cfg->intline)) { + pci_write_config(child, PCIR_INTLINE, + cfg->intline, 1); + } + } + } + + free(children, M_TEMP); + + return (bus_generic_resume(dev)); +} + ==== //depot/projects/ia64/sys/dev/pci/pci_private.h#9 (text+ko) ==== @@ -25,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/pci/pci_private.h,v 1.10 2003/08/22 03:11:53 imp Exp $ + * $FreeBSD: src/sys/dev/pci/pci_private.h,v 1.11 2003/09/17 08:32:44 iwasaki Exp $ * */ @@ -73,4 +73,5 @@ int pci_child_pnpinfo_str_method(device_t cbdev, device_t child, char *buf, size_t buflen); int pci_assign_interrupt_method(device_t dev, device_t child); +int pci_resume(device_t dev); #endif /* _PCI_PRIVATE_H_ */ ==== //depot/projects/ia64/sys/dev/sio/sio.c#52 (text+ko) ==== @@ -35,7 +35,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/sio/sio.c,v 1.405 2003/09/15 13:49:18 bde Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/sio/sio.c,v 1.408 2003/09/17 17:26:00 bde Exp $"); #include "opt_comconsole.h" #include "opt_compat.h" @@ -113,21 +113,20 @@ #define COM_ISMULTIPORT(flags) (0) #endif /* COM_MULTIPORT */ +#define COM_C_IIR_TXRDYBUG 0x80000 #define COM_CONSOLE(flags) ((flags) & 0x10) +#define COM_DEBUGGER(flags) ((flags) & 0x80) +#define COM_FIFOSIZE(flags) (((flags) & 0xff000000) >> 24) #define COM_FORCECONSOLE(flags) ((flags) & 0x20) +#define COM_IIR_TXRDYBUG(flags) ((flags) & COM_C_IIR_TXRDYBUG) #define COM_LLCONSOLE(flags) ((flags) & 0x40) -#define COM_DEBUGGER(flags) ((flags) & 0x80) #define COM_LOSESOUTINTS(flags) ((flags) & 0x08) -#define COM_NOFIFO(flags) ((flags) & 0x02) +#define COM_NOFIFO(flags) ((flags) & 0x02) +#define COM_NOPROBE(flags) ((flags) & 0x40000) +#define COM_NOSCR(flags) ((flags) & 0x100000) #define COM_PPSCTS(flags) ((flags) & 0x10000) -#define COM_ST16650A(flags) ((flags) & 0x20000) -#define COM_C_NOPROBE (0x40000) -#define COM_NOPROBE(flags) ((flags) & COM_C_NOPROBE) -#define COM_C_IIR_TXRDYBUG (0x80000) -#define COM_IIR_TXRDYBUG(flags) ((flags) & COM_C_IIR_TXRDYBUG) -#define COM_NOSCR(flags) ((flags) & 0x100000) +#define COM_ST16650A(flags) ((flags) & 0x20000) #define COM_TI16754(flags) ((flags) & 0x200000) -#define COM_FIFOSIZE(flags) (((flags) & 0xff000000) >> 24) #define sio_getreg(com, off) \ (bus_space_read_1((com)->bst, (com)->bsh, (off))) @@ -196,7 +195,6 @@ u_char extra_state; /* more flag bits, separate for order trick */ u_char fifo_image; /* copy of value written to FIFO */ bool_t hasfifo; /* nonzero for 16550 UARTs */ - bool_t st16650a; /* Is a Startech 16650A or RTS/CTS compat */ bool_t loses_outints; /* nonzero if device loses output interrupts */ u_char mcr_image; /* copy of value written to MCR */ #ifdef COM_MULTIPORT @@ -206,6 +204,7 @@ bool_t gone; /* hardware disappeared */ bool_t poll; /* nonzero if polling is required */ bool_t poll_output; /* nonzero if polling for output is required */ + bool_t st16650a; /* nonzero if Startech 16650A compatible */ int unit; /* unit number */ int dtr_wait; /* time to hold DTR down on close (* 1/hz) */ u_int tx_fifo_size; @@ -450,7 +449,7 @@ device_printf(dev, "NULL com in siounload\n"); return (0); } - com->gone = 1; + com->gone = TRUE; for (i = 0 ; i < 6; i++) destroy_dev(com->devs[i]); if (com->irqres) { @@ -1023,7 +1022,6 @@ } sio_setreg(com, com_fifo, FIFO_ENABLE | FIFO_RX_HIGH); DELAY(100); - com->st16650a = 0; switch (inb(com->int_id_port) & IIR_FIFO_MASK) { case FIFO_RX_LOW: printf(" 16450"); @@ -1037,40 +1035,40 @@ case FIFO_RX_HIGH: if (COM_NOFIFO(flags)) { printf(" 16550A fifo disabled"); - } else { - com->hasfifo = TRUE; - if (COM_ST16650A(flags)) { - com->st16650a = 1; - com->tx_fifo_size = 32; - printf(" ST16650A"); - } else if (COM_TI16754(flags)) { - com->tx_fifo_size = 64; - printf(" TI16754"); - } else { - com->tx_fifo_size = COM_FIFOSIZE(flags); - printf(" 16550A"); - } + break; + } + com->hasfifo = TRUE; + if (COM_ST16650A(flags)) { + printf(" ST16650A"); + com->st16650a = TRUE; + com->tx_fifo_size = 32; + break; + } + if (COM_TI16754(flags)) { + printf(" TI16754"); + com->tx_fifo_size = 64; + break; } + printf(" 16550A"); #ifdef COM_ESP for (espp = likely_esp_ports; *espp != 0; espp++) if (espattach(com, *espp)) { com->tx_fifo_size = 1024; break; } + if (com->esp != NULL) + break; #endif - if (!com->st16650a && !COM_TI16754(flags)) { - if (!com->tx_fifo_size) - com->tx_fifo_size = 16; - else - printf(" lookalike with %d bytes FIFO", - com->tx_fifo_size); - } - + com->tx_fifo_size = COM_FIFOSIZE(flags); + if (com->tx_fifo_size == 0) + com->tx_fifo_size = 16; + else + printf(" lookalike with %u bytes FIFO", + com->tx_fifo_size); break; } - #ifdef COM_ESP - if (com->esp) { + if (com->esp != NULL) { /* * Set 16550 compatibility mode. * We don't use the ESP_MODE_SCALE bit to increase the @@ -2205,6 +2203,7 @@ u_int divisor; u_char dlbh; u_char dlbl; + u_char efr_flowbits; int s; int unit; @@ -2309,18 +2308,13 @@ sio_setreg(com, com_dlbh, dlbh); } - sio_setreg(com, com_cfcr, com->cfcr_image = cfcr); - if (!(tp->t_state & TS_TTSTOP)) com->state |= CS_TTGO; + efr_flowbits = 0; if (cflag & CRTS_IFLOW) { - if (com->st16650a) { - sio_setreg(com, com_cfcr, 0xbf); - sio_setreg(com, com_fifo, - sio_getreg(com, com_fifo) | 0x40); - } com->state |= CS_RTS_IFLOW; + efr_flowbits |= EFR_AUTORTS; /* * If CS_RTS_IFLOW just changed from off to on, the change * needs to be propagated to MCR_RTS. This isn't urgent, @@ -2334,14 +2328,8 @@ * on here, since comstart() won't do it later. */ outb(com->modem_ctl_port, com->mcr_image |= MCR_RTS); - if (com->st16650a) { - sio_setreg(com, com_cfcr, 0xbf); - sio_setreg(com, com_fifo, - sio_getreg(com, com_fifo) & ~0x40); - } } - /* * Set up state to handle output flow control. * XXX - worth handling MDMBUF (DCD) flow control at the lowest level? @@ -2351,22 +2339,18 @@ com->state &= ~CS_CTS_OFLOW; if (cflag & CCTS_OFLOW) { com->state |= CS_CTS_OFLOW; + efr_flowbits |= EFR_AUTOCTS; if (!(com->last_modem_status & MSR_CTS)) com->state &= ~CS_ODEVREADY; - if (com->st16650a) { - sio_setreg(com, com_cfcr, 0xbf); - sio_setreg(com, com_fifo, - sio_getreg(com, com_fifo) | 0x80); - } - } else { - if (com->st16650a) { - sio_setreg(com, com_cfcr, 0xbf); - sio_setreg(com, com_fifo, - sio_getreg(com, com_fifo) & ~0x80); - } } - sio_setreg(com, com_cfcr, com->cfcr_image); + if (com->st16650a) { + sio_setreg(com, com_lcr, LCR_EFR_ENABLE); + sio_setreg(com, com_efr, + (sio_getreg(com, com_efr) + & ~(EFR_AUTOCTS | EFR_AUTORTS)) | efr_flowbits); + } + sio_setreg(com, com_cfcr, com->cfcr_image = cfcr); /* XXX shouldn't call functions while intrs are disabled. */ disc_optim(tp, t, com); @@ -3173,7 +3157,6 @@ return (c); } - static int siocngetc(struct consdev *cd) { ==== //depot/projects/ia64/sys/i386/acpica/acpi_machdep.c#13 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/i386/acpica/acpi_machdep.c,v 1.12 2003/09/10 05:29:30 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/i386/acpica/acpi_machdep.c,v 1.13 2003/09/17 08:47:39 iwasaki Exp $"); #include <sys/param.h> #include <sys/bus.h> @@ -98,6 +98,15 @@ if (battp->state & ACPI_BATT_STAT_CHARGING) state = 3; /* charging */ + /* If still unknown, determine it based on the battery capacity. */ + if (state == 0xff) { + if (battp->cap >= 50) { + state = 0; /* high */ + } else { + state = 1; /* low */ + } + } + return (state); } ==== //depot/projects/ia64/sys/isa/fd.c#22 (text+ko) ==== @@ -53,7 +53,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/isa/fd.c,v 1.258 2003/09/11 19:27:24 phk Exp $"); +__FBSDID("$FreeBSD: src/sys/isa/fd.c,v 1.260 2003/09/17 07:40:00 phk Exp $"); #include "opt_fdc.h" #include "card.h" @@ -404,10 +404,10 @@ static int fd_in(struct fdc_data *, int *); static int out_fdc(struct fdc_data *, int); /* - * The open function is named Fdopen() to avoid confusion with fdopen() + * The open function is named fdopen() to avoid confusion with fdopen() * in fd(4). The difference is now only meaningful for debuggers. */ -static d_open_t Fdopen; +static d_open_t fdopen; static d_close_t fdclose; static d_strategy_t fdstrategy; static void fdstart(struct fdc_data *); @@ -483,7 +483,7 @@ #define CDEV_MAJOR 9 static struct cdevsw fd_cdevsw = { - .d_open = Fdopen, + .d_open = fdopen, .d_close = fdclose, .d_read = physread, .d_write = physwrite, @@ -1171,6 +1171,7 @@ UID_ROOT, GID_OPERATOR, 0640, name); fd->clonedevs[i] = *dev; + fd->clonedevs[i]->si_drv1 = fd; return; } } @@ -1336,6 +1337,7 @@ #endif fd->masterdev = make_dev(&fd_cdevsw, fd->fdu << 6, UID_ROOT, GID_OPERATOR, 0640, "fd%d", fd->fdu); + fd->masterdev->si_drv1 = fd; #ifdef GONE_IN_5 { int i; @@ -1560,15 +1562,15 @@ * auxiliary functions). */ static int -Fdopen(dev_t dev, int flags, int mode, struct thread *td) +fdopen(dev_t dev, int flags, int mode, struct thread *td) { - fdu_t fdu = FDUNIT(minor(dev)); int type = FDTYPE(minor(dev)); fd_p fd; fdc_p fdc; int rv, unitattn, dflags; - if ((fd = devclass_get_softc(fd_devclass, fdu)) == 0) + fd = dev->si_drv1; + if (fd == NULL) return (ENXIO); fdc = fd->fdc; if ((fdc == NULL) || (fd->type == FDT_NONE)) @@ -1664,10 +1666,9 @@ static int fdclose(dev_t dev, int flags, int mode, struct thread *td) { - fdu_t fdu = FDUNIT(minor(dev)); struct fd_data *fd; - fd = devclass_get_softc(fd_devclass, fdu); + fd = dev->si_drv1; fd->flags &= ~(FD_OPEN | FD_NONBLOCK); fd->options &= ~(FDOPT_NORETRY | FDOPT_NOERRLOG | FDOPT_NOERROR); @@ -1685,8 +1686,8 @@ size_t fdblk; fdu = FDUNIT(minor(bp->bio_dev)); - fd = devclass_get_softc(fd_devclass, fdu); - if (fd == 0) + fd = bp->bio_dev->si_drv1; + if (fd == NULL) panic("fdstrategy: buf for nonexistent device (%#lx, %#lx)", (u_long)major(bp->bio_dev), (u_long)minor(bp->bio_dev)); fdc = fd->fdc; @@ -1883,7 +1884,7 @@ int i, n, oopts, rv; fdu = FDUNIT(minor(dev)); - fd = devclass_get_softc(fd_devclass, fdu); + fd = dev->si_drv1; switch (fd->type) { default: @@ -2010,7 +2011,7 @@ return (0); } fdu = FDUNIT(minor(bp->bio_dev)); - fd = devclass_get_softc(fd_devclass, fdu); + fd = bp->bio_dev->si_drv1; fdblk = 128 << fd->ft->secsize; if (fdc->fd && (fd != fdc->fd)) device_printf(fd->dev, "confused fd pointers\n"); @@ -2513,7 +2514,7 @@ /* XXX shouldn't this be cached somewhere? */ fdu = FDUNIT(minor(bp->bio_dev)); - fd = devclass_get_softc(fd_devclass, fdu); + fd = bp->bio_dev->si_drv1; if (fd->options & FDOPT_NORETRY) goto fail; @@ -2584,7 +2585,7 @@ int error; fdu = FDUNIT(minor(dev)); - fd = devclass_get_softc(fd_devclass, fdu); + fd = dev->si_drv1; fdblk = 128 << fd->ft->secsize; finfo = (struct fd_formb *)data; idfield = (struct fdc_readid *)data; @@ -2636,7 +2637,7 @@ fdu = FDUNIT(minor(dev)); type = FDTYPE(minor(dev)); - fd = devclass_get_softc(fd_devclass, fdu); + fd = dev->si_drv1; /* * First, handle everything that could be done with ==== //depot/projects/ia64/sys/net/bridge.c#21 (text+ko) ==== @@ -24,7 +24,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/net/bridge.c,v 1.68 2003/09/17 00:50:33 sam Exp $ + * $FreeBSD: src/sys/net/bridge.c,v 1.69 2003/09/17 18:14:49 sam Exp $ */ /* @@ -852,7 +852,7 @@ eh->ether_shost, ".", eh->ether_dhost, ".", ntohs(eh->ether_type), - (dst <= BDG_FORWARD) ? bdg_dst_names[(int)dst] : + (dst <= BDG_FORWARD) ? bdg_dst_names[(uintptr_t)dst] : dst->if_name, (dst <= BDG_FORWARD) ? 0 : dst->if_unit)); ==== //depot/projects/ia64/sys/netinet/ip_fw2.c#27 (text+ko) ==== @@ -22,7 +22,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/netinet/ip_fw2.c,v 1.38 2003/09/17 00:56:50 sam Exp $ + * $FreeBSD: src/sys/netinet/ip_fw2.c,v 1.39 2003/09/17 22:06:47 sam Exp $ */ #define DEB(x) @@ -111,7 +111,8 @@ struct mtx mtx; /* lock guarding rule list */ }; #define IPFW_LOCK_INIT(_chain) \ - mtx_init(&(_chain)->mtx, "IPFW static rules", NULL, MTX_DEF) + mtx_init(&(_chain)->mtx, "IPFW static rules", NULL, \ + MTX_DEF | MTX_RECURSE) #define IPFW_LOCK_DESTROY(_chain) mtx_destroy(&(_chain)->mtx) #define IPFW_LOCK(_chain) mtx_lock(&(_chain)->mtx) #define IPFW_UNLOCK(_chain) mtx_unlock(&(_chain)->mtx) ==== //depot/projects/ia64/sys/netinet/raw_ip.c#28 (text+ko) ==== @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)raw_ip.c 8.7 (Berkeley) 5/15/95 - * $FreeBSD: src/sys/netinet/raw_ip.c,v 1.117 2003/09/01 04:27:34 sam Exp $ + * $FreeBSD: src/sys/netinet/raw_ip.c,v 1.118 2003/09/17 21:13:16 sam Exp $ */ #include "opt_inet6.h" @@ -709,10 +709,8 @@ for (inp = LIST_FIRST(ripcbinfo.listhead), i = 0; inp && i < n; inp = LIST_NEXT(inp, inp_list)) { INP_LOCK(inp); - if (inp->inp_gencnt <= gencnt) { - if (cr_canseesocket(req->td->td_ucred, - inp->inp_socket)) - continue; + if (inp->inp_gencnt <= gencnt && + cr_canseesocket(req->td->td_ucred, inp->inp_socket) == 0) { /* XXX held references? */ inp_list[i++] = inp; } ==== //depot/projects/ia64/sys/sys/param.h#42 (text+ko) ==== @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)param.h 8.3 (Berkeley) 4/4/95 - * $FreeBSD: src/sys/sys/param.h,v 1.166 2003/09/08 11:54:59 tjr Exp $ + * $FreeBSD: src/sys/sys/param.h,v 1.167 2003/09/17 20:37:02 jhb Exp $ */ #ifndef _SYS_PARAM_H_ @@ -57,7 +57,7 @@ * scheme is: <major><two digit minor><0 if release branch, otherwise 1>xx */ #undef __FreeBSD_version -#define __FreeBSD_version 501106 /* Master, propagated to newvers */ +#define __FreeBSD_version 501107 /* Master, propagated to newvers */ #ifndef NULL #define NULL 0 ==== //depot/projects/ia64/sys/vm/vm_object.c#67 (text+ko) ==== @@ -67,7 +67,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/vm/vm_object.c,v 1.305 2003/09/15 05:58:27 alc Exp $"); +__FBSDID("$FreeBSD: src/sys/vm/vm_object.c,v 1.306 2003/09/17 07:00:14 alc Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -1093,8 +1093,6 @@ vm_object_t source; vm_object_t result; - GIANT_REQUIRED; - source = *object; /* ==== //depot/projects/ia64/sys/vm/vm_pageout.c#46 (text+ko) ==== @@ -71,7 +71,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/vm/vm_pageout.c,v 1.242 2003/08/31 00:00:46 alc Exp $"); +__FBSDID("$FreeBSD: src/sys/vm/vm_pageout.c,v 1.243 2003/09/17 06:55:42 alc Exp $"); #include "opt_vm.h" #include <sys/param.h> @@ -926,13 +926,14 @@ */ if (object->type == OBJT_VNODE) { vp = object->handle; - mp = NULL; if (vp->v_type == VREG) vn_start_write(vp, &mp, V_NOWAIT); vm_page_unlock_queues(); + VI_LOCK(vp); VM_OBJECT_UNLOCK(object); - if (vget(vp, LK_EXCLUSIVE|LK_TIMELOCK, curthread)) { + if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK | + LK_TIMELOCK, curthread)) { VM_OBJECT_LOCK(object); vm_page_lock_queues(); ++pageout_lock_miss; ==== //depot/projects/ia64/usr.bin/window/main.c#3 (text+ko) ==== @@ -43,7 +43,7 @@ #ifndef lint static char sccsid[] = "@(#)main.c 8.2 (Berkeley) 4/2/94"; static char rcsid[] = - "$FreeBSD: src/usr.bin/window/main.c,v 1.7 2001/05/17 09:38:48 obrien Exp $"; + "$FreeBSD: src/usr.bin/window/main.c,v 1.8 2003/09/17 03:58:52 marcel Exp $"; #endif /* not lint */ #include "defs.h" @@ -55,10 +55,8 @@ #include "char.h" #include "local.h" -void *usage(void); +#define next(a) (*++*(a) ? *(a) : (*++(a) ? *(a) : (char *)(uintptr_t)usage())) -#define next(a) (*++*(a) ? *(a) : (*++(a) ? *(a) : (char *)usage())) - /*ARGSUSED*/ main(argc, argv) char **argv; @@ -201,10 +199,9 @@ return 0; } -void * usage() { (void) fprintf(stderr, "usage: window [-e escape-char] [-c command] [-t] [-f] [-d]\n"); exit(1); - return NULL; /* for lint */ + return 0; /* for lint */ } ==== //depot/projects/ia64/usr.sbin/sysinstall/dmenu.c#3 (text+ko) ==== @@ -4,7 +4,7 @@ * This is probably the last attempt in the `sysinstall' line, the next * generation being slated for what's essentially a complete rewrite. * - * $FreeBSD: src/usr.sbin/sysinstall/dmenu.c,v 1.44 2000/03/08 14:20:26 jkh Exp $ + * $FreeBSD: src/usr.sbin/sysinstall/dmenu.c,v 1.45 2003/09/17 03:45:30 marcel Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -287,16 +287,19 @@ dialog_clear_norefresh(); /* Pop up that dialog! */ if (menu->type & DMENU_NORMAL_TYPE) - rval = dialog_menu((u_char *)menu->title, (u_char *)menu->prompt, -1, -1, - menu_height(menu, n), -n, items, (char *)(uintptr_t)buttons, choice, scroll); + rval = dialog_menu((u_char *)menu->title, (u_char *)menu->prompt, + -1, -1, menu_height(menu, n), -n, items, + (char *)(uintptr_t)buttons, choice, scroll); else if (menu->type & DMENU_RADIO_TYPE) - rval = dialog_radiolist((u_char *)menu->title, (u_char *)menu->prompt, -1, -1, - menu_height(menu, n), -n, items, (char *)(uintptr_t)buttons); + rval = dialog_radiolist((u_char *)menu->title, + (u_char *)menu->prompt, -1, -1, menu_height(menu, n), -n, + items, (char *)(uintptr_t)buttons); else if (menu->type & DMENU_CHECKLIST_TYPE) - rval = dialog_checklist((u_char *)menu->title, (u_char *)menu->prompt, -1, -1, - menu_height(menu, n), -n, items, (char *)(uintptr_t)buttons); + rval = dialog_checklist((u_char *)menu->title, + (u_char *)menu->prompt, -1, -1, menu_height(menu, n), -n, + items, (char *)(uintptr_t)buttons); else msgFatal("Menu: `%s' is of an unknown type\n", menu->title); if (exited) {help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200309172242.h8HMgcWx036599>
