From owner-p4-projects@FreeBSD.ORG Mon Dec 19 21:35:28 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id CA56316A423; Mon, 19 Dec 2005 21:35:27 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9DD0D16A41F for ; Mon, 19 Dec 2005 21:35:27 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5010643D45 for ; Mon, 19 Dec 2005 21:35:27 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id jBJLZP9m033875 for ; Mon, 19 Dec 2005 21:35:25 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id jBJLZPtG033872 for perforce@freebsd.org; Mon, 19 Dec 2005 21:35:25 GMT (envelope-from imp@freebsd.org) Date: Mon, 19 Dec 2005 21:35:25 GMT Message-Id: <200512192135.jBJLZPtG033872@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to imp@freebsd.org using -f From: Warner Losh To: Perforce Change Reviews Cc: Subject: PERFORCE change 88425 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Dec 2005 21:35:28 -0000 http://perforce.freebsd.org/chv.cgi?CH=88425 Change 88425 by imp@imp_Speedy on 2005/12/19 21:35:06 Define the processor's master clock. Affected files ... .. //depot/projects/arm/src/sys/arm/at91/at91rm92reg.h#8 edit Differences ... ==== //depot/projects/arm/src/sys/arm/at91/at91rm92reg.h#8 (text+ko) ==== @@ -622,5 +622,6 @@ #define AT91RM92_PIO_PD27 (1 << 27) #define AT91RM92_PD27_TPK15 (AT91RM92_PIO_PD27) /* ETM Trace Packet 15 */ +#define AT91C_MASTER_CLOCK 60000000 #endif /* AT91RM92REG_H_ */ From owner-p4-projects@FreeBSD.ORG Mon Dec 19 21:36:28 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 4C80016A422; Mon, 19 Dec 2005 21:36:28 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2328416A41F for ; Mon, 19 Dec 2005 21:36:28 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id CA57443D60 for ; Mon, 19 Dec 2005 21:36:27 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id jBJLaRtT033931 for ; Mon, 19 Dec 2005 21:36:27 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id jBJLaRS8033928 for perforce@freebsd.org; Mon, 19 Dec 2005 21:36:27 GMT (envelope-from imp@freebsd.org) Date: Mon, 19 Dec 2005 21:36:27 GMT Message-Id: <200512192136.jBJLaRS8033928@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to imp@freebsd.org using -f From: Warner Losh To: Perforce Change Reviews Cc: Subject: PERFORCE change 88426 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Dec 2005 21:36:29 -0000 http://perforce.freebsd.org/chv.cgi?CH=88426 Change 88426 by imp@imp_Speedy on 2005/12/19 21:35:29 Default RCLK is the system's master clock. Add some comments. Affected files ... .. //depot/projects/arm/src/sys/arm/at91/uart_dev_at91usart.c#3 edit Differences ... ==== //depot/projects/arm/src/sys/arm/at91/uart_dev_at91usart.c#3 (text+ko) ==== @@ -43,7 +43,7 @@ #include "uart_if.h" -#define DEFAULT_RCLK 3686400 +#define DEFAULT_RCLK AT91C_MASTER_CLOCK /* * Low-level UART interface. @@ -71,9 +71,13 @@ static int usart_at91rm92_probe(struct uart_bas *bas) { + /* We know that this is always here */ return (0); } +/* + * Initialize this device (I think as the console) + */ static void usart_at91rm92_init(struct uart_bas *bas, int baudrate, int databits, int stopbits, int parity) @@ -84,12 +88,19 @@ uart_setreg(bas, USART_IER, USART_CSR_TXRDY | USART_CSR_RXRDY); } +/* + * Free resources now that we're no longer the console. + */ static void usart_at91rm92_term(struct uart_bas *bas) { /* XXX */ } +/* + * Put a character of console output (so we do it here polling rather than + * interrutp driven). + */ static void usart_at91rm92_putc(struct uart_bas *bas, int c) { @@ -99,6 +110,9 @@ uart_setreg(bas, USART_THR, c); } +/* + * Poll for a character available + */ static int usart_at91rm92_poll(struct uart_bas *bas) { @@ -108,6 +122,9 @@ return (uart_getreg(bas, USART_RHR) & 0xff); } +/* + * Block waiting for a character. + */ static int usart_at91rm92_getc(struct uart_bas *bas) { @@ -212,5 +229,5 @@ usart_at91rm92_methods, 1, .uc_range = 8, - .uc_rclk = 3686400 + .uc_rclk = DEFAULT_RCLK }; From owner-p4-projects@FreeBSD.ORG Mon Dec 19 21:41:01 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id A7D5716A422; Mon, 19 Dec 2005 21:41:00 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 80DAE16A41F for ; Mon, 19 Dec 2005 21:41:00 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 35A2F43D75 for ; Mon, 19 Dec 2005 21:40:39 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id jBJLeX16034099 for ; Mon, 19 Dec 2005 21:40:33 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id jBJLeWPV034096 for perforce@freebsd.org; Mon, 19 Dec 2005 21:40:32 GMT (envelope-from imp@freebsd.org) Date: Mon, 19 Dec 2005 21:40:32 GMT Message-Id: <200512192140.jBJLeWPV034096@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to imp@freebsd.org using -f From: Warner Losh To: Perforce Change Reviews Cc: Subject: PERFORCE change 88427 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Dec 2005 21:41:01 -0000 http://perforce.freebsd.org/chv.cgi?CH=88427 Change 88427 by imp@imp_Speedy on 2005/12/19 21:40:17 Minor renaming Affected files ... .. //depot/projects/arm/src/sys/arm/at91/uart_bus_at91usart.c#2 edit .. //depot/projects/arm/src/sys/arm/at91/uart_cpu_at91rm9200usart.c#2 edit .. //depot/projects/arm/src/sys/arm/at91/uart_dev_at91usart.c#4 edit Differences ... ==== //depot/projects/arm/src/sys/arm/at91/uart_bus_at91usart.c#2 (text+ko) ==== @@ -45,7 +45,7 @@ static int usart_at91rm92_probe(device_t dev); -extern struct uart_class usart_at91rm92_class; +extern struct uart_class at91_usart_class; static device_method_t usart_at91rm92_methods[] = { /* Device interface */ @@ -93,7 +93,7 @@ */ if (device_get_unit(dev) == 0) sc->sc_sysdev = SLIST_FIRST(&uart_sysdevs); - sc->sc_class = &usart_at91rm92_class; + sc->sc_class = &at91_usart_class; bcopy(&sc->sc_sysdev->bas, &sc->sc_bas, sizeof(sc->sc_bas)); return (uart_bus_probe(dev, 0, 0, 0, 0, 0)); } ==== //depot/projects/arm/src/sys/arm/at91/uart_cpu_at91rm9200usart.c#2 (text+ko) ==== @@ -41,7 +41,7 @@ bus_space_tag_t uart_bus_space_io; bus_space_tag_t uart_bus_space_mem; -extern struct uart_ops usart_at91rm92_ops; +extern struct uart_ops at91_usart_ops; extern struct bus_space at91rm92_bs_tag; int @@ -53,7 +53,7 @@ int uart_cpu_getdev(int devtype, struct uart_devinfo *di) { - di->ops = usart_at91rm92_ops; + di->ops = at91_usart_ops; di->bas.chan = 0; di->bas.bst = &at91rm92_bs_tag; /* ==== //depot/projects/arm/src/sys/arm/at91/uart_dev_at91usart.c#4 (text+ko) ==== @@ -48,28 +48,28 @@ /* * Low-level UART interface. */ -static int usart_at91rm92_probe(struct uart_bas *bas); -static void usart_at91rm92_init(struct uart_bas *bas, int, int, int, int); -static void usart_at91rm92_term(struct uart_bas *bas); -static void usart_at91rm92_putc(struct uart_bas *bas, int); -static int usart_at91rm92_poll(struct uart_bas *bas); -static int usart_at91rm92_getc(struct uart_bas *bas); +static int at91_usart_probe(struct uart_bas *bas); +static void at91_usart_init(struct uart_bas *bas, int, int, int, int); +static void at91_usart_term(struct uart_bas *bas); +static void at91_usart_putc(struct uart_bas *bas, int); +static int at91_usart_poll(struct uart_bas *bas); +static int at91_usart_getc(struct uart_bas *bas); int did_mmu = 0; extern SLIST_HEAD(uart_devinfo_list, uart_devinfo) uart_sysdevs; -struct uart_ops usart_at91rm92_ops = { - .probe = usart_at91rm92_probe, - .init = usart_at91rm92_init, - .term = usart_at91rm92_term, - .putc = usart_at91rm92_putc, - .poll = usart_at91rm92_poll, - .getc = usart_at91rm92_getc, +struct uart_ops at91_usart_ops = { + .probe = at91_usart_probe, + .init = at91_usart_init, + .term = at91_usart_term, + .putc = at91_usart_putc, + .poll = at91_usart_poll, + .getc = at91_usart_getc, }; static int -usart_at91rm92_probe(struct uart_bas *bas) +at91_usart_probe(struct uart_bas *bas) { /* We know that this is always here */ return (0); @@ -79,7 +79,7 @@ * Initialize this device (I think as the console) */ static void -usart_at91rm92_init(struct uart_bas *bas, int baudrate, int databits, int stopbits, +at91_usart_init(struct uart_bas *bas, int baudrate, int databits, int stopbits, int parity) { @@ -92,7 +92,7 @@ * Free resources now that we're no longer the console. */ static void -usart_at91rm92_term(struct uart_bas *bas) +at91_usart_term(struct uart_bas *bas) { /* XXX */ } @@ -102,7 +102,7 @@ * interrutp driven). */ static void -usart_at91rm92_putc(struct uart_bas *bas, int c) +at91_usart_putc(struct uart_bas *bas, int c) { while (!(uart_getreg(bas, USART_CSR) & @@ -114,7 +114,7 @@ * Poll for a character available */ static int -usart_at91rm92_poll(struct uart_bas *bas) +at91_usart_poll(struct uart_bas *bas) { if (!(uart_getreg(bas, USART_CSR) & USART_CSR_RXRDY)) @@ -126,7 +126,7 @@ * Block waiting for a character. */ static int -usart_at91rm92_getc(struct uart_bas *bas) +at91_usart_getc(struct uart_bas *bas) { int c; @@ -137,40 +137,40 @@ return (c); } -static int usart_at91rm92_bus_probe(struct uart_softc *sc); -static int usart_at91rm92_bus_attach(struct uart_softc *sc); -static int usart_at91rm92_bus_flush(struct uart_softc *, int); -static int usart_at91rm92_bus_getsig(struct uart_softc *); -static int usart_at91rm92_bus_ioctl(struct uart_softc *, int, intptr_t); -static int usart_at91rm92_bus_ipend(struct uart_softc *); -static int usart_at91rm92_bus_param(struct uart_softc *, int, int, int, int); -static int usart_at91rm92_bus_receive(struct uart_softc *); -static int usart_at91rm92_bus_setsig(struct uart_softc *, int); -static int usart_at91rm92_bus_transmit(struct uart_softc *); +static int at91_usart_bus_probe(struct uart_softc *sc); +static int at91_usart_bus_attach(struct uart_softc *sc); +static int at91_usart_bus_flush(struct uart_softc *, int); +static int at91_usart_bus_getsig(struct uart_softc *); +static int at91_usart_bus_ioctl(struct uart_softc *, int, intptr_t); +static int at91_usart_bus_ipend(struct uart_softc *); +static int at91_usart_bus_param(struct uart_softc *, int, int, int, int); +static int at91_usart_bus_receive(struct uart_softc *); +static int at91_usart_bus_setsig(struct uart_softc *, int); +static int at91_usart_bus_transmit(struct uart_softc *); -static kobj_method_t usart_at91rm92_methods[] = { - KOBJMETHOD(uart_probe, usart_at91rm92_bus_probe), - KOBJMETHOD(uart_attach, usart_at91rm92_bus_attach), - KOBJMETHOD(uart_flush, usart_at91rm92_bus_flush), - KOBJMETHOD(uart_getsig, usart_at91rm92_bus_getsig), - KOBJMETHOD(uart_ioctl, usart_at91rm92_bus_ioctl), - KOBJMETHOD(uart_ipend, usart_at91rm92_bus_ipend), - KOBJMETHOD(uart_param, usart_at91rm92_bus_param), - KOBJMETHOD(uart_receive, usart_at91rm92_bus_receive), - KOBJMETHOD(uart_setsig, usart_at91rm92_bus_setsig), - KOBJMETHOD(uart_transmit, usart_at91rm92_bus_transmit), +static kobj_method_t at91_usart_methods[] = { + KOBJMETHOD(uart_probe, at91_usart_bus_probe), + KOBJMETHOD(uart_attach, at91_usart_bus_attach), + KOBJMETHOD(uart_flush, at91_usart_bus_flush), + KOBJMETHOD(uart_getsig, at91_usart_bus_getsig), + KOBJMETHOD(uart_ioctl, at91_usart_bus_ioctl), + KOBJMETHOD(uart_ipend, at91_usart_bus_ipend), + KOBJMETHOD(uart_param, at91_usart_bus_param), + KOBJMETHOD(uart_receive, at91_usart_bus_receive), + KOBJMETHOD(uart_setsig, at91_usart_bus_setsig), + KOBJMETHOD(uart_transmit, at91_usart_bus_transmit), {0, 0 } }; int -usart_at91rm92_bus_probe(struct uart_softc *sc) +at91_usart_bus_probe(struct uart_softc *sc) { return (0); } static int -usart_at91rm92_bus_attach(struct uart_softc *sc) +at91_usart_bus_attach(struct uart_softc *sc) { bcopy(&sc->sc_sysdev->bas, &sc->sc_bas, sizeof(sc->sc_bas)); @@ -180,53 +180,53 @@ return (0); } static int -usart_at91rm92_bus_transmit(struct uart_softc *sc) +at91_usart_bus_transmit(struct uart_softc *sc) { return (0); } static int -usart_at91rm92_bus_setsig(struct uart_softc *sc, int sig) +at91_usart_bus_setsig(struct uart_softc *sc, int sig) { return (0); } static int -usart_at91rm92_bus_receive(struct uart_softc *sc) +at91_usart_bus_receive(struct uart_softc *sc) { return (0); } static int -usart_at91rm92_bus_param(struct uart_softc *sc, int baudrate, int databits, +at91_usart_bus_param(struct uart_softc *sc, int baudrate, int databits, int stopbits, int parity) { return (0); } static int -usart_at91rm92_bus_ipend(struct uart_softc *sc) +at91_usart_bus_ipend(struct uart_softc *sc) { return (0); } static int -usart_at91rm92_bus_flush(struct uart_softc *sc, int what) +at91_usart_bus_flush(struct uart_softc *sc, int what) { return (0); } static int -usart_at91rm92_bus_getsig(struct uart_softc *sc) +at91_usart_bus_getsig(struct uart_softc *sc) { return (0); } static int -usart_at91rm92_bus_ioctl(struct uart_softc *sc, int request, intptr_t data) +at91_usart_bus_ioctl(struct uart_softc *sc, int request, intptr_t data) { return (EINVAL); } -struct uart_class usart_at91rm92_class = { - "usart_at91rm92 class", - usart_at91rm92_methods, +struct uart_class at91_usart_class = { + "at91_usart class", + at91_usart_methods, 1, .uc_range = 8, .uc_rclk = DEFAULT_RCLK From owner-p4-projects@FreeBSD.ORG Tue Dec 20 00:20:47 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 112C716A422; Tue, 20 Dec 2005 00:20:47 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C83FB16A41F for ; Tue, 20 Dec 2005 00:20:46 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2411A43D88 for ; Tue, 20 Dec 2005 00:20:46 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id jBK0KjVl039883 for ; Tue, 20 Dec 2005 00:20:45 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id jBK0Kj6e039880 for perforce@freebsd.org; Tue, 20 Dec 2005 00:20:45 GMT (envelope-from imp@freebsd.org) Date: Tue, 20 Dec 2005 00:20:45 GMT Message-Id: <200512200020.jBK0Kj6e039880@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to imp@freebsd.org using -f From: Warner Losh To: Perforce Change Reviews Cc: Subject: PERFORCE change 88429 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Dec 2005 00:20:47 -0000 http://perforce.freebsd.org/chv.cgi?CH=88429 Change 88429 by imp@imp_Speedy on 2005/12/20 00:19:55 Lame transmit code decent get/set sig code start on setting parameters # this is a checkpoint, more to follow Affected files ... .. //depot/projects/arm/src/sys/arm/at91/at91usartreg.h#2 edit .. //depot/projects/arm/src/sys/arm/at91/uart_cpu_at91rm9200usart.c#3 edit .. //depot/projects/arm/src/sys/arm/at91/uart_dev_at91usart.c#5 edit Differences ... ==== //depot/projects/arm/src/sys/arm/at91/at91usartreg.h#2 (text+ko) ==== @@ -48,13 +48,62 @@ #define USART_CR_RTSDIS (1 << 19) /* Request to Send Disable */ #define USART_MR 0x04 /* Mode register */ +#define USART_MR_MODE_NORMAL 0 /* Normal/Async/3-wire rs-232 */ +#define USART_MR_MODE_RS485 1 /* RS485 */ +#define USART_MR_MODE_HWFLOW 2 /* Hardware flow control/handshake */ +#define USART_MR_MODE_MODEM 3 /* Full modem protocol */ +#define USART_MR_MODE_ISO7816T0 4 /* ISO7816 T=0 */ +#define USART_MR_MODE_ISO7816T1 6 /* ISO7816 T=1 */ +#define USART_MR_MODE_IRDA 8 /* IrDA mode */ +#define USART_MR_USCLKS_MCK (0U << 4) /* use MCK for baudclock */ +#define USART_MR_USCLKS_MCKDIV (1U << 4) /* use MCK/DIV for baudclock */ +#define USART_MR_USCLKS_SCK (3U << 4) /* use SCK (ext) for baudclock */ +#define USART_MR_CHRL_5BITS (0U << 6) +#define USART_MR_CHRL_6BITS (1U << 6) +#define USART_MR_CHRL_7BITS (2U << 6) +#define USART_MR_CHRL_8BITS (3U << 6) +#define USART_MR_SYNC (1U << 8) /* 1 -> sync 0 -> async */ +#define USART_MR_PAR_EVEN (0U << 9) +#define USART_MR_PAR_ODD (1U << 9) +#define USART_MR_PAR_SPACE (2U << 9) +#define USART_MR_PAR_MARK (3U << 9) +#define USART_MR_PAR_NONE (4U << 9) +#define USART_MR_PAR_MULTIDROP (6U << 9) +#define USART_MR_NBSTOP_1 (0U << 12) +#define USART_MR_NBSTOP_1_5 (1U << 12) +#define USART_MR_NBSTOP_2 (2U << 12) +#define USART_MR_CHMODE_NORMAL (0U << 14) +#define USART_MR_CHMODE_ECHO (1U << 14) +#define USART_MR_CHMODE_LOOP (2U << 14) +#define USART_MR_CHMODE_REMLOOP (3U << 14) + #define USART_IER 0x08 /* Interrupt enable register */ #define USART_IDR 0x0c /* Interrupt disable register */ #define USART_IMR 0x10 /* Interrupt mask register */ #define USART_CSR 0x14 /* Channel status register */ -#define USART_CSR_RXRDY (1 << 0) /* Receiver ready */ -#define USART_CSR_TXRDY (1 << 1) /* Transmitter ready */ +#define USART_CSR_RXRDY (1U << 0) /* Receiver ready */ +#define USART_CSR_TXRDY (1U << 1) /* Transmitter ready */ +#define USART_CSR_RXBRK (1U << 2) /* Break received */ +#define USART_CSR_ENDRX (1U << 3) /* End of Transfer RX from PDC */ +#define USART_CSR_ENDTX (1U << 4) /* End of Transfer TX from PDC */ +#define USART_CSR_OVRE (1U << 5) /* Overrun error */ +#define USART_CSR_FRAME (1U << 6) /* Framing error */ +#define USART_CSR_PARE (1U << 7) /* Parity Error */ +#define USART_CSR_TIMEOUT (1U << 8) /* Timeout since start-timeout */ +#define USART_CSR_TXEMPTY (1U << 9) /* Transmitter empty */ +#define USART_CSR_ITERATION (1U << 10) /* max repetitions since RSIT */ +#define USART_CSR_TXBUFE (1U << 11) /* Buffer empty from PDC */ +#define USART_CSR_RXBUFF (1U << 12) /* Buffer full from PDC */ +#define USART_CSR_NACK (1U << 13) /* NACK since last RSTNACK */ +#define USART_CSR_RIIC (1U << 16) /* RI delta since last csr read */ +#define USART_CSR_DSRIC (1U << 17) /* DSR delta */ +#define USART_CSR_DCDIC (1U << 18) /* DCD delta */ +#define USART_CSR_CTSIC (1U << 19) /* CTS delta */ +#define USART_CSR_RI (1U << 20) /* RI status */ +#define USART_CSR_DSR (1U << 21) /* DSR status */ +#define USART_CSR_DCD (1U << 22) /* DCD status */ +#define USART_CSR_CTS (1U << 23) /* CTS status */ #define USART_RHR 0x18 /* Receiver holding register */ #define USART_THR 0x1c /* Transmitter holding register */ ==== //depot/projects/arm/src/sys/arm/at91/uart_cpu_at91rm9200usart.c#3 (text+ko) ==== ==== //depot/projects/arm/src/sys/arm/at91/uart_dev_at91usart.c#5 (text+ko) ==== @@ -1,5 +1,6 @@ /*- - * Copyright (c) 2003 Marcel Moolenaar + * Copyright (c) 2005 M. Warner Losh + * Copyright (c) 2005 cognet * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -45,6 +46,14 @@ #define DEFAULT_RCLK AT91C_MASTER_CLOCK +#define SIGCHG(c, i, s, d) \ + if (c) { \ + i |= (i & s) ? s : s | d; \ + } else { \ + i = (i & s) ? (i & ~s) | d : i; \ + } + + /* * Low-level UART interface. */ @@ -55,9 +64,41 @@ static int at91_usart_poll(struct uart_bas *bas); static int at91_usart_getc(struct uart_bas *bas); -int did_mmu = 0; +extern SLIST_HEAD(uart_devinfo_list, uart_devinfo) uart_sysdevs; + +static int +at91_usart_param(struct uart_bas *bas, int baudrate, int databits, + int stopbits, int parity) +{ + uint32_t mr; + + /* + * Assume 3-write RS-232 configuration. + * XXX Not sure how uart will present the other modes to us, so + * XXX they are unimplemented. maybe ioctl? + */ + mr = USART_MR_MODE_NORMAL; + mr |= USART_MR_USCLKS_MCK; /* Assume MCK */ + + switch (databits) { + case 5: + mr |= USART_MR_CHRL_5BITS; + break; + case 6: + mr |= USART_MR_CHRL_6BITS; + break; + case 7: + mr |= USART_MR_CHRL_7BITS; + break; + case 8: + mr |= USART_MR_CHRL_8BITS; + break; + default: + return (EINVAL); + } -extern SLIST_HEAD(uart_devinfo_list, uart_devinfo) uart_sysdevs; + return (0); +} struct uart_ops at91_usart_ops = { .probe = at91_usart_probe, @@ -82,10 +123,13 @@ at91_usart_init(struct uart_bas *bas, int baudrate, int databits, int stopbits, int parity) { + at91_usart_param(bas, baudrate, databits, stopbits, parity); + /* Turn on rx and tx */ uart_setreg(bas, USART_CR, USART_CR_RSTRX | USART_CR_RSTTX); uart_setreg(bas, USART_CR, USART_CR_RXEN | USART_CR_TXEN); uart_setreg(bas, USART_IER, USART_CSR_TXRDY | USART_CSR_RXRDY); + uart_barrier(bas); } /* @@ -172,22 +216,59 @@ static int at91_usart_bus_attach(struct uart_softc *sc) { - bcopy(&sc->sc_sysdev->bas, &sc->sc_bas, sizeof(sc->sc_bas)); + bcopy(&sc->sc_sysdev->bas, &sc->sc_bas, sizeof(sc->sc_bas)); - sc->sc_txfifosz = 3; - sc->sc_rxfifosz = 1; - sc->sc_hwiflow = 0; + sc->sc_txfifosz = 1; + sc->sc_rxfifosz = 1; + sc->sc_hwiflow = 0; return (0); } static int at91_usart_bus_transmit(struct uart_softc *sc) { + int i; + /* XXX very sub-optimial */ + mtx_lock_spin(&sc->sc_hwmtx); + for (i = 0; i < sc->sc_txdatasz; i++) + at91_usart_putc(&sc->sc_bas, sc->sc_txbuf[i]); + mtx_unlock_spin(&sc->sc_hwmtx); return (0); } static int at91_usart_bus_setsig(struct uart_softc *sc, int sig) { + uint32_t new, old, cr; + struct uart_bas *bas; + + do { + old = sc->sc_hwsig; + new = old; + if (sig & SER_DDTR) { + SIGCHG(sig & SER_DTR, new, SER_DTR, + SER_DDTR); + } + if (sig & SER_DRTS) { + SIGCHG(sig & SER_RTS, new, SER_RTS, + SER_DRTS); + } + } while (!atomic_cmpset_32(&sc->sc_hwsig, old, new)); + bas = &sc->sc_bas; + mtx_lock_spin(&sc->sc_hwmtx); + cr = uart_getreg(bas, USART_CR); + cr &= ~(USART_CR_DTREN | USART_CR_DTRDIS | USART_CR_RTSEN | + USART_CR_RTSDIS); + if (new & SER_DTR) + cr |= USART_CR_DTREN; + else + cr |= USART_CR_DTRDIS; + if (new & SER_RTS) + cr |= USART_CR_RTSEN; + else + cr |= USART_CR_RTSDIS; + uart_setreg(bas, USART_CR, cr); + uart_barrier(bas); + mtx_unlock_spin(&sc->sc_hwmtx); return (0); } static int @@ -216,7 +297,24 @@ static int at91_usart_bus_getsig(struct uart_softc *sc) { - return (0); + uint32_t new, sig; + uint8_t csr; + + mtx_lock_spin(&sc->sc_hwmtx); + csr = uart_getreg(&sc->sc_bas, USART_CSR); + sig = 0; + if (csr & USART_CSR_CTS) + sig |= SER_CTS; + if (csr & USART_CSR_DCD) + sig |= SER_DCD; + if (csr & USART_CSR_DSR) + sig |= SER_DSR; + if (csr & USART_CSR_RI) + sig |= SER_RI; + new = sig & ~UART_SIGMASK_DELTA; + sc->sc_hwsig = new; + mtx_unlock_spin(&sc->sc_hwmtx); + return (sig); } static int From owner-p4-projects@FreeBSD.ORG Tue Dec 20 01:34:28 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 627DC16A422; Tue, 20 Dec 2005 01:34:27 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 202D816A41F for ; Tue, 20 Dec 2005 01:34:27 +0000 (GMT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5BC2E43D88 for ; Tue, 20 Dec 2005 01:34:18 +0000 (GMT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id jBK1YILR050633 for ; Tue, 20 Dec 2005 01:34:18 GMT (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id jBK1YHHV050630 for perforce@freebsd.org; Tue, 20 Dec 2005 01:34:17 GMT (envelope-from peter@freebsd.org) Date: Tue, 20 Dec 2005 01:34:17 GMT Message-Id: <200512200134.jBK1YHHV050630@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Cc: Subject: PERFORCE change 88435 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Dec 2005 01:34:28 -0000 http://perforce.freebsd.org/chv.cgi?CH=88435 Change 88435 by peter@peter_daintree on 2005/12/20 01:33:34 IFC @88434 Affected files ... .. //depot/projects/hammer/ObsoleteFiles.inc#11 integrate .. //depot/projects/hammer/UPDATING#88 integrate .. //depot/projects/hammer/bin/sh/jobs.c#13 integrate .. //depot/projects/hammer/etc/Makefile#45 integrate .. //depot/projects/hammer/etc/defaults/rc.conf#65 integrate .. //depot/projects/hammer/etc/rc.d/Makefile#44 integrate .. //depot/projects/hammer/etc/rc.d/abi#5 integrate .. //depot/projects/hammer/etc/rc.d/cleanvar#10 integrate .. //depot/projects/hammer/etc/rc.d/cleartmp#11 integrate .. //depot/projects/hammer/etc/rc.d/syscons#7 integrate .. //depot/projects/hammer/etc/rc.d/usbd#4 delete .. //depot/projects/hammer/etc/usbd.conf#6 delete .. //depot/projects/hammer/gnu/usr.bin/grep/grep.1#9 integrate .. //depot/projects/hammer/include/Makefile#52 integrate .. //depot/projects/hammer/include/dlfcn.h#4 integrate .. //depot/projects/hammer/include/printf.h#1 branch .. //depot/projects/hammer/lib/libc/gen/dlfcn.c#6 integrate .. //depot/projects/hammer/lib/libc/gen/nlist.c#3 integrate .. //depot/projects/hammer/lib/libc/stdio/Makefile.inc#13 integrate .. //depot/projects/hammer/lib/libc/stdio/fread.c#4 integrate .. //depot/projects/hammer/lib/libc/stdio/local.h#14 integrate .. //depot/projects/hammer/lib/libc/stdio/vfprintf.c#20 integrate .. //depot/projects/hammer/lib/libc/stdio/vfscanf.c#13 integrate .. //depot/projects/hammer/lib/libc/stdio/xprintf.c#1 branch .. //depot/projects/hammer/lib/libc/stdio/xprintf_float.c#1 branch .. //depot/projects/hammer/lib/libc/stdio/xprintf_hexdump.c#1 branch .. //depot/projects/hammer/lib/libc/stdio/xprintf_int.c#1 branch .. //depot/projects/hammer/lib/libc/stdio/xprintf_str.c#1 branch .. //depot/projects/hammer/lib/libc/stdio/xprintf_time.c#1 branch .. //depot/projects/hammer/lib/libc/stdio/xprintf_vis.c#1 branch .. //depot/projects/hammer/lib/libthr/thread/thr_create.c#19 integrate .. //depot/projects/hammer/lib/libthr/thread/thr_detach.c#9 integrate .. //depot/projects/hammer/lib/libthr/thread/thr_join.c#13 integrate .. //depot/projects/hammer/lib/libthr/thread/thr_once.c#3 integrate .. //depot/projects/hammer/lib/libthr/thread/thr_private.h#27 integrate .. //depot/projects/hammer/lib/libthr/thread/thr_sig.c#10 integrate .. //depot/projects/hammer/lib/msun/src/s_cbrt.c#4 integrate .. //depot/projects/hammer/lib/msun/src/s_cbrtf.c#4 integrate .. //depot/projects/hammer/libexec/rtld-elf/alpha/reloc.c#6 integrate .. //depot/projects/hammer/libexec/rtld-elf/amd64/reloc.c#11 integrate .. //depot/projects/hammer/libexec/rtld-elf/arm/reloc.c#4 integrate .. //depot/projects/hammer/libexec/rtld-elf/i386/reloc.c#11 integrate .. //depot/projects/hammer/libexec/rtld-elf/ia64/reloc.c#8 integrate .. //depot/projects/hammer/libexec/rtld-elf/map_object.c#10 integrate .. //depot/projects/hammer/libexec/rtld-elf/powerpc/reloc.c#6 integrate .. //depot/projects/hammer/libexec/rtld-elf/rtld.c#32 integrate .. //depot/projects/hammer/libexec/rtld-elf/rtld.h#10 integrate .. //depot/projects/hammer/libexec/rtld-elf/sparc64/reloc.c#9 integrate .. //depot/projects/hammer/release/Makefile#79 integrate .. //depot/projects/hammer/release/alpha/boot_crunch.conf#5 integrate .. //depot/projects/hammer/release/amd64/boot_crunch.conf#5 integrate .. //depot/projects/hammer/release/doc/en_US.ISO8859-1/hardware/alpha/proc-alpha.sgml#19 integrate .. //depot/projects/hammer/release/i386/boot_crunch.conf#6 integrate .. //depot/projects/hammer/release/ia64/boot_crunch.conf#8 integrate .. //depot/projects/hammer/release/powerpc/boot_crunch.conf#3 integrate .. //depot/projects/hammer/release/sparc64/boot_crunch.conf#6 integrate .. //depot/projects/hammer/rescue/rescue/Makefile#27 integrate .. //depot/projects/hammer/sbin/atacontrol/atacontrol.c#18 integrate .. //depot/projects/hammer/sbin/devd/devd.8#13 integrate .. //depot/projects/hammer/sbin/ifconfig/ifbridge.c#3 integrate .. //depot/projects/hammer/sbin/ifconfig/ifconfig.8#33 integrate .. //depot/projects/hammer/sbin/ifconfig/ifieee80211.c#20 integrate .. //depot/projects/hammer/sbin/mount_cd9660/mount_cd9660.c#13 integrate .. //depot/projects/hammer/share/examples/etc/make.conf#44 integrate .. //depot/projects/hammer/share/man/man3/siginfo.3#2 integrate .. //depot/projects/hammer/share/man/man4/ata.4#21 integrate .. //depot/projects/hammer/share/man/man4/ataraid.4#7 integrate .. //depot/projects/hammer/share/man/man4/man4.sparc64/snd_audiocs.4#4 integrate .. //depot/projects/hammer/share/man/man4/rp.4#4 integrate .. //depot/projects/hammer/share/man/man4/snd_ad1816.4#6 integrate .. //depot/projects/hammer/share/man/man4/snd_als4000.4#6 integrate .. //depot/projects/hammer/share/man/man4/snd_cmi.4#7 integrate .. //depot/projects/hammer/share/man/man4/snd_cs4281.4#6 integrate .. //depot/projects/hammer/share/man/man4/snd_csa.4#5 integrate .. //depot/projects/hammer/share/man/man4/snd_ds1.4#6 integrate .. //depot/projects/hammer/share/man/man4/snd_emu10k1.4#8 integrate .. //depot/projects/hammer/share/man/man4/snd_es137x.4#8 integrate .. //depot/projects/hammer/share/man/man4/snd_ess.4#6 integrate .. //depot/projects/hammer/share/man/man4/snd_gusc.4#4 integrate .. //depot/projects/hammer/share/man/man4/snd_ich.4#7 integrate .. //depot/projects/hammer/share/man/man4/snd_maestro.4#3 integrate .. //depot/projects/hammer/share/man/man4/snd_maestro3.4#5 integrate .. //depot/projects/hammer/share/man/man4/snd_sbc.4#6 integrate .. //depot/projects/hammer/share/man/man4/snd_uaudio.4#2 integrate .. //depot/projects/hammer/share/man/man4/umass.4#17 integrate .. //depot/projects/hammer/share/man/man4/usb.4#9 integrate .. //depot/projects/hammer/share/man/man5/devfs.conf.5#4 integrate .. //depot/projects/hammer/share/man/man5/elf.5#10 integrate .. //depot/projects/hammer/share/man/man5/make.conf.5#42 integrate .. //depot/projects/hammer/share/man/man5/rc.conf.5#67 integrate .. //depot/projects/hammer/share/man/man8/rc.8#8 integrate .. //depot/projects/hammer/share/man/man9/VFS_LOCK_GIANT.9#3 integrate .. //depot/projects/hammer/sys/alpha/alpha/clock.c#11 integrate .. //depot/projects/hammer/sys/alpha/alpha/elf_machdep.c#14 integrate .. //depot/projects/hammer/sys/alpha/linux/linux_sysvec.c#13 integrate .. //depot/projects/hammer/sys/amd64/amd64/apic_vector.S#36 integrate .. //depot/projects/hammer/sys/amd64/amd64/busdma_machdep.c#37 integrate .. //depot/projects/hammer/sys/amd64/amd64/elf_machdep.c#33 integrate .. //depot/projects/hammer/sys/amd64/linux32/linux32_sysvec.c#10 integrate .. //depot/projects/hammer/sys/arm/arm/elf_trampoline.c#4 integrate .. //depot/projects/hammer/sys/arm/arm/locore.S#12 integrate .. //depot/projects/hammer/sys/boot/common/bootstrap.h#7 integrate .. //depot/projects/hammer/sys/boot/common/load_elf.c#16 integrate .. //depot/projects/hammer/sys/boot/common/load_elf_obj.c#2 integrate .. //depot/projects/hammer/sys/boot/common/reloc_elf.c#2 integrate .. //depot/projects/hammer/sys/boot/i386/libi386/Makefile#16 integrate .. //depot/projects/hammer/sys/boot/i386/libi386/biosdisk.c#10 integrate .. //depot/projects/hammer/sys/boot/i386/libi386/biospnp.c#4 integrate .. //depot/projects/hammer/sys/boot/i386/libi386/biossmap.c#10 integrate .. //depot/projects/hammer/sys/boot/i386/libi386/i386_copy.c#3 integrate .. //depot/projects/hammer/sys/boot/i386/loader/main.c#11 integrate .. //depot/projects/hammer/sys/cam/scsi/scsi_da.c#30 integrate .. //depot/projects/hammer/sys/compat/linux/linux_mib.c#7 integrate .. //depot/projects/hammer/sys/compat/linux/linux_mib.h#3 integrate .. //depot/projects/hammer/sys/compat/ndis/subr_ndis.c#39 integrate .. //depot/projects/hammer/sys/compat/ndis/subr_ntoskrnl.c#40 integrate .. //depot/projects/hammer/sys/conf/Makefile.arm#16 integrate .. //depot/projects/hammer/sys/contrib/pf/net/pf.c#26 integrate .. //depot/projects/hammer/sys/contrib/pf/net/pfvar.h#11 integrate .. //depot/projects/hammer/sys/dev/amr/amr.c#27 integrate .. //depot/projects/hammer/sys/dev/amr/amr_cam.c#14 integrate .. //depot/projects/hammer/sys/dev/amr/amr_disk.c#14 integrate .. //depot/projects/hammer/sys/dev/amr/amr_pci.c#20 integrate .. //depot/projects/hammer/sys/dev/amr/amrio.h#5 integrate .. //depot/projects/hammer/sys/dev/amr/amrreg.h#6 integrate .. //depot/projects/hammer/sys/dev/amr/amrvar.h#17 integrate .. //depot/projects/hammer/sys/dev/ata/ata-chipset.c#65 integrate .. //depot/projects/hammer/sys/dev/ata/ata-pci.h#37 integrate .. //depot/projects/hammer/sys/dev/ata/ata-raid.c#32 integrate .. //depot/projects/hammer/sys/dev/ata/ata-raid.h#18 integrate .. //depot/projects/hammer/sys/dev/bge/if_bge.c#60 integrate .. //depot/projects/hammer/sys/dev/bge/if_bgereg.h#29 integrate .. //depot/projects/hammer/sys/dev/ciss/ciss.c#37 integrate .. //depot/projects/hammer/sys/dev/cp/cpddk.c#5 integrate .. //depot/projects/hammer/sys/dev/em/if_em.c#55 integrate .. //depot/projects/hammer/sys/dev/if_ndis/if_ndis.c#46 integrate .. //depot/projects/hammer/sys/dev/isp/isp_pci.c#17 integrate .. //depot/projects/hammer/sys/dev/ixgb/if_ixgb.c#16 integrate .. //depot/projects/hammer/sys/dev/nge/if_nge.c#37 integrate .. //depot/projects/hammer/sys/dev/re/if_re.c#38 integrate .. //depot/projects/hammer/sys/dev/sound/usb/uaudio.c#8 integrate .. //depot/projects/hammer/sys/dev/ti/if_ti.c#2 integrate .. //depot/projects/hammer/sys/dev/ti/if_tireg.h#2 integrate .. //depot/projects/hammer/sys/dev/txp/if_txp.c#24 integrate .. //depot/projects/hammer/sys/dev/usb/ugen.c#26 integrate .. //depot/projects/hammer/sys/dev/usb/umass.c#34 integrate .. //depot/projects/hammer/sys/dev/usb/usb_quirks.c#12 integrate .. //depot/projects/hammer/sys/dev/usb/usbdevs#65 integrate .. //depot/projects/hammer/sys/dev/vge/if_vge.c#15 integrate .. //depot/projects/hammer/sys/fs/nullfs/null_vfsops.c#19 integrate .. //depot/projects/hammer/sys/fs/nwfs/nwfs_vfsops.c#17 integrate .. //depot/projects/hammer/sys/fs/smbfs/smbfs_vfsops.c#23 integrate .. //depot/projects/hammer/sys/geom/nop/g_nop.c#8 integrate .. //depot/projects/hammer/sys/gnu/fs/xfs/FreeBSD/support/kdb.c#2 integrate .. //depot/projects/hammer/sys/gnu/fs/xfs/FreeBSD/xfs_mountops.c#2 integrate .. //depot/projects/hammer/sys/i386/i386/apic_vector.s#17 integrate .. //depot/projects/hammer/sys/i386/linux/linux_sysvec.c#24 integrate .. //depot/projects/hammer/sys/ia64/ia64/elf_machdep.c#18 integrate .. //depot/projects/hammer/sys/kern/imgact_elf.c#35 integrate .. //depot/projects/hammer/sys/kern/kern_clock.c#31 integrate .. //depot/projects/hammer/sys/kern/kern_mutex.c#34 integrate .. //depot/projects/hammer/sys/kern/kern_switch.c#46 integrate .. //depot/projects/hammer/sys/kern/kern_sx.c#7 integrate .. //depot/projects/hammer/sys/kern/link_elf.c#24 integrate .. //depot/projects/hammer/sys/kern/link_elf_obj.c#49 integrate .. //depot/projects/hammer/sys/kern/sched_ule.c#67 integrate .. //depot/projects/hammer/sys/kern/subr_prof.c#13 integrate .. //depot/projects/hammer/sys/kern/sys_pipe.c#29 integrate .. //depot/projects/hammer/sys/kern/uipc_mbuf.c#36 integrate .. //depot/projects/hammer/sys/kern/uipc_mqueue.c#4 integrate .. //depot/projects/hammer/sys/kern/uipc_usrreq.c#37 integrate .. //depot/projects/hammer/sys/kern/vfs_default.c#44 integrate .. //depot/projects/hammer/sys/kern/vfs_mount.c#64 integrate .. //depot/projects/hammer/sys/kern/vfs_syscalls.c#54 integrate .. //depot/projects/hammer/sys/kern/vfs_vnops.c#39 integrate .. //depot/projects/hammer/sys/kern/vnode_if.src#19 integrate .. //depot/projects/hammer/sys/net/bridgestp.c#7 integrate .. //depot/projects/hammer/sys/net/if_bridge.c#19 integrate .. //depot/projects/hammer/sys/net/if_bridgevar.h#5 integrate .. //depot/projects/hammer/sys/net/if_ethersubr.c#52 integrate .. //depot/projects/hammer/sys/net/if_vlan_var.h#10 integrate .. //depot/projects/hammer/sys/net80211/ieee80211.c#20 integrate .. //depot/projects/hammer/sys/net80211/ieee80211_input.c#27 integrate .. //depot/projects/hammer/sys/net80211/ieee80211_ioctl.c#26 integrate .. //depot/projects/hammer/sys/net80211/ieee80211_ioctl.h#13 integrate .. //depot/projects/hammer/sys/net80211/ieee80211_node.c#29 integrate .. //depot/projects/hammer/sys/net80211/ieee80211_proto.c#20 integrate .. //depot/projects/hammer/sys/net80211/ieee80211_var.h#21 integrate .. //depot/projects/hammer/sys/netinet/if_ether.c#29 integrate .. //depot/projects/hammer/sys/netinet/ip_fw2.c#70 integrate .. //depot/projects/hammer/sys/netinet/ip_mroute.c#31 integrate .. //depot/projects/hammer/sys/netinet/raw_ip.c#39 integrate .. //depot/projects/hammer/sys/netinet/tcp_usrreq.c#35 integrate .. //depot/projects/hammer/sys/netinet/udp_usrreq.c#37 integrate .. //depot/projects/hammer/sys/pc98/cbus/sio.c#6 integrate .. //depot/projects/hammer/sys/pci/amdpm.c#10 integrate .. //depot/projects/hammer/sys/powerpc/include/frame.h#5 integrate .. //depot/projects/hammer/sys/powerpc/powerpc/genassym.c#11 integrate .. //depot/projects/hammer/sys/sparc64/sparc64/elf_machdep.c#15 integrate .. //depot/projects/hammer/sys/sys/elf32.h#2 integrate .. //depot/projects/hammer/sys/sys/elf64.h#2 integrate .. //depot/projects/hammer/sys/sys/elf_common.h#5 integrate .. //depot/projects/hammer/sys/sys/elf_generic.h#2 integrate .. //depot/projects/hammer/sys/sys/imgact_elf.h#6 integrate .. //depot/projects/hammer/sys/sys/ktr.h#15 integrate .. //depot/projects/hammer/sys/sys/linker.h#15 integrate .. //depot/projects/hammer/sys/sys/lock.h#10 integrate .. //depot/projects/hammer/sys/sys/mount.h#40 integrate .. //depot/projects/hammer/sys/sys/param.h#72 integrate .. //depot/projects/hammer/sys/sys/resourcevar.h#16 integrate .. //depot/projects/hammer/sys/sys/vnode.h#61 integrate .. //depot/projects/hammer/sys/tools/vnode_if.awk#14 integrate .. //depot/projects/hammer/sys/ufs/ufs/quota.h#7 integrate .. //depot/projects/hammer/sys/ufs/ufs/ufs_quota.c#15 integrate .. //depot/projects/hammer/sys/ufs/ufs/ufs_vfsops.c#13 integrate .. //depot/projects/hammer/sys/vm/vm_extern.h#16 integrate .. //depot/projects/hammer/sys/vm/vm_glue.c#42 integrate .. //depot/projects/hammer/tools/tools/README#20 integrate .. //depot/projects/hammer/tools/tools/ansify/Makefile#1 branch .. //depot/projects/hammer/tools/tools/ansify/ansify.pl#1 branch .. //depot/projects/hammer/tools/tools/ath/athdebug/athdebug.c#2 integrate .. //depot/projects/hammer/tools/tools/ath/athstats/athstats.c#2 integrate .. //depot/projects/hammer/tools/tools/net80211/wlanstats/wlanstats.c#2 integrate .. //depot/projects/hammer/tools/tools/netrate/netblast/netblast.c#3 integrate .. //depot/projects/hammer/usr.bin/calendar/calendars/calendar.freebsd#42 integrate .. //depot/projects/hammer/usr.bin/elf2aout/elf2aout.c#3 integrate .. //depot/projects/hammer/usr.bin/elfdump/elfdump.c#5 integrate .. //depot/projects/hammer/usr.bin/netstat/netstat.1#14 integrate .. //depot/projects/hammer/usr.sbin/Makefile#71 integrate .. //depot/projects/hammer/usr.sbin/arp/arp.4#9 integrate .. //depot/projects/hammer/usr.sbin/crunch/crunchide/exec_elf32.c#10 integrate .. //depot/projects/hammer/usr.sbin/kldxref/ef.c#5 integrate .. //depot/projects/hammer/usr.sbin/kldxref/ef.h#5 integrate .. //depot/projects/hammer/usr.sbin/kldxref/ef_amd64.c#3 integrate .. //depot/projects/hammer/usr.sbin/kldxref/ef_i386.c#3 integrate .. //depot/projects/hammer/usr.sbin/kldxref/ef_obj.c#3 integrate .. //depot/projects/hammer/usr.sbin/kldxref/ef_powerpc.c#2 integrate .. //depot/projects/hammer/usr.sbin/kldxref/ef_sparc64.c#4 integrate .. //depot/projects/hammer/usr.sbin/sysinstall/Makefile#11 integrate .. //depot/projects/hammer/usr.sbin/sysinstall/main.c#5 integrate .. //depot/projects/hammer/usr.sbin/sysinstall/menus.c#36 integrate .. //depot/projects/hammer/usr.sbin/sysinstall/sysinstall.h#21 integrate .. //depot/projects/hammer/usr.sbin/sysinstall/usb.c#2 delete .. //depot/projects/hammer/usr.sbin/usbd/Makefile#2 delete .. //depot/projects/hammer/usr.sbin/usbd/usbd.8#5 delete .. //depot/projects/hammer/usr.sbin/usbd/usbd.c#9 delete .. //depot/projects/hammer/usr.sbin/usbd/usbd.conf.5#5 delete Differences ... ==== //depot/projects/hammer/ObsoleteFiles.inc#11 (text+ko) ==== @@ -1,5 +1,5 @@ # -# $FreeBSD: src/ObsoleteFiles.inc,v 1.21 2005/10/29 05:27:32 yar Exp $ +# $FreeBSD: src/ObsoleteFiles.inc,v 1.22 2005/12/15 01:04:47 iedowse Exp $ # # This file lists old files (OLD_FILES), libraries (OLD_LIBS) and # directories (OLD_DIRS) which should get removed at an update. Recently @@ -14,6 +14,11 @@ # The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS last. # +# 20051214: usbd(8) removed +OLD_FILES+=etc/rc.d/usbd +OLD_FILES+=etc/usbd.conf +OLD_FILES+=usr/sbin/usbd +OLD_FILES+=usr/share/man/man8/usbd.8.gz # 20051029: rc.d/ppp-user renamed to rc.d/ppp for convenience OLD_FILES+=etc/rc.d/ppp-user # 20051012: setkey(8) moved to /sbin/ ==== //depot/projects/hammer/UPDATING#88 (text+ko) ==== @@ -46,6 +46,10 @@ ABI between ipfw(4) and ipfw(8) has been changed. You need to rebuild ipfw(8) when rebuilding kernel. +20051108: + rp(4)'s device files now contain the unit number. + Uses of {cua,tty}R[0-9a-f] should be replaced by {cua,tty}R0[0-9a-f]. + 20051029: /etc/rc.d/ppp-user has been renamed to /etc/rc.d/ppp. Its /etc/rc.conf.d configuration file has been `ppp' from @@ -458,4 +462,4 @@ Contact Warner Losh if you have any questions about your use of this document. -$FreeBSD: src/UPDATING,v 1.429 2005/12/11 23:18:58 sam Exp $ +$FreeBSD: src/UPDATING,v 1.430 2005/12/19 03:15:49 obrien Exp $ ==== //depot/projects/hammer/bin/sh/jobs.c#13 (text+ko) ==== @@ -36,7 +36,7 @@ #endif #endif /* not lint */ #include -__FBSDID("$FreeBSD: src/bin/sh/jobs.c,v 1.69 2005/09/05 17:57:19 stefanf Exp $"); +__FBSDID("$FreeBSD: src/bin/sh/jobs.c,v 1.70 2005/12/14 17:26:29 maxim Exp $"); #include #include @@ -924,6 +924,8 @@ } while ((pid == -1 && errno == EINTR && breakwaitcmd == 0) || (pid > 0 && WIFSTOPPED(status) && !iflag)); in_dowait--; + if (pid == -1 && errno == ECHILD && job != NULL) + job->state = JOBDONE; if (breakwaitcmd != 0) { breakwaitcmd = 0; if (pid <= 0) ==== //depot/projects/hammer/etc/Makefile#45 (text+ko) ==== @@ -1,5 +1,5 @@ # from: @(#)Makefile 5.11 (Berkeley) 5/21/91 -# $FreeBSD: src/etc/Makefile,v 1.348 2005/11/16 07:24:31 ru Exp $ +# $FreeBSD: src/etc/Makefile,v 1.349 2005/12/15 01:04:47 iedowse Exp $ .if !defined(NO_SENDMAIL) SUBDIR= sendmail @@ -15,7 +15,7 @@ rc rc.bsdextended rc.firewall rc.firewall6 rc.initdiskless \ rc.sendmail rc.shutdown \ rc.subr remote rpc services shells \ - snmpd.config sysctl.conf syslog.conf usbd.conf \ + snmpd.config sysctl.conf syslog.conf \ etc.${MACHINE_ARCH}/ttys \ ${.CURDIR}/../gnu/usr.bin/man/manpath/manpath.config \ ${.CURDIR}/../usr.bin/mail/misc/mail.rc \ ==== //depot/projects/hammer/etc/defaults/rc.conf#65 (text+ko) ==== @@ -15,7 +15,7 @@ # For a more detailed explanation of all the rc.conf variables, please # refer to the rc.conf(5) manual page. # -# $FreeBSD: src/etc/defaults/rc.conf,v 1.266 2005/12/10 20:21:45 dougb Exp $ +# $FreeBSD: src/etc/defaults/rc.conf,v 1.268 2005/12/19 10:56:59 dougb Exp $ ############################################################## ### Important initial Boot-time options #################### @@ -54,6 +54,7 @@ varsize="32m" # Size of mfs /var if created varmfs_flags="-S -M" # Extra mount options for the mfs /var populate_var="AUTO" # Set to YES to always (re)populate /var, NO to never +cleanvar_enable="YES" # Clean the /var directory local_startup="/usr/local/etc/rc.d /usr/X11R6/etc/rc.d" # startup script dirs. script_name_sep=" " # Change if your startup scripts' names contain spaces rc_conf_files="/etc/rc.conf /etc/rc.conf.local" @@ -475,8 +476,6 @@ lpd_flags="" # Flags to lpd (if enabled). chkprintcap_enable="NO" # Run chkprintcap(8) before running lpd. chkprintcap_flags="-d" # Create missing directories by default. -usbd_enable="NO" # Run the usbd daemon. -usbd_flags="" # Flags to usbd (if enabled). dumpdev="AUTO" # Device to crashdump to (device name, AUTO, or NO). dumpdir="/var/crash" # Directory where crash dumps are to be stored savecore_flags="" # Used if dumpdev is enabled above, and present. @@ -485,9 +484,12 @@ accounting_enable="NO" # Turn on process accounting (or NO). ibcs2_enable="NO" # Ibcs2 (SCO) emulation loaded at startup (or NO). ibcs2_loaders="coff" # List of additional Ibcs2 loaders (or NO). + +# Emulation/compatibility services provided by /etc/rc.d/abi sysvipc_enable="NO" # Load System V IPC primitives at startup (or NO). linux_enable="NO" # Linux binary compatibility loaded at startup (or NO). svr4_enable="NO" # SysVR4 emulation loaded at startup (or NO). + osf1_enable="NO" # Alpha OSF/1 emulation loaded at startup (or NO). clear_tmp_enable="NO" # Clear /tmp at startup. ldconfig_insecure="NO" # Set to YES to disable ldconfig security checks ==== //depot/projects/hammer/etc/rc.d/Makefile#44 (text+ko) ==== @@ -1,5 +1,5 @@ # $NetBSD: Makefile,v 1.16 2001/01/14 15:37:22 minoura Exp $ -# $FreeBSD: src/etc/rc.d/Makefile,v 1.61 2005/12/10 23:23:09 dougb Exp $ +# $FreeBSD: src/etc/rc.d/Makefile,v 1.62 2005/12/15 01:04:48 iedowse Exp $ FILES= DAEMON LOGIN NETWORKING SERVERS \ abi accounting addswap adjkerntz amd \ @@ -35,7 +35,7 @@ serial sppp swap1 \ syscons sysctl syslogd \ timed tmp \ - ugidfw usbd \ + ugidfw \ var virecover \ watchdogd wpa_supplicant \ ypbind yppasswdd ypserv \ ==== //depot/projects/hammer/etc/rc.d/abi#5 (text+ko) ==== @@ -1,6 +1,6 @@ #!/bin/sh # -# $FreeBSD: src/etc/rc.d/abi,v 1.4 2004/10/07 13:55:25 mtm Exp $ +# $FreeBSD: src/etc/rc.d/abi,v 1.5 2005/12/19 10:57:00 dougb Exp $ # # PROVIDE: abi @@ -10,12 +10,9 @@ . /etc/rc.subr -echo -n 'Additional ABI support:' - -name="sysvipc" -rcvar=`set_rcvar` -start_cmd="sysv_start" -stop_cmd=":" +name="abi" +start_precmd="${name}_prestart" +start_cmd=":" sysv_start() { @@ -24,12 +21,6 @@ kldload sysvsem >/dev/null 2>&1 kldload sysvshm >/dev/null 2>&1 } -load_rc_config $name -run_rc_command "$1" - -name="linux" -rcvar=`set_rcvar` -start_cmd="linux_start" linux_start() { @@ -41,15 +32,23 @@ /compat/linux/sbin/ldconfig fi } -load_rc_config $name -run_rc_command "$1" + +svr4_start() +{ + echo -n ' svr4' + kldload svr4 > /dev/null 2>&1 +} + +abi_prestart() +{ + echo -n 'Additional ABI support:' + + checkyesno sysvipc_enable && sysv_start + checkyesno linux_enable && linux_start + checkyesno svr4_enable && svr4_start -name="svr4" -rcvar=`set_rcvar` -start_precmd="echo -n ' svr4'" -start_cmd="kldload svr4 > /dev/null 2>&1" + echo '.' +} load_rc_config $name run_rc_command "$1" - -echo '.' ==== //depot/projects/hammer/etc/rc.d/cleanvar#10 (text+ko) ==== @@ -1,11 +1,23 @@ #!/bin/sh # -# $FreeBSD: src/etc/rc.d/cleanvar,v 1.10 2005/08/08 09:46:09 pjd Exp $ +# $FreeBSD: src/etc/rc.d/cleanvar,v 1.11 2005/12/19 10:57:00 dougb Exp $ # # PROVIDE: cleanvar # REQUIRE: mountcritlocal var +. /etc/rc.subr + +name="cleanvar" +rcvar=`set_rcvar` + +start_precmd="${name}_prestart" +start_cmd="${name}_start" +stop_cmd=":" + +extra_commands="reload" +reload_cmd="${name}_start" + purgedir() { local dir file @@ -34,20 +46,28 @@ fi } -# These files must be removed only the first time this script is run -# on boot. -# -[ "$1" != "reload" ] && rm -f /var/run/clean_var /var/spool/lock/clean_var +cleanvar_prestart() +{ + # These files must be removed only the first time this script is run + # on boot. + # + rm -f /var/run/clean_var /var/spool/lock/clean_var +} -if [ -d /var/run -a ! -f /var/run/clean_var ]; then - purgedir /var/run - # And an initial utmp file - (cd /var/run && cp /dev/null utmp && chmod 644 utmp;) - >/var/run/clean_var -fi -if [ -d /var/spool/lock -a ! -f /var/spool/lock/clean_var ]; then - purgedir /var/spool/lock - >/var/spool/lock/clean_var -fi -rm -rf /var/spool/uucp/.Temp/* +cleanvar_start () +{ + if [ -d /var/run -a ! -f /var/run/clean_var ]; then + purgedir /var/run + # And an initial utmp file + (cd /var/run && cp /dev/null utmp && chmod 644 utmp;) + >/var/run/clean_var + fi + if [ -d /var/spool/lock -a ! -f /var/spool/lock/clean_var ]; then + purgedir /var/spool/lock + >/var/spool/lock/clean_var + fi + rm -rf /var/spool/uucp/.Temp/* +} +load_rc_config $name +run_rc_command "$1" ==== //depot/projects/hammer/etc/rc.d/cleartmp#11 (text+ko) ==== @@ -1,7 +1,6 @@ #!/bin/sh # -# $NetBSD: cleartmp,v 1.4 2002/03/22 04:33:58 thorpej Exp $ -# $FreeBSD: src/etc/rc.d/cleartmp,v 1.12 2005/01/12 07:18:25 anholt Exp $ +# $FreeBSD: src/etc/rc.d/cleartmp,v 1.13 2005/12/19 10:57:00 dougb Exp $ # # PROVIDE: cleartmp @@ -12,12 +11,12 @@ name="cleartmp" rcvar=`set_rcvar clear_tmp` -start_cmd="cleartmp_start" -stop_cmd=":" -x11_socket_dirs="/tmp/.X11-unix /tmp/.ICE-unix /tmp/.font-unix /tmp/.XIM-unix" +start_cmd="${name}_start" cleartmp_start() { + + local x11_socket_dirs="/tmp/.X11-unix /tmp/.ICE-unix /tmp/.font-unix /tmp/.XIM-unix" echo "Clearing /tmp." # # Prune quickly with one rm, then use find to clean up @@ -27,14 +26,16 @@ (cd /tmp && rm -rf [a-km-pr-zA-Z]* && find -x . ! -name . ! -name lost+found ! -name quota.user \ ! -name quota.group -exec rm -rf -- {} \; -type d -prune) + + # Remove X lock files, since they will prevent you from restarting X. + rm -f /tmp/.X[0-9]-lock + + # Create socket directories with correct permissions to avoid + # security problem. + # + rm -fr ${x11_socket_dirs} + mkdir -m 1777 ${x11_socket_dirs} } load_rc_config $name run_rc_command "$1" - -# Remove X lock files, since they will prevent you from restarting X. -rm -f /tmp/.X[0-9]-lock - -# Create socket directories with correct permissions to avoid security problem. -rm -fr ${x11_socket_dirs} -mkdir -m 1777 ${x11_socket_dirs} ==== //depot/projects/hammer/etc/rc.d/syscons#7 (text+ko) ==== @@ -24,11 +24,11 @@ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # -# $FreeBSD: src/etc/rc.d/syscons,v 1.13 2004/10/07 13:55:26 mtm Exp $ +# $FreeBSD: src/etc/rc.d/syscons,v 1.14 2005/12/15 01:04:48 iedowse Exp $ # # PROVIDE: syscons -# REQUIRE: LOGIN usbd +# REQUIRE: LOGIN # KEYWORD: nojail . /etc/rc.subr ==== //depot/projects/hammer/gnu/usr.bin/grep/grep.1#9 (text+ko) ==== @@ -1,5 +1,5 @@ .\" grep man page -.\" $FreeBSD: src/gnu/usr.bin/grep/grep.1,v 1.27 2005/10/23 11:19:56 stefanf Exp $ +.\" $FreeBSD: src/gnu/usr.bin/grep/grep.1,v 1.28 2005/12/18 12:09:23 ru Exp $ .if !\n(.g \{\ . if !\w|\*(lq| \{\ . ds lq `` @@ -201,6 +201,7 @@ .I PATTERN as a list of fixed strings, separated by newlines, any of which is to be matched. +.TP .BR \-P ", " \-\^\-perl-regexp Interpret .I PATTERN ==== //depot/projects/hammer/include/Makefile#52 (text+ko) ==== @@ -1,5 +1,5 @@ # @(#)Makefile 8.2 (Berkeley) 1/4/94 -# $FreeBSD: src/include/Makefile,v 1.252 2005/12/01 21:46:01 ru Exp $ +# $FreeBSD: src/include/Makefile,v 1.253 2005/12/16 18:56:38 phk Exp $ # # Doing a "make install" builds /usr/include. @@ -14,7 +14,7 @@ locale.h malloc.h memory.h monetary.h mpool.h mqueue.h \ ndbm.h netconfig.h \ netdb.h nl_types.h nlist.h nss.h nsswitch.h objformat.h paths.h \ - proc_service.h pthread.h \ + printf.h proc_service.h pthread.h \ pthread_np.h pwd.h ranlib.h readpassphrase.h regex.h regexp.h \ resolv.h runetype.h search.h setjmp.h sgtty.h \ signal.h stab.h \ ==== //depot/projects/hammer/include/dlfcn.h#4 (text+ko) ==== @@ -30,7 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/include/dlfcn.h,v 1.19 2003/02/13 17:47:43 kan Exp $ + * $FreeBSD: src/include/dlfcn.h,v 1.20 2005/12/18 19:43:31 kan Exp $ */ #ifndef _DLFCN_H_ @@ -131,6 +131,8 @@ void (*_lock_release)(void *_lock), void (*_lock_destroy)(void *_lock), void (*_context_destroy)(void *_context)); +void *dlvsym(void * __restrict, const char * __restrict, + const char * __restrict); #endif /* __BSD_VISIBLE */ __END_DECLS ==== //depot/projects/hammer/lib/libc/gen/dlfcn.c#6 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/lib/libc/gen/dlfcn.c,v 1.12 2004/03/05 08:10:17 markm Exp $"); +__FBSDID("$FreeBSD: src/lib/libc/gen/dlfcn.c,v 1.13 2005/12/18 19:43:32 kan Exp $"); /* * Linkage to services provided by the dynamic linker. @@ -104,6 +104,15 @@ return NULL; } +#pragma weak dlvsym +void * +dlvsym(void * __restrict handle, const char * __restrict name, + const char * __restrict version) +{ + _rtld_error(sorry); + return NULL; +} + #pragma weak dlinfo int dlinfo(void * __restrict handle, int request, void * __restrict p) ==== //depot/projects/hammer/lib/libc/gen/nlist.c#3 (text+ko) ==== @@ -35,7 +35,7 @@ static char sccsid[] = "@(#)nlist.c 8.1 (Berkeley) 6/4/93"; #endif /* LIBC_SCCS and not lint */ #include -__FBSDID("$FreeBSD: src/lib/libc/gen/nlist.c,v 1.18 2003/02/27 13:40:00 nectar Exp $"); +__FBSDID("$FreeBSD: src/lib/libc/gen/nlist.c,v 1.19 2005/12/18 04:52:33 marcel Exp $"); #include "namespace.h" #include @@ -243,8 +243,8 @@ { struct nlist *p; Elf_Off symoff = 0, symstroff = 0; - Elf_Word symsize = 0, symstrsize = 0; - Elf_Sword cc, i; + Elf_Size symsize = 0, symstrsize = 0; + Elf_Ssize cc, i; int nent = -1; int errsave; Elf_Sym sbuf[1024]; @@ -252,7 +252,7 @@ Elf_Ehdr ehdr; char *strtab = NULL; Elf_Shdr *shdr = NULL; - Elf_Word shdr_size; + Elf_Size shdr_size; void *base; struct stat st; ==== //depot/projects/hammer/lib/libc/stdio/Makefile.inc#13 (text+ko) ==== @@ -1,5 +1,5 @@ # @(#)Makefile.inc 8.3 (Berkeley) 4/17/94 -# $FreeBSD: src/lib/libc/stdio/Makefile.inc,v 1.33 2004/07/16 06:06:09 tjr Exp $ +# $FreeBSD: src/lib/libc/stdio/Makefile.inc,v 1.34 2005/12/16 18:56:38 phk Exp $ # stdio sources .PATH: ${.CURDIR}/stdio @@ -23,6 +23,9 @@ vswprintf.c vswscanf.c vwprintf.c vwscanf.c wbuf.c wprintf.c wscanf.c \ wsetup.c +SRCS+= xprintf.c xprintf_float.c xprintf_int.c xprintf_str.c +SRCS+= xprintf_hexdump.c xprintf_time.c xprintf_vis.c + MAN+= fclose.3 ferror.3 fflush.3 fgetln.3 fgets.3 fgetwln.3 fgetws.3 \ flockfile.3 \ fopen.3 fputs.3 \ ==== //depot/projects/hammer/lib/libc/stdio/fread.c#4 (text+ko) ==== @@ -38,7 +38,7 @@ static char sccsid[] = "@(#)fread.c 8.2 (Berkeley) 12/11/93"; #endif /* LIBC_SCCS and not lint */ #include -__FBSDID("$FreeBSD: src/lib/libc/stdio/fread.c,v 1.12 2002/10/12 16:13:37 mike Exp $"); +__FBSDID("$FreeBSD: src/lib/libc/stdio/fread.c,v 1.13 2005/12/16 02:50:53 davidxu Exp $"); #include "namespace.h" #include @@ -47,11 +47,23 @@ #include "local.h" #include "libc_private.h" +/* + * MT-safe version + */ + size_t -fread(buf, size, count, fp) - void * __restrict buf; - size_t size, count; - FILE * __restrict fp; +fread(void * __restrict buf, size_t size, size_t count, FILE * __restrict fp) +{ + int ret; + + FLOCKFILE(fp); + ret = __fread(buf, size, count, fp); + FUNLOCKFILE(fp); + return (ret); +} + +size_t +__fread(void * __restrict buf, size_t size, size_t count, FILE * __restrict fp) { size_t resid; char *p; @@ -65,7 +77,6 @@ */ if ((resid = count * size) == 0) return (0); - FLOCKFILE(fp); ORIENT(fp, -1); if (fp->_r < 0) fp->_r = 0; @@ -79,13 +90,11 @@ resid -= r; if (__srefill(fp)) { /* no more input: return partial result */ - FUNLOCKFILE(fp); return ((total - resid) / size); } } (void)memcpy((void *)p, (void *)fp->_p, resid); fp->_r -= resid; fp->_p += resid; - FUNLOCKFILE(fp); return (count); } ==== //depot/projects/hammer/lib/libc/stdio/local.h#14 (text+ko) ==== @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)local.h 8.3 (Berkeley) 7/3/94 - * $FreeBSD: src/lib/libc/stdio/local.h,v 1.27 2005/09/12 13:46:32 stefanf Exp $ + * $FreeBSD: src/lib/libc/stdio/local.h,v 1.28 2005/12/16 02:50:53 davidxu Exp $ */ #include /* for off_t */ @@ -78,7 +78,8 @@ extern int __vfwprintf(FILE *, const wchar_t *, __va_list); extern int __vfwscanf(FILE * __restrict, const wchar_t * __restrict, __va_list); - +extern size_t __fread(void * __restrict buf, size_t size, size_t count, + FILE * __restrict fp); extern int __sdidinit; ==== //depot/projects/hammer/lib/libc/stdio/vfprintf.c#20 (text+ko) ==== @@ -38,7 +38,7 @@ static char sccsid[] = "@(#)vfprintf.c 8.1 (Berkeley) 6/4/93"; #endif /* LIBC_SCCS and not lint */ #include -__FBSDID("$FreeBSD: src/lib/libc/stdio/vfprintf.c,v 1.71 2005/12/13 13:23:27 phk Exp $"); +__FBSDID("$FreeBSD: src/lib/libc/stdio/vfprintf.c,v 1.72 2005/12/16 18:56:38 phk Exp $"); /* * Actual printf innards. @@ -58,6 +58,7 @@ #include #include #include +#include #include #include "un-namespace.h" @@ -466,6 +467,12 @@ char sign; /* sign prefix (' ', '+', '-', or \0) */ char thousands_sep; /* locale specific thousands separator */ const char *grouping; /* locale specific numeric grouping rules */ + + if (__use_xprintf == 0 && getenv("USE_XPRINTF")) + __use_xprintf = 1; + if (__use_xprintf > 0) + return (__xvprintf(fp, fmt0, ap)); + #ifndef NO_FLOATING_POINT /* * We can decompose the printed representation of floating ==== //depot/projects/hammer/lib/libc/stdio/vfscanf.c#13 (text+ko) ==== @@ -38,7 +38,7 @@ static char sccsid[] = "@(#)vfscanf.c 8.1 (Berkeley) 6/4/93"; #endif /* LIBC_SCCS and not lint */ #include -__FBSDID("$FreeBSD: src/lib/libc/stdio/vfscanf.c,v 1.38 2005/04/08 20:58:47 stefanf Exp $"); +__FBSDID("$FreeBSD: src/lib/libc/stdio/vfscanf.c,v 1.39 2005/12/16 02:50:53 davidxu Exp $"); #include "namespace.h" #include @@ -412,7 +412,7 @@ } nread += sum; } else { - size_t r = fread((void *)va_arg(ap, char *), 1, + size_t r = __fread((void *)va_arg(ap, char *), 1, width, fp); if (r == 0) ==== //depot/projects/hammer/lib/libthr/thread/thr_create.c#19 (text+ko) ==== @@ -1,36 +1,30 @@ /* * Copyright (c) 2003 Daniel M. Eischen - * Copyright (c) 1995-1998 John Birrell + * Copyright (c) 2005, David Xu * 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. + * notice unmodified, 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by John Birrell. - * 4. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY JOHN BIRRELL 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. + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 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. * - * $FreeBSD: src/lib/libthr/thread/thr_create.c,v 1.24 2005/10/10 12:15:07 davidxu Exp $ + * $FreeBSD: src/lib/libthr/thread/thr_create.c,v 1.25 2005/12/17 09:42:45 davidxu Exp $ */ #include ==== //depot/projects/hammer/lib/libthr/thread/thr_detach.c#9 (text+ko) ==== @@ -1,35 +1,31 @@ /* - * Copyright (c) 1995 John Birrell . + * Copyright (c) 2005 David Xu + * Copyright (C) 2003 Daniel M. Eischen * 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. + * notice unmodified, 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by John Birrell. - * 4. Neither the name of the author nor the names of any co-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 ``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 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. * - * THIS SOFTWARE IS PROVIDED BY JOHN BIRRELL 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. + * $FreeBSD: src/lib/libthr/thread/thr_detach.c,v 1.10 2005/12/17 09:42:45 davidxu Exp $ * - * $FreeBSD: src/lib/libthr/thread/thr_detach.c,v 1.9 2005/04/02 01:20:00 davidxu Exp $ */ #include ==== //depot/projects/hammer/lib/libthr/thread/thr_join.c#13 (text+ko) ==== @@ -1,35 +1,30 @@ >>> TRUNCATED FOR MAIL (1000 lines) <<< From owner-p4-projects@FreeBSD.ORG Tue Dec 20 04:39:02 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 8DA5E16A422; Tue, 20 Dec 2005 04:39:01 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3B81E16A41F for ; Tue, 20 Dec 2005 04:39:01 +0000 (GMT) (envelope-from soc-andrew@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id BE60943D55 for ; Tue, 20 Dec 2005 04:39:00 +0000 (GMT) (envelope-from soc-andrew@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id jBK4d0rv057699 for ; Tue, 20 Dec 2005 04:39:00 GMT (envelope-from soc-andrew@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id jBK4d0DE057696 for perforce@freebsd.org; Tue, 20 Dec 2005 04:39:00 GMT (envelope-from soc-andrew@freebsd.org) Date: Tue, 20 Dec 2005 04:39:00 GMT Message-Id: <200512200439.jBK4d0DE057696@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to soc-andrew@freebsd.org using -f From: soc-andrew To: Perforce Change Reviews Cc: Subject: PERFORCE change 88438 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Dec 2005 04:39:02 -0000 http://perforce.freebsd.org/chv.cgi?CH=88438 Change 88438 by soc-andrew@soc-andrew_serv on 2005/12/20 04:38:58 Rename bsd_lua -> bsdlua, libbsd_lua -> libbsdlua, libbsd_lualib -> libbsdlualib Install the lua headers with a bsd prefix, ie lua.h as bsdlua.h Affected files ... .. //depot/projects/soc2005/bsdinstaller/src/lib/lua/lua/Makefile#3 edit .. //depot/projects/soc2005/bsdinstaller/src/lib/lua/lualib/Makefile#3 edit .. //depot/projects/soc2005/bsdinstaller/src/release/bsdinstaller/bsdinstaller_shell.sh#7 edit .. //depot/projects/soc2005/bsdinstaller/src/usr.bin/lua/Makefile#3 edit Differences ... ==== //depot/projects/soc2005/bsdinstaller/src/lib/lua/lua/Makefile#3 (text+ko) ==== @@ -1,11 +1,20 @@ -LIB=bsd_lua +LIB=bsdlua SRCS= lapi.c lcode.c ldebug.c ldo.c ldump.c lfunc.c lgc.c llex.c lmem.c \ lobject.c lopcodes.c lparser.c lstate.c lstring.c ltable.c ltests.c \ - ltm.c lundump.c lvm.c lzio.c + ltm.c lundump.c lvm.c lzio.c bsdlua.h bsdlauxlib.h SHLIB_MAJOR=5 +INCS= bsdlua.h bsdlauxlib.h +CLEANFILES+= bsdlua.h bsdlauxlib.h + +bsdlua.h: + cp ${LUA_DIR}/include/lua.h ${.OBJDIR}/bsdlua.h + +bsdlauxlib.h: + sed "s|lua\.h|bsdlua\.h|" < ${LUA_DIR}/include/lauxlib.h > ${.OBJDIR}/bsdlauxlib.h + .include <${.CURDIR}/../Makefile.inc1> .PATH: ${LUA_DIR}/src ==== //depot/projects/soc2005/bsdinstaller/src/lib/lua/lualib/Makefile#3 (text+ko) ==== @@ -1,7 +1,14 @@ -LIB=bsd_lualib +LIB=bsdlualib SRCS= lauxlib.c lbaselib.c ldblib.c liolib.c lmathlib.c ltablib.c lstrlib.c \ - loadlib.c + loadlib.c bsdlualib.h + +INCS= bsdlualib.h +CLEANFILES+= bsdlualib.h + +bsdlualib.h: + sed "s|lua\.h|bsdlua\.h|" < ${LUA_DIR}/include/lualib.h > ${.OBJDIR}/bsdlualib.h + SHLIB_MAJOR=5 CFLAGS+=-DUSE_DLOPEN=1 ==== //depot/projects/soc2005/bsdinstaller/src/release/bsdinstaller/bsdinstaller_shell.sh#7 (text+ko) ==== @@ -13,7 +13,7 @@ /usr/sbin/bsd_installer_ncurses elif [ ${TTY} = "/dev/ttyv1" ] then - LUA_PATH="/usr/lib/lua/?.lua;/usr/libexec/bsdinstaller/lib/?.lua" LUA_CPATH=/usr/lib/lua/?.so LUA_SOPATH=/usr/lib/lua/ bsd_lua -lcompat-5.1 /usr/libexec/bsdinstaller/main.lua /usr/libexec/bsdinstaller/conf/BSDInstaller.lua /usr/libexec/bsdinstaller/conf/FreeBSD.lua dir.root=/ booted_from_install_media=true + LUA_PATH="/usr/lib/lua/?.lua;/usr/libexec/bsdinstaller/lib/?.lua" LUA_CPATH=/usr/lib/lua/?.so LUA_SOPATH=/usr/lib/lua/ bsdlua -lcompat-5.1 /usr/libexec/bsdinstaller/main.lua /usr/libexec/bsdinstaller/conf/BSDInstaller.lua /usr/libexec/bsdinstaller/conf/FreeBSD.lua dir.root=/ booted_from_install_media=true #/usr/sbin/bsd_installer_be if [ $? -eq 5 ] then ==== //depot/projects/soc2005/bsdinstaller/src/usr.bin/lua/Makefile#3 (text+ko) ==== @@ -1,4 +1,4 @@ -PROG= bsd_lua +PROG= bsdlua SRCS= lua.c LUA_DIR=${.CURDIR}/../../contrib/lua/lua @@ -7,8 +7,8 @@ CFLAGS+=-I${LUA_DIR}/include LDADD= -lm -LDADD+= -L${LUA_LIB}/lua -lbsd_lua -LDADD+= -L${LUA_LIB}/lualib -lbsd_lualib +LDADD+= -L${LUA_LIB}/lua -lbsdlua +LDADD+= -L${LUA_LIB}/lualib -lbsdlualib NOMAN=1 From owner-p4-projects@FreeBSD.ORG Tue Dec 20 05:39:15 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 75CE516A422; Tue, 20 Dec 2005 05:39:15 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 308F516A41F for ; Tue, 20 Dec 2005 05:39:15 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 76F4443D62 for ; Tue, 20 Dec 2005 05:39:13 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id jBK5dD68067108 for ; Tue, 20 Dec 2005 05:39:13 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id jBK5dDoo067105 for perforce@freebsd.org; Tue, 20 Dec 2005 05:39:13 GMT (envelope-from imp@freebsd.org) Date: Tue, 20 Dec 2005 05:39:13 GMT Message-Id: <200512200539.jBK5dDoo067105@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to imp@freebsd.org using -f From: Warner Losh To: Perforce Change Reviews Cc: Subject: PERFORCE change 88439 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Dec 2005 05:39:16 -0000 http://perforce.freebsd.org/chv.cgi?CH=88439 Change 88439 by imp@imp_hammer on 2005/12/20 05:38:48 Flesh out parameter setting Affected files ... .. //depot/projects/arm/src/sys/arm/at91/at91usartreg.h#3 edit .. //depot/projects/arm/src/sys/arm/at91/uart_dev_at91usart.c#6 edit Differences ... ==== //depot/projects/arm/src/sys/arm/at91/at91usartreg.h#3 (text+ko) ==== @@ -76,6 +76,15 @@ #define USART_MR_CHMODE_ECHO (1U << 14) #define USART_MR_CHMODE_LOOP (2U << 14) #define USART_MR_CHMODE_REMLOOP (3U << 14) +#define USART_MR_MSBF (1U << 16) +#define USART_MR_MODE9 (1U << 17) +#define USART_MR_CKLO_SCK (1U << 18) +#define USART_MR_OVER16 0 +#define USART_MR_OVER8 (1U << 19) +#define USART_MR_INACK (1U << 20) /* Inhibit NACK generation */ +#define USART_MR_DSNACK (1U << 21) /* Disable Successive NACK */ +#define USART_MR_MAXITERATION(x) ((x) << 24) +#define USART_MR_FILTER (1U << 28) /* Filters for Ir lines */ #define USART_IER 0x08 /* Interrupt enable register */ #define USART_IDR 0x0c /* Interrupt disable register */ ==== //depot/projects/arm/src/sys/arm/at91/uart_dev_at91usart.c#6 (text+ko) ==== @@ -47,13 +47,14 @@ #define DEFAULT_RCLK AT91C_MASTER_CLOCK #define SIGCHG(c, i, s, d) \ - if (c) { \ - i |= (i & s) ? s : s | d; \ - } else { \ - i = (i & s) ? (i & ~s) | d : i; \ - } + do { \ + if (c) { \ + i |= (i & s) ? s : s | d; \ + } else { \ + i = (i & s) ? (i & ~s) | d : i; \ + } \ + } while (0); - /* * Low-level UART interface. */ @@ -80,6 +81,11 @@ mr = USART_MR_MODE_NORMAL; mr |= USART_MR_USCLKS_MCK; /* Assume MCK */ + /* + * Or in the databits requested + */ + if (databits < 9) + mr &= ~USART_MR_MODE9; switch (databits) { case 5: mr |= USART_MR_CHRL_5BITS; @@ -93,10 +99,59 @@ case 8: mr |= USART_MR_CHRL_8BITS; break; + case 9: + mr |= USART_MR_CHRL_8BITS | USART_MR_MODE9; + break; default: return (EINVAL); } + /* + * Or in the parity + */ + switch (parity) { + case UART_PARITY_NONE: + mr |= USART_MR_PAR_NONE; + break; + case UART_PARITY_ODD: + mr |= USART_MR_PAR_ODD; + break; + case UART_PARITY_EVEN: + mr |= USART_MR_PAR_EVEN; + break; + case UART_PARITY_MARK: + mr |= USART_MR_PAR_MARK; + break; + case UART_PARITY_SPACE: + mr |= USART_MR_PAR_SPACE; + break; + default: + return (EINVAL); + } + + /* + * Or in the stop bits. Note: The hardware supports + * 1.5 stop bits in async mode, but there's no way to + * specify that AFAICT. + */ + if (stopbits > 1) + mr |= USART_MR_NBSTOP_2; + else + mr |= USART_MR_NBSTOP_2; + /* else if (stopbits == 1.5) + mr |= USART_MR_NBSTOP_1_5; */ + + /* + * We want normal plumbing mode too, none of this fancy + * loopback or echo mode. + */ + mr |= USART_MR_CHMODE_NORMAL; + + mr &= ~USART_MR_MSBF; /* lsb first */ + mr &= ~USART_MR_CKLO_SCK; /* Don't drive SCK */ + + /* XXX Need to take possible synchronous mode into account */ + return (0); } @@ -133,7 +188,8 @@ } /* - * Free resources now that we're no longer the console. + * Free resources now that we're no longer the console. This appears to + * be never called, and I'm unsure quite what to do if I am called. */ static void at91_usart_term(struct uart_bas *bas) @@ -204,7 +260,7 @@ KOBJMETHOD(uart_setsig, at91_usart_bus_setsig), KOBJMETHOD(uart_transmit, at91_usart_bus_transmit), - {0, 0 } + { 0, 0 } }; int @@ -228,7 +284,7 @@ { int i; - /* XXX very sub-optimial */ + /* XXX VERY sub-optimial */ mtx_lock_spin(&sc->sc_hwmtx); for (i = 0; i < sc->sc_txdatasz; i++) at91_usart_putc(&sc->sc_bas, sc->sc_txbuf[i]); @@ -244,14 +300,10 @@ do { old = sc->sc_hwsig; new = old; - if (sig & SER_DDTR) { - SIGCHG(sig & SER_DTR, new, SER_DTR, - SER_DDTR); - } - if (sig & SER_DRTS) { - SIGCHG(sig & SER_RTS, new, SER_RTS, - SER_DRTS); - } + if (sig & SER_DDTR) + SIGCHG(sig & SER_DTR, new, SER_DTR, SER_DDTR); + if (sig & SER_DRTS) + SIGCHG(sig & SER_RTS, new, SER_RTS, SER_DRTS); } while (!atomic_cmpset_32(&sc->sc_hwsig, old, new)); bas = &sc->sc_bas; mtx_lock_spin(&sc->sc_hwmtx); @@ -281,7 +333,8 @@ at91_usart_bus_param(struct uart_softc *sc, int baudrate, int databits, int stopbits, int parity) { - return (0); + return (at91_usart_param(&sc->sc_bas, baudrate, databits, stopbits, + parity)); } static int at91_usart_bus_ipend(struct uart_softc *sc) From owner-p4-projects@FreeBSD.ORG Tue Dec 20 18:07:53 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 316EF16A420; Tue, 20 Dec 2005 18:07:53 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E9A2616A420 for ; Tue, 20 Dec 2005 18:07:52 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5586B43D8C for ; Tue, 20 Dec 2005 18:07:48 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id jBKI7mGN019581 for ; Tue, 20 Dec 2005 18:07:48 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id jBKI7m5H019576 for perforce@freebsd.org; Tue, 20 Dec 2005 18:07:48 GMT (envelope-from imp@freebsd.org) Date: Tue, 20 Dec 2005 18:07:48 GMT Message-Id: <200512201807.jBKI7m5H019576@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to imp@freebsd.org using -f From: Warner Losh To: Perforce Change Reviews Cc: Subject: PERFORCE change 88458 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Dec 2005 18:07:54 -0000 http://perforce.freebsd.org/chv.cgi?CH=88458 Change 88458 by imp@imp_Speedy on 2005/12/20 18:07:38 This uart_barrier blows up, comment it out for now since it doesn't seem to be absolutely required. Affected files ... .. //depot/projects/arm/src/sys/arm/at91/uart_dev_at91usart.c#7 edit Differences ... ==== //depot/projects/arm/src/sys/arm/at91/uart_dev_at91usart.c#7 (text+ko) ==== @@ -151,7 +151,6 @@ mr &= ~USART_MR_CKLO_SCK; /* Don't drive SCK */ /* XXX Need to take possible synchronous mode into account */ - return (0); } @@ -184,7 +183,9 @@ uart_setreg(bas, USART_CR, USART_CR_RSTRX | USART_CR_RSTTX); uart_setreg(bas, USART_CR, USART_CR_RXEN | USART_CR_TXEN); uart_setreg(bas, USART_IER, USART_CSR_TXRDY | USART_CSR_RXRDY); +#if 0 uart_barrier(bas); +#endif } /* From owner-p4-projects@FreeBSD.ORG Tue Dec 20 19:09:07 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 391A416A422; Tue, 20 Dec 2005 19:09:07 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EE22116A41F for ; Tue, 20 Dec 2005 19:09:06 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id DB56F43D5A for ; Tue, 20 Dec 2005 19:09:05 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id jBKJ95k5021857 for ; Tue, 20 Dec 2005 19:09:05 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id jBKJ94lQ021854 for perforce@freebsd.org; Tue, 20 Dec 2005 19:09:04 GMT (envelope-from imp@freebsd.org) Date: Tue, 20 Dec 2005 19:09:04 GMT Message-Id: <200512201909.jBKJ94lQ021854@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to imp@freebsd.org using -f From: Warner Losh To: Perforce Change Reviews Cc: Subject: PERFORCE change 88463 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Dec 2005 19:09:08 -0000 http://perforce.freebsd.org/chv.cgi?CH=88463 Change 88463 by imp@imp_Speedy on 2005/12/20 19:08:20 IFC @88461 # I had to hand merge the lcore.s changes that cognet and I made # to this branch, I don't know if they were merged correctly. # I can boot the compressed kernel now. Woo Hoo! Affected files ... .. //depot/projects/arm/src/sys/alpha/alpha/clock.c#4 integrate .. //depot/projects/arm/src/sys/alpha/alpha/elf_machdep.c#2 integrate .. //depot/projects/arm/src/sys/alpha/linux/linux_sysvec.c#3 integrate .. //depot/projects/arm/src/sys/amd64/amd64/apic_vector.S#5 integrate .. //depot/projects/arm/src/sys/amd64/amd64/busdma_machdep.c#5 integrate .. //depot/projects/arm/src/sys/amd64/amd64/elf_machdep.c#3 integrate .. //depot/projects/arm/src/sys/amd64/amd64/local_apic.c#6 integrate .. //depot/projects/arm/src/sys/amd64/isa/clock.c#5 integrate .. //depot/projects/arm/src/sys/amd64/linux32/linux32_sysvec.c#3 integrate .. //depot/projects/arm/src/sys/arm/arm/elf_trampoline.c#4 integrate .. //depot/projects/arm/src/sys/arm/arm/locore.S#15 integrate .. //depot/projects/arm/src/sys/arm/conf/KB920X#9 edit .. //depot/projects/arm/src/sys/boot/common/bootstrap.h#2 integrate .. //depot/projects/arm/src/sys/boot/common/load_elf.c#2 integrate .. //depot/projects/arm/src/sys/boot/common/load_elf_obj.c#2 integrate .. //depot/projects/arm/src/sys/boot/common/reloc_elf.c#2 integrate .. //depot/projects/arm/src/sys/boot/i386/libi386/Makefile#3 integrate .. //depot/projects/arm/src/sys/boot/i386/libi386/biosdisk.c#2 integrate .. //depot/projects/arm/src/sys/boot/i386/libi386/biospnp.c#2 integrate .. //depot/projects/arm/src/sys/boot/i386/libi386/biossmap.c#2 integrate .. //depot/projects/arm/src/sys/boot/i386/libi386/i386_copy.c#2 integrate .. //depot/projects/arm/src/sys/boot/i386/loader/main.c#3 integrate .. //depot/projects/arm/src/sys/boot/pc98/libpc98/Makefile#3 integrate .. //depot/projects/arm/src/sys/cam/scsi/scsi_da.c#4 integrate .. //depot/projects/arm/src/sys/compat/linux/linux_ioctl.c#3 integrate .. //depot/projects/arm/src/sys/compat/linux/linux_mib.c#2 integrate .. //depot/projects/arm/src/sys/compat/linux/linux_mib.h#2 integrate .. //depot/projects/arm/src/sys/compat/ndis/subr_ndis.c#5 integrate .. //depot/projects/arm/src/sys/compat/ndis/subr_ntoskrnl.c#7 integrate .. //depot/projects/arm/src/sys/conf/Makefile.arm#7 integrate .. //depot/projects/arm/src/sys/contrib/pf/net/pf.c#4 integrate .. //depot/projects/arm/src/sys/contrib/pf/net/pfvar.h#3 integrate .. //depot/projects/arm/src/sys/dev/amr/amr.c#6 integrate .. //depot/projects/arm/src/sys/dev/amr/amr_cam.c#3 integrate .. //depot/projects/arm/src/sys/dev/amr/amr_disk.c#3 integrate .. //depot/projects/arm/src/sys/dev/amr/amr_pci.c#4 integrate .. //depot/projects/arm/src/sys/dev/amr/amrio.h#2 integrate .. //depot/projects/arm/src/sys/dev/amr/amrreg.h#2 integrate .. //depot/projects/arm/src/sys/dev/amr/amrvar.h#3 integrate .. //depot/projects/arm/src/sys/dev/ata/ata-chipset.c#5 integrate .. //depot/projects/arm/src/sys/dev/ata/ata-pci.h#4 integrate .. //depot/projects/arm/src/sys/dev/ata/ata-raid.c#5 integrate .. //depot/projects/arm/src/sys/dev/ata/ata-raid.h#5 integrate .. //depot/projects/arm/src/sys/dev/bge/if_bge.c#5 integrate .. //depot/projects/arm/src/sys/dev/bge/if_bgereg.h#5 integrate .. //depot/projects/arm/src/sys/dev/ciss/ciss.c#5 integrate .. //depot/projects/arm/src/sys/dev/cp/cpddk.c#2 integrate .. //depot/projects/arm/src/sys/dev/em/if_em.c#8 integrate .. //depot/projects/arm/src/sys/dev/if_ndis/if_ndis.c#5 integrate .. //depot/projects/arm/src/sys/dev/isp/isp_pci.c#4 integrate .. //depot/projects/arm/src/sys/dev/ixgb/if_ixgb.c#4 integrate .. //depot/projects/arm/src/sys/dev/nge/if_nge.c#4 integrate .. //depot/projects/arm/src/sys/dev/re/if_re.c#6 integrate .. //depot/projects/arm/src/sys/dev/smbus/smb.c#2 integrate .. //depot/projects/arm/src/sys/dev/smbus/smbus.c#2 integrate .. //depot/projects/arm/src/sys/dev/sound/usb/uaudio.c#3 integrate .. //depot/projects/arm/src/sys/dev/ti/if_ti.c#2 integrate .. //depot/projects/arm/src/sys/dev/ti/if_tireg.h#2 integrate .. //depot/projects/arm/src/sys/dev/txp/if_txp.c#4 integrate .. //depot/projects/arm/src/sys/dev/usb/ugen.c#2 integrate .. //depot/projects/arm/src/sys/dev/usb/umass.c#4 integrate .. //depot/projects/arm/src/sys/dev/usb/usb_quirks.c#3 integrate .. //depot/projects/arm/src/sys/dev/usb/usbdevs#5 integrate .. //depot/projects/arm/src/sys/dev/vge/if_vge.c#4 integrate .. //depot/projects/arm/src/sys/fs/nullfs/null_vfsops.c#3 integrate .. //depot/projects/arm/src/sys/fs/nwfs/nwfs_vfsops.c#3 integrate .. //depot/projects/arm/src/sys/fs/smbfs/smbfs_vfsops.c#4 integrate .. //depot/projects/arm/src/sys/geom/nop/g_nop.c#3 integrate .. //depot/projects/arm/src/sys/gnu/fs/xfs/FreeBSD/support/kdb.c#2 integrate .. //depot/projects/arm/src/sys/gnu/fs/xfs/FreeBSD/xfs_freebsd.h#2 integrate .. //depot/projects/arm/src/sys/gnu/fs/xfs/FreeBSD/xfs_mountops.c#2 integrate .. //depot/projects/arm/src/sys/i386/i386/apic_vector.s#5 integrate .. //depot/projects/arm/src/sys/i386/i386/local_apic.c#5 integrate .. //depot/projects/arm/src/sys/i386/isa/clock.c#4 integrate .. //depot/projects/arm/src/sys/i386/linux/linux_sysvec.c#3 integrate .. //depot/projects/arm/src/sys/ia64/ia64/elf_machdep.c#3 integrate .. //depot/projects/arm/src/sys/kern/imgact_elf.c#3 integrate .. //depot/projects/arm/src/sys/kern/kern_clock.c#3 integrate .. //depot/projects/arm/src/sys/kern/kern_mutex.c#3 integrate .. //depot/projects/arm/src/sys/kern/kern_switch.c#3 integrate .. //depot/projects/arm/src/sys/kern/kern_sx.c#2 integrate .. //depot/projects/arm/src/sys/kern/link_elf.c#3 integrate .. //depot/projects/arm/src/sys/kern/link_elf_obj.c#3 integrate .. //depot/projects/arm/src/sys/kern/sched_ule.c#4 integrate .. //depot/projects/arm/src/sys/kern/subr_prof.c#3 integrate .. //depot/projects/arm/src/sys/kern/sys_pipe.c#3 integrate .. //depot/projects/arm/src/sys/kern/uipc_mbuf.c#8 integrate .. //depot/projects/arm/src/sys/kern/uipc_mqueue.c#3 integrate .. //depot/projects/arm/src/sys/kern/uipc_usrreq.c#4 integrate .. //depot/projects/arm/src/sys/kern/vfs_default.c#5 integrate .. //depot/projects/arm/src/sys/kern/vfs_mount.c#7 integrate .. //depot/projects/arm/src/sys/kern/vfs_syscalls.c#4 integrate .. //depot/projects/arm/src/sys/kern/vfs_vnops.c#5 integrate .. //depot/projects/arm/src/sys/kern/vnode_if.src#4 integrate .. //depot/projects/arm/src/sys/net/bridgestp.c#2 integrate .. //depot/projects/arm/src/sys/net/if_bridge.c#3 integrate .. //depot/projects/arm/src/sys/net/if_bridgevar.h#2 integrate .. //depot/projects/arm/src/sys/net/if_ethersubr.c#6 integrate .. //depot/projects/arm/src/sys/net/if_vlan_var.h#4 integrate .. //depot/projects/arm/src/sys/net80211/ieee80211.c#4 integrate .. //depot/projects/arm/src/sys/net80211/ieee80211_input.c#5 integrate .. //depot/projects/arm/src/sys/net80211/ieee80211_ioctl.c#5 integrate .. //depot/projects/arm/src/sys/net80211/ieee80211_ioctl.h#4 integrate .. //depot/projects/arm/src/sys/net80211/ieee80211_node.c#5 integrate .. //depot/projects/arm/src/sys/net80211/ieee80211_proto.c#4 integrate .. //depot/projects/arm/src/sys/net80211/ieee80211_var.h#4 integrate .. //depot/projects/arm/src/sys/netinet/if_ether.c#5 integrate .. //depot/projects/arm/src/sys/netinet/in.h#4 integrate .. //depot/projects/arm/src/sys/netinet/ip_fw.h#4 integrate .. //depot/projects/arm/src/sys/netinet/ip_fw2.c#6 integrate .. //depot/projects/arm/src/sys/netinet/ip_mroute.c#5 integrate .. //depot/projects/arm/src/sys/netinet/raw_ip.c#3 integrate .. //depot/projects/arm/src/sys/netinet/tcp_usrreq.c#5 integrate .. //depot/projects/arm/src/sys/netinet/udp_usrreq.c#5 integrate .. //depot/projects/arm/src/sys/nfsclient/nfs_socket.c#5 integrate .. //depot/projects/arm/src/sys/pc98/cbus/sio.c#2 integrate .. //depot/projects/arm/src/sys/pci/amdpm.c#4 integrate .. //depot/projects/arm/src/sys/powerpc/include/frame.h#2 integrate .. //depot/projects/arm/src/sys/powerpc/powerpc/genassym.c#2 integrate .. //depot/projects/arm/src/sys/sparc64/sparc64/elf_machdep.c#2 integrate .. //depot/projects/arm/src/sys/sys/elf32.h#2 integrate .. //depot/projects/arm/src/sys/sys/elf64.h#2 integrate .. //depot/projects/arm/src/sys/sys/elf_common.h#2 integrate .. //depot/projects/arm/src/sys/sys/elf_generic.h#2 integrate .. //depot/projects/arm/src/sys/sys/imgact_elf.h#2 integrate .. //depot/projects/arm/src/sys/sys/ktr.h#5 integrate .. //depot/projects/arm/src/sys/sys/linker.h#2 integrate .. //depot/projects/arm/src/sys/sys/lock.h#4 integrate .. //depot/projects/arm/src/sys/sys/mount.h#5 integrate .. //depot/projects/arm/src/sys/sys/param.h#6 integrate .. //depot/projects/arm/src/sys/sys/resourcevar.h#3 integrate .. //depot/projects/arm/src/sys/sys/vnode.h#6 integrate .. //depot/projects/arm/src/sys/tools/vnode_if.awk#3 integrate .. //depot/projects/arm/src/sys/ufs/ufs/quota.h#2 integrate .. //depot/projects/arm/src/sys/ufs/ufs/ufs_quota.c#3 integrate .. //depot/projects/arm/src/sys/ufs/ufs/ufs_vfsops.c#4 integrate .. //depot/projects/arm/src/sys/vm/vm_extern.h#3 integrate .. //depot/projects/arm/src/sys/vm/vm_fault.c#4 integrate .. //depot/projects/arm/src/sys/vm/vm_glue.c#3 integrate .. //depot/projects/arm/src/sys/vm/vm_page.c#4 integrate Differences ... ==== //depot/projects/arm/src/sys/alpha/alpha/clock.c#4 (text+ko) ==== @@ -38,7 +38,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/alpha/alpha/clock.c,v 1.40 2005/11/20 01:31:29 marcel Exp $"); +__FBSDID("$FreeBSD: src/sys/alpha/alpha/clock.c,v 1.41 2005/12/14 21:42:12 jhb Exp $"); #include "opt_clock.h" @@ -158,8 +158,8 @@ static u_int32_t last_time; static void handleclock(void* arg); -static void -calibrate_clocks(u_int32_t firmware_freq, u_int32_t *pcc, u_int32_t *timer); +static void calibrate_clocks(u_int32_t firmware_freq, u_int32_t *pcc, + u_int32_t *timer); static void set_timer_freq(u_int freq, int intr_freq); void ==== //depot/projects/arm/src/sys/alpha/alpha/elf_machdep.c#2 (text+ko) ==== @@ -24,7 +24,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/alpha/alpha/elf_machdep.c,v 1.19 2004/08/11 02:35:04 marcel Exp $"); +__FBSDID("$FreeBSD: src/sys/alpha/alpha/elf_machdep.c,v 1.20 2005/12/18 04:52:34 marcel Exp $"); #include #include @@ -121,7 +121,7 @@ Elf_Addr *where; Elf_Addr addr; Elf_Addr addend; - Elf_Word rtype, symidx; + Elf_Size rtype, symidx; const Elf_Rel *rel; const Elf_Rela *rela; ==== //depot/projects/arm/src/sys/alpha/linux/linux_sysvec.c#3 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/alpha/linux/linux_sysvec.c,v 1.96 2005/10/14 12:43:43 davidxu Exp $"); +__FBSDID("$FreeBSD: src/sys/alpha/linux/linux_sysvec.c,v 1.97 2005/12/15 16:30:41 jhb Exp $"); /* XXX we use functions that might not exist. */ #include "opt_compat.h" @@ -265,7 +265,6 @@ linux_ioctl_unregister_handler(*lihp); if (bootverbose) printf("Linux ELF exec handler removed\n"); - linux_mib_destroy(); } else printf("Could not deinstall ELF interpreter entry\n"); break; ==== //depot/projects/arm/src/sys/amd64/amd64/apic_vector.S#5 (text+ko) ==== @@ -28,7 +28,7 @@ * SUCH DAMAGE. * * from: vector.s, 386BSD 0.1 unknown origin - * $FreeBSD: src/sys/amd64/amd64/apic_vector.S,v 1.106 2005/12/08 18:33:29 jhb Exp $ + * $FreeBSD: src/sys/amd64/amd64/apic_vector.S,v 1.107 2005/12/14 21:47:01 jhb Exp $ */ /* @@ -171,8 +171,7 @@ iretq /* - * Forward hardclock to another CPU. Pushes a clockframe and calls - * forwarded_hardclock(). + * Handler for IPIs sent via the per-cpu IPI bitmap. */ .text SUPERALIGN_TEXT ==== //depot/projects/arm/src/sys/amd64/amd64/busdma_machdep.c#5 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/amd64/busdma_machdep.c,v 1.71 2005/11/24 15:28:32 le Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/busdma_machdep.c,v 1.72 2005/12/16 05:57:18 scottl Exp $"); #include #include @@ -49,7 +49,7 @@ #include #include -#define MAX_BPAGES 512 +#define MAX_BPAGES 8192 struct bounce_zone; ==== //depot/projects/arm/src/sys/amd64/amd64/elf_machdep.c#3 (text+ko) ==== @@ -24,7 +24,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/amd64/elf_machdep.c,v 1.23 2005/09/27 18:18:23 peter Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/elf_machdep.c,v 1.24 2005/12/18 04:52:35 marcel Exp $"); #include #include @@ -119,7 +119,7 @@ Elf32_Addr *where32, val32; Elf_Addr addr; Elf_Addr addend; - Elf_Word rtype, symidx; + Elf_Size rtype, symidx; const Elf_Rel *rel; const Elf_Rela *rela; ==== //depot/projects/arm/src/sys/amd64/amd64/local_apic.c#6 (text+ko) ==== @@ -32,7 +32,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/amd64/local_apic.c,v 1.20 2005/12/08 18:33:29 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/local_apic.c,v 1.22 2005/12/13 18:29:09 jhb Exp $"); #include "opt_hwpmc_hooks.h" ==== //depot/projects/arm/src/sys/amd64/isa/clock.c#5 (text+ko) ==== @@ -33,7 +33,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/isa/clock.c,v 1.222 2005/07/13 15:43:19 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/isa/clock.c,v 1.223 2005/12/12 22:27:07 peter Exp $"); /* * Routines to handle clock hardware. @@ -61,6 +61,7 @@ #include #include #include +#include #include #include #include @@ -269,7 +270,21 @@ int getit_calls = 1; int n1; static int state = 0; +#endif + if (tsc_freq != 0 && !tsc_is_broken) { + uint64_t start, end, now; + + sched_pin(); + start = rdtsc(); + end = start + (tsc_freq * n) / 1000000; + do { + now = rdtsc(); + } while (now < end || (now > start && end < start)); + sched_unpin(); + return; + } +#ifdef DELAYDEBUG if (state == 0) { state = 1; for (n1 = 1; n1 <= 10000000; n1 *= 10) ==== //depot/projects/arm/src/sys/amd64/linux32/linux32_sysvec.c#3 (text+ko) ==== @@ -31,7 +31,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/linux32/linux32_sysvec.c,v 1.12 2005/11/02 21:18:07 ps Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/linux32/linux32_sysvec.c,v 1.13 2005/12/15 16:30:41 jhb Exp $"); /* XXX we use functions that might not exist. */ #include "opt_compat.h" @@ -1083,7 +1083,6 @@ linux_ioctl_unregister_handler(*lihp); if (bootverbose) printf("Linux ELF exec handler removed\n"); - linux_mib_destroy(); } else printf("Could not deinstall ELF interpreter entry\n"); break; ==== //depot/projects/arm/src/sys/arm/arm/elf_trampoline.c#4 (text+ko) ==== @@ -23,7 +23,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/arm/arm/elf_trampoline.c,v 1.3 2005/12/05 12:55:46 cognet Exp $"); +__FBSDID("$FreeBSD: src/sys/arm/arm/elf_trampoline.c,v 1.4 2005/12/20 01:28:17 cognet Exp $"); #include #include #include @@ -47,9 +47,10 @@ { const char *s = src; char *d = dst; - + while (len) { - if (len >= 4 && !((vm_offset_t)d & 3) && !((vm_offset_t)s & 3)) { + if (0 && len >= 4 && !((vm_offset_t)d & 3) && + !((vm_offset_t)s & 3)) { *(uint32_t *)d = *(uint32_t *)s; s += 4; d += 4; @@ -83,6 +84,29 @@ void _start(void) { + int physaddr = KERNPHYSADDR; + int tmp1; + + __asm __volatile("adr %0, 2f\n" + "bic %0, %0, #0xff000000\n" + "bic sp, sp, #0xff000000\n" + "and %1, %1, #0xff000000\n" + "orr %0, %0, %1\n" + "orr sp, sp, %1\n" + "mrc p15, 0, %1, c1, c0, 0\n" + "bic %1, %1, #1\n" /* Disable MMU */ + "orr %1, %1, #(4 | 8)\n" /* Add DC enable, + WBUF enable */ + "orr %1, %1, #0x1000\n" /* Add IC enable */ + "orr %1, %1, #(0x800)\n" /* BPRD enable */ + + "mcr p15, 0, %1, c1, c0, 0\n" + "nop\n" + "nop\n" + "nop\n" + "mov pc, %0\n" + "2: nop\n" + : "=r" (tmp1), "+r" (physaddr)); __start(); } @@ -156,6 +180,7 @@ char slide[GZ_WSIZE]; orig_input = kernel; + memcnt = memtot = 0; i_input = (char *)kernel + GZ_HEAD; if (((char *)kernel)[3] & 0x18) { while (*i_input) @@ -173,7 +198,6 @@ #endif - void * load_kernel(unsigned int kstart, unsigned int curaddr,unsigned int func_end, int d) @@ -194,6 +218,7 @@ entry_point = (void*)eh->e_entry; memcpy(phdr, (void *)(kstart + eh->e_phoff ), eh->e_phnum * sizeof(phdr[0])); + /* Determine lastaddr. */ for (i = 0; i < eh->e_phnum; i++) { if (lastaddr < (phdr[i].p_vaddr - KERNVIRTADDR + curaddr @@ -204,9 +229,12 @@ /* Save the symbol tables, as there're about to be scratched. */ lastaddr = roundup(lastaddr, sizeof(long)); + shdr = (Elf_Shdr *)lastaddr; + lastaddr += sizeof(*shdr) * eh->e_shnum; + memcpy(shdr, (void *)(kstart + eh->e_shoff), + sizeof(*shdr) * eh->e_shnum); if (eh->e_shnum * eh->e_shentsize != 0 && eh->e_shoff != 0) { - shdr = (Elf_Shdr *)(kstart + eh->e_shoff); for (i = 0; i < eh->e_shnum; i++) { if (shdr[i].sh_type == SHT_SYMTAB) { for (j = 0; j < eh->e_phnum; j++) { @@ -295,6 +323,10 @@ *((Elf_Addr *)curaddr + 2) = lastaddr - curaddr + KERNVIRTADDR; } else *(Elf_Addr *)curaddr = 0; + /* Invalidate the instruction cache. */ + __asm __volatile("mcr p15, 0, %0, c7, c5, 0\n" + "mcr p15, 0, %0, c7, c10, 4\n" + : : "r" (curaddr)); /* Jump to the entry point. */ ((void(*)(void))(entry_point - KERNVIRTADDR + curaddr))(); __asm __volatile(".globl func_end\n" ==== //depot/projects/arm/src/sys/arm/arm/locore.S#15 (text+ko) ==== @@ -37,7 +37,7 @@ #include #include #include -__FBSDID("$FreeBSD: src/sys/arm/arm/locore.S,v 1.11 2005/10/03 14:10:55 cognet Exp $"); +__FBSDID("$FreeBSD: src/sys/arm/arm/locore.S,v 1.12 2005/12/20 01:29:17 cognet Exp $"); /* What size should this really be ? It is only used by init_arm() */ #define INIT_ARM_STACK_SIZE 2048 @@ -140,12 +140,13 @@ Lstart_off: .word start_inram-_C_LABEL(_start) start_inram: adr r7, Lunmapped - bic r7, r7, #0xff000000 - orr r7, r7, #PHYSADDR /* Disable MMU for a while */ mrc p15, 0, r2, c1, c0, 0 - bic r2, r2, #CPU_CONTROL_MMU_ENABLE + bic r2, r2, #(CPU_CONTROL_MMU_ENABLE | CPU_CONTROL_DC_ENABLE |\ + CPU_CONTROL_WBUF_ENABLE) + bic r2, r2, #(CPU_CONTROL_IC_ENABLE) + bic r2, r2, #(CPU_CONTROL_BPRD_ENABLE) mcr p15, 0, r2, c1, c0, 0 nop @@ -159,6 +160,8 @@ /* build page table from scratch */ ldr r0, Lstartup_pagetable adr r4, mmu_init_table + bic r4, r4, #0xff000000 + orr r4, r4, #PHYSADDR b 3f 2: @@ -181,25 +184,27 @@ /* Set the Domain Access register. Very important! */ mov r0, #((DOMAIN_CLIENT << (PMAP_DOMAIN_KERNEL*2)) | DOMAIN_CLIENT) mcr p15, 0, r0, c3, c0, 0 - /* Enable MMU */ mrc p15, 0, r0, c1, c0, 0 orr r0, r0, #CPU_CONTROL_MMU_ENABLE mcr p15, 0, r0, c1, c0, 0 + nop + nop + nop CPWAIT(r0) - bl mmu_done +#endif mmu_done: -#endif + nop adr r1, .Lstart ldmia r1, {r1, r2, sp} /* Set initial stack and */ sub r2, r2, r1 /* get zero init data */ mov r3, #0 - .L1: str r3, [r1], #0x0004 /* get zero init data */ subs r2, r2, #4 bgt .L1 + ldr pc, .Lvirt_done mov r0, pc #if KERNVIRTADDR > KERNPHYSADDR @@ -218,7 +223,6 @@ sub pc, pc, r5 #endif virt_done: - nop LED1ON mov fp, #0 /* trace back starts here */ bl _C_LABEL(initarm) /* Off we go */ @@ -260,6 +264,8 @@ .word _end .word svcstk + INIT_ARM_STACK_SIZE +.Lvirt_done: + .word virt_done .Lmainreturned: .asciz "main() returned" .align 0 ==== //depot/projects/arm/src/sys/arm/conf/KB920X#9 (text+ko) ==== @@ -42,7 +42,7 @@ #options UFS_ACL #Support for access control lists #options UFS_DIRHASH #Improve performance on big directories options MD_ROOT #MD is a potential root device -options MD_ROOT_SIZE=4096 # 4MB ram disk +options MD_ROOT_SIZE=1024 # 3MB ram disk options ROOTDEVNAME=\"ufs:md0\" #options NFSCLIENT #Network Filesystem Client #options NFSSERVER #Network Filesystem Server @@ -67,7 +67,6 @@ device loop device ether device nexus -#device saarm device uart # Debugging for use in -current ==== //depot/projects/arm/src/sys/boot/common/bootstrap.h#2 (text+ko) ==== @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/boot/common/bootstrap.h,v 1.41 2004/08/29 00:48:41 iedowse Exp $ + * $FreeBSD: src/sys/boot/common/bootstrap.h,v 1.42 2005/12/18 04:52:35 marcel Exp $ */ #include @@ -240,7 +240,7 @@ #define ELF_RELOC_RELA 2 struct elf_file; -typedef Elf_Addr (symaddr_fn)(struct elf_file *ef, Elf_Word symidx); +typedef Elf_Addr (symaddr_fn)(struct elf_file *ef, Elf_Size symidx); int __elfN(loadfile)(char *filename, u_int64_t dest, struct preloaded_file **result); int __elfN(obj_loadfile)(char *filename, u_int64_t dest, ==== //depot/projects/arm/src/sys/boot/common/load_elf.c#2 (text+ko) ==== @@ -26,7 +26,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/boot/common/load_elf.c,v 1.32 2004/08/28 23:03:05 iedowse Exp $"); +__FBSDID("$FreeBSD: src/sys/boot/common/load_elf.c,v 1.33 2005/12/18 04:52:35 marcel Exp $"); #include #include @@ -744,7 +744,7 @@ } static Elf_Addr -__elfN(symaddr)(struct elf_file *ef, Elf_Word symidx) +__elfN(symaddr)(struct elf_file *ef, Elf_Size symidx) { /* Symbol lookup by index not required here. */ ==== //depot/projects/arm/src/sys/boot/common/load_elf_obj.c#2 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/boot/common/load_elf_obj.c,v 1.1 2004/08/29 00:48:41 iedowse Exp $"); +__FBSDID("$FreeBSD: src/sys/boot/common/load_elf_obj.c,v 1.2 2005/12/18 04:52:35 marcel Exp $"); #include #include @@ -70,7 +70,7 @@ Elf_Addr p, void *val, size_t len); static int __elfN(obj_parse_modmetadata)(struct preloaded_file *mp, elf_file_t ef); -static Elf_Addr __elfN(obj_symaddr)(struct elf_file *ef, Elf_Word symidx); +static Elf_Addr __elfN(obj_symaddr)(struct elf_file *ef, Elf_Size symidx); const char *__elfN(obj_kerneltype) = "elf kernel"; const char *__elfN(obj_moduletype) = "elf obj module"; @@ -495,7 +495,7 @@ /* Look up the address of a specified symbol. */ static Elf_Addr -__elfN(obj_symaddr)(struct elf_file *ef, Elf_Word symidx) +__elfN(obj_symaddr)(struct elf_file *ef, Elf_Size symidx) { Elf_Sym sym; Elf_Addr base; ==== //depot/projects/arm/src/sys/boot/common/reloc_elf.c#2 (text+ko) ==== @@ -28,7 +28,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/boot/common/reloc_elf.c,v 1.1 2004/08/28 23:03:05 iedowse Exp $"); +__FBSDID("$FreeBSD: src/sys/boot/common/reloc_elf.c,v 1.2 2005/12/18 04:52:35 marcel Exp $"); #include #include @@ -54,7 +54,7 @@ int reltype, Elf_Addr relbase, Elf_Addr dataaddr, void *data, size_t len) { #ifdef __sparc__ - Elf_Word w; + Elf_Size w; const Elf_Rela *a; switch (reltype) { @@ -81,7 +81,7 @@ #elif defined(__i386__) && __ELF_WORD_SIZE == 64 Elf64_Addr *where, val; Elf_Addr addend, addr; - Elf_Word rtype, symidx; + Elf_Size rtype, symidx; const Elf_Rel *rel; const Elf_Rela *rela; @@ -138,7 +138,7 @@ return (0); #elif defined(__i386__) && __ELF_WORD_SIZE == 32 Elf_Addr addend, addr, *where, val; - Elf_Word rtype, symidx; + Elf_Size rtype, symidx; const Elf_Rel *rel; const Elf_Rela *rela; ==== //depot/projects/arm/src/sys/boot/i386/libi386/Makefile#3 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/boot/i386/libi386/Makefile,v 1.38 2005/07/14 19:52:22 jkim Exp $ +# $FreeBSD: src/sys/boot/i386/libi386/Makefile,v 1.39 2005/12/19 09:00:11 sobomax Exp $ # LIB= i386 INTERNALLIB= @@ -24,6 +24,9 @@ # Include simple terminal emulation (cons25-compatible) CFLAGS+= -DTERM_EMU +# XXX: make alloca() useable +CFLAGS+= -Dalloca=__builtin_alloca + CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}/../btx/lib \ -I${.CURDIR}/../../../contrib/dev/acpica \ -I${.CURDIR}/../../.. -I. ==== //depot/projects/arm/src/sys/boot/i386/libi386/biosdisk.c#2 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/boot/i386/libi386/biosdisk.c,v 1.45 2004/09/21 06:46:44 wes Exp $"); +__FBSDID("$FreeBSD: src/sys/boot/i386/libi386/biosdisk.c,v 1.46 2005/12/19 09:00:11 sobomax Exp $"); /* * BIOS disk device handling. @@ -861,17 +861,18 @@ p = dest; /* Decide whether we have to bounce */ - if ((od->od_unit < 0x80) && - ((VTOP(dest) >> 16) != (VTOP(dest + blks * BIOSDISK_SECSIZE) >> 16))) { + if (VTOP(dest) >> 20 != 0 || ((od->od_unit < 0x80) && + ((VTOP(dest) >> 16) != (VTOP(dest + blks * BIOSDISK_SECSIZE) >> 16)))) { /* - * There is a 64k physical boundary somewhere in the destination buffer, so we have + * There is a 64k physical boundary somewhere in the destination buffer, or the + * destination buffer is above first 1MB of physical memory so we have * to arrange a suitable bounce buffer. Allocate a buffer twice as large as we * need to. Use the bottom half unless there is a break there, in which case we * use the top half. */ x = min(FLOPPY_BOUNCEBUF, (unsigned)blks); - bbuf = malloc(x * 2 * BIOSDISK_SECSIZE); + bbuf = alloca(x * 2 * BIOSDISK_SECSIZE); if (((u_int32_t)VTOP(bbuf) & 0xffff0000) == ((u_int32_t)VTOP(bbuf + x * BIOSDISK_SECSIZE) & 0xffff0000)) { breg = bbuf; } else { @@ -960,8 +961,6 @@ DEBUG("ax = 0x%04x cx = 0x%04x dx = 0x%04x status 0x%x", 0x200 | x, ((cyl & 0xff) << 8) | ((cyl & 0x300) >> 2) | sec, (hd << 8) | od->od_unit, (v86.eax >> 8) & 0xff); if (result) { - if (bbuf != NULL) - free(bbuf); return(-1); } if (bbuf != NULL) @@ -972,8 +971,6 @@ } /* hexdump(dest, (blks * BIOSDISK_SECSIZE)); */ - if (bbuf != NULL) - free(bbuf); return(0); } @@ -993,18 +990,18 @@ p = dest; /* Decide whether we have to bounce */ - if ((od->od_unit < 0x80) && - ((VTOP(dest) >> 16) != (VTOP(dest + blks * BIOSDISK_SECSIZE) >> 16))) { + if (VTOP(dest) >> 20 != 0 || ((od->od_unit < 0x80) && + ((VTOP(dest) >> 16) != (VTOP(dest + blks * BIOSDISK_SECSIZE) >> 16)))) { /* - * There is a 64k physical boundary somewhere in the destination buffer, so we have + * There is a 64k physical boundary somewhere in the destination buffer, or the + * destination buffer is above first 1MB of physical memory so we have * to arrange a suitable bounce buffer. Allocate a buffer twice as large as we * need to. Use the bottom half unless there is a break there, in which case we * use the top half. */ - x = min(FLOPPY_BOUNCEBUF, (unsigned)blks); - bbuf = malloc(x * 2 * BIOSDISK_SECSIZE); + bbuf = alloca(x * 2 * BIOSDISK_SECSIZE); if (((u_int32_t)VTOP(bbuf) & 0xffff0000) == ((u_int32_t)VTOP(bbuf + x * BIOSDISK_SECSIZE) & 0xffff0000)) { breg = bbuf; } else { @@ -1104,15 +1101,11 @@ DEBUG("ax = 0x%04x cx = 0x%04x dx = 0x%04x status 0x%x", 0x200 | x, ((cyl & 0xff) << 8) | ((cyl & 0x300) >> 2) | sec, (hd << 8) | od->od_unit, (v86.eax >> 8) & 0xff); if (result) { - if (bbuf != NULL) - free(bbuf); return(-1); } } /* hexdump(dest, (blks * BIOSDISK_SECSIZE)); */ - if (bbuf != NULL) - free(bbuf); return(0); } static int ==== //depot/projects/arm/src/sys/boot/i386/libi386/biospnp.c#2 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/boot/i386/libi386/biospnp.c,v 1.9 2003/08/25 23:28:31 obrien Exp $"); +__FBSDID("$FreeBSD: src/sys/boot/i386/libi386/biospnp.c,v 1.10 2005/12/19 09:00:11 sobomax Exp $"); /* * PnP BIOS enumerator. @@ -165,7 +165,7 @@ if (biospnp_init()) return; - devNodeBuffer = (struct pnp_devNode *)malloc(pnp_NodeSize); + devNodeBuffer = (struct pnp_devNode *)alloca(pnp_NodeSize); Node = 0; count = 1000; while((Node != 0xff) && (count-- > 0)) { ==== //depot/projects/arm/src/sys/boot/i386/libi386/biossmap.c#2 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/boot/i386/libi386/biossmap.c,v 1.3 2004/11/08 23:59:44 peter Exp $"); +__FBSDID("$FreeBSD: src/sys/boot/i386/libi386/biossmap.c,v 1.4 2005/12/19 09:00:11 sobomax Exp $"); /* * Obtain memory configuration information from the BIOS @@ -86,9 +86,10 @@ v86.eax = 0xe820; v86.ecx = sizeof(struct smap); v86.edx = SMAPSIG; - v86.es = VTOPSEG(&smapbase[smaplen]); - v86.edi = VTOPOFF(&smapbase[smaplen]); + v86.es = VTOPSEG(&smap); + v86.edi = VTOPOFF(&smap); v86int(); + bcopy(&smap, &smapbase[smaplen], sizeof(struct smap)); smaplen++; if ((v86.efl & 1) || (v86.eax != SMAPSIG)) break; ==== //depot/projects/arm/src/sys/boot/i386/libi386/i386_copy.c#2 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/boot/i386/libi386/i386_copy.c,v 1.10 2003/08/25 23:28:31 obrien Exp $"); +__FBSDID("$FreeBSD: src/sys/boot/i386/libi386/i386_copy.c,v 1.11 2005/12/19 09:00:11 sobomax Exp $"); /* * MD primitives supporting placement of module data @@ -37,8 +37,6 @@ #include "libi386.h" #include "btxv86.h" -#define READIN_BUF (16 * 1024) - ssize_t i386_copyin(const void *src, vm_offset_t dest, const size_t len) { @@ -67,25 +65,11 @@ ssize_t i386_readin(const int fd, vm_offset_t dest, const size_t len) { - void *buf; - size_t resid, chunk, get; - ssize_t got; - if (dest + len >= memtop) - return(0); + if (dest + len >= memtop) { + errno = EFBIG; + return(-1); + } - chunk = min(READIN_BUF, len); - buf = malloc(chunk); - if (buf == NULL) - return(0); - - for (resid = len; resid > 0; resid -= got, dest += got) { - get = min(chunk, resid); - got = read(fd, buf, get); - if (got <= 0) - break; - bcopy(buf, PTOV(dest), (size_t)got); - } - free(buf); - return(len - resid); + return (read(fd, PTOV(dest), len)); } ==== //depot/projects/arm/src/sys/boot/i386/loader/main.c#3 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/boot/i386/loader/main.c,v 1.33 2005/09/22 15:14:13 ru Exp $"); +__FBSDID("$FreeBSD: src/sys/boot/i386/loader/main.c,v 1.35 2005/12/19 18:39:01 sobomax Exp $"); /* * MD bootstrap main() and assorted miscellaneous @@ -72,6 +72,9 @@ /* XXX debugging */ extern char end[]; +static void *heap_top; +static void *heap_bottom; + int main(void) { @@ -88,7 +91,14 @@ */ bios_getmem(); - setheap((void *)end, (void *)bios_basemem); +#ifdef LOADER_BZIP2_SUPPORT + heap_top = PTOV(0x400000); + heap_bottom = PTOV(0x100000); +#else + heap_top = (void *)bios_basemem; + heap_bottom = (void *)end; +#endif + setheap(heap_bottom, heap_top); /* * XXX Chicken-and-egg problem; we want to have console output early, but some @@ -269,7 +279,8 @@ command_heap(int argc, char *argv[]) { mallocstats(); - printf("heap base at %p, top at %p\n", end, sbrk(0)); + printf("heap base at %p, top at %p, upper limit at %p\n", heap_bottom, + sbrk(0), heap_top); return(CMD_OK); } ==== //depot/projects/arm/src/sys/boot/pc98/libpc98/Makefile#3 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/boot/pc98/libpc98/Makefile,v 1.22 2005/05/08 14:17:28 nyan Exp $ +# $FreeBSD: src/sys/boot/pc98/libpc98/Makefile,v 1.23 2005/12/20 08:54:30 sobomax Exp $ # LIB= pc98 INTERNALLIB= @@ -24,6 +24,9 @@ # Include simple terminal emulation (cons25-compatible) CFLAGS+= -DTERM_EMU +# XXX: make alloca() useable +CFLAGS+= -Dalloca=__builtin_alloca + CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}/../btx/lib \ -I${.CURDIR}/../../i386/libi386 \ -I${.CURDIR}/../../.. -I. ==== //depot/projects/arm/src/sys/cam/scsi/scsi_da.c#4 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/cam/scsi/scsi_da.c,v 1.181 2005/11/18 02:43:49 jdp Exp $"); +__FBSDID("$FreeBSD: src/sys/cam/scsi/scsi_da.c,v 1.183 2005/12/19 03:43:48 pjd Exp $"); #include @@ -351,8 +351,17 @@ * Kingston DataTraveler II+ USB Pen-Drive. * Reported by: Pawel Jakub Dawidek */ - {T_DIRECT, SIP_MEDIA_REMOVABLE, "Kingston" , "DataTraveler II+", "*"}, - /*quirks*/ DA_Q_NO_SYNC_CACHE + {T_DIRECT, SIP_MEDIA_REMOVABLE, "Kingston" , "DataTraveler II+", + "*"}, /*quirks*/ DA_Q_NO_SYNC_CACHE + }, + { + /* + * Motorola E398 Mobile Phone (TransFlash memory card). + * Reported by: Wojciech A. Koszek + * PR: usb/89889 + */ + {T_DIRECT, SIP_MEDIA_REMOVABLE, "Motorola" , "Motorola Phone", + "*"}, /*quirks*/ DA_Q_NO_SYNC_CACHE }, }; ==== //depot/projects/arm/src/sys/compat/linux/linux_ioctl.c#3 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/compat/linux/linux_ioctl.c,v 1.130 2005/08/28 13:11:08 delphij Exp $"); +__FBSDID("$FreeBSD: src/sys/compat/linux/linux_ioctl.c,v 1.131 2005/12/13 15:32:52 delphij Exp $"); #include #include @@ -806,22 +806,22 @@ } >>> TRUNCATED FOR MAIL (1000 lines) <<< From owner-p4-projects@FreeBSD.ORG Tue Dec 20 21:14:55 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 5CDA016A465; Tue, 20 Dec 2005 21:14:53 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C129A16A444 for ; Tue, 20 Dec 2005 21:14:52 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id EBDDC43D68 for ; Tue, 20 Dec 2005 21:14:41 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id jBKLEfM1035809 for ; Tue, 20 Dec 2005 21:14:41 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id jBKLEefU035806 for perforce@freebsd.org; Tue, 20 Dec 2005 21:14:40 GMT (envelope-from imp@freebsd.org) Date: Tue, 20 Dec 2005 21:14:40 GMT Message-Id: <200512202114.jBKLEefU035806@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to imp@freebsd.org using -f From: Warner Losh To: Perforce Change Reviews Cc: Subject: PERFORCE change 88472 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Dec 2005 21:14:56 -0000 http://perforce.freebsd.org/chv.cgi?CH=88472 Change 88472 by imp@imp_Speedy on 2005/12/20 21:13:56 IFC @88471 (to pick up Makefile.arm changes for tramps!) Affected files ... .. //depot/projects/arm/src/sys/amd64/pci/pci_bus.c#3 integrate .. //depot/projects/arm/src/sys/conf/Makefile.arm#8 integrate .. //depot/projects/arm/src/sys/conf/files#9 integrate .. //depot/projects/arm/src/sys/dev/acpica/acpi_pci.c#3 integrate .. //depot/projects/arm/src/sys/dev/pci/hostb_pci.c#1 branch .. //depot/projects/arm/src/sys/dev/pci/pci.c#5 integrate .. //depot/projects/arm/src/sys/dev/pci/pci_if.m#2 integrate .. //depot/projects/arm/src/sys/dev/pci/pci_private.h#3 integrate .. //depot/projects/arm/src/sys/dev/pci/pcireg.h#3 integrate .. //depot/projects/arm/src/sys/dev/pci/pcivar.h#3 integrate .. //depot/projects/arm/src/sys/dev/smbus/smb.c#3 integrate .. //depot/projects/arm/src/sys/dev/smbus/smbus.c#3 integrate .. //depot/projects/arm/src/sys/i386/pci/pci_bus.c#3 integrate .. //depot/projects/arm/src/sys/pci/agp.c#2 integrate .. //depot/projects/arm/src/sys/pci/agpvar.h#2 integrate .. //depot/projects/arm/src/sys/sparc64/pci/ofw_pcibus.c#5 integrate Differences ... ==== //depot/projects/arm/src/sys/amd64/pci/pci_bus.c#3 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/pci/pci_bus.c,v 1.114 2005/09/18 01:42:43 imp Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/pci/pci_bus.c,v 1.115 2005/12/20 21:09:44 jhb Exp $"); #include "opt_cpu.h" @@ -336,64 +336,6 @@ /* - * Provide a device to "eat" the host->pci bridges that we dug up above - * and stop them showing up twice on the probes. This also stops them - * showing up as 'none' in pciconf -l. - */ -static int -pci_hostb_probe(device_t dev) -{ - u_int32_t id; - - id = pci_get_devid(dev); - - switch (id) { - - /* VIA VT82C596 Power Managment Function */ - case 0x30501106: - return ENXIO; - - default: - break; - } - - if (pci_get_class(dev) == PCIC_BRIDGE && - pci_get_subclass(dev) == PCIS_BRIDGE_HOST) { - device_set_desc(dev, "Host to PCI bridge"); - device_quiet(dev); - return -10000; - } - return ENXIO; -} - -static int -pci_hostb_attach(device_t dev) -{ - - return 0; -} - -static device_method_t pci_hostb_methods[] = { - /* Device interface */ - DEVMETHOD(device_probe, pci_hostb_probe), - DEVMETHOD(device_attach, pci_hostb_attach), - DEVMETHOD(device_shutdown, bus_generic_shutdown), - DEVMETHOD(device_suspend, bus_generic_suspend), - DEVMETHOD(device_resume, bus_generic_resume), - - { 0, 0 } -}; -static driver_t pci_hostb_driver = { - "hostb", - pci_hostb_methods, - 1, -}; -static devclass_t pci_hostb_devclass; - -DRIVER_MODULE(hostb, pci, pci_hostb_driver, pci_hostb_devclass, 0, 0); - - -/* * Install placeholder to claim the resources owned by the * PCI bus interface. This could be used to extract the * config space registers in the extreme case where the PnP ==== //depot/projects/arm/src/sys/conf/Makefile.arm#8 (text+ko) ==== @@ -1,7 +1,7 @@ # Makefile.arm -- with config changes. # Copyright 1990 W. Jolitz # from: @(#)Makefile.i386 7.1 5/10/91 -# $FreeBSD: src/sys/conf/Makefile.arm,v 1.23 2005/12/20 01:28:17 cognet Exp $ +# $FreeBSD: src/sys/conf/Makefile.arm,v 1.24 2005/12/20 20:57:20 cognet Exp $ # # Makefile for FreeBSD # @@ -58,40 +58,39 @@ ${OBJCOPY} -S -O binary ${FULLKERNEL}.noheader \ ${KERNEL_KO}.bin; \ rm ${FULLKERNEL}.noheader -.if ${DDB_ENABLED} != "" || defined(BUILD_ELF_TRAMPOLINE) -SYSTEM_LD_TAIL += ;echo "\#define KERNNAME \"${KERNEL_KO}.tmp\"" \ - >opt_kernname.h ;\ - sed s/${KERNVIRTADDR}/${KERNPHYSADDR}/ ldscript.$M > \ - ldscript.$M.tramp; \ + +trampoline: ${KERNEL_KO}.tramp +${KERNEL_KO}.tramp: ${KERNEL_KO} + echo "#define KERNNAME \"${KERNEL_KO}.tmp\"" >opt_kernname.h + sed s/${KERNVIRTADDR}/${KERNPHYSADDR}/ ldscript.$M > ldscript.$M.tramp sed s/" + SIZEOF_HEADERS"// ldscript.$M.tramp > \ - ldscript.$M.tramp.noheader; \ + ldscript.$M.tramp.noheader ${OBJCOPY} --strip-symbol '$$d' --strip-symbol '$$a' \ - -g --strip-symbol '$$t' ${FULLKERNEL} ${KERNEL_KO}.tmp;\ + -g --strip-symbol '$$t' ${FULLKERNEL} ${KERNEL_KO}.tmp ${CC} -O -nostdlib -I. -Xlinker -T -Xlinker ldscript.$M.tramp \ - $S/$M/$M/elf_trampoline.c $S/$M/$M/inckern.S -o ${KERNEL_KO}.tramp;\ + $S/$M/$M/elf_trampoline.c $S/$M/$M/inckern.S -o ${KERNEL_KO}.tramp ${CC} -O -nostdlib -I. -Xlinker -T -Xlinker ldscript.$M.tramp.noheader \ $S/$M/$M/elf_trampoline.c $S/$M/$M/inckern.S -o \ - ${KERNEL_KO}.tramp.noheader; \ + ${KERNEL_KO}.tramp.noheader ${OBJCOPY} -S -O binary ${KERNEL_KO}.tramp.noheader \ - ${KERNEL_KO}.tramp.bin; \ - ${OBJCOPY} ${STRIP_FLAGS} ${KERNEL_KO}.tmp; \ - echo "\#define KERNNAME \"${KERNEL_KO}.tmp.gz\"" \ - >opt_kernname.h ;\ - gzip -9 ${KERNEL_KO}.tmp; \ + ${KERNEL_KO}.tramp.bin + ${OBJCOPY} ${STRIP_FLAGS} ${KERNEL_KO}.tmp + echo "#define KERNNAME \"${KERNEL_KO}.tmp.gz\"" \ + >opt_kernname.h + gzip -9 ${KERNEL_KO}.tmp eval $$(stat -s ${KERNEL_KO}.tmp.gz) && \ - echo "\#define KERNSIZE $$st_size" >>opt_kernname.h;\ - ${CC} -O2 -DKZIP -I. -c $S/kern/inflate.c -o inflate-tramp.o; \ + echo "#define KERNSIZE $$st_size" >>opt_kernname.h + ${CC} -O2 -DKZIP -I. -c $S/kern/inflate.c -o inflate-tramp.o ${CC} -O -nostdlib -I. -Xlinker -T -Xlinker ldscript.$M.tramp \ -DKZIP $S/$M/$M/elf_trampoline.c inflate-tramp.o $S/$M/$M/inckern.S \ - -o ${KERNEL_KO}.gz.tramp;\ + -o ${KERNEL_KO}.gz.tramp ${CC} -O -nostdlib -I. -Xlinker -T -Xlinker ldscript.$M.tramp.noheader \ -DKZIP $S/$M/$M/elf_trampoline.c inflate-tramp.o $S/$M/$M/inckern.S \ - -o ${KERNEL_KO}.tramp.noheader; \ + -o ${KERNEL_KO}.tramp.noheader ${OBJCOPY} -S -O binary ${KERNEL_KO}.tramp.noheader \ - ${KERNEL_KO}.gz.tramp.bin; \ + ${KERNEL_KO}.gz.tramp.bin rm ${KERNEL_KO}.tmp.gz ${KERNEL_KO}.tramp.noheader opt_kernname.h \ - inflate-tramp.o; -.endif + inflate-tramp.o %BEFORE_DEPEND ==== //depot/projects/arm/src/sys/conf/files#9 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/conf/files,v 1.1076 2005/12/12 01:14:59 rodrigc Exp $ +# $FreeBSD: src/sys/conf/files,v 1.1077 2005/12/20 21:09:44 jhb Exp $ # # The long compile-with and dependency lines are required because of # limitations in config: backslash-newline doesn't work in strings, and @@ -751,6 +751,7 @@ dev/pcf/pcf.c optional pcf dev/pci/eisa_pci.c optional pci eisa dev/pci/fixup_pci.c optional pci +dev/pci/hostb_pci.c optional pci dev/pci/ignore_pci.c optional pci dev/pci/isa_pci.c optional pci isa dev/pci/pci.c optional pci ==== //depot/projects/arm/src/sys/dev/acpica/acpi_pci.c#3 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_pci.c,v 1.27 2005/09/11 18:39:01 obrien Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_pci.c,v 1.28 2005/12/20 19:57:47 jhb Exp $"); #include #include @@ -117,6 +117,7 @@ DEVMETHOD(pci_get_powerstate, pci_get_powerstate_method), DEVMETHOD(pci_set_powerstate, acpi_pci_set_powerstate_method), DEVMETHOD(pci_assign_interrupt, pci_assign_interrupt_method), + DEVMETHOD(pci_find_extcap, pci_find_extcap_method), { 0, 0 } }; ==== //depot/projects/arm/src/sys/dev/pci/pci.c#5 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/pci/pci.c,v 1.304 2005/11/09 03:37:52 imp Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/pci/pci.c,v 1.305 2005/12/20 19:57:47 jhb Exp $"); #include "opt_bus.h" @@ -133,6 +133,7 @@ DEVMETHOD(pci_get_powerstate, pci_get_powerstate_method), DEVMETHOD(pci_set_powerstate, pci_set_powerstate_method), DEVMETHOD(pci_assign_interrupt, pci_assign_interrupt_method), + DEVMETHOD(pci_find_extcap, pci_find_extcap_method), { 0, 0 } }; @@ -449,10 +450,10 @@ } /* Find the next entry */ ptr = nextptr; - nextptr = REG(ptr + 1, 1); + nextptr = REG(ptr + PCICAP_NEXTPTR, 1); /* Process this entry */ - switch (REG(ptr, 1)) { + switch (REG(ptr + PCICAP_ID, 1)) { case PCIY_PMG: /* PCI power management */ if (cfg->pp.pp_cap == 0) { cfg->pp.pp_cap = REG(ptr + PCIR_POWER_CAP, 2); @@ -477,6 +478,57 @@ #undef REG } +/* + * Return the offset in configuration space of the requested extended + * capability entry or 0 if the specified capability was not found. + */ +int +pci_find_extcap_method(device_t dev, device_t child, int capability, + int *capreg) +{ + struct pci_devinfo *dinfo = device_get_ivars(child); + pcicfgregs *cfg = &dinfo->cfg; + u_int32_t status; + u_int8_t ptr; + + /* + * Check the CAP_LIST bit of the PCI status register first. + */ + status = pci_read_config(child, PCIR_STATUS, 2); + if (!(status & PCIM_STATUS_CAPPRESENT)) + return (ENXIO); + + /* + * Determine the start pointer of the capabilities list. + */ + switch (cfg->hdrtype & PCIM_HDRTYPE) { + case 0: + ptr = PCIR_CAP_PTR; + break; + case 2: + ptr = PCIR_CAP_PTR_2; + break; + default: + /* XXX: panic? */ + return (ENXIO); /* no extended capabilities support */ + } + ptr = pci_read_config(child, ptr, 1); + + /* + * Traverse the capabilities list. + */ + while (ptr != 0) { + if (pci_read_config(child, ptr + PCICAP_ID, 1) == capability) { + if (capreg != NULL) + *capreg = ptr; + return (0); + } + ptr = pci_read_config(child, ptr + PCICAP_NEXTPTR, 1); + } + + return (ENOENT); +} + /* free pcicfgregs structure and all depending data structures */ int ==== //depot/projects/arm/src/sys/dev/pci/pci_if.m#2 (text+ko) ==== @@ -23,7 +23,7 @@ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # -# $FreeBSD: src/sys/dev/pci/pci_if.m,v 1.7 2005/01/06 01:43:05 imp Exp $ +# $FreeBSD: src/sys/dev/pci/pci_if.m,v 1.8 2005/12/20 19:57:47 jhb Exp $ # #include @@ -82,3 +82,10 @@ device_t dev; device_t child; }; + +METHOD int find_extcap { + device_t dev; + device_t child; + int capability; + int *capreg; +}; ==== //depot/projects/arm/src/sys/dev/pci/pci_private.h#3 (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.14 2005/02/28 01:14:15 imp Exp $ + * $FreeBSD: src/sys/dev/pci/pci_private.h,v 1.15 2005/12/20 19:57:47 jhb Exp $ * */ @@ -59,6 +59,8 @@ int pci_disable_busmaster_method(device_t dev, device_t child); int pci_enable_io_method(device_t dev, device_t child, int space); int pci_disable_io_method(device_t dev, device_t child, int space); +int pci_find_extcap_method(device_t dev, device_t child, + int capability, int *capreg); struct resource *pci_alloc_resource(device_t dev, device_t child, int type, int *rid, u_long start, u_long end, u_long count, u_int flags); ==== //depot/projects/arm/src/sys/dev/pci/pcireg.h#3 (text+ko) ==== @@ -23,7 +23,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/pcireg.h,v 1.48 2005/10/29 05:49:06 imp Exp $ + * $FreeBSD: src/sys/dev/pci/pcireg.h,v 1.49 2005/12/20 19:57:47 jhb Exp $ * */ @@ -88,6 +88,11 @@ #define PCIM_MFDEV 0x80 #define PCIR_BIST 0x0f +/* Capability Register Offsets */ + +#define PCICAP_ID 0x0 +#define PCICAP_NEXTPTR 0x1 + /* Capability Identification Numbers */ #define PCIY_PMG 0x01 /* PCI Power Management */ ==== //depot/projects/arm/src/sys/dev/pci/pcivar.h#3 (text+ko) ==== @@ -23,7 +23,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/pcivar.h,v 1.67 2005/09/11 03:22:03 imp Exp $ + * $FreeBSD: src/sys/dev/pci/pcivar.h,v 1.68 2005/12/20 19:57:47 jhb Exp $ * */ @@ -348,6 +348,12 @@ return PCI_GET_POWERSTATE(device_get_parent(dev), dev); } +static __inline int +pci_find_extcap(device_t dev, int capability, int *capreg) +{ + return PCI_FIND_EXTCAP(device_get_parent(dev), dev, capability, capreg); +} + device_t pci_find_bsf(uint8_t, uint8_t, uint8_t); device_t pci_find_device(uint16_t, uint16_t); #endif /* _SYS_BUS_H_ */ ==== //depot/projects/arm/src/sys/dev/smbus/smb.c#3 (text+ko) ==== @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/smbus/smb.c,v 1.35 2005/12/20 14:26:47 ru Exp $ + * $FreeBSD: src/sys/dev/smbus/smb.c,v 1.36 2005/12/20 21:06:57 ru Exp $ */ #include @@ -58,13 +58,11 @@ static int smb_probe(device_t); static int smb_attach(device_t); static int smb_detach(device_t); -static void smb_identify(driver_t *driver, device_t parent); static devclass_t smb_devclass; static device_method_t smb_methods[] = { /* device interface */ - DEVMETHOD(device_identify, smb_identify), DEVMETHOD(device_probe, smb_probe), DEVMETHOD(device_attach, smb_attach), DEVMETHOD(device_detach, smb_detach), @@ -94,14 +92,6 @@ .d_name = "smb", }; -static void -smb_identify(driver_t *driver, device_t parent) -{ - - if (!device_find_child(parent, "smb", -1)) - device_add_child(parent, "smb", -1); -} - static int smb_probe(device_t dev) { ==== //depot/projects/arm/src/sys/dev/smbus/smbus.c#3 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/smbus/smbus.c,v 1.19 2005/12/20 14:26:47 ru Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/smbus/smbus.c,v 1.20 2005/12/20 21:06:57 ru Exp $"); #include #include #include @@ -49,11 +49,12 @@ * Device methods */ static int smbus_probe(device_t); +static int smbus_attach(device_t); static device_method_t smbus_methods[] = { /* device interface */ DEVMETHOD(device_probe, smbus_probe), - DEVMETHOD(device_attach, bus_generic_attach), + DEVMETHOD(device_attach, smbus_attach), DEVMETHOD(device_detach, bus_generic_detach), /* bus interface */ @@ -81,6 +82,15 @@ return (0); } +static int +smbus_attach(device_t dev) +{ + device_add_child(dev, NULL, -1); + bus_generic_attach(dev); + + return (0); +} + void smbus_generic_intr(device_t dev, u_char devaddr, char low, char high) { ==== //depot/projects/arm/src/sys/i386/pci/pci_bus.c#3 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/i386/pci/pci_bus.c,v 1.121 2005/09/17 23:57:53 imp Exp $"); +__FBSDID("$FreeBSD: src/sys/i386/pci/pci_bus.c,v 1.122 2005/12/20 21:09:45 jhb Exp $"); #include "opt_cpu.h" @@ -548,64 +548,6 @@ /* - * Provide a device to "eat" the host->pci bridges that we dug up above - * and stop them showing up twice on the probes. This also stops them - * showing up as 'none' in pciconf -l. - */ -static int -pci_hostb_probe(device_t dev) -{ - u_int32_t id; - - id = pci_get_devid(dev); - - switch (id) { - - /* VIA VT82C596 Power Managment Function */ - case 0x30501106: - return ENXIO; - - default: - break; - } - - if (pci_get_class(dev) == PCIC_BRIDGE && - pci_get_subclass(dev) == PCIS_BRIDGE_HOST) { - device_set_desc(dev, "Host to PCI bridge"); - device_quiet(dev); - return -10000; - } - return ENXIO; -} - -static int -pci_hostb_attach(device_t dev) -{ - - return 0; -} - -static device_method_t pci_hostb_methods[] = { - /* Device interface */ - DEVMETHOD(device_probe, pci_hostb_probe), - DEVMETHOD(device_attach, pci_hostb_attach), - DEVMETHOD(device_shutdown, bus_generic_shutdown), - DEVMETHOD(device_suspend, bus_generic_suspend), - DEVMETHOD(device_resume, bus_generic_resume), - - { 0, 0 } -}; -static driver_t pci_hostb_driver = { - "hostb", - pci_hostb_methods, - 1, -}; -static devclass_t pci_hostb_devclass; - -DRIVER_MODULE(hostb, pci, pci_hostb_driver, pci_hostb_devclass, 0, 0); - - -/* * Install placeholder to claim the resources owned by the * PCI bus interface. This could be used to extract the * config space registers in the extreme case where the PnP ==== //depot/projects/arm/src/sys/pci/agp.c#2 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/pci/agp.c,v 1.46 2004/10/24 07:12:13 alc Exp $"); +__FBSDID("$FreeBSD: src/sys/pci/agp.c,v 1.50 2005/12/20 21:06:43 jhb Exp $"); #include "opt_bus.h" @@ -101,33 +101,12 @@ u_int8_t agp_find_caps(device_t dev) { - u_int32_t status; - u_int8_t ptr, next; + int capreg; - /* - * Check the CAP_LIST bit of the PCI status register first. - */ - status = pci_read_config(dev, PCIR_STATUS, 2); - if (!(status & 0x10)) - return 0; - /* - * Traverse the capabilities list. - */ - for (ptr = pci_read_config(dev, AGP_CAPPTR, 1); - ptr != 0; - ptr = next) { - u_int32_t capid = pci_read_config(dev, ptr, 4); - next = AGP_CAPID_GET_NEXT_PTR(capid); - - /* - * If this capability entry ID is 2, then we are done. - */ - if (AGP_CAPID_GET_CAP_ID(capid) == 2) - return ptr; - } - - return 0; + if (pci_find_extcap(dev, PCIY_AGP, &capreg) != 0) + capreg = 0; + return (capreg); } /* @@ -230,8 +209,7 @@ * Find and map the aperture. */ rid = AGP_APBASE; - sc->as_aperture = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, - RF_ACTIVE); + sc->as_aperture = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, 0); if (!sc->as_aperture) return ENOMEM; @@ -274,9 +252,10 @@ agp_generic_detach(device_t dev) { struct agp_softc *sc = device_get_softc(dev); + + destroy_dev(sc->as_devnode); bus_release_resource(dev, SYS_RES_MEMORY, AGP_APBASE, sc->as_aperture); mtx_destroy(&sc->as_lock); - destroy_dev(sc->as_devnode); agp_flush_cache(); return 0; } @@ -851,9 +830,18 @@ device_t agp_find_device() { + device_t *children; + int i, count; + if (!agp_devclass) - return 0; - return devclass_get_device(agp_devclass, 0); + return NULL; + if (devclass_get_devices(agp_devclass, &children, &count) != 0) + return NULL; + for (i = 0; i < count; i++) { + if (device_is_attached(children[i])) + return (children[i]); + } + return NULL; } enum agp_acquire_state @@ -872,7 +860,6 @@ pci_read_config(dev, agp_find_caps(dev) + AGP_STATUS, 4); info->ai_aperture_base = rman_get_start(sc->as_aperture); info->ai_aperture_size = rman_get_size(sc->as_aperture); - info->ai_aperture_va = (vm_offset_t) rman_get_virtual(sc->as_aperture); info->ai_memory_allowed = sc->as_maxmem; info->ai_memory_used = sc->as_allocated; } ==== //depot/projects/arm/src/sys/pci/agpvar.h#2 (text+ko) ==== @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/pci/agpvar.h,v 1.2 2001/12/19 08:54:29 mdodd Exp $ + * $FreeBSD: src/sys/pci/agpvar.h,v 1.3 2005/12/20 20:05:21 jhb Exp $ */ #ifndef _PCI_AGPVAR_H_ @@ -47,7 +47,6 @@ u_int32_t ai_mode; vm_offset_t ai_aperture_base; vm_size_t ai_aperture_size; - vm_offset_t ai_aperture_va; vm_size_t ai_memory_allowed; vm_size_t ai_memory_used; u_int32_t ai_devid; ==== //depot/projects/arm/src/sys/sparc64/pci/ofw_pcibus.c#5 (text+ko) ==== @@ -28,7 +28,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/sparc64/pci/ofw_pcibus.c,v 1.8 2005/12/03 18:11:26 marius Exp $"); +__FBSDID("$FreeBSD: src/sys/sparc64/pci/ofw_pcibus.c,v 1.9 2005/12/20 19:57:47 jhb Exp $"); #include "opt_ofw_pci.h" @@ -106,6 +106,7 @@ DEVMETHOD(pci_get_powerstate, pci_get_powerstate_method), DEVMETHOD(pci_set_powerstate, pci_set_powerstate_method), DEVMETHOD(pci_assign_interrupt, ofw_pcibus_assign_interrupt), + DEVMETHOD(pci_find_extcap, pci_find_extcap_method), /* ofw_bus interface */ DEVMETHOD(ofw_bus_get_devinfo, ofw_pcibus_get_devinfo), From owner-p4-projects@FreeBSD.ORG Wed Dec 21 00:18:05 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id ED00F16A422; Wed, 21 Dec 2005 00:18:04 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A7A2D16A41F for ; Wed, 21 Dec 2005 00:18:04 +0000 (GMT) (envelope-from cognet@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 70C7243D49 for ; Wed, 21 Dec 2005 00:18:04 +0000 (GMT) (envelope-from cognet@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id jBL0I4ci045239 for ; Wed, 21 Dec 2005 00:18:04 GMT (envelope-from cognet@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id jBL0I468045236 for perforce@freebsd.org; Wed, 21 Dec 2005 00:18:04 GMT (envelope-from cognet@freebsd.org) Date: Wed, 21 Dec 2005 00:18:04 GMT Message-Id: <200512210018.jBL0I468045236@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to cognet@freebsd.org using -f From: Olivier Houchard To: Perforce Change Reviews Cc: Subject: PERFORCE change 88491 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Dec 2005 00:18:05 -0000 http://perforce.freebsd.org/chv.cgi?CH=88491 Change 88491 by cognet@cognet on 2005/12/21 00:17:28 Remove unreachable code. Affected files ... .. //depot/projects/arm/src/sys/arm/arm/locore.S#16 edit Differences ... ==== //depot/projects/arm/src/sys/arm/arm/locore.S#16 (text+ko) ==== @@ -205,23 +205,6 @@ subs r2, r2, #4 bgt .L1 ldr pc, .Lvirt_done - - mov r0, pc -#if KERNVIRTADDR > KERNPHYSADDR - ldr r4, =KERNVIRTADDR - cmp r0, r4 - bgt virt_done - ldr r5, =KERNPHYSADDR - sub r4, r4, r5 - add pc, pc, r4 -#else - ldr r5, =KERNPHYSADDR - cmp r0, r4 - blt virt_done - ldr r4, =KERNVIRTADDR - sub r5, r5, r4 - sub pc, pc, r5 -#endif virt_done: LED1ON mov fp, #0 /* trace back starts here */ From owner-p4-projects@FreeBSD.ORG Wed Dec 21 00:19:07 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id C696216A422; Wed, 21 Dec 2005 00:19:06 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A1FF516A41F for ; Wed, 21 Dec 2005 00:19:06 +0000 (GMT) (envelope-from cognet@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 368D143D46 for ; Wed, 21 Dec 2005 00:19:06 +0000 (GMT) (envelope-from cognet@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id jBL0J63W045288 for ; Wed, 21 Dec 2005 00:19:06 GMT (envelope-from cognet@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id jBL0J58o045285 for perforce@freebsd.org; Wed, 21 Dec 2005 00:19:05 GMT (envelope-from cognet@freebsd.org) Date: Wed, 21 Dec 2005 00:19:05 GMT Message-Id: <200512210019.jBL0J58o045285@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to cognet@freebsd.org using -f From: Olivier Houchard To: Perforce Change Reviews Cc: Subject: PERFORCE change 88492 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Dec 2005 00:19:07 -0000 http://perforce.freebsd.org/chv.cgi?CH=88492 Change 88492 by cognet@cognet on 2005/12/21 00:18:24 Remove the now hopefully uneeded PA == VA mapping hack. Affected files ... .. //depot/projects/arm/src/sys/arm/at91/kb920x_machdep.c#14 edit Differences ... ==== //depot/projects/arm/src/sys/arm/at91/kb920x_machdep.c#14 (text+ko) ==== @@ -271,12 +271,6 @@ pmap_map_chunk(l1pagetable, KERNBASE, KERNPHYSADDR, (((uint32_t)(&end) - KERNBASE) + PAGE_SIZE) & ~(PAGE_SIZE - 1), VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); -#if 1 - /* XXX PA == VA XXX */ - pmap_map_chunk(l1pagetable, KERNPHYSADDR, KERNPHYSADDR, - (((uint32_t)(&end) - KERNBASE) + L1_S_SIZE) & ~(L1_S_SIZE - 1), - VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); -#endif afterkern = round_page(((vm_offset_t)&end + L1_S_SIZE) & ~(L1_S_SIZE - 1)); for (i = 0; i < KERNEL_PT_AFKERNEL_NUM; i++) { From owner-p4-projects@FreeBSD.ORG Wed Dec 21 15:25:21 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 2254716A420; Wed, 21 Dec 2005 15:25:21 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D4DE816A41F for ; Wed, 21 Dec 2005 15:25:20 +0000 (GMT) (envelope-from cognet@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5C9BA43D55 for ; Wed, 21 Dec 2005 15:25:19 +0000 (GMT) (envelope-from cognet@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id jBLFPJaX015654 for ; Wed, 21 Dec 2005 15:25:19 GMT (envelope-from cognet@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id jBLFPJcl015651 for perforce@freebsd.org; Wed, 21 Dec 2005 15:25:19 GMT (envelope-from cognet@freebsd.org) Date: Wed, 21 Dec 2005 15:25:19 GMT Message-Id: <200512211525.jBLFPJcl015651@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to cognet@freebsd.org using -f From: Olivier Houchard To: Perforce Change Reviews Cc: Subject: PERFORCE change 88522 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Dec 2005 15:25:22 -0000 http://perforce.freebsd.org/chv.cgi?CH=88522 Change 88522 by cognet@cognet on 2005/12/21 15:24:39 Add a new option to use the USART0 as the console instead of DBGU, USART0_CONSOLE, and use it for Skyeye. This is enough to get Skyeye to boot a FreeBSD kernel again. Affected files ... .. //depot/projects/arm/src/sys/arm/at91/uart_bus_at91usart.c#3 edit .. //depot/projects/arm/src/sys/arm/at91/uart_cpu_at91rm9200usart.c#4 edit .. //depot/projects/arm/src/sys/arm/conf/SKYEYE#2 edit .. //depot/projects/arm/src/sys/conf/options.arm#6 edit Differences ... ==== //depot/projects/arm/src/sys/arm/at91/uart_bus_at91usart.c#3 (text+ko) ==== @@ -22,6 +22,8 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include "opt_uart.h" + #include __FBSDID("$FreeBSD$"); @@ -91,7 +93,11 @@ * Setting sc_sysdev makes this device a 'system device' and * indirectly makes it the system console. */ +#ifdef USART0_CONSOLE if (device_get_unit(dev) == 0) +#else + if (device_get_unit(dev) == 0) +#endif sc->sc_sysdev = SLIST_FIRST(&uart_sysdevs); sc->sc_class = &at91_usart_class; bcopy(&sc->sc_sysdev->bas, &sc->sc_bas, sizeof(sc->sc_bas)); ==== //depot/projects/arm/src/sys/arm/at91/uart_cpu_at91rm9200usart.c#4 (text+ko) ==== @@ -24,6 +24,8 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include "opt_uart.h" + #include __FBSDID("$FreeBSD: src/sys/arm/sa11x0/uart_cpu_sa1110.c,v 1.3 2005/01/05 21:58:48 imp Exp $"); @@ -60,10 +62,15 @@ * XXX: Not pretty, but will work because we map VA == PA early * for the last 1MB of memory. */ +#ifdef USART0_CONSOLE + di->bas.bsh = AT91RM92_BASE + AT91RM92_USART0_BASE; + di->baudrate = 38400; +#else di->bas.bsh = AT91RM92_BASE + AT91RM92_SYS_BASE + DBGU; + di->baudrate = 115200; +#endif di->bas.regshft = 0; di->bas.rclk = 0; - di->baudrate = 115200; di->databits = 8; di->stopbits = 1; di->parity = UART_PARITY_NONE; ==== //depot/projects/arm/src/sys/arm/conf/SKYEYE#2 (text+ko) ==== @@ -32,6 +32,8 @@ options DDB options KDB +options USART0_CONSOLE + options SCHED_4BSD #4BSD scheduler options INET #InterNETworking options INET6 #IPv6 communications protocols ==== //depot/projects/arm/src/sys/conf/options.arm#6 (text+ko) ==== @@ -12,6 +12,7 @@ PHYSADDR opt_global.h KERNPHYSADDR opt_global.h KERNVIRTADDR opt_global.h +USART0_CONSOLE opt_uart.h STARTUP_PAGETABLE_ADDR opt_global.h VERBOSE_INIT_ARM opt_global.h XSCALE_CACHE_READ_WRITE_ALLOCATE opt_global.h From owner-p4-projects@FreeBSD.ORG Wed Dec 21 20:46:51 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id D4F0E16A422; Wed, 21 Dec 2005 20:46:50 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7B15A16A41F for ; Wed, 21 Dec 2005 20:46:50 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 20ADD43D46 for ; Wed, 21 Dec 2005 20:46:50 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id jBLKkotV036890 for ; Wed, 21 Dec 2005 20:46:50 GMT (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id jBLKkn9Z036887 for perforce@freebsd.org; Wed, 21 Dec 2005 20:46:49 GMT (envelope-from jhb@freebsd.org) Date: Wed, 21 Dec 2005 20:46:49 GMT Message-Id: <200512212046.jBLKkn9Z036887@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jhb@freebsd.org using -f From: John Baldwin To: Perforce Change Reviews Cc: Subject: PERFORCE change 88529 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Dec 2005 20:46:51 -0000 http://perforce.freebsd.org/chv.cgi?CH=88529 Change 88529 by jhb@jhb_slimer on 2005/12/21 20:45:50 IFC @88526. Affected files ... .. //depot/projects/smpng/sys/alpha/alpha/elf_machdep.c#15 integrate .. //depot/projects/smpng/sys/amd64/amd64/elf_machdep.c#10 integrate .. //depot/projects/smpng/sys/amd64/pci/pci_bus.c#14 integrate .. //depot/projects/smpng/sys/arm/arm/elf_trampoline.c#3 integrate .. //depot/projects/smpng/sys/arm/arm/locore.S#11 integrate .. //depot/projects/smpng/sys/arm/xscale/i80321/iq31244_machdep.c#17 integrate .. //depot/projects/smpng/sys/boot/common/bootstrap.h#9 integrate .. //depot/projects/smpng/sys/boot/common/load_elf.c#13 integrate .. //depot/projects/smpng/sys/boot/common/load_elf_obj.c#2 integrate .. //depot/projects/smpng/sys/boot/common/reloc_elf.c#2 integrate .. //depot/projects/smpng/sys/boot/i386/libi386/Makefile#14 integrate .. //depot/projects/smpng/sys/boot/i386/libi386/biosdisk.c#12 integrate .. //depot/projects/smpng/sys/boot/i386/libi386/biosmem.c#4 integrate .. //depot/projects/smpng/sys/boot/i386/libi386/biospnp.c#6 integrate .. //depot/projects/smpng/sys/boot/i386/libi386/biossmap.c#4 integrate .. //depot/projects/smpng/sys/boot/i386/libi386/i386_copy.c#3 integrate .. //depot/projects/smpng/sys/boot/i386/libi386/libi386.h#10 integrate .. //depot/projects/smpng/sys/boot/i386/loader/main.c#12 integrate .. //depot/projects/smpng/sys/boot/pc98/libpc98/Makefile#13 integrate .. //depot/projects/smpng/sys/boot/pc98/libpc98/biosdisk.c#11 integrate .. //depot/projects/smpng/sys/boot/pc98/libpc98/biosmem.c#5 integrate .. //depot/projects/smpng/sys/boot/pc98/loader/main.c#10 integrate .. //depot/projects/smpng/sys/cam/scsi/scsi_da.c#61 integrate .. //depot/projects/smpng/sys/conf/Makefile.arm#17 integrate .. //depot/projects/smpng/sys/conf/NOTES#110 integrate .. //depot/projects/smpng/sys/conf/files#161 integrate .. //depot/projects/smpng/sys/contrib/pf/net/pf.c#21 integrate .. //depot/projects/smpng/sys/contrib/pf/net/pfvar.h#9 integrate .. //depot/projects/smpng/sys/dev/acpica/acpi_pci.c#19 integrate .. //depot/projects/smpng/sys/dev/acpica/acpi_video.c#10 integrate .. //depot/projects/smpng/sys/dev/bge/if_bge.c#66 integrate .. //depot/projects/smpng/sys/dev/bge/if_bgereg.h#35 integrate .. //depot/projects/smpng/sys/dev/cp/cpddk.c#5 integrate .. //depot/projects/smpng/sys/dev/drm/drm_agpsupport.c#4 integrate .. //depot/projects/smpng/sys/dev/drm/drm_drv.c#3 integrate .. //depot/projects/smpng/sys/dev/drm/i915_drv.c#3 integrate .. //depot/projects/smpng/sys/dev/drm/mach64_drv.c#3 integrate .. //depot/projects/smpng/sys/dev/drm/mga_drv.c#9 integrate .. //depot/projects/smpng/sys/dev/drm/r128_drv.c#9 integrate .. //depot/projects/smpng/sys/dev/drm/radeon_drv.c#11 integrate .. //depot/projects/smpng/sys/dev/drm/savage_drv.c#3 integrate .. //depot/projects/smpng/sys/dev/drm/sis_drv.c#7 integrate .. //depot/projects/smpng/sys/dev/drm/tdfx_drv.c#9 integrate .. //depot/projects/smpng/sys/dev/em/if_em.c#60 integrate .. //depot/projects/smpng/sys/dev/ixgb/if_ixgb.c#15 integrate .. //depot/projects/smpng/sys/dev/nge/if_nge.c#47 integrate .. //depot/projects/smpng/sys/dev/pci/hostb_pci.c#1 branch .. //depot/projects/smpng/sys/dev/pci/pci.c#66 integrate .. //depot/projects/smpng/sys/dev/pci/pci_if.m#5 integrate .. //depot/projects/smpng/sys/dev/pci/pci_private.h#13 integrate .. //depot/projects/smpng/sys/dev/pci/pcireg.h#13 integrate .. //depot/projects/smpng/sys/dev/pci/pcivar.h#16 integrate .. //depot/projects/smpng/sys/dev/pci/vga_pci.c#1 branch .. //depot/projects/smpng/sys/dev/ppbus/if_plip.c#16 integrate .. //depot/projects/smpng/sys/dev/ppbus/immio.c#3 integrate .. //depot/projects/smpng/sys/dev/ppbus/lpbb.c#6 integrate .. //depot/projects/smpng/sys/dev/ppbus/lpt.c#14 integrate .. //depot/projects/smpng/sys/dev/ppbus/ppi.c#12 integrate .. //depot/projects/smpng/sys/dev/ppbus/pps.c#19 integrate .. //depot/projects/smpng/sys/dev/ppc/ppc.c#7 integrate .. //depot/projects/smpng/sys/dev/random/nehemiah.c#4 integrate .. //depot/projects/smpng/sys/dev/random/randomdev.c#29 integrate .. //depot/projects/smpng/sys/dev/random/randomdev.h#6 integrate .. //depot/projects/smpng/sys/dev/random/randomdev_soft.c#10 integrate .. //depot/projects/smpng/sys/dev/random/randomdev_soft.h#2 integrate .. //depot/projects/smpng/sys/dev/random/yarrow.c#13 integrate .. //depot/projects/smpng/sys/dev/re/if_re.c#35 integrate .. //depot/projects/smpng/sys/dev/smbus/smb.c#9 integrate .. //depot/projects/smpng/sys/dev/smbus/smbus.c#7 integrate .. //depot/projects/smpng/sys/dev/sound/usb/uaudio.c#10 integrate .. //depot/projects/smpng/sys/dev/ti/if_ti.c#2 integrate .. //depot/projects/smpng/sys/dev/txp/if_txp.c#32 integrate .. //depot/projects/smpng/sys/dev/usb/umass.c#50 integrate .. //depot/projects/smpng/sys/dev/usb/usb_quirks.c#15 integrate .. //depot/projects/smpng/sys/dev/usb/usbdevs#81 integrate .. //depot/projects/smpng/sys/dev/vge/if_vge.c#14 integrate .. //depot/projects/smpng/sys/geom/nop/g_nop.c#7 integrate .. //depot/projects/smpng/sys/i386/conf/NOTES#113 integrate .. //depot/projects/smpng/sys/i386/pci/pci_bus.c#28 integrate .. //depot/projects/smpng/sys/ia64/ia64/elf_machdep.c#17 integrate .. //depot/projects/smpng/sys/kern/imgact_elf.c#50 integrate .. //depot/projects/smpng/sys/kern/kern_clock.c#46 integrate .. //depot/projects/smpng/sys/kern/kern_switch.c#61 integrate .. //depot/projects/smpng/sys/kern/link_elf.c#31 integrate .. //depot/projects/smpng/sys/kern/link_elf_obj.c#7 integrate .. //depot/projects/smpng/sys/kern/sched_ule.c#63 integrate .. //depot/projects/smpng/sys/kern/vfs_mount.c#55 integrate .. //depot/projects/smpng/sys/kern/vfs_syscalls.c#94 integrate .. //depot/projects/smpng/sys/modules/i2c/controllers/Makefile#4 integrate .. //depot/projects/smpng/sys/modules/i2c/controllers/amdsmb/Makefile#1 branch .. //depot/projects/smpng/sys/modules/i2c/controllers/nfsmb/Makefile#1 branch .. //depot/projects/smpng/sys/net/bridgestp.c#6 integrate .. //depot/projects/smpng/sys/net/if_bridge.c#19 integrate .. //depot/projects/smpng/sys/net/if_bridgevar.h#6 integrate .. //depot/projects/smpng/sys/net/if_ethersubr.c#67 integrate .. //depot/projects/smpng/sys/net/if_vlan_var.h#15 integrate .. //depot/projects/smpng/sys/net80211/ieee80211_input.c#26 integrate .. //depot/projects/smpng/sys/netatm/uni/unisig_encode.c#6 integrate .. //depot/projects/smpng/sys/netinet/if_ether.c#44 integrate .. //depot/projects/smpng/sys/netinet/in.h#34 integrate .. //depot/projects/smpng/sys/pc98/cbus/sio.c#6 integrate .. //depot/projects/smpng/sys/pc98/conf/NOTES#49 integrate .. //depot/projects/smpng/sys/pci/agp.c#24 integrate .. //depot/projects/smpng/sys/pci/agp_ali.c#13 integrate .. //depot/projects/smpng/sys/pci/agp_amd.c#16 integrate .. //depot/projects/smpng/sys/pci/agp_amd64.c#8 integrate .. //depot/projects/smpng/sys/pci/agp_ati.c#2 integrate .. //depot/projects/smpng/sys/pci/agp_i810.c#20 integrate .. //depot/projects/smpng/sys/pci/agp_intel.c#21 integrate .. //depot/projects/smpng/sys/pci/agp_nvidia.c#7 integrate .. //depot/projects/smpng/sys/pci/agp_sis.c#13 integrate .. //depot/projects/smpng/sys/pci/agp_via.c#17 integrate .. //depot/projects/smpng/sys/pci/agpreg.h#15 integrate .. //depot/projects/smpng/sys/pci/agpvar.h#3 integrate .. //depot/projects/smpng/sys/pci/amdpm.c#16 integrate .. //depot/projects/smpng/sys/pci/amdsmb.c#1 branch .. //depot/projects/smpng/sys/pci/if_devar.h#14 integrate .. //depot/projects/smpng/sys/pci/nfsmb.c#1 branch .. //depot/projects/smpng/sys/powerpc/conf/Makefile#1 branch .. //depot/projects/smpng/sys/powerpc/conf/NOTES#1 branch .. //depot/projects/smpng/sys/sparc64/pci/ofw_pcibus.c#7 integrate .. //depot/projects/smpng/sys/sparc64/sparc64/elf_machdep.c#17 integrate .. //depot/projects/smpng/sys/sys/elf32.h#3 integrate .. //depot/projects/smpng/sys/sys/elf64.h#3 integrate .. //depot/projects/smpng/sys/sys/elf_common.h#6 integrate .. //depot/projects/smpng/sys/sys/elf_generic.h#4 integrate .. //depot/projects/smpng/sys/sys/imgact_elf.h#9 integrate .. //depot/projects/smpng/sys/sys/ktr.h#24 integrate .. //depot/projects/smpng/sys/sys/linker.h#15 integrate .. //depot/projects/smpng/sys/sys/mount.h#47 integrate .. //depot/projects/smpng/sys/sys/param.h#93 integrate .. //depot/projects/smpng/sys/vm/vm_fault.c#52 integrate Differences ... ==== //depot/projects/smpng/sys/alpha/alpha/elf_machdep.c#15 (text+ko) ==== @@ -24,7 +24,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/alpha/alpha/elf_machdep.c,v 1.19 2004/08/11 02:35:04 marcel Exp $"); +__FBSDID("$FreeBSD: src/sys/alpha/alpha/elf_machdep.c,v 1.20 2005/12/18 04:52:34 marcel Exp $"); #include #include @@ -121,7 +121,7 @@ Elf_Addr *where; Elf_Addr addr; Elf_Addr addend; - Elf_Word rtype, symidx; + Elf_Size rtype, symidx; const Elf_Rel *rel; const Elf_Rela *rela; ==== //depot/projects/smpng/sys/amd64/amd64/elf_machdep.c#10 (text+ko) ==== @@ -24,7 +24,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/amd64/elf_machdep.c,v 1.23 2005/09/27 18:18:23 peter Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/elf_machdep.c,v 1.24 2005/12/18 04:52:35 marcel Exp $"); #include #include @@ -119,7 +119,7 @@ Elf32_Addr *where32, val32; Elf_Addr addr; Elf_Addr addend; - Elf_Word rtype, symidx; + Elf_Size rtype, symidx; const Elf_Rel *rel; const Elf_Rela *rela; ==== //depot/projects/smpng/sys/amd64/pci/pci_bus.c#14 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/pci/pci_bus.c,v 1.114 2005/09/18 01:42:43 imp Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/pci/pci_bus.c,v 1.115 2005/12/20 21:09:44 jhb Exp $"); #include "opt_cpu.h" @@ -336,64 +336,6 @@ /* - * Provide a device to "eat" the host->pci bridges that we dug up above - * and stop them showing up twice on the probes. This also stops them - * showing up as 'none' in pciconf -l. - */ -static int -pci_hostb_probe(device_t dev) -{ - u_int32_t id; - - id = pci_get_devid(dev); - - switch (id) { - - /* VIA VT82C596 Power Managment Function */ - case 0x30501106: - return ENXIO; - - default: - break; - } - - if (pci_get_class(dev) == PCIC_BRIDGE && - pci_get_subclass(dev) == PCIS_BRIDGE_HOST) { - device_set_desc(dev, "Host to PCI bridge"); - device_quiet(dev); - return -10000; - } - return ENXIO; -} - -static int -pci_hostb_attach(device_t dev) -{ - - return 0; -} - -static device_method_t pci_hostb_methods[] = { - /* Device interface */ - DEVMETHOD(device_probe, pci_hostb_probe), - DEVMETHOD(device_attach, pci_hostb_attach), - DEVMETHOD(device_shutdown, bus_generic_shutdown), - DEVMETHOD(device_suspend, bus_generic_suspend), - DEVMETHOD(device_resume, bus_generic_resume), - - { 0, 0 } -}; -static driver_t pci_hostb_driver = { - "hostb", - pci_hostb_methods, - 1, -}; -static devclass_t pci_hostb_devclass; - -DRIVER_MODULE(hostb, pci, pci_hostb_driver, pci_hostb_devclass, 0, 0); - - -/* * Install placeholder to claim the resources owned by the * PCI bus interface. This could be used to extract the * config space registers in the extreme case where the PnP ==== //depot/projects/smpng/sys/arm/arm/elf_trampoline.c#3 (text+ko) ==== @@ -23,7 +23,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/arm/arm/elf_trampoline.c,v 1.3 2005/12/05 12:55:46 cognet Exp $"); +__FBSDID("$FreeBSD: src/sys/arm/arm/elf_trampoline.c,v 1.4 2005/12/20 01:28:17 cognet Exp $"); #include #include #include @@ -47,9 +47,10 @@ { const char *s = src; char *d = dst; - + while (len) { - if (len >= 4 && !((vm_offset_t)d & 3) && !((vm_offset_t)s & 3)) { + if (0 && len >= 4 && !((vm_offset_t)d & 3) && + !((vm_offset_t)s & 3)) { *(uint32_t *)d = *(uint32_t *)s; s += 4; d += 4; @@ -83,6 +84,29 @@ void _start(void) { + int physaddr = KERNPHYSADDR; + int tmp1; + + __asm __volatile("adr %0, 2f\n" + "bic %0, %0, #0xff000000\n" + "bic sp, sp, #0xff000000\n" + "and %1, %1, #0xff000000\n" + "orr %0, %0, %1\n" + "orr sp, sp, %1\n" + "mrc p15, 0, %1, c1, c0, 0\n" + "bic %1, %1, #1\n" /* Disable MMU */ + "orr %1, %1, #(4 | 8)\n" /* Add DC enable, + WBUF enable */ + "orr %1, %1, #0x1000\n" /* Add IC enable */ + "orr %1, %1, #(0x800)\n" /* BPRD enable */ + + "mcr p15, 0, %1, c1, c0, 0\n" + "nop\n" + "nop\n" + "nop\n" + "mov pc, %0\n" + "2: nop\n" + : "=r" (tmp1), "+r" (physaddr)); __start(); } @@ -156,6 +180,7 @@ char slide[GZ_WSIZE]; orig_input = kernel; + memcnt = memtot = 0; i_input = (char *)kernel + GZ_HEAD; if (((char *)kernel)[3] & 0x18) { while (*i_input) @@ -173,7 +198,6 @@ #endif - void * load_kernel(unsigned int kstart, unsigned int curaddr,unsigned int func_end, int d) @@ -194,6 +218,7 @@ entry_point = (void*)eh->e_entry; memcpy(phdr, (void *)(kstart + eh->e_phoff ), eh->e_phnum * sizeof(phdr[0])); + /* Determine lastaddr. */ for (i = 0; i < eh->e_phnum; i++) { if (lastaddr < (phdr[i].p_vaddr - KERNVIRTADDR + curaddr @@ -204,9 +229,12 @@ /* Save the symbol tables, as there're about to be scratched. */ lastaddr = roundup(lastaddr, sizeof(long)); + shdr = (Elf_Shdr *)lastaddr; + lastaddr += sizeof(*shdr) * eh->e_shnum; + memcpy(shdr, (void *)(kstart + eh->e_shoff), + sizeof(*shdr) * eh->e_shnum); if (eh->e_shnum * eh->e_shentsize != 0 && eh->e_shoff != 0) { - shdr = (Elf_Shdr *)(kstart + eh->e_shoff); for (i = 0; i < eh->e_shnum; i++) { if (shdr[i].sh_type == SHT_SYMTAB) { for (j = 0; j < eh->e_phnum; j++) { @@ -295,6 +323,10 @@ *((Elf_Addr *)curaddr + 2) = lastaddr - curaddr + KERNVIRTADDR; } else *(Elf_Addr *)curaddr = 0; + /* Invalidate the instruction cache. */ + __asm __volatile("mcr p15, 0, %0, c7, c5, 0\n" + "mcr p15, 0, %0, c7, c10, 4\n" + : : "r" (curaddr)); /* Jump to the entry point. */ ((void(*)(void))(entry_point - KERNVIRTADDR + curaddr))(); __asm __volatile(".globl func_end\n" ==== //depot/projects/smpng/sys/arm/arm/locore.S#11 (text+ko) ==== @@ -37,7 +37,7 @@ #include #include #include -__FBSDID("$FreeBSD: src/sys/arm/arm/locore.S,v 1.11 2005/10/03 14:10:55 cognet Exp $"); +__FBSDID("$FreeBSD: src/sys/arm/arm/locore.S,v 1.13 2005/12/21 15:02:31 cognet Exp $"); /* What size should this really be ? It is only used by init_arm() */ #define INIT_ARM_STACK_SIZE 2048 @@ -103,12 +103,16 @@ Lstart_off: .word start_inram-_C_LABEL(_start) start_inram: adr r7, Lunmapped - bic r7, r7, #0xff000000 - orr r7, r7, #PHYSADDR + bic r7, r7, #0xff000000 + orr r7, r7, #PHYSADDR + /* Disable MMU for a while */ mrc p15, 0, r2, c1, c0, 0 - bic r2, r2, #CPU_CONTROL_MMU_ENABLE + bic r2, r2, #(CPU_CONTROL_MMU_ENABLE | CPU_CONTROL_DC_ENABLE |\ + CPU_CONTROL_WBUF_ENABLE) + bic r2, r2, #(CPU_CONTROL_IC_ENABLE) + bic r2, r2, #(CPU_CONTROL_BPRD_ENABLE) mcr p15, 0, r2, c1, c0, 0 nop @@ -143,43 +147,29 @@ /* Set the Domain Access register. Very important! */ mov r0, #((DOMAIN_CLIENT << (PMAP_DOMAIN_KERNEL*2)) | DOMAIN_CLIENT) mcr p15, 0, r0, c3, c0, 0 - /* Enable MMU */ mrc p15, 0, r0, c1, c0, 0 orr r0, r0, #CPU_CONTROL_MMU_ENABLE mcr p15, 0, r0, c1, c0, 0 + nop + nop + nop CPWAIT(r0) - bl mmu_done +#endif mmu_done: -#endif + nop adr r1, .Lstart ldmia r1, {r1, r2, sp} /* Set initial stack and */ sub r2, r2, r1 /* get zero init data */ mov r3, #0 - .L1: str r3, [r1], #0x0004 /* get zero init data */ subs r2, r2, #4 bgt .L1 + ldr pc, .Lvirt_done - ldr r4, =KERNVIRTADDR - cmp pc, r4 -#if KERNVIRTADDR > KERNPHYSADDR - bgt virt_done - ldr r4, =KERNVIRTADDR - ldr r5, =KERNPHYSADDR - sub r4, r4, r5 - add pc, pc, r4 -#else - blt virt_done - ldr r4, =KERNPHYSADDR - ldr r5, =KERNVIRTADDR - sub r4, r4, r5 - sub pc, pc, r4 -#endif virt_done: - nop mov fp, #0 /* trace back starts here */ bl _C_LABEL(initarm) /* Off we go */ @@ -217,6 +207,8 @@ .word _end .word svcstk + INIT_ARM_STACK_SIZE +.Lvirt_done: + .word virt_done .Lmainreturned: .asciz "main() returned" .align 0 ==== //depot/projects/smpng/sys/arm/xscale/i80321/iq31244_machdep.c#17 (text+ko) ==== @@ -49,7 +49,7 @@ #include "opt_ddb.h" #include -__FBSDID("$FreeBSD: src/sys/arm/xscale/i80321/iq31244_machdep.c,v 1.17 2005/12/09 23:54:50 cognet Exp $"); +__FBSDID("$FreeBSD: src/sys/arm/xscale/i80321/iq31244_machdep.c,v 1.18 2005/12/21 15:01:49 cognet Exp $"); #define _ARM32_BUS_DMA_PRIVATE #include @@ -94,7 +94,6 @@ #include #include -#undef DDB #include #include #include ==== //depot/projects/smpng/sys/boot/common/bootstrap.h#9 (text+ko) ==== @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/boot/common/bootstrap.h,v 1.41 2004/08/29 00:48:41 iedowse Exp $ + * $FreeBSD: src/sys/boot/common/bootstrap.h,v 1.42 2005/12/18 04:52:35 marcel Exp $ */ #include @@ -240,7 +240,7 @@ #define ELF_RELOC_RELA 2 struct elf_file; -typedef Elf_Addr (symaddr_fn)(struct elf_file *ef, Elf_Word symidx); +typedef Elf_Addr (symaddr_fn)(struct elf_file *ef, Elf_Size symidx); int __elfN(loadfile)(char *filename, u_int64_t dest, struct preloaded_file **result); int __elfN(obj_loadfile)(char *filename, u_int64_t dest, ==== //depot/projects/smpng/sys/boot/common/load_elf.c#13 (text+ko) ==== @@ -26,7 +26,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/boot/common/load_elf.c,v 1.32 2004/08/28 23:03:05 iedowse Exp $"); +__FBSDID("$FreeBSD: src/sys/boot/common/load_elf.c,v 1.33 2005/12/18 04:52:35 marcel Exp $"); #include #include @@ -744,7 +744,7 @@ } static Elf_Addr -__elfN(symaddr)(struct elf_file *ef, Elf_Word symidx) +__elfN(symaddr)(struct elf_file *ef, Elf_Size symidx) { /* Symbol lookup by index not required here. */ ==== //depot/projects/smpng/sys/boot/common/load_elf_obj.c#2 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/boot/common/load_elf_obj.c,v 1.1 2004/08/29 00:48:41 iedowse Exp $"); +__FBSDID("$FreeBSD: src/sys/boot/common/load_elf_obj.c,v 1.2 2005/12/18 04:52:35 marcel Exp $"); #include #include @@ -70,7 +70,7 @@ Elf_Addr p, void *val, size_t len); static int __elfN(obj_parse_modmetadata)(struct preloaded_file *mp, elf_file_t ef); -static Elf_Addr __elfN(obj_symaddr)(struct elf_file *ef, Elf_Word symidx); +static Elf_Addr __elfN(obj_symaddr)(struct elf_file *ef, Elf_Size symidx); const char *__elfN(obj_kerneltype) = "elf kernel"; const char *__elfN(obj_moduletype) = "elf obj module"; @@ -495,7 +495,7 @@ /* Look up the address of a specified symbol. */ static Elf_Addr -__elfN(obj_symaddr)(struct elf_file *ef, Elf_Word symidx) +__elfN(obj_symaddr)(struct elf_file *ef, Elf_Size symidx) { Elf_Sym sym; Elf_Addr base; ==== //depot/projects/smpng/sys/boot/common/reloc_elf.c#2 (text+ko) ==== @@ -28,7 +28,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/boot/common/reloc_elf.c,v 1.1 2004/08/28 23:03:05 iedowse Exp $"); +__FBSDID("$FreeBSD: src/sys/boot/common/reloc_elf.c,v 1.2 2005/12/18 04:52:35 marcel Exp $"); #include #include @@ -54,7 +54,7 @@ int reltype, Elf_Addr relbase, Elf_Addr dataaddr, void *data, size_t len) { #ifdef __sparc__ - Elf_Word w; + Elf_Size w; const Elf_Rela *a; switch (reltype) { @@ -81,7 +81,7 @@ #elif defined(__i386__) && __ELF_WORD_SIZE == 64 Elf64_Addr *where, val; Elf_Addr addend, addr; - Elf_Word rtype, symidx; + Elf_Size rtype, symidx; const Elf_Rel *rel; const Elf_Rela *rela; @@ -138,7 +138,7 @@ return (0); #elif defined(__i386__) && __ELF_WORD_SIZE == 32 Elf_Addr addend, addr, *where, val; - Elf_Word rtype, symidx; + Elf_Size rtype, symidx; const Elf_Rel *rel; const Elf_Rela *rela; ==== //depot/projects/smpng/sys/boot/i386/libi386/Makefile#14 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/boot/i386/libi386/Makefile,v 1.38 2005/07/14 19:52:22 jkim Exp $ +# $FreeBSD: src/sys/boot/i386/libi386/Makefile,v 1.39 2005/12/19 09:00:11 sobomax Exp $ # LIB= i386 INTERNALLIB= @@ -24,6 +24,9 @@ # Include simple terminal emulation (cons25-compatible) CFLAGS+= -DTERM_EMU +# XXX: make alloca() useable +CFLAGS+= -Dalloca=__builtin_alloca + CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}/../btx/lib \ -I${.CURDIR}/../../../contrib/dev/acpica \ -I${.CURDIR}/../../.. -I. ==== //depot/projects/smpng/sys/boot/i386/libi386/biosdisk.c#12 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/boot/i386/libi386/biosdisk.c,v 1.45 2004/09/21 06:46:44 wes Exp $"); +__FBSDID("$FreeBSD: src/sys/boot/i386/libi386/biosdisk.c,v 1.46 2005/12/19 09:00:11 sobomax Exp $"); /* * BIOS disk device handling. @@ -861,17 +861,18 @@ p = dest; /* Decide whether we have to bounce */ - if ((od->od_unit < 0x80) && - ((VTOP(dest) >> 16) != (VTOP(dest + blks * BIOSDISK_SECSIZE) >> 16))) { + if (VTOP(dest) >> 20 != 0 || ((od->od_unit < 0x80) && + ((VTOP(dest) >> 16) != (VTOP(dest + blks * BIOSDISK_SECSIZE) >> 16)))) { /* - * There is a 64k physical boundary somewhere in the destination buffer, so we have + * There is a 64k physical boundary somewhere in the destination buffer, or the + * destination buffer is above first 1MB of physical memory so we have * to arrange a suitable bounce buffer. Allocate a buffer twice as large as we * need to. Use the bottom half unless there is a break there, in which case we * use the top half. */ x = min(FLOPPY_BOUNCEBUF, (unsigned)blks); - bbuf = malloc(x * 2 * BIOSDISK_SECSIZE); + bbuf = alloca(x * 2 * BIOSDISK_SECSIZE); if (((u_int32_t)VTOP(bbuf) & 0xffff0000) == ((u_int32_t)VTOP(bbuf + x * BIOSDISK_SECSIZE) & 0xffff0000)) { breg = bbuf; } else { @@ -960,8 +961,6 @@ DEBUG("ax = 0x%04x cx = 0x%04x dx = 0x%04x status 0x%x", 0x200 | x, ((cyl & 0xff) << 8) | ((cyl & 0x300) >> 2) | sec, (hd << 8) | od->od_unit, (v86.eax >> 8) & 0xff); if (result) { - if (bbuf != NULL) - free(bbuf); return(-1); } if (bbuf != NULL) @@ -972,8 +971,6 @@ } /* hexdump(dest, (blks * BIOSDISK_SECSIZE)); */ - if (bbuf != NULL) - free(bbuf); return(0); } @@ -993,18 +990,18 @@ p = dest; /* Decide whether we have to bounce */ - if ((od->od_unit < 0x80) && - ((VTOP(dest) >> 16) != (VTOP(dest + blks * BIOSDISK_SECSIZE) >> 16))) { + if (VTOP(dest) >> 20 != 0 || ((od->od_unit < 0x80) && + ((VTOP(dest) >> 16) != (VTOP(dest + blks * BIOSDISK_SECSIZE) >> 16)))) { /* - * There is a 64k physical boundary somewhere in the destination buffer, so we have + * There is a 64k physical boundary somewhere in the destination buffer, or the + * destination buffer is above first 1MB of physical memory so we have * to arrange a suitable bounce buffer. Allocate a buffer twice as large as we * need to. Use the bottom half unless there is a break there, in which case we * use the top half. */ - x = min(FLOPPY_BOUNCEBUF, (unsigned)blks); - bbuf = malloc(x * 2 * BIOSDISK_SECSIZE); + bbuf = alloca(x * 2 * BIOSDISK_SECSIZE); if (((u_int32_t)VTOP(bbuf) & 0xffff0000) == ((u_int32_t)VTOP(bbuf + x * BIOSDISK_SECSIZE) & 0xffff0000)) { breg = bbuf; } else { @@ -1104,15 +1101,11 @@ DEBUG("ax = 0x%04x cx = 0x%04x dx = 0x%04x status 0x%x", 0x200 | x, ((cyl & 0xff) << 8) | ((cyl & 0x300) >> 2) | sec, (hd << 8) | od->od_unit, (v86.eax >> 8) & 0xff); if (result) { - if (bbuf != NULL) - free(bbuf); return(-1); } } /* hexdump(dest, (blks * BIOSDISK_SECSIZE)); */ - if (bbuf != NULL) - free(bbuf); return(0); } static int ==== //depot/projects/smpng/sys/boot/i386/libi386/biosmem.c#4 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/boot/i386/libi386/biosmem.c,v 1.7 2003/08/25 23:28:31 obrien Exp $"); +__FBSDID("$FreeBSD: src/sys/boot/i386/libi386/biosmem.c,v 1.8 2005/12/21 02:17:58 sobomax Exp $"); /* * Obtain memory configuration information from the BIOS @@ -34,7 +34,7 @@ #include "libi386.h" #include "btxv86.h" -vm_offset_t memtop; +vm_offset_t memtop, memtop_copyin; u_int32_t bios_basemem, bios_extmem; #define SMAPSIG 0x534D4150 @@ -101,7 +101,7 @@ } /* Set memtop to actual top of memory */ - memtop = 0x100000 + bios_extmem; + memtop = memtop_copyin = 0x100000 + bios_extmem; } ==== //depot/projects/smpng/sys/boot/i386/libi386/biospnp.c#6 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/boot/i386/libi386/biospnp.c,v 1.9 2003/08/25 23:28:31 obrien Exp $"); +__FBSDID("$FreeBSD: src/sys/boot/i386/libi386/biospnp.c,v 1.10 2005/12/19 09:00:11 sobomax Exp $"); /* * PnP BIOS enumerator. @@ -165,7 +165,7 @@ if (biospnp_init()) return; - devNodeBuffer = (struct pnp_devNode *)malloc(pnp_NodeSize); + devNodeBuffer = (struct pnp_devNode *)alloca(pnp_NodeSize); Node = 0; count = 1000; while((Node != 0xff) && (count-- > 0)) { ==== //depot/projects/smpng/sys/boot/i386/libi386/biossmap.c#4 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/boot/i386/libi386/biossmap.c,v 1.3 2004/11/08 23:59:44 peter Exp $"); +__FBSDID("$FreeBSD: src/sys/boot/i386/libi386/biossmap.c,v 1.4 2005/12/19 09:00:11 sobomax Exp $"); /* * Obtain memory configuration information from the BIOS @@ -86,9 +86,10 @@ v86.eax = 0xe820; v86.ecx = sizeof(struct smap); v86.edx = SMAPSIG; - v86.es = VTOPSEG(&smapbase[smaplen]); - v86.edi = VTOPOFF(&smapbase[smaplen]); + v86.es = VTOPSEG(&smap); + v86.edi = VTOPOFF(&smap); v86int(); + bcopy(&smap, &smapbase[smaplen], sizeof(struct smap)); smaplen++; if ((v86.efl & 1) || (v86.eax != SMAPSIG)) break; ==== //depot/projects/smpng/sys/boot/i386/libi386/i386_copy.c#3 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/boot/i386/libi386/i386_copy.c,v 1.10 2003/08/25 23:28:31 obrien Exp $"); +__FBSDID("$FreeBSD: src/sys/boot/i386/libi386/i386_copy.c,v 1.12 2005/12/21 02:17:58 sobomax Exp $"); /* * MD primitives supporting placement of module data @@ -37,8 +37,6 @@ #include "libi386.h" #include "btxv86.h" -#define READIN_BUF (16 * 1024) - ssize_t i386_copyin(const void *src, vm_offset_t dest, const size_t len) { @@ -67,25 +65,11 @@ ssize_t i386_readin(const int fd, vm_offset_t dest, const size_t len) { - void *buf; - size_t resid, chunk, get; - ssize_t got; - if (dest + len >= memtop) - return(0); + if (dest + len >= memtop_copyin) { + errno = EFBIG; + return(-1); + } - chunk = min(READIN_BUF, len); - buf = malloc(chunk); - if (buf == NULL) - return(0); - - for (resid = len; resid > 0; resid -= got, dest += got) { - get = min(chunk, resid); - got = read(fd, buf, get); - if (got <= 0) - break; - bcopy(buf, PTOV(dest), (size_t)got); - } - free(buf); - return(len - resid); + return (read(fd, PTOV(dest), len)); } ==== //depot/projects/smpng/sys/boot/i386/libi386/libi386.h#10 (text+ko) ==== @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/boot/i386/libi386/libi386.h,v 1.22 2005/09/22 15:14:12 ru Exp $ + * $FreeBSD: src/sys/boot/i386/libi386/libi386.h,v 1.23 2005/12/21 02:17:58 sobomax Exp $ */ @@ -91,7 +91,10 @@ void bios_getmem(void); extern u_int32_t bios_basemem; /* base memory in bytes */ extern u_int32_t bios_extmem; /* extended memory in bytes */ -extern vm_offset_t memtop; +extern vm_offset_t memtop; /* last address of physical memory + 1 */ +extern vm_offset_t memtop_copyin; /* memtop less heap size for the cases */ + /* when heap is at the top of extended memory */ + /* for other cases - just the same as memtop */ int biospci_find_devclass(uint32_t class, int index); int biospci_write_config(uint32_t locator, int offset, int width, int val); ==== //depot/projects/smpng/sys/boot/i386/loader/main.c#12 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/boot/i386/loader/main.c,v 1.33 2005/09/22 15:14:13 ru Exp $"); +__FBSDID("$FreeBSD: src/sys/boot/i386/loader/main.c,v 1.36 2005/12/21 02:17:58 sobomax Exp $"); /* * MD bootstrap main() and assorted miscellaneous @@ -72,6 +72,9 @@ /* XXX debugging */ extern char end[]; +static void *heap_top; +static void *heap_bottom; + int main(void) { @@ -88,7 +91,15 @@ */ bios_getmem(); - setheap((void *)end, (void *)bios_basemem); +#ifdef LOADER_BZIP2_SUPPORT + heap_top = PTOV(memtop_copyin); + memtop_copyin -= 0x300000; + heap_bottom = PTOV(memtop_copyin); +#else + heap_top = (void *)bios_basemem; + heap_bottom = (void *)end; +#endif + setheap(heap_bottom, heap_top); /* * XXX Chicken-and-egg problem; we want to have console output early, but some @@ -269,7 +280,8 @@ command_heap(int argc, char *argv[]) { mallocstats(); - printf("heap base at %p, top at %p\n", end, sbrk(0)); + printf("heap base at %p, top at %p, upper limit at %p\n", heap_bottom, + sbrk(0), heap_top); return(CMD_OK); } ==== //depot/projects/smpng/sys/boot/pc98/libpc98/Makefile#13 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/boot/pc98/libpc98/Makefile,v 1.22 2005/05/08 14:17:28 nyan Exp $ +# $FreeBSD: src/sys/boot/pc98/libpc98/Makefile,v 1.23 2005/12/20 08:54:30 sobomax Exp $ # LIB= pc98 INTERNALLIB= @@ -24,6 +24,9 @@ # Include simple terminal emulation (cons25-compatible) CFLAGS+= -DTERM_EMU +# XXX: make alloca() useable +CFLAGS+= -Dalloca=__builtin_alloca + CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}/../btx/lib \ -I${.CURDIR}/../../i386/libi386 \ -I${.CURDIR}/../../.. -I. ==== //depot/projects/smpng/sys/boot/pc98/libpc98/biosdisk.c#11 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/boot/pc98/libpc98/biosdisk.c,v 1.32 2005/05/08 14:17:28 nyan Exp $"); +__FBSDID("$FreeBSD: src/sys/boot/pc98/libpc98/biosdisk.c,v 1.33 2005/12/21 06:09:09 nyan Exp $"); /* * BIOS disk device handling. @@ -754,16 +754,18 @@ p = dest; /* Decide whether we have to bounce */ - if (((VTOP(dest) >> 16) != (VTOP(dest + blks * BIOSDISK_SECSIZE) >> 16))) { + if (VTOP(dest) >> 20 != 0 || + ((VTOP(dest) >> 16) != (VTOP(dest + blks * BIOSDISK_SECSIZE) >> 16))) { /* - * There is a 64k physical boundary somewhere in the destination buffer, so we have + * There is a 64k physical boundary somewhere in the destination buffer, or the + * destination buffer is above first 1MB of physical memory so we have * to arrange a suitable bounce buffer. Allocate a buffer twice as large as we * need to. Use the bottom half unless there is a break there, in which case we * use the top half. */ x = min(od->od_sec, (unsigned)blks); - bbuf = malloc(x * 2 * BIOSDISK_SECSIZE); + bbuf = alloca(x * 2 * BIOSDISK_SECSIZE); if (((u_int32_t)VTOP(bbuf) & 0xffff0000) == ((u_int32_t)VTOP(bbuf + x * BIOSDISK_SECSIZE) & 0xffff0000)) { breg = bbuf; } else { @@ -837,8 +839,6 @@ od->od_flags & BD_FLOPPY ? 0x0200 | cyl : cyl, (hd << 8) | sec, (v86.eax >> 8) & 0xff); if (result) { - if (bbuf != NULL) - free(bbuf); return(-1); } if (bbuf != NULL) @@ -849,8 +849,6 @@ } /* hexdump(dest, (blks * BIOSDISK_SECSIZE)); */ - if (bbuf != NULL) - free(bbuf); return(0); } @@ -870,17 +868,18 @@ p = dest; /* Decide whether we have to bounce */ - if (((VTOP(dest) >> 16) != (VTOP(dest + blks * BIOSDISK_SECSIZE) >> 16))) { + if (VTOP(dest) >> 20 != 0 || + ((VTOP(dest) >> 16) != (VTOP(dest + blks * BIOSDISK_SECSIZE) >> 16))) { /* - * There is a 64k physical boundary somewhere in the destination buffer, so we have + * There is a 64k physical boundary somewhere in the destination buffer, or the + * destination buffer is above first 1MB of physical memory so we have * to arrange a suitable bounce buffer. Allocate a buffer twice as large as we * need to. Use the bottom half unless there is a break there, in which case we * use the top half. */ - x = min(od->od_sec, (unsigned)blks); - bbuf = malloc(x * 2 * BIOSDISK_SECSIZE); + bbuf = alloca(x * 2 * BIOSDISK_SECSIZE); if (((u_int32_t)VTOP(bbuf) & 0xffff0000) == ((u_int32_t)VTOP(bbuf + x * BIOSDISK_SECSIZE) & 0xffff0000)) { breg = bbuf; } else { @@ -959,15 +958,11 @@ (v86.eax >> 8) & 0xff); if (result) { - if (bbuf != NULL) - free(bbuf); return(-1); } >>> TRUNCATED FOR MAIL (1000 lines) <<< From owner-p4-projects@FreeBSD.ORG Thu Dec 22 02:34:44 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id CE33416A422; Thu, 22 Dec 2005 02:34:43 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8A73916A41F; Thu, 22 Dec 2005 02:34:43 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (vc4-2-0-87.dsl.netrack.net [199.45.160.85]) by mx1.FreeBSD.org (Postfix) with ESMTP id CC91E43D55; Thu, 22 Dec 2005 02:34:42 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from localhost (localhost.village.org [127.0.0.1] (may be forged)) by harmony.bsdimp.com (8.13.3/8.13.3) with ESMTP id jBM2Xgj8043560; Wed, 21 Dec 2005 19:33:42 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Wed, 21 Dec 2005 19:34:26 -0700 (MST) Message-Id: <20051221.193426.11989410.imp@bsdimp.com> To: cognet@freebsd.org From: "M. Warner Losh" In-Reply-To: <200512211525.jBLFPJcl015651@repoman.freebsd.org> References: <200512211525.jBLFPJcl015651@repoman.freebsd.org> X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0 (harmony.bsdimp.com [127.0.0.1]); Wed, 21 Dec 2005 19:33:42 -0700 (MST) Cc: perforce@freebsd.org Subject: Re: PERFORCE change 88522 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Dec 2005 02:34:44 -0000 In message: <200512211525.jBLFPJcl015651@repoman.freebsd.org> Olivier Houchard writes: : Add a new option to use the USART0 as the console instead of DBGU, : USART0_CONSOLE, and use it for Skyeye. : This is enough to get Skyeye to boot a FreeBSD kernel again. I'd planned on making this settable via a hint... Does skyeye have a network emulator? Does this mean that the usart driver is working well enough to get us to the exec of /bin/sh? Warner From owner-p4-projects@FreeBSD.ORG Thu Dec 22 17:19:54 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 363FF16A426; Thu, 22 Dec 2005 17:19:53 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 091C616A422 for ; Thu, 22 Dec 2005 17:19:53 +0000 (GMT) (envelope-from cognet@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id C9BD443D5D for ; Thu, 22 Dec 2005 17:19:51 +0000 (GMT) (envelope-from cognet@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id jBMHJpvG034163 for ; Thu, 22 Dec 2005 17:19:51 GMT (envelope-from cognet@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id jBMHJpEK034160 for perforce@freebsd.org; Thu, 22 Dec 2005 17:19:51 GMT (envelope-from cognet@freebsd.org) Date: Thu, 22 Dec 2005 17:19:51 GMT Message-Id: <200512221719.jBMHJpEK034160@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to cognet@freebsd.org using -f From: Olivier Houchard To: Perforce Change Reviews Cc: Subject: PERFORCE change 88573 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Dec 2005 17:19:54 -0000 http://perforce.freebsd.org/chv.cgi?CH=88573 Change 88573 by cognet@cognet on 2005/12/22 17:19:00 Don't forget to set the bustag at the rman level. Affected files ... .. //depot/projects/arm/src/sys/arm/at91/at91rm92.c#7 edit Differences ... ==== //depot/projects/arm/src/sys/arm/at91/at91rm92.c#7 (text+ko) ==== @@ -320,6 +320,9 @@ case SYS_RES_MEMORY: rle->res = rman_reserve_resource(&sc->sc_mem_rman, start, end, count, flags, child); + rman_set_bustag(rle->res, &at91rm92_bs_tag); + rman_set_bushandle(rle->res, start); + break; } if (rle->res) { rle->start = rman_get_start(rle->res); From owner-p4-projects@FreeBSD.ORG Thu Dec 22 17:26:00 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 50D0416A42C; Thu, 22 Dec 2005 17:26:00 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1056D16A42B for ; Thu, 22 Dec 2005 17:26:00 +0000 (GMT) (envelope-from cognet@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id C049743D5A for ; Thu, 22 Dec 2005 17:25:59 +0000 (GMT) (envelope-from cognet@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id jBMHPxKG034491 for ; Thu, 22 Dec 2005 17:25:59 GMT (envelope-from cognet@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id jBMHPxnI034488 for perforce@freebsd.org; Thu, 22 Dec 2005 17:25:59 GMT (envelope-from cognet@freebsd.org) Date: Thu, 22 Dec 2005 17:25:59 GMT Message-Id: <200512221725.jBMHPxnI034488@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to cognet@freebsd.org using -f From: Olivier Houchard To: Perforce Change Reviews Cc: Subject: PERFORCE change 88574 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Dec 2005 17:26:01 -0000 http://perforce.freebsd.org/chv.cgi?CH=88574 Change 88574 by cognet@cognet on 2005/12/22 17:25:21 - Implement at91_usart_bus_receive and at91_usart_bus_ipend. - Don't use uart_barrier(), it's not needed and will panic the box because the corresponding entry for "bs_barrier" is NULL in the bus tag (XXX: we should do the same than NetBSD do, and use stubs instead of NULL). - Some hacks to support Skyeye : don't attempt to access the CSR register for any USART other than USART0, because skyeye doesn't emulate those, and will return -1 - In transmit, manually raise an IRQ once done, as Skyeye won't do it for us. Affected files ... .. //depot/projects/arm/src/sys/arm/at91/uart_bus_at91usart.c#4 edit .. //depot/projects/arm/src/sys/arm/at91/uart_cpu_at91rm9200usart.c#5 edit .. //depot/projects/arm/src/sys/arm/at91/uart_dev_at91usart.c#8 edit Differences ... ==== //depot/projects/arm/src/sys/arm/at91/uart_bus_at91usart.c#4 (text+ko) ==== @@ -43,6 +43,8 @@ #include #include +#include + #include "uart_if.h" static int usart_at91rm92_probe(device_t dev); @@ -70,13 +72,26 @@ { struct uart_softc *sc; + sc = device_get_softc(dev); switch (device_get_unit(dev)) { case 0: device_set_desc(dev, "DBGU"); +#ifndef USART0_CONSOLE + /* + * Setting sc_sysdev makes this device a 'system device' and + * indirectly makes it the system console. + */ + sc->sc_sysdev = SLIST_FIRST(&uart_sysdevs); + bcopy(&sc->sc_sysdev->bas, &sc->sc_bas, sizeof(sc->sc_bas)); +#endif break; case 1: device_set_desc(dev, "USART0"); +#ifdef USART0_CONSOLE + sc->sc_sysdev = SLIST_FIRST(&uart_sysdevs); + bcopy(&sc->sc_sysdev->bas, &sc->sc_bas, sizeof(sc->sc_bas)); +#endif break; case 2: device_set_desc(dev, "USART1"); @@ -88,20 +103,8 @@ device_set_desc(dev, "USART3"); break; } - sc = device_get_softc(dev); - /* - * Setting sc_sysdev makes this device a 'system device' and - * indirectly makes it the system console. - */ -#ifdef USART0_CONSOLE - if (device_get_unit(dev) == 0) -#else - if (device_get_unit(dev) == 0) -#endif - sc->sc_sysdev = SLIST_FIRST(&uart_sysdevs); sc->sc_class = &at91_usart_class; - bcopy(&sc->sc_sysdev->bas, &sc->sc_bas, sizeof(sc->sc_bas)); - return (uart_bus_probe(dev, 0, 0, 0, 0, 0)); + return (uart_bus_probe(dev, 0, 0, 0, device_get_unit(dev), 0)); } ==== //depot/projects/arm/src/sys/arm/at91/uart_cpu_at91rm9200usart.c#5 (text+ko) ==== @@ -64,9 +64,11 @@ */ #ifdef USART0_CONSOLE di->bas.bsh = AT91RM92_BASE + AT91RM92_USART0_BASE; + di->bas.chan = 1; di->baudrate = 38400; #else di->bas.bsh = AT91RM92_BASE + AT91RM92_SYS_BASE + DBGU; + di->bas.chan = 0; di->baudrate = 115200; #endif di->bas.regshft = 0; ==== //depot/projects/arm/src/sys/arm/at91/uart_dev_at91usart.c#8 (text+ko) ==== @@ -183,9 +183,6 @@ uart_setreg(bas, USART_CR, USART_CR_RSTRX | USART_CR_RSTTX); uart_setreg(bas, USART_CR, USART_CR_RXEN | USART_CR_TXEN); uart_setreg(bas, USART_IER, USART_CSR_TXRDY | USART_CSR_RXRDY); -#if 0 - uart_barrier(bas); -#endif } /* @@ -273,8 +270,6 @@ static int at91_usart_bus_attach(struct uart_softc *sc) { - bcopy(&sc->sc_sysdev->bas, &sc->sc_bas, sizeof(sc->sc_bas)); - sc->sc_txfifosz = 1; sc->sc_rxfifosz = 1; sc->sc_hwiflow = 0; @@ -287,9 +282,17 @@ /* XXX VERY sub-optimial */ mtx_lock_spin(&sc->sc_hwmtx); + sc->sc_txbusy = 1; for (i = 0; i < sc->sc_txdatasz; i++) at91_usart_putc(&sc->sc_bas, sc->sc_txbuf[i]); mtx_unlock_spin(&sc->sc_hwmtx); +#ifdef USART0_CONSOLE + /* + * XXX: Gross hack : Skyeye doesn't raise an interrupt once the + * transfer is done, so simulate it. + */ + uart_setreg(&sc->sc_bas, USART_IER, USART_CSR_TXRDY); +#endif return (0); } static int @@ -320,7 +323,6 @@ else cr |= USART_CR_RTSDIS; uart_setreg(bas, USART_CR, cr); - uart_barrier(bas); mtx_unlock_spin(&sc->sc_hwmtx); return (0); } @@ -328,6 +330,9 @@ at91_usart_bus_receive(struct uart_softc *sc) { + mtx_lock_spin(&sc->sc_hwmtx); + uart_rx_put(sc, at91_usart_getc(&sc->sc_bas)); + mtx_unlock_spin(&sc->sc_hwmtx); return (0); } static int @@ -340,7 +345,25 @@ static int at91_usart_bus_ipend(struct uart_softc *sc) { - return (0); + int csr = uart_getreg(&sc->sc_bas, USART_CSR); + int ipend = 0; + +#ifdef USART0_CONSOLE + /* + * XXX: We have to cheat for skyeye, as it will return 0xff for all + * the devices it doesn't emulate. + */ + if (sc->sc_bas.chan != 1) + return (0); +#endif + + mtx_lock_spin(&sc->sc_hwmtx); + if (csr & USART_CSR_TXRDY && sc->sc_txbusy) + ipend |= UART_IPEND_TXIDLE; + if (csr & USART_CSR_RXRDY) + ipend |= UART_IPEND_RXREADY; + mtx_unlock_spin(&sc->sc_hwmtx); + return (ipend); } static int at91_usart_bus_flush(struct uart_softc *sc, int what) From owner-p4-projects@FreeBSD.ORG Thu Dec 22 21:00:35 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 9F52016A423; Thu, 22 Dec 2005 21:00:34 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5D1E616A420 for ; Thu, 22 Dec 2005 21:00:34 +0000 (GMT) (envelope-from soc-andrew@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2822F43D5C for ; Thu, 22 Dec 2005 21:00:23 +0000 (GMT) (envelope-from soc-andrew@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id jBML0NfJ051259 for ; Thu, 22 Dec 2005 21:00:23 GMT (envelope-from soc-andrew@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id jBML0NRl051254 for perforce@freebsd.org; Thu, 22 Dec 2005 21:00:23 GMT (envelope-from soc-andrew@freebsd.org) Date: Thu, 22 Dec 2005 21:00:23 GMT Message-Id: <200512222100.jBML0NRl051254@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to soc-andrew@freebsd.org using -f From: soc-andrew To: Perforce Change Reviews Cc: Subject: PERFORCE change 88582 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Dec 2005 21:00:35 -0000 http://perforce.freebsd.org/chv.cgi?CH=88582 Change 88582 by soc-andrew@soc-andrew_serv on 2005/12/22 20:59:47 Reduce diff to BSD Installer cvs Affected files ... .. //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/install/500_install_os.lua#5 edit .. //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/lib/target_system.lua#8 edit .. //depot/projects/soc2005/bsdinstaller/src/contrib/lua/posix/posix.lua#2 edit Differences ... ==== //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/install/500_install_os.lua#5 (text+ko) ==== @@ -1,4 +1,4 @@ --- $Id: 500_install_os.lua,v 1.80 2005/09/15 05:14:53 cpressey Exp $ +-- $Id: 500_install_os.lua,v 1.81 2005/12/22 03:32:37 cpressey Exp $ -- -- Actually install the OS. ==== //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/lib/target_system.lua#8 (text+ko) ==== @@ -1,4 +1,4 @@ --- $Id: target_system.lua,v 1.58 2005/08/27 21:13:58 cpressey Exp $ +-- $Id: target_system.lua,v 1.59 2005/12/21 23:00:33 cpressey Exp $ -- -- Copyright (c)2005 Chris Pressey. All rights reserved. @@ -514,7 +514,11 @@ } cmds:add("${root}${ECHO} '${header}' >${root}${base}${filename}") - + + -- + -- Add the mountpoints for the selected subpartitions + -- (/, /usr, /var, and so on) to the fstab file. + -- for spd in pd:get_subparts() do cmds:set_replacements{ device = spd:get_device_name(), @@ -530,6 +534,11 @@ end end + -- + -- Add the mountpoints for the extra filesystems + -- (/cdrom, /procfs, and so on) to the fstab file. + -- Create the associated directories, as well. + -- local i, fs_desc for i, fs_desc in extra_fs do cmds:set_replacements{ ==== //depot/projects/soc2005/bsdinstaller/src/contrib/lua/posix/posix.lua#2 (text+ko) ==== @@ -8,3 +8,5 @@ end so"posix" + +return posix From owner-p4-projects@FreeBSD.ORG Fri Dec 23 10:47:02 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 8C77816A423; Fri, 23 Dec 2005 10:47:01 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5C98C16A41F for ; Fri, 23 Dec 2005 10:47:01 +0000 (GMT) (envelope-from soc-tyler@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 08A5243D66 for ; Fri, 23 Dec 2005 10:47:00 +0000 (GMT) (envelope-from soc-tyler@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id jBNAkxmI004713 for ; Fri, 23 Dec 2005 10:46:59 GMT (envelope-from soc-tyler@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id jBNAkx2l004710 for perforce@freebsd.org; Fri, 23 Dec 2005 10:46:59 GMT (envelope-from soc-tyler@freebsd.org) Date: Fri, 23 Dec 2005 10:46:59 GMT Message-Id: <200512231046.jBNAkx2l004710@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to soc-tyler@freebsd.org using -f From: soc-tyler To: Perforce Change Reviews Cc: Subject: PERFORCE change 88606 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Dec 2005 10:47:02 -0000 http://perforce.freebsd.org/chv.cgi?CH=88606 Change 88606 by soc-tyler@soc-tyler_launchd on 2005/12/23 10:46:02 Merge changes, sync with perforce repo. Still locks up in some kqueue calls. Affected files ... .. //depot/projects/soc2005/launchd/includes/launch.h#15 edit .. //depot/projects/soc2005/launchd/includes/launch_priv.h#5 edit .. //depot/projects/soc2005/launchd/includes/launchd.h#12 edit .. //depot/projects/soc2005/launchd/includes/launchd_core_logic.h#2 edit .. //depot/projects/soc2005/launchd/includes/launchd_unix_ipc.h#2 edit .. //depot/projects/soc2005/launchd/includes/pathnames.h#4 edit .. //depot/projects/soc2005/launchd/init.c#13 edit .. //depot/projects/soc2005/launchd/launchctl/launchctl.c#25 edit .. //depot/projects/soc2005/launchd/launchd.c#27 edit .. //depot/projects/soc2005/launchd/launchd_core_logic.c#2 edit .. //depot/projects/soc2005/launchd/launchd_unix_ipc.c#2 edit .. //depot/projects/soc2005/launchd/liblaunch.c#17 edit Differences ... ==== //depot/projects/soc2005/launchd/includes/launch.h#15 (text+ko) ==== @@ -40,12 +40,11 @@ #define LAUNCHD_PATH "/sbin/launchd" #endif - -/* Keep Mac OS/Darwin specific code in for reference purposes, but don't build it */ #if defined(__APPLE__) && defined(__MACH__) #define _BUILD_DARWIN_ #endif + #define LAUNCH_KEY_SUBMITJOB "SubmitJob" #define LAUNCH_KEY_REMOVEJOB "RemoveJob" #define LAUNCH_KEY_STARTJOB "StartJob" @@ -62,13 +61,13 @@ #define LAUNCH_JOBKEY_TIMEOUT "TimeOut" #define LAUNCH_JOBKEY_INITGROUPS "InitGroups" #define LAUNCH_JOBKEY_SOCKETS "Sockets" -#define LAUNCH_JOBKEY_EVENTSOURCES "EventSources" +#define LAUNCH_JOBKEY_MACHSERVICES "MachServices" #define LAUNCH_JOBKEY_INETDCOMPATIBILITY "inetdCompatibility" #define LAUNCH_JOBKEY_PROGRAMARGUMENTS "ProgramArguments" #define LAUNCH_JOBKEY_PROGRAM "Program" #define LAUNCH_JOBKEY_ONDEMAND "OnDemand" -#define LAUNCH_JOBKEY_LIMITLOADTOHOSTS "LimitLoadToHosts" -#define LAUNCH_JOBKEY_LIMITLOADFROMHOSTS "LimitLoadFromHosts" +#define LAUNCH_JOBKEY_LIMITLOADTOHOSTS "LimitLoadToHosts" +#define LAUNCH_JOBKEY_LIMITLOADFROMHOSTS "LimitLoadFromHosts" #define LAUNCH_JOBKEY_RUNATLOAD "RunAtLoad" #define LAUNCH_JOBKEY_ROOTDIRECTORY "RootDirectory" #define LAUNCH_JOBKEY_WORKINGDIRECTORY "WorkingDirectory" @@ -78,20 +77,10 @@ #define LAUNCH_JOBKEY_PID "PID" #define LAUNCH_JOBKEY_UMASK "Umask" #define LAUNCH_JOBKEY_NICE "Nice" - -// FreeBSD's sysctl() interface doesn't allow per-process attributes :/ -#ifdef _BUILD_DARWIN_ #define LAUNCH_JOBKEY_LOWPRIORITYIO "LowPriorityIO" -#endif - #define LAUNCH_JOBKEY_SESSIONCREATE "SessionCreate" #define LAUNCH_JOBKEY_SOFTRESOURCELIMITS "SoftResourceLimits" #define LAUNCH_JOBKEY_HARDRESOURCELIMITS "HardResourceLimits" -/* - * sipc = job_get_bool(j->ldj, LAUNCH_JOBKEY_SERVICEIPC); - * job_get_bool (j=0x0, key=0x4f ) - at launchd.c:687 - */ #define LAUNCH_JOBKEY_SERVICEIPC "ServiceIPC" #define LAUNCH_JOBKEY_STANDARDOUTPATH "StandardOutPath" #define LAUNCH_JOBKEY_STANDARDERRORPATH "StandardErrorPath" @@ -101,8 +90,8 @@ #define LAUNCH_JOBKEY_STARTINTERVAL "StartInterval" #define LAUNCH_JOBKEY_STARTCALENDARINTERVAL "StartCalendarInterval" #define LAUNCH_JOBKEY_BONJOURFDS "BonjourFDs" -#define LAUNCH_JOBKEY_LASTEXITSTATUS "LastExitStatus" -#define LAUNCH_JOBKEY_PID "PID" +#define LAUNCH_JOBKEY_LASTEXITSTATUS "LastExitStatus" +#define LAUNCH_JOBKEY_PID "PID" #define LAUNCH_JOBINETDCOMPATIBILITY_WAIT "Wait" @@ -127,6 +116,7 @@ #define LAUNCH_JOBSOCKETKEY_BONJOUR "Bonjour" #define LAUNCH_JOBSOCKETKEY_SECUREWITHKEY "SecureSocketWithKey" #define LAUNCH_JOBSOCKETKEY_PATHNAME "SockPathName" +#define LAUNCH_JOBSOCKETKEY_PATHMODE "SockPathMode" #define LAUNCH_JOBSOCKETKEY_NODENAME "SockNodeName" #define LAUNCH_JOBSOCKETKEY_SERVICENAME "SockServiceName" #define LAUNCH_JOBSOCKETKEY_FAMILY "SockFamily" @@ -144,8 +134,8 @@ LAUNCH_DATA_BOOL, LAUNCH_DATA_STRING, LAUNCH_DATA_OPAQUE, + LAUNCH_DATA_ERRNO, LAUNCH_DATA_PROPERTY, - LAUNCH_DATA_ERRNO, } launch_data_type_t; launch_data_t launch_data_alloc(launch_data_type_t); ==== //depot/projects/soc2005/launchd/includes/launch_priv.h#5 (text+ko) ==== ==== //depot/projects/soc2005/launchd/includes/launchd.h#12 (text+ko) ==== ==== //depot/projects/soc2005/launchd/includes/launchd_core_logic.h#2 (text+ko) ==== ==== //depot/projects/soc2005/launchd/includes/launchd_unix_ipc.h#2 (text+ko) ==== ==== //depot/projects/soc2005/launchd/includes/pathnames.h#4 (text+ko) ==== ==== //depot/projects/soc2005/launchd/init.c#13 (text+ko) ==== @@ -35,20 +35,6 @@ * SUCH DAMAGE. */ -#ifndef lint -static const char copyright[] = -"@(#) Copyright (c) 1991, 1993\n\ - The Regents of the University of California. All rights reserved.\n"; -#endif /* not lint */ - -#ifndef lint -#if 0 -static char sccsid[] = "@(#)init.c 8.1 (Berkeley) 7/15/93"; -#endif -static const char rcsid[] = - "$FreeBSD: src/sbin/init/init.c,v 1.60 2005/01/11 14:34:29 delphij Exp $"; -#endif /* not lint */ - #include #include #include ==== //depot/projects/soc2005/launchd/launchctl/launchctl.c#25 (text+ko) ==== @@ -151,6 +151,7 @@ { "stdout", stdio_cmd, "Redirect launchd's standard out to the given path" }, { "stderr", stdio_cmd, "Redirect launchd's standard error to the given path" }, { "shutdown", fyi_cmd, "Prepare for system shutdown" }, + { "singleuser", fyi_cmd, "Switch to single-user mode" }, { "reloadttys", fyi_cmd, "Reload /etc/ttys" }, { "getrusage", getrusage_cmd, "Get resource usage statistics from launchd" }, { "log", logupdate_cmd, "Adjust the logging level or mask of launchd" }, @@ -268,21 +269,29 @@ return 0; } +static void print_launchd_env(launch_data_t obj, const char *key, void *context) +{ + bool *is_csh = context; + + /* XXX escape the double quotes */ + if (*is_csh) + fprintf(stdout, "setenv %s \"%s\";\n", key, launch_data_get_string(obj)); + else + fprintf(stdout, "%s=\"%s\"; export %s;\n", key, launch_data_get_string(obj), key); +} + +static void print_key_value(launch_data_t obj, const char *key, void *context) +{ + const char *k = context; + + if (!strcmp(key, k)) + fprintf(stdout, "%s\n", launch_data_get_string(obj)); +} static int getenv_and_export_cmd(int argc, char *const argv[] __attribute__((unused))) { launch_data_t resp, msg; bool is_csh = false; - const char *k; - void print_launchd_env(launch_data_t obj, const char *key, void *context __attribute__((unused))) { - if (is_csh) - fprintf(stdout, "setenv %s %s;\n", key, launch_data_get_string(obj)); - else - fprintf(stdout, "%s=%s; export %s;\n", key, launch_data_get_string(obj), key); - } - void print_key_value(launch_data_t obj, const char *key, void *context __attribute__((unused))) { - if (!strcmp(key, k)) - fprintf(stdout, "%s\n", launch_data_get_string(obj)); - } + char *k; if (!strcmp(argv[0], "export")) { char *s = getenv("SHELL"); @@ -301,7 +310,10 @@ launch_data_free(msg); if (resp) { - launch_data_dict_iterate(resp, (!strcmp(argv[0], "export")) ? print_launchd_env : print_key_value, NULL); + if (!strcmp(argv[0], "export")) + launch_data_dict_iterate(resp, print_launchd_env, &is_csh); + else + launch_data_dict_iterate(resp, print_key_value, k); launch_data_free(resp); } else { fprintf(stderr, "launch_msg(\"" LAUNCH_KEY_GETUSERENVIRONMENT "\"): %s\n", strerror(errno)); @@ -460,7 +472,8 @@ } } -static bool delay_to_second_pass(launch_data_t o) { +static bool delay_to_second_pass(launch_data_t o) +{ bool res = false; launch_data_t socks = launch_data_dict_lookup(o, LAUNCH_JOBKEY_SOCKETS); @@ -495,50 +508,50 @@ #endif if (NULL == launch_data_dict_lookup(thejob, LAUNCH_JOBKEY_LABEL)) { - fprintf(stderr, "%s: missing the Label key: %s\n", getprogname(), what); - goto out_bad; - } + fprintf(stderr, "%s: missing the Label key: %s\n", getprogname(), what); + goto out_bad; + } - if (NULL != (tmpa = launch_data_dict_lookup(thejob, LAUNCH_JOBKEY_LIMITLOADFROMHOSTS))) { - c = launch_data_array_get_count(tmpa); + if (NULL != (tmpa = launch_data_dict_lookup(thejob, LAUNCH_JOBKEY_LIMITLOADFROMHOSTS))) { + c = launch_data_array_get_count(tmpa); - for (i = 0; i < c; i++) { - launch_data_t oai = launch_data_array_get_index(tmpa, i); - if (!strcasecmp(ourhostname, launch_data_get_string(oai))) - goto out_bad; - } - } + for (i = 0; i < c; i++) { + launch_data_t oai = launch_data_array_get_index(tmpa, i); + if (!strcasecmp(ourhostname, launch_data_get_string(oai))) + goto out_bad; + } + } - if (NULL != (tmpa = launch_data_dict_lookup(thejob, LAUNCH_JOBKEY_LIMITLOADTOHOSTS))) { - c = launch_data_array_get_count(tmpa); + if (NULL != (tmpa = launch_data_dict_lookup(thejob, LAUNCH_JOBKEY_LIMITLOADTOHOSTS))) { + c = launch_data_array_get_count(tmpa); - for (i = 0; i < c; i++) { - launch_data_t oai = launch_data_array_get_index(tmpa, i); - if (!strcasecmp(ourhostname, launch_data_get_string(oai))) - break; - } + for (i = 0; i < c; i++) { + launch_data_t oai = launch_data_array_get_index(tmpa, i); + if (!strcasecmp(ourhostname, launch_data_get_string(oai))) + break; + } - if (i == c) - goto out_bad; - } + if (i == c) + goto out_bad; + } - if ((tmpd = launch_data_dict_lookup(thejob, LAUNCH_JOBKEY_DISABLED))) - job_disabled = launch_data_get_bool(tmpd); + if ((tmpd = launch_data_dict_lookup(thejob, LAUNCH_JOBKEY_DISABLED))) + job_disabled = launch_data_get_bool(tmpd); - if (forceload) - job_disabled = false; + if (forceload) + job_disabled = false; - if (job_disabled && load) - goto out_bad; + if (job_disabled && load) + goto out_bad; - if (delay_to_second_pass(thejob)) - launch_data_array_append(pass2, thejob); - else - launch_data_array_append(pass1, thejob); + if (delay_to_second_pass(thejob)) + launch_data_array_append(pass2, thejob); + else + launch_data_array_append(pass1, thejob); - return; + return; out_bad: - launch_data_free(thejob); + launch_data_free(thejob); } static void readpath(const char *what, launch_data_t pass1, launch_data_t pass2, bool editondisk, bool load, bool forceload) @@ -578,9 +591,16 @@ static void distill_config_file(launch_data_t id_plist) { struct distill_context dc = { id_plist, NULL }; - launch_data_t tmp; + launch_data_t tmp, sipco = launch_data_dict_lookup(dc.base, LAUNCH_JOBKEY_SERVICEIPC); + bool sipc = sipco ? launch_data_get_bool(sipco) : false; - if ((tmp = launch_data_dict_lookup(id_plist, LAUNCH_JOBKEY_SOCKETS))) { + if ((tmp = launch_data_dict_lookup(dc.base, LAUNCH_JOBKEY_SOCKETS))) { + if (!sipc && !launch_data_dict_lookup(dc.base, LAUNCH_JOBKEY_INETDCOMPATIBILITY)) { + fprintf(stderr, "%s specified without %s == true or %s will not work as expected.\n", + LAUNCH_JOBKEY_SOCKETS, + LAUNCH_JOBKEY_SERVICEIPC, + LAUNCH_JOBKEY_INETDCOMPATIBILITY); + } dc.newsockdict = launch_data_alloc(LAUNCH_DATA_DICTIONARY); launch_data_dict_iterate(tmp, sock_dict_cb, &dc); launch_data_dict_insert(dc.base, dc.newsockdict, LAUNCH_JOBKEY_SOCKETS); @@ -647,6 +667,9 @@ if ((val = launch_data_dict_lookup(tmp, LAUNCH_JOBSOCKETKEY_PATHNAME))) { struct sockaddr_un sun; + mode_t sun_mode = 0; + mode_t oldmask; + bool setm = false; memset(&sun, 0, sizeof(sun)); @@ -657,15 +680,26 @@ if ((sfd = _fd(socket(AF_UNIX, st, 0))) == -1) return; + if ((val = launch_data_dict_lookup(tmp, LAUNCH_JOBSOCKETKEY_PATHMODE))) { + sun_mode = (mode_t)launch_data_get_integer(val); + setm = true; + } + if (passive) { if (unlink(sun.sun_path) == -1 && errno != ENOENT) { close(sfd); return; } + oldmask = umask(S_IRWXG|S_IRWXO); if (bind(sfd, (struct sockaddr *)&sun, sizeof(sun)) == -1) { close(sfd); + umask(oldmask); return; } + umask(oldmask); + if (setm) { + chmod(sun.sun_path, sun_mode); + } if ((st == SOCK_STREAM || st == SOCK_SEQPACKET) && listen(sfd, SOMAXCONN) == -1) { close(sfd); @@ -695,7 +729,7 @@ if ((val = launch_data_dict_lookup(tmp, LAUNCH_JOBSOCKETKEY_NODENAME))) node = launch_data_get_string(val); if ((val = launch_data_dict_lookup(tmp, LAUNCH_JOBSOCKETKEY_MULTICASTGROUP))) - mgroup = launch_data_get_string(val); + mgroup = launch_data_get_string(val); if ((val = launch_data_dict_lookup(tmp, LAUNCH_JOBSOCKETKEY_SERVICENAME))) { if (LAUNCH_DATA_INTEGER == launch_data_get_type(val)) { sprintf(servnbuf, "%lld", launch_data_get_integer(val)); @@ -740,23 +774,24 @@ return; } if (mgroup) { - if (setsockopt(sfd, SOL_SOCKET, SO_REUSEPORT, (void *)&sock_opt, sizeof(sock_opt)) == -1) { - fprintf(stderr, "setsockopt(SO_REUSEPORT): %s\n", strerror(errno)); - return; - } - } else { - if (setsockopt(sfd, SOL_SOCKET, SO_REUSEADDR, (void *)&sock_opt, sizeof(sock_opt)) == -1) { - fprintf(stderr, "setsockopt(SO_REUSEADDR): %s\n", strerror(errno)); - return; - } - } + if (setsockopt(sfd, SOL_SOCKET, SO_REUSEPORT, (void *)&sock_opt, sizeof(sock_opt)) == -1) { + fprintf(stderr, "setsockopt(SO_REUSEPORT): %s\n", strerror(errno)); + return; + } + } else { + if (setsockopt(sfd, SOL_SOCKET, SO_REUSEADDR, (void *)&sock_opt, sizeof(sock_opt)) == -1) { + fprintf(stderr, "setsockopt(SO_REUSEADDR): %s\n", strerror(errno)); + return; + } + } if (bind(sfd, res->ai_addr, res->ai_addrlen) == -1) { fprintf(stderr, "bind(): %s\n", strerror(errno)); return; } + if (mgroup) { - do_mgroup_join(sfd, res->ai_family, res->ai_socktype, res->ai_protocol, mgroup); - } + do_mgroup_join(sfd, res->ai_family, res->ai_socktype, res->ai_protocol, mgroup); + } if ((res->ai_socktype == SOCK_STREAM || res->ai_socktype == SOCK_SEQPACKET) && listen(sfd, SOMAXCONN) == -1) { fprintf(stderr, "listen(): %s\n", strerror(errno)); @@ -770,15 +805,15 @@ launch_data_dict_insert(thejob, rvs_fds, LAUNCH_JOBKEY_BONJOURFDS); } if (NULL == rnames) { - /* XXX: let's NOT do any rendezvous magic :P +#ifdef _BUILD_DARWIN_ rvs_fd = do_rendezvous_magic(res, serv); - */ +#endif if (rvs_fd) launch_data_array_append(rvs_fds, rvs_fd); } else if (LAUNCH_DATA_STRING == launch_data_get_type(rnames)) { - /* XXX: let's NOT do any rendezvous magic :P +#ifdef _BUILD_DARWIN_ rvs_fd = do_rendezvous_magic(res, launch_data_get_string(rnames)); - */ +#endif if (rvs_fd) launch_data_array_append(rvs_fds, rvs_fd); } else if (LAUNCH_DATA_ARRAY == launch_data_get_type(rnames)) { @@ -786,10 +821,9 @@ for (rn_i = 0; rn_i < rn_ac; rn_i++) { launch_data_t rn_tmp = launch_data_array_get_index(rnames, rn_i); - - /* XXX: let's NOT do any rendezvous magic :P +#ifdef _BUILD_DARWIN_ rvs_fd = do_rendezvous_magic(res, launch_data_get_string(rn_tmp)); - */ +#endif if (rvs_fd) launch_data_array_append(rvs_fds, rvs_fd); } @@ -812,45 +846,51 @@ } } -static void do_mgroup_join(int fd, int family, int socktype, int protocol, const char *mgroup) { - struct addrinfo hints, *res0, *res; - struct ip_mreq mreq; - struct ipv6_mreq m6req; int gerr; - - memset(&hints, 0, sizeof(hints)); - - hints.ai_flags |= AI_PASSIVE; - hints.ai_family = family; - hints.ai_socktype = socktype; - hints.ai_protocol = protocol; - if ((gerr = getaddrinfo(mgroup, NULL, &hints, &res0)) != 0) { - fprintf(stderr, "getaddrinfo(): %s\n", gai_strerror(gerr)); - return; - } +static void do_mgroup_join(int fd, int family, int socktype, int protocol, const char *mgroup) +{ + struct addrinfo hints, *res0, *res; + struct ip_mreq mreq; + struct ipv6_mreq m6req; + int gerr; + + memset(&hints, 0, sizeof(hints)); + + hints.ai_flags |= AI_PASSIVE; + hints.ai_family = family; + hints.ai_socktype = socktype; + hints.ai_protocol = protocol; + + if ((gerr = getaddrinfo(mgroup, NULL, &hints, &res0)) != 0) { + fprintf(stderr, "getaddrinfo(): %s\n", gai_strerror(gerr)); + return; + } + + for (res = res0; res; res = res->ai_next) { + if (AF_INET == family) { + memset(&mreq, 0, sizeof(mreq)); + mreq.imr_multiaddr = ((struct sockaddr_in *)res->ai_addr)->sin_addr; + if (setsockopt(fd, IPPROTO_IP, IP_ADD_MEMBERSHIP, &mreq, sizeof(mreq)) == -1) { + fprintf(stderr, "setsockopt(IP_ADD_MEMBERSHIP): %s\n", strerror(errno)); + continue; + } + break; + } else if (AF_INET6 == family) { + memset(&m6req, 0, sizeof(m6req)); + m6req.ipv6mr_multiaddr = ((struct sockaddr_in6 *)res->ai_addr)->sin6_addr; + if (setsockopt(fd, IPPROTO_IPV6, IPV6_JOIN_GROUP, &m6req, sizeof(m6req)) == -1) { + fprintf(stderr, "setsockopt(IPV6_JOIN_GROUP): %s\n", strerror(errno)); + continue; + } + break; + } else { + fprintf(stderr, "unknown family during multicast group bind!\n"); + break; + } + } - for (res = res0; res; res = res->ai_next) { - if (AF_INET == family) { memset(&mreq, 0, sizeof(mreq)); - mreq.imr_multiaddr = ((struct sockaddr_in *)res->ai_addr)->sin_addr; - if (setsockopt(fd, IPPROTO_IP, IP_ADD_MEMBERSHIP, &mreq, sizeof(mreq)) == -1) { fprintf(stderr, "setsockopt(IP_ADD_MEMBERSHIP): %s\n", strerror(errno)); - continue; - } break; - } else if (AF_INET6 == family) { - memset(&m6req, 0, sizeof(m6req)); - m6req.ipv6mr_multiaddr = ((struct sockaddr_in6 *)res->ai_addr)->sin6_addr; - if (setsockopt(fd, IPPROTO_IPV6, IPV6_JOIN_GROUP, &m6req, sizeof(m6req)) == -1) { - fprintf(stderr, "setsockopt(IPV6_JOIN_GROUP): %s\n", strerror(errno)); - continue; - } - break; - } else { - fprintf(stderr, "unknown family during multicast group bind!\n"); - break; - } } - - freeaddrinfo(res0); + freeaddrinfo(res0); } - #ifdef _BUILD_DARWIN_ static launch_data_t do_rendezvous_magic(const struct addrinfo *res, const char *serv) { @@ -964,6 +1004,7 @@ double d; CFNumberType cfnt = CFNumberGetType(cfr); switch (cfnt) { + case kCFNumberSInt8Type: case kCFNumberSInt16Type: case kCFNumberSInt32Type: case kCFNumberSInt64Type: @@ -1007,16 +1048,16 @@ fprintf(where, "usage: %s \n", getprogname()); for (i = 0; i < (sizeof cmds / sizeof cmds[0]); i++) { - l = strlen(cmds[i].name); - if (l > cmdwidth) - cmdwidth = l; - } + l = strlen(cmds[i].name); + if (l > cmdwidth) + cmdwidth = l; + } - for (i = 0; i < (sizeof cmds / sizeof cmds[0]); i++) { - if (cmds[i].func == exit_cmd && istty == false) - continue; - fprintf(where, "\t%-*s\t%s\n", cmdwidth, cmds[i].name, cmds[i].desc); - } + for (i = 0; i < (sizeof cmds / sizeof cmds[0]); i++) { + if (cmds[i].func == exit_cmd && istty == false) + continue; + fprintf(where, "\t%-*s\t%s\n", cmdwidth, cmds[i].name, cmds[i].desc); + } return 0; } @@ -1166,7 +1207,7 @@ lmsgcmd = LAUNCH_KEY_STARTJOB; if (0 == strcmp(argv[0], "remove")) - lmsgcmd = LAUNCH_KEY_REMOVEJOB; + lmsgcmd = LAUNCH_KEY_REMOVEJOB; if (argc != 2) { fprintf(stderr, "usage: %s %s \n", getprogname(), argv[0]); @@ -1199,22 +1240,22 @@ static void print_jobs(launch_data_t j __attribute__((unused)), const char *label, void *context __attribute__((unused))) { launch_data_t pido = launch_data_dict_lookup(j, LAUNCH_JOBKEY_PID); - launch_data_t stato = launch_data_dict_lookup(j, LAUNCH_JOBKEY_LASTEXITSTATUS); + launch_data_t stato = launch_data_dict_lookup(j, LAUNCH_JOBKEY_LASTEXITSTATUS); - if (pido) { - fprintf(stdout, "%lld\t-\t%s\n", launch_data_get_integer(pido), label); - } else if (stato) { - int wstatus = (int)launch_data_get_integer(stato); - if (WIFEXITED(wstatus)) { - fprintf(stdout, "-\t%d\t%s\n", WEXITSTATUS(wstatus), label); - } else if (WIFSIGNALED(wstatus)) { - fprintf(stdout, "-\t-%d\t%s\n", WTERMSIG(wstatus), label); - } else { - fprintf(stdout, "-\t???\t%s\n", label); - } - } else { - fprintf(stdout, "-\t-\t%s\n", label); - } + if (pido) { + fprintf(stdout, "%lld\t-\t%s\n", launch_data_get_integer(pido), label); + } else if (stato) { + int wstatus = (int)launch_data_get_integer(stato); + if (WIFEXITED(wstatus)) { + fprintf(stdout, "-\t%d\t%s\n", WEXITSTATUS(wstatus), label); + } else if (WIFSIGNALED(wstatus)) { + fprintf(stdout, "-\t-%d\t%s\n", WTERMSIG(wstatus), label); + } else { + fprintf(stdout, "-\t???\t%s\n", label); + } + } else { + fprintf(stdout, "-\t-\t%s\n", label); + } } static int quickstart_cmd(int argc, char *const argv[]) { @@ -1359,8 +1400,11 @@ return 1; } - if (!strcmp(argv[0], "shutdown")) + if (!strcmp(argv[0], "shutdown")) { lmsgk = LAUNCH_KEY_SHUTDOWN; + } else if (!strcmp(argv[0], "singleuser")) { + lmsgk = LAUNCH_KEY_SINGLEUSER; + } msg = launch_data_new_string(lmsgk); resp = launch_msg(msg); @@ -1492,6 +1536,70 @@ return r; } +static const struct { + const char *name; + int lim; +} limlookup[] = { + { "cpu", RLIMIT_CPU }, + { "filesize", RLIMIT_FSIZE }, + { "data", RLIMIT_DATA }, + { "stack", RLIMIT_STACK }, + { "core", RLIMIT_CORE }, + { "rss", RLIMIT_RSS }, + { "memlock", RLIMIT_MEMLOCK }, + { "maxproc", RLIMIT_NPROC }, + { "maxfiles", RLIMIT_NOFILE } +}; + +static const size_t limlookupcnt = sizeof limlookup / sizeof limlookup[0]; + +static ssize_t name2num(const char *n) +{ + size_t i; + + for (i = 0; i < limlookupcnt; i++) { + if (!strcmp(limlookup[i].name, n)) { + return limlookup[i].lim; + } + } + return -1; +} + +static const char *num2name(int n) +{ + size_t i; + + for (i = 0; i < limlookupcnt; i++) { + if (limlookup[i].lim == n) + return limlookup[i].name; + } + return NULL; +} + +static const char *lim2str(rlim_t val, char *buf) +{ + if (val == RLIM_INFINITY) + strcpy(buf, "unlimited"); + else + sprintf(buf, "%lld", val); + return buf; +} + +static bool str2lim(const char *buf, rlim_t *res) +{ + char *endptr; + *res = strtoll(buf, &endptr, 10); + if (!strcmp(buf, "unlimited")) { + *res = RLIM_INFINITY; + return false; + } else if (*endptr == '\0') { + return false; + } + return true; +} + + + static int limit_cmd(int argc __attribute__((unused)), char *const argv[]) { char slimstr[100]; @@ -1502,57 +1610,6 @@ size_t i, lsz = -1, which = 0; rlim_t slim = -1, hlim = -1; bool badargs = false; - static const struct { - const char *name; - int lim; - } limlookup[] = { - { "cpu", RLIMIT_CPU }, - { "filesize", RLIMIT_FSIZE }, - { "data", RLIMIT_DATA }, - { "stack", RLIMIT_STACK }, - { "core", RLIMIT_CORE }, - { "rss", RLIMIT_RSS }, - { "memlock", RLIMIT_MEMLOCK }, - { "maxproc", RLIMIT_NPROC }, - { "maxfiles", RLIMIT_NOFILE } - }; - - size_t limlookupcnt = (sizeof(limlookup) / sizeof(limlookup[0])); - - bool name2num(const char *n) { - for (i = 0; i < limlookupcnt; i++) { - if (!strcmp(limlookup[i].name, n)) { - which = limlookup[i].lim; - return false; - } - } - return true; - }; - const char *num2name(int n) { - for (i = 0; i < limlookupcnt; i++) { - if (limlookup[i].lim == n) - return limlookup[i].name; - } - return NULL; - }; - const char *lim2str(rlim_t val, char *buf) { - if (val == RLIM_INFINITY) - strcpy(buf, "unlimited"); - else - sprintf(buf, "%lld", val); - return buf; - }; - bool str2lim(const char *buf, rlim_t *res) { - char *endptr; - *res = strtoll(buf, &endptr, 10); - if (!strcmp(buf, "unlimited")) { - *res = RLIM_INFINITY; - return false; - } else if (*endptr == '\0') { - return false; - } - return true; - }; if (argc > 4) badargs = true; @@ -1565,7 +1622,7 @@ if (argc == 4 && str2lim(argv[3], &hlim)) badargs = true; - if (argc >= 2 && name2num(argv[1])) + if (argc >= 2 && -1 == (which = name2num(argv[1]))) badargs = true; if (badargs) { @@ -1588,7 +1645,7 @@ lsz = launch_data_get_opaque_size(resp); if (argc <= 2) { for (i = 0; i < (lsz / sizeof(struct rlimit)); i++) { - if (argc == 2 && which != i) + if (argc == 2 && (size_t)which != i) continue; fprintf(stdout, "\t%-12s%-15s%-15s\n", num2name(i), lim2str(lmts[i].rlim_cur, slimstr), @@ -1639,48 +1696,48 @@ static int umask_cmd(int argc, char *const argv[]) { launch_data_t resp, msg; - bool badargs = false; - char *endptr; - long m = 0; - int r = 0; + bool badargs = false; + char *endptr; + long m = 0; + int r = 0; - if (argc == 2) { - m = strtol(argv[1], &endptr, 8); - if (*endptr != '\0' || m > 0777) - badargs = true; - } + if (argc == 2) { + m = strtol(argv[1], &endptr, 8); + if (*endptr != '\0' || m > 0777) + badargs = true; + } - if (argc > 2 || badargs) { - fprintf(stderr, "usage: %s %s \n", getprogname(), argv[0]); - return 1; - } + if (argc > 2 || badargs) { + fprintf(stderr, "usage: %s %s \n", getprogname(), argv[0]); + return 1; + } - if (argc == 1) { - msg = launch_data_new_string(LAUNCH_KEY_GETUMASK); - } else { - msg = launch_data_alloc(LAUNCH_DATA_DICTIONARY); - launch_data_dict_insert(msg, launch_data_new_integer(m), LAUNCH_KEY_SETUMASK); - } - resp = launch_msg(msg); - launch_data_free(msg); + if (argc == 1) { + msg = launch_data_new_string(LAUNCH_KEY_GETUMASK); + } else { + msg = launch_data_alloc(LAUNCH_DATA_DICTIONARY); + launch_data_dict_insert(msg, launch_data_new_integer(m), LAUNCH_KEY_SETUMASK); + } + resp = launch_msg(msg); + launch_data_free(msg); - if (resp == NULL) { - fprintf(stderr, "launch_msg(): %s\n", strerror(errno)); - return 1; - } else if (launch_data_get_type(resp) == LAUNCH_DATA_STRING) { - fprintf(stderr, "%s %s error: %s\n", getprogname(), argv[0], launch_data_get_string(resp)); - r = 1; - } else if (launch_data_get_type(resp) != LAUNCH_DATA_INTEGER) { - fprintf(stderr, "%s %s returned unknown response\n", getprogname(), argv[0]); - r = 1; - } else if (argc == 1) { - fprintf(stdout, "%o\n", (unsigned int)launch_data_get_integer(resp)); - } + if (resp == NULL) { + fprintf(stderr, "launch_msg(): %s\n", strerror(errno)); + return 1; + } else if (launch_data_get_type(resp) == LAUNCH_DATA_STRING) { + fprintf(stderr, "%s %s error: %s\n", getprogname(), argv[0], launch_data_get_string(resp)); + r = 1; + } else if (launch_data_get_type(resp) != LAUNCH_DATA_INTEGER) { + fprintf(stderr, "%s %s returned unknown response\n", getprogname(), argv[0]); + r = 1; + } else if (argc == 1) { + fprintf(stdout, "%o\n", (unsigned int)launch_data_get_integer(resp)); + } - launch_data_free(resp); + launch_data_free(resp); - return r; + return r; } static int submit_cmd(int argc, char *const argv[]) ==== //depot/projects/soc2005/launchd/launchd.c#27 (text+ko) ==== @@ -302,7 +302,7 @@ exit(EXIT_SUCCESS); } else if (re_exec_in_single_user_mode) { re_exec_in_single_user_mode = false; - launchd_assumes(execl("/sbin/launchd", "/sbin/launchd", "-s", NULL) != -1); + launchd_assumes(execl(LAUNCHD_PATH, LAUNCHD_PATH, "-s", NULL) != -1); } } ==== //depot/projects/soc2005/launchd/launchd_core_logic.c#2 (text+ko) ==== ==== //depot/projects/soc2005/launchd/launchd_unix_ipc.c#2 (text+ko) ==== ==== //depot/projects/soc2005/launchd/liblaunch.c#17 (text+ko) ==== @@ -106,6 +106,8 @@ int dfd, lfd = -1; _lc = calloc(1, sizeof(struct _launch_client)); + + fprintf(stderr, "Entering into launch_client_init()\n"); if (!_lc) return; @@ -146,6 +148,8 @@ return; out_bad: + fprintf(stderr, "Entered out_bad withing launch_client_init()\n"); + if (_lc->l) launchd_close(_lc->l); else if (lfd != -1) From owner-p4-projects@FreeBSD.ORG Sat Dec 24 18:52:14 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id D08FA16A422; Sat, 24 Dec 2005 18:52:13 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8AB0516A41F for ; Sat, 24 Dec 2005 18:52:13 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2D9F143D49 for ; Sat, 24 Dec 2005 18:52:13 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id jBOIqDMt041335 for ; Sat, 24 Dec 2005 18:52:13 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id jBOIqC3K041332 for perforce@freebsd.org; Sat, 24 Dec 2005 18:52:12 GMT (envelope-from imp@freebsd.org) Date: Sat, 24 Dec 2005 18:52:12 GMT Message-Id: <200512241852.jBOIqC3K041332@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to imp@freebsd.org using -f From: Warner Losh To: Perforce Change Reviews Cc: Subject: PERFORCE change 88685 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Dec 2005 18:52:14 -0000 http://perforce.freebsd.org/chv.cgi?CH=88685 Change 88685 by imp@imp_harmony on 2005/12/24 18:51:25 IFC @88682 Affected files ... .. //depot/projects/arm/src/sys/alpha/alpha/clock.c#5 integrate .. //depot/projects/arm/src/sys/alpha/alpha/interrupt.c#3 integrate .. //depot/projects/arm/src/sys/alpha/include/cpu.h#2 integrate .. //depot/projects/arm/src/sys/alpha/include/cpuconf.h#2 integrate .. //depot/projects/arm/src/sys/amd64/amd64/db_trace.c#4 integrate .. //depot/projects/arm/src/sys/amd64/amd64/local_apic.c#7 integrate .. //depot/projects/arm/src/sys/amd64/amd64/mp_machdep.c#5 integrate .. //depot/projects/arm/src/sys/amd64/include/apicvar.h#5 integrate .. //depot/projects/arm/src/sys/amd64/include/clock.h#2 integrate .. //depot/projects/arm/src/sys/amd64/include/cpu.h#2 integrate .. //depot/projects/arm/src/sys/amd64/include/frame.h#3 integrate .. //depot/projects/arm/src/sys/amd64/include/smp.h#5 integrate .. //depot/projects/arm/src/sys/amd64/isa/clock.c#6 integrate .. //depot/projects/arm/src/sys/arm/arm/intr.c#8 integrate .. //depot/projects/arm/src/sys/arm/arm/locore.S#17 integrate .. //depot/projects/arm/src/sys/arm/include/cpu.h#2 integrate .. //depot/projects/arm/src/sys/arm/include/frame.h#2 integrate .. //depot/projects/arm/src/sys/arm/sa11x0/sa11x0_ost.c#2 integrate .. //depot/projects/arm/src/sys/arm/xscale/i80321/i80321_timer.c#4 integrate .. //depot/projects/arm/src/sys/arm/xscale/i80321/iq31244_machdep.c#7 integrate .. //depot/projects/arm/src/sys/boot/i386/libi386/biosmem.c#2 integrate .. //depot/projects/arm/src/sys/boot/i386/libi386/i386_copy.c#3 integrate .. //depot/projects/arm/src/sys/boot/i386/libi386/libi386.h#3 integrate .. //depot/projects/arm/src/sys/boot/i386/loader/main.c#4 integrate .. //depot/projects/arm/src/sys/boot/pc98/libpc98/biosdisk.c#3 integrate .. //depot/projects/arm/src/sys/boot/pc98/libpc98/biosmem.c#3 integrate .. //depot/projects/arm/src/sys/boot/pc98/loader/main.c#3 integrate .. //depot/projects/arm/src/sys/compat/freebsd32/freebsd32_proto.h#5 integrate .. //depot/projects/arm/src/sys/compat/freebsd32/freebsd32_syscall.h#5 integrate .. //depot/projects/arm/src/sys/compat/freebsd32/freebsd32_syscalls.c#5 integrate .. //depot/projects/arm/src/sys/compat/freebsd32/freebsd32_sysent.c#5 integrate .. //depot/projects/arm/src/sys/compat/freebsd32/syscalls.master#5 integrate .. //depot/projects/arm/src/sys/conf/NOTES#9 integrate .. //depot/projects/arm/src/sys/conf/files#10 integrate .. //depot/projects/arm/src/sys/dev/acpica/acpi_video.c#4 integrate .. //depot/projects/arm/src/sys/dev/bge/if_bge.c#6 integrate .. //depot/projects/arm/src/sys/dev/bge/if_bgereg.h#6 integrate .. //depot/projects/arm/src/sys/dev/drm/drm_agpsupport.c#3 integrate .. //depot/projects/arm/src/sys/dev/drm/drm_drv.c#4 integrate .. //depot/projects/arm/src/sys/dev/drm/i915_drv.c#4 integrate .. //depot/projects/arm/src/sys/dev/drm/mach64_drv.c#3 integrate .. //depot/projects/arm/src/sys/dev/drm/mga_drv.c#4 integrate .. //depot/projects/arm/src/sys/dev/drm/r128_drv.c#4 integrate .. //depot/projects/arm/src/sys/dev/drm/radeon_drv.c#4 integrate .. //depot/projects/arm/src/sys/dev/drm/savage_drv.c#3 integrate .. //depot/projects/arm/src/sys/dev/drm/sis_drv.c#4 integrate .. //depot/projects/arm/src/sys/dev/drm/tdfx_drv.c#4 integrate .. //depot/projects/arm/src/sys/dev/em/if_em.c#9 integrate .. //depot/projects/arm/src/sys/dev/pci/vga_pci.c#1 branch .. //depot/projects/arm/src/sys/dev/ppbus/if_plip.c#3 integrate .. //depot/projects/arm/src/sys/dev/ppbus/immio.c#2 integrate .. //depot/projects/arm/src/sys/dev/ppbus/lpbb.c#2 integrate .. //depot/projects/arm/src/sys/dev/ppbus/lpt.c#3 integrate .. //depot/projects/arm/src/sys/dev/ppbus/ppi.c#2 integrate .. //depot/projects/arm/src/sys/dev/ppbus/pps.c#6 integrate .. //depot/projects/arm/src/sys/dev/ppc/ppc.c#4 integrate .. //depot/projects/arm/src/sys/dev/random/nehemiah.c#3 integrate .. //depot/projects/arm/src/sys/dev/random/randomdev.c#2 integrate .. //depot/projects/arm/src/sys/dev/random/randomdev.h#2 integrate .. //depot/projects/arm/src/sys/dev/random/randomdev_soft.c#3 integrate .. //depot/projects/arm/src/sys/dev/random/randomdev_soft.h#2 integrate .. //depot/projects/arm/src/sys/dev/random/yarrow.c#3 integrate .. //depot/projects/arm/src/sys/dev/smbus/smbus.c#4 integrate .. //depot/projects/arm/src/sys/dev/usb/umass.c#5 integrate .. //depot/projects/arm/src/sys/i386/conf/NOTES#8 integrate .. //depot/projects/arm/src/sys/i386/i386/db_trace.c#4 integrate .. //depot/projects/arm/src/sys/i386/i386/local_apic.c#6 integrate .. //depot/projects/arm/src/sys/i386/i386/mp_machdep.c#5 integrate .. //depot/projects/arm/src/sys/i386/include/apicvar.h#4 integrate .. //depot/projects/arm/src/sys/i386/include/clock.h#4 integrate .. //depot/projects/arm/src/sys/i386/include/cpu.h#2 integrate .. //depot/projects/arm/src/sys/i386/include/frame.h#3 integrate .. //depot/projects/arm/src/sys/i386/include/smp.h#5 integrate .. //depot/projects/arm/src/sys/i386/isa/clock.c#5 integrate .. //depot/projects/arm/src/sys/ia64/ia64/interrupt.c#3 integrate .. //depot/projects/arm/src/sys/ia64/include/cpu.h#2 integrate .. //depot/projects/arm/src/sys/kern/imgact_aout.c#3 integrate .. //depot/projects/arm/src/sys/kern/imgact_elf.c#4 integrate .. //depot/projects/arm/src/sys/kern/imgact_gzip.c#3 integrate .. //depot/projects/arm/src/sys/kern/init_sysent.c#5 integrate .. //depot/projects/arm/src/sys/kern/kern_clock.c#4 integrate .. //depot/projects/arm/src/sys/kern/kern_exit.c#5 integrate .. //depot/projects/arm/src/sys/kern/kern_lock.c#4 integrate .. //depot/projects/arm/src/sys/kern/kern_sig.c#6 integrate .. //depot/projects/arm/src/sys/kern/subr_sbuf.c#2 integrate .. //depot/projects/arm/src/sys/kern/subr_taskqueue.c#3 integrate .. //depot/projects/arm/src/sys/kern/sys_process.c#3 integrate .. //depot/projects/arm/src/sys/kern/syscalls.c#5 integrate .. //depot/projects/arm/src/sys/kern/syscalls.master#6 integrate .. //depot/projects/arm/src/sys/modules/Makefile#7 integrate .. //depot/projects/arm/src/sys/modules/i2c/controllers/Makefile#3 integrate .. //depot/projects/arm/src/sys/modules/i2c/controllers/amdsmb/Makefile#1 branch .. //depot/projects/arm/src/sys/modules/i2c/controllers/nfsmb/Makefile#1 branch .. //depot/projects/arm/src/sys/net/if_bridge.c#4 integrate .. //depot/projects/arm/src/sys/net/if_ethersubr.c#7 integrate .. //depot/projects/arm/src/sys/net/if_gif.c#3 integrate .. //depot/projects/arm/src/sys/net/if_gif.h#3 integrate .. //depot/projects/arm/src/sys/netatm/uni/unisig_encode.c#2 integrate .. //depot/projects/arm/src/sys/netgraph/ng_source.c#4 integrate .. //depot/projects/arm/src/sys/netgraph/ng_source.h#4 integrate .. //depot/projects/arm/src/sys/netinet/in_gif.c#3 integrate .. //depot/projects/arm/src/sys/netinet/in_proto.c#4 integrate .. //depot/projects/arm/src/sys/netinet6/in6_gif.c#3 integrate .. //depot/projects/arm/src/sys/pc98/cbus/clock.c#2 integrate .. //depot/projects/arm/src/sys/pc98/conf/NOTES#6 integrate .. //depot/projects/arm/src/sys/pci/agp_ali.c#3 integrate .. //depot/projects/arm/src/sys/pci/agp_amd.c#3 integrate .. //depot/projects/arm/src/sys/pci/agp_amd64.c#4 integrate .. //depot/projects/arm/src/sys/pci/agp_ati.c#2 integrate .. //depot/projects/arm/src/sys/pci/agp_i810.c#4 integrate .. //depot/projects/arm/src/sys/pci/agp_intel.c#4 integrate .. //depot/projects/arm/src/sys/pci/agp_nvidia.c#4 integrate .. //depot/projects/arm/src/sys/pci/agp_sis.c#3 integrate .. //depot/projects/arm/src/sys/pci/agp_via.c#4 integrate .. //depot/projects/arm/src/sys/pci/agpreg.h#4 integrate .. //depot/projects/arm/src/sys/pci/amdsmb.c#1 branch .. //depot/projects/arm/src/sys/pci/if_de.c#6 integrate .. //depot/projects/arm/src/sys/pci/if_devar.h#5 integrate .. //depot/projects/arm/src/sys/pci/nfsmb.c#1 branch .. //depot/projects/arm/src/sys/powerpc/conf/Makefile#1 branch .. //depot/projects/arm/src/sys/powerpc/conf/NOTES#1 branch .. //depot/projects/arm/src/sys/powerpc/include/clock.h#2 integrate .. //depot/projects/arm/src/sys/powerpc/include/cpu.h#2 integrate .. //depot/projects/arm/src/sys/powerpc/include/frame.h#3 integrate .. //depot/projects/arm/src/sys/powerpc/powerpc/clock.c#2 integrate .. //depot/projects/arm/src/sys/powerpc/powerpc/db_trace.c#3 integrate .. //depot/projects/arm/src/sys/powerpc/powerpc/interrupt.c#2 integrate .. //depot/projects/arm/src/sys/powerpc/powerpc/trap_subr.S#3 integrate .. //depot/projects/arm/src/sys/sparc64/conf/GENERIC#7 integrate .. //depot/projects/arm/src/sys/sparc64/include/cpu.h#2 integrate .. //depot/projects/arm/src/sys/sparc64/include/frame.h#2 integrate .. //depot/projects/arm/src/sys/sparc64/sparc64/tick.c#3 integrate .. //depot/projects/arm/src/sys/sys/param.h#7 integrate .. //depot/projects/arm/src/sys/sys/syscall.h#5 integrate .. //depot/projects/arm/src/sys/sys/syscall.mk#5 integrate .. //depot/projects/arm/src/sys/sys/sysproto.h#5 integrate .. //depot/projects/arm/src/sys/sys/systm.h#6 integrate .. //depot/projects/arm/src/sys/ufs/ffs/ffs_softdep.c#5 integrate Differences ... ==== //depot/projects/arm/src/sys/alpha/alpha/clock.c#5 (text+ko) ==== @@ -38,7 +38,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/alpha/alpha/clock.c,v 1.41 2005/12/14 21:42:12 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/alpha/alpha/clock.c,v 1.42 2005/12/22 22:16:04 jhb Exp $"); #include "opt_clock.h" @@ -157,7 +157,7 @@ static u_int32_t max_cycles_per_tick; static u_int32_t last_time; -static void handleclock(void* arg); +static void handleclock(int usermode, uintfptr_t pc); static void calibrate_clocks(u_int32_t firmware_freq, u_int32_t *pcc, u_int32_t *timer); static void set_timer_freq(u_int freq, int intr_freq); @@ -230,8 +230,7 @@ */ /* - * Start the real-time and statistics clocks. Leave stathz 0 since there - * are no other timers available. + * Start the real-time and statistics clocks. */ void cpu_initclocks() @@ -275,7 +274,9 @@ */ if (hwrpb->rpb_type != ST_DEC_21000) { tc_init(&i8254_timecounter); - } + platform.clockintr = handleclock; + } else + platform.clockintr = hardclock; if (ncpus == 1) { alpha_timecounter.tc_frequency = freq; @@ -283,7 +284,7 @@ } stathz = hz / 8; - platform.clockintr = (void (*)(void *)) handleclock; + profhz = hz; /* * Get the clock started. @@ -424,27 +425,23 @@ } static void -handleclock(void *arg) +handleclock(int usermode, uintfptr_t pc) { - /* - * XXX: TurboLaser doesn't have an i8254 counter. - * XXX: A replacement is needed, and another method - * XXX: of determining this would be nice. - */ - if (hwrpb->rpb_type != ST_DEC_21000) { - if (timecounter->tc_get_timecount == i8254_get_timecount) { - mtx_lock_spin(&clock_lock); - if (i8254_ticked) - i8254_ticked = 0; - else { - i8254_offset += timer0_max_count; - i8254_lastcount = 0; - } - clkintr_pending = 0; - mtx_unlock_spin(&clock_lock); + + KASSERT(hwrpb->rpb_type != ST_DEC_21000, + ("custom clock handler called on TurboLaser")); + if (timecounter->tc_get_timecount == i8254_get_timecount) { + mtx_lock_spin(&clock_lock); + if (i8254_ticked) + i8254_ticked = 0; + else { + i8254_offset += timer0_max_count; + i8254_lastcount = 0; } + clkintr_pending = 0; + mtx_unlock_spin(&clock_lock); } - hardclock(arg); + hardclock(usermode, pc); } void ==== //depot/projects/arm/src/sys/alpha/alpha/interrupt.c#3 (text+ko) ==== @@ -33,7 +33,7 @@ #include /* RCS ID & Copyright macro defns */ /* __KERNEL_RCSID(0, "$NetBSD: interrupt.c,v 1.23 1998/02/24 07:38:01 thorpej Exp $");*/ -__FBSDID("$FreeBSD: src/sys/alpha/alpha/interrupt.c,v 1.88 2005/10/25 19:48:45 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/alpha/alpha/interrupt.c,v 1.89 2005/12/22 22:16:04 jhb Exp $"); #include #include @@ -489,23 +489,21 @@ */ if (PCPU_GET(cpuid) == 0) { #endif - (*platform.clockintr)(framep); - /* divide hz (1024) by 8 to get stathz (128) */ - if ((++schedclk2 & 0x7) == 0) { - if (profprocs != 0) - profclock((struct clockframe *)framep); - statclock((struct clockframe *)framep); - } + (*platform.clockintr)(TRAPF_USERMODE(framep), + TRAPF_PC(framep)); + + /* Bump stathz divider. */ + schedclk2++; #ifdef SMP - } else { - hardclock_process((struct clockframe *)framep); - if ((schedclk2 & 0x7) == 0) { - if (profprocs != 0) - profclock((struct clockframe *)framep); - statclock((struct clockframe *)framep); - } - } + } else + hardclock_cpu(TRAPF_USERMODE(framep)); #endif + if (profprocs != 0) + profclock(TRAPF_USERMODE(framep), TRAPF_PC(framep)); + + /* divide hz (1024) by 8 to get stathz (128) */ + if ((schedclk2 & 0x7) == 0) + statclock(TRAPF_USERMODE(framep)); critical_exit(); } } ==== //depot/projects/arm/src/sys/alpha/include/cpu.h#2 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/alpha/include/cpu.h,v 1.42 2005/01/05 20:05:50 imp Exp $ */ +/* $FreeBSD: src/sys/alpha/include/cpu.h,v 1.43 2005/12/22 22:16:04 jhb Exp $ */ /* From: NetBSD: cpu.h,v 1.18 1997/09/23 23:17:49 mjacob Exp */ /*- @@ -48,21 +48,10 @@ #include -/* - * Arguments to hardclock and gatherstats encapsulate the previous - * machine state in an opaque clockframe. One the Alpha, we use - * what we push on an interrupt (a trapframe). - */ -struct clockframe { - struct trapframe cf_tf; -}; #define TRAPF_USERMODE(framep) \ (((framep)->tf_regs[FRAME_PS] & ALPHA_PSL_USERMODE) != 0) #define TRAPF_PC(framep) ((framep)->tf_regs[FRAME_PC]) -#define CLKF_USERMODE(framep) TRAPF_USERMODE(&(framep)->cf_tf) -#define CLKF_PC(framep) TRAPF_PC(&(framep)->cf_tf) - /* * CTL_MACHDEP definitions. */ ==== //depot/projects/arm/src/sys/alpha/include/cpuconf.h#2 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/alpha/include/cpuconf.h,v 1.14 2005/01/31 23:07:42 ticso Exp $ */ +/* $FreeBSD: src/sys/alpha/include/cpuconf.h,v 1.15 2005/12/22 22:16:04 jhb Exp $ */ /* $NetBSD: cpuconf.h,v 1.7 1997/11/06 00:42:03 thorpej Exp $ */ #ifndef _ALPHA_CPUCONF_H #define _ALPHA_CPUCONF_H @@ -68,7 +68,7 @@ void (*cons_init)(void); void (*device_register)(struct device *, void *); void (*iointr)(void *, unsigned long); - void (*clockintr)(void *); + void (*clockintr)(int, uintfptr_t); void (*mcheck_handler)(unsigned long, struct trapframe *, unsigned long, unsigned long); void (*cpu_idle)(void); ==== //depot/projects/arm/src/sys/amd64/amd64/db_trace.c#4 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/amd64/db_trace.c,v 1.71 2005/12/08 18:33:29 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/db_trace.c,v 1.72 2005/12/23 21:33:55 jeff Exp $"); #include #include @@ -180,7 +180,7 @@ * Stack trace. */ #define INKERNEL(va) (((va) >= DMAP_MIN_ADDRESS && (va) < DMAP_MAX_ADDRESS) \ - || (va) >= KERNBASE) + || ((va) >= KERNBASE && (va) < VM_MAX_KERNEL_ADDRESS)) struct amd64_frame { struct amd64_frame *f_frame; @@ -515,6 +515,10 @@ break; if (stack_put(st, callpc) == -1) break; + if (frame->f_frame <= frame || + (vm_offset_t)frame->f_frame >= + (vm_offset_t)rbp + KSTACK_PAGES * PAGE_SIZE) + break; frame = frame->f_frame; } } ==== //depot/projects/arm/src/sys/amd64/amd64/local_apic.c#7 (text+ko) ==== @@ -32,7 +32,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/amd64/local_apic.c,v 1.22 2005/12/13 18:29:09 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/local_apic.c,v 1.23 2005/12/22 22:16:05 jhb Exp $"); #include "opt_hwpmc_hooks.h" @@ -51,6 +51,7 @@ #include #include +#include #include #include #include @@ -617,7 +618,7 @@ } void -lapic_handle_timer(struct clockframe frame) +lapic_handle_timer(struct trapframe frame) { struct lapic *la; @@ -634,16 +635,16 @@ if (la->la_hard_ticks >= lapic_timer_hz) { la->la_hard_ticks -= lapic_timer_hz; if (PCPU_GET(cpuid) == 0) - hardclock(&frame); + hardclock(TRAPF_USERMODE(&frame), TRAPF_PC(&frame)); else - hardclock_process(&frame); + hardclock_cpu(TRAPF_USERMODE(&frame)); } /* Fire statclock at stathz. */ la->la_stat_ticks += stathz; if (la->la_stat_ticks >= lapic_timer_hz) { la->la_stat_ticks -= lapic_timer_hz; - statclock(&frame); + statclock(TRAPF_USERMODE(&frame)); } /* Fire profclock at profhz, but only when needed. */ @@ -651,7 +652,7 @@ if (la->la_prof_ticks >= lapic_timer_hz) { la->la_prof_ticks -= lapic_timer_hz; if (profprocs != 0) - profclock(&frame); + profclock(TRAPF_USERMODE(&frame), TRAPF_PC(&frame)); } critical_exit(); } ==== //depot/projects/arm/src/sys/amd64/amd64/mp_machdep.c#5 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/amd64/mp_machdep.c,v 1.266 2005/12/08 18:33:29 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/mp_machdep.c,v 1.267 2005/12/22 22:16:05 jhb Exp $"); #include "opt_cpu.h" #include "opt_kstack_pages.h" @@ -917,7 +917,7 @@ } void -ipi_bitmap_handler(struct clockframe frame) +ipi_bitmap_handler(struct trapframe frame) { int cpu = PCPU_GET(cpuid); u_int ipi_bitmap; ==== //depot/projects/arm/src/sys/amd64/include/apicvar.h#5 (text+ko) ==== @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/amd64/include/apicvar.h,v 1.15 2005/12/08 18:33:30 jhb Exp $ + * $FreeBSD: src/sys/amd64/include/apicvar.h,v 1.16 2005/12/22 22:16:05 jhb Exp $ */ #ifndef _MACHINE_APICVAR_H_ @@ -202,7 +202,7 @@ void lapic_ipi_vectored(u_int vector, int dest); int lapic_ipi_wait(int delay); void lapic_handle_intr(int vector, struct trapframe frame); -void lapic_handle_timer(struct clockframe frame); +void lapic_handle_timer(struct trapframe frame); void lapic_set_logical_id(u_int apic_id, u_int cluster, u_int cluster_id); int lapic_set_lvt_mask(u_int apic_id, u_int lvt, u_char masked); int lapic_set_lvt_mode(u_int apic_id, u_int lvt, u_int32_t mode); ==== //depot/projects/arm/src/sys/amd64/include/clock.h#2 (text+ko) ==== @@ -3,7 +3,7 @@ * Garrett Wollman, September 1994. * This file is in the public domain. * - * $FreeBSD: src/sys/amd64/include/clock.h,v 1.50 2005/01/05 20:17:20 imp Exp $ + * $FreeBSD: src/sys/amd64/include/clock.h,v 1.51 2005/12/22 22:16:05 jhb Exp $ */ #ifndef _MACHINE_CLOCK_H_ @@ -29,7 +29,6 @@ /* * Driver to clock driver interface. */ -struct clockframe; int acquire_timer2(int mode); int release_timer2(void); ==== //depot/projects/arm/src/sys/amd64/include/cpu.h#2 (text+ko) ==== @@ -30,7 +30,7 @@ * SUCH DAMAGE. * * from: @(#)cpu.h 5.4 (Berkeley) 5/9/91 - * $FreeBSD: src/sys/amd64/include/cpu.h,v 1.74 2004/08/03 18:44:26 mux Exp $ + * $FreeBSD: src/sys/amd64/include/cpu.h,v 1.75 2005/12/22 22:16:05 jhb Exp $ */ #ifndef _MACHINE_CPU_H_ @@ -59,10 +59,6 @@ (ISPL((framep)->tf_cs) == SEL_UPL) #define TRAPF_PC(framep) ((framep)->tf_rip) -#define CLKF_USERMODE(framep) \ - (ISPL((framep)->cf_cs) == SEL_UPL) -#define CLKF_PC(framep) ((framep)->cf_rip) - /* * CTL_MACHDEP definitions. */ ==== //depot/projects/arm/src/sys/amd64/include/frame.h#3 (text+ko) ==== @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)frame.h 5.2 (Berkeley) 1/18/91 - * $FreeBSD: src/sys/amd64/include/frame.h,v 1.29 2005/12/08 18:33:30 jhb Exp $ + * $FreeBSD: src/sys/amd64/include/frame.h,v 1.30 2005/12/22 22:16:05 jhb Exp $ */ #ifndef _MACHINE_FRAME_H_ @@ -76,34 +76,4 @@ register_t tf_ss; }; -/* frame of clock (same as interrupt frame) */ - -struct clockframe { - register_t cf_rdi; - register_t cf_rsi; - register_t cf_rdx; - register_t cf_rcx; - register_t cf_r8; - register_t cf_r9; - register_t cf_rax; - register_t cf_rbx; - register_t cf_rbp; - register_t cf_r10; - register_t cf_r11; - register_t cf_r12; - register_t cf_r13; - register_t cf_r14; - register_t cf_r15; - register_t :64; /* compat with trap frame - trapno */ - register_t :64; /* compat with trap frame - addr */ - register_t :64; /* compat with trap frame - flags */ - register_t :64; /* compat with trap frame - err */ - /* below portion defined in hardware */ - register_t cf_rip; - register_t cf_cs; - register_t cf_rflags; - register_t cf_rsp; - register_t cf_ss; -}; - #endif /* _MACHINE_FRAME_H_ */ ==== //depot/projects/arm/src/sys/amd64/include/smp.h#5 (text+ko) ==== @@ -6,7 +6,7 @@ * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp * ---------------------------------------------------------------------------- * - * $FreeBSD: src/sys/amd64/include/smp.h,v 1.86 2005/12/08 18:33:30 jhb Exp $ + * $FreeBSD: src/sys/amd64/include/smp.h,v 1.87 2005/12/22 22:16:05 jhb Exp $ * */ @@ -52,7 +52,7 @@ void ipi_all(u_int ipi); void ipi_all_but_self(u_int ipi); void ipi_self(u_int ipi); -void ipi_bitmap_handler(struct clockframe frame); +void ipi_bitmap_handler(struct trapframe frame); u_int mp_bootaddress(u_int); int mp_grab_cpu_hlt(void); void mp_topology(void); ==== //depot/projects/arm/src/sys/amd64/isa/clock.c#6 (text+ko) ==== @@ -33,7 +33,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/isa/clock.c,v 1.223 2005/12/12 22:27:07 peter Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/isa/clock.c,v 1.224 2005/12/22 22:16:05 jhb Exp $"); /* * Routines to handle clock hardware. @@ -67,6 +67,7 @@ #include #include +#include #include #include #include @@ -141,7 +142,7 @@ }; static void -clkintr(struct clockframe *frame) +clkintr(struct trapframe *frame) { if (timecounter->tc_get_timecount == i8254_get_timecount) { @@ -155,8 +156,8 @@ clkintr_pending = 0; mtx_unlock_spin(&clock_lock); } - if (!using_lapic_timer) - hardclock(frame); + KASSERT(!using_lapic_timer, ("clk interrupt enabled with lapic timer")); + hardclock(TRAPF_USERMODE(frame), TRAPF_PC(frame)); } int @@ -212,17 +213,17 @@ * in the statistics, but the stat clock will no longer stop. */ static void -rtcintr(struct clockframe *frame) +rtcintr(struct trapframe *frame) { while (rtcin(RTC_INTR) & RTCIR_PERIOD) { if (profprocs != 0) { if (--pscnt == 0) pscnt = psdiv; - profclock(frame); + profclock(TRAPF_USERMODE(frame), TRAPF_PC(frame)); } if (pscnt == psdiv) - statclock(frame); + statclock(TRAPF_USERMODE(frame)); } } ==== //depot/projects/arm/src/sys/arm/arm/intr.c#8 (text+ko) ==== @@ -37,7 +37,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/arm/arm/intr.c,v 1.11 2005/10/25 19:48:46 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/arm/arm/intr.c,v 1.12 2005/12/22 22:16:06 jhb Exp $"); #include #include #include @@ -55,7 +55,7 @@ static int intrcnt_index = 0; static int last_printed = 0; -void arm_handler_execute(void *, int); +void arm_handler_execute(struct trapframe *, int); void arm_setup_irqhandler(const char *name, void (*hand)(void*), void *arg, @@ -99,7 +99,7 @@ } void -arm_handler_execute(void *frame, int irqnb) +arm_handler_execute(struct trapframe *frame, int irqnb) { struct intr_event *event; struct intr_handler *ih; ==== //depot/projects/arm/src/sys/arm/arm/locore.S#17 (text+ko) ==== @@ -37,7 +37,7 @@ #include #include #include -__FBSDID("$FreeBSD: src/sys/arm/arm/locore.S,v 1.12 2005/12/20 01:29:17 cognet Exp $"); +__FBSDID("$FreeBSD: src/sys/arm/arm/locore.S,v 1.13 2005/12/21 15:02:31 cognet Exp $"); /* What size should this really be ? It is only used by init_arm() */ #define INIT_ARM_STACK_SIZE 2048 @@ -140,6 +140,9 @@ Lstart_off: .word start_inram-_C_LABEL(_start) start_inram: adr r7, Lunmapped + bic r7, r7, #0xff000000 + orr r7, r7, #PHYSADDR + /* Disable MMU for a while */ mrc p15, 0, r2, c1, c0, 0 @@ -160,8 +163,6 @@ /* build page table from scratch */ ldr r0, Lstartup_pagetable adr r4, mmu_init_table - bic r4, r4, #0xff000000 - orr r4, r4, #PHYSADDR b 3f 2: ==== //depot/projects/arm/src/sys/arm/include/cpu.h#2 (text+ko) ==== @@ -1,5 +1,5 @@ /* $NetBSD: cpu.h,v 1.2 2001/02/23 21:23:52 reinoud Exp $ */ -/* $FreeBSD: src/sys/arm/include/cpu.h,v 1.4 2005/02/01 06:36:27 njl Exp $ */ +/* $FreeBSD: src/sys/arm/include/cpu.h,v 1.5 2005/12/22 22:16:06 jhb Exp $ */ #ifndef MACHINE_CPU_H #define MACHINE_CPU_H @@ -29,10 +29,7 @@ #define CPU_MAXID 6 /* number of valid machdep ids */ -#define CLKF_USERMODE(frame) ((frame->if_spsr & PSR_MODE) == PSR_USR32_MODE) - #define TRAPF_USERMODE(frame) ((frame->tf_spsr & PSR_MODE) == PSR_USR32_MODE) -#define CLKF_PC(frame) (frame->if_pc) #define TRAPF_PC(tfp) ((tfp)->tf_pc) ==== //depot/projects/arm/src/sys/arm/include/frame.h#2 (text+ko) ==== @@ -42,7 +42,7 @@ * * Created : 30/09/94 * - * $FreeBSD: src/sys/arm/include/frame.h,v 1.3 2005/01/05 21:58:48 imp Exp $ + * $FreeBSD: src/sys/arm/include/frame.h,v 1.4 2005/12/22 22:16:06 jhb Exp $ * */ @@ -137,28 +137,6 @@ unsigned int if_pc; } irqframe_t; -typedef struct clockframe { - unsigned int if_spsr; - unsigned int if_r0; - unsigned int if_r1; - unsigned int if_r2; - unsigned int if_r3; - unsigned int if_r4; - unsigned int if_r5; - unsigned int if_r6; - unsigned int if_r7; - unsigned int if_r8; - unsigned int if_r9; - unsigned int if_r10; - unsigned int if_r11; - unsigned int if_r12; - unsigned int if_usr_sp; - unsigned int if_usr_lr; - unsigned int if_svc_sp; - unsigned int if_svc_lr; - unsigned int if_pc; -} clockframe_t; - /* * Switch frame */ ==== //depot/projects/arm/src/sys/arm/sa11x0/sa11x0_ost.c#2 (text+ko) ==== @@ -38,7 +38,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/arm/sa11x0/sa11x0_ost.c,v 1.3 2005/01/05 21:58:48 imp Exp $"); +__FBSDID("$FreeBSD: src/sys/arm/sa11x0/sa11x0_ost.c,v 1.4 2005/12/22 22:16:06 jhb Exp $"); #include #include @@ -54,7 +54,9 @@ #include #include +#include #include +#include #include @@ -144,7 +146,7 @@ clockintr(arg) void *arg; { - struct clockframe *frame = arg; + struct trapframe *frame = arg; u_int32_t oscr, nextmatch, oldmatch; int s; @@ -179,7 +181,7 @@ saost_sc->sc_clock_count = nextmatch; bus_space_write_4(saost_sc->sc_iot, saost_sc->sc_ioh, SAOST_MR0, nextmatch); - hardclock(frame); + hardclock(TRAPF_USERMODE(frame), TRAPF_PC(frame)); #if 0 mtx_unlock_spin(&clock_lock); #endif @@ -190,7 +192,7 @@ statintr(arg) void *arg; { - struct clockframe *frame = arg; + struct trapframe *frame = arg; u_int32_t oscr, nextmatch, oldmatch; int s; @@ -225,7 +227,7 @@ } saost_sc->sc_statclock_count = nextmatch; - statclock(frame); + statclock(TRAPF_USERMODE(frame)); } #endif ==== //depot/projects/arm/src/sys/arm/xscale/i80321/i80321_timer.c#4 (text+ko) ==== @@ -40,7 +40,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/arm/xscale/i80321/i80321_timer.c,v 1.8 2005/12/09 23:52:51 cognet Exp $"); +__FBSDID("$FreeBSD: src/sys/arm/xscale/i80321/i80321_timer.c,v 1.9 2005/12/22 22:16:06 jhb Exp $"); #include #include @@ -53,7 +53,9 @@ #include #include +#include #include +#include #include #include #include @@ -377,11 +379,11 @@ void clockhandler(void *arg) { - struct clockframe *frame = arg; + struct trapframe *frame = arg; ticked++; tisr_write(TISR_TMR0); - hardclock(frame); + hardclock(TRAPF_USERMODE(frame), TRAPF_PC(frame)); if (i80321_hardclock_hook != NULL) (*i80321_hardclock_hook)(); ==== //depot/projects/arm/src/sys/arm/xscale/i80321/iq31244_machdep.c#7 (text+ko) ==== @@ -49,7 +49,7 @@ #include "opt_ddb.h" #include -__FBSDID("$FreeBSD: src/sys/arm/xscale/i80321/iq31244_machdep.c,v 1.17 2005/12/09 23:54:50 cognet Exp $"); +__FBSDID("$FreeBSD: src/sys/arm/xscale/i80321/iq31244_machdep.c,v 1.18 2005/12/21 15:01:49 cognet Exp $"); #define _ARM32_BUS_DMA_PRIVATE #include @@ -94,7 +94,6 @@ #include #include -#undef DDB #include #include #include ==== //depot/projects/arm/src/sys/boot/i386/libi386/biosmem.c#2 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/boot/i386/libi386/biosmem.c,v 1.7 2003/08/25 23:28:31 obrien Exp $"); +__FBSDID("$FreeBSD: src/sys/boot/i386/libi386/biosmem.c,v 1.8 2005/12/21 02:17:58 sobomax Exp $"); /* * Obtain memory configuration information from the BIOS @@ -34,7 +34,7 @@ #include "libi386.h" #include "btxv86.h" -vm_offset_t memtop; +vm_offset_t memtop, memtop_copyin; u_int32_t bios_basemem, bios_extmem; #define SMAPSIG 0x534D4150 @@ -101,7 +101,7 @@ } /* Set memtop to actual top of memory */ - memtop = 0x100000 + bios_extmem; + memtop = memtop_copyin = 0x100000 + bios_extmem; } ==== //depot/projects/arm/src/sys/boot/i386/libi386/i386_copy.c#3 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/boot/i386/libi386/i386_copy.c,v 1.11 2005/12/19 09:00:11 sobomax Exp $"); +__FBSDID("$FreeBSD: src/sys/boot/i386/libi386/i386_copy.c,v 1.12 2005/12/21 02:17:58 sobomax Exp $"); /* * MD primitives supporting placement of module data @@ -66,7 +66,7 @@ i386_readin(const int fd, vm_offset_t dest, const size_t len) { - if (dest + len >= memtop) { + if (dest + len >= memtop_copyin) { errno = EFBIG; return(-1); } ==== //depot/projects/arm/src/sys/boot/i386/libi386/libi386.h#3 (text+ko) ==== @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/boot/i386/libi386/libi386.h,v 1.22 2005/09/22 15:14:12 ru Exp $ + * $FreeBSD: src/sys/boot/i386/libi386/libi386.h,v 1.23 2005/12/21 02:17:58 sobomax Exp $ */ @@ -91,7 +91,10 @@ void bios_getmem(void); extern u_int32_t bios_basemem; /* base memory in bytes */ extern u_int32_t bios_extmem; /* extended memory in bytes */ -extern vm_offset_t memtop; +extern vm_offset_t memtop; /* last address of physical memory + 1 */ +extern vm_offset_t memtop_copyin; /* memtop less heap size for the cases */ + /* when heap is at the top of extended memory */ + /* for other cases - just the same as memtop */ int biospci_find_devclass(uint32_t class, int index); int biospci_write_config(uint32_t locator, int offset, int width, int val); ==== //depot/projects/arm/src/sys/boot/i386/loader/main.c#4 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/boot/i386/loader/main.c,v 1.35 2005/12/19 18:39:01 sobomax Exp $"); +__FBSDID("$FreeBSD: src/sys/boot/i386/loader/main.c,v 1.36 2005/12/21 02:17:58 sobomax Exp $"); /* * MD bootstrap main() and assorted miscellaneous @@ -92,8 +92,9 @@ bios_getmem(); #ifdef LOADER_BZIP2_SUPPORT - heap_top = PTOV(0x400000); - heap_bottom = PTOV(0x100000); + heap_top = PTOV(memtop_copyin); + memtop_copyin -= 0x300000; + heap_bottom = PTOV(memtop_copyin); #else heap_top = (void *)bios_basemem; heap_bottom = (void *)end; ==== //depot/projects/arm/src/sys/boot/pc98/libpc98/biosdisk.c#3 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/boot/pc98/libpc98/biosdisk.c,v 1.32 2005/05/08 14:17:28 nyan Exp $"); +__FBSDID("$FreeBSD: src/sys/boot/pc98/libpc98/biosdisk.c,v 1.33 2005/12/21 06:09:09 nyan Exp $"); /* * BIOS disk device handling. @@ -754,16 +754,18 @@ p = dest; /* Decide whether we have to bounce */ - if (((VTOP(dest) >> 16) != (VTOP(dest + blks * BIOSDISK_SECSIZE) >> 16))) { + if (VTOP(dest) >> 20 != 0 || + ((VTOP(dest) >> 16) != (VTOP(dest + blks * BIOSDISK_SECSIZE) >> 16))) { /* - * There is a 64k physical boundary somewhere in the destination buffer, so we have + * There is a 64k physical boundary somewhere in the destination buffer, or the >>> TRUNCATED FOR MAIL (1000 lines) <<<