From owner-p4-projects@FreeBSD.ORG Sun May 8 04:43:36 2005 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 5333816A4E3; Sun, 8 May 2005 04:43:33 +0000 (GMT) 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 1042A16A4E1 for ; Sun, 8 May 2005 04:43:33 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id DABF343D78 for ; Sun, 8 May 2005 04:43:32 +0000 (GMT) (envelope-from scottl@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 j484hW5W025363 for ; Sun, 8 May 2005 04:43:32 GMT (envelope-from scottl@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j484hWaR025360 for perforce@freebsd.org; Sun, 8 May 2005 04:43:32 GMT (envelope-from scottl@freebsd.org) Date: Sun, 8 May 2005 04:43:32 GMT Message-Id: <200505080443.j484hWaR025360@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to scottl@freebsd.org using -f From: Scott Long To: Perforce Change Reviews Subject: PERFORCE change 76671 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 May 2005 04:43:36 -0000 http://perforce.freebsd.org/chv.cgi?CH=76671 Change 76671 by scottl@scottl-x64 on 2005/05/08 04:42:53 Use the correct path for the policy file. Affected files ... .. //depot/projects/trustedbsd/sebsd/sys/boot/forth/loader.conf.sebsd#4 edit Differences ... ==== //depot/projects/trustedbsd/sebsd/sys/boot/forth/loader.conf.sebsd#4 (text+ko) ==== @@ -9,4 +9,4 @@ sebsdpolicy_load="YES" # Default SEBSD policy location: -sebsdpolicy_name="/etc/security/sebsd/policy.bin" +sebsdpolicy_name="/etc/security/sebsd/policy/policy.bin" From owner-p4-projects@FreeBSD.ORG Sun May 8 04:43:39 2005 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 20C7516A4E3; Sun, 8 May 2005 04:43:37 +0000 (GMT) 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 6494A16A4E2 for ; Sun, 8 May 2005 04:43:33 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 44EE443D4C for ; Sun, 8 May 2005 04:43:33 +0000 (GMT) (envelope-from scottl@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 j484hX2T025372 for ; Sun, 8 May 2005 04:43:33 GMT (envelope-from scottl@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j484hW8o025369 for perforce@freebsd.org; Sun, 8 May 2005 04:43:32 GMT (envelope-from scottl@freebsd.org) Date: Sun, 8 May 2005 04:43:32 GMT Message-Id: <200505080443.j484hW8o025369@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to scottl@freebsd.org using -f From: Scott Long To: Perforce Change Reviews Subject: PERFORCE change 76672 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 May 2005 04:43:39 -0000 http://perforce.freebsd.org/chv.cgi?CH=76672 Change 76672 by scottl@scottl-x64 on 2005/05/08 04:43:20 Modify the install target to put create the policy.bin symlink correctly. Affected files ... .. //depot/projects/trustedbsd/sebsd/contrib/sebsd/policy/Makefile#21 edit Differences ... ==== //depot/projects/trustedbsd/sebsd/contrib/sebsd/policy/Makefile#21 (text+ko) ==== @@ -28,11 +28,12 @@ POLICYVERTMP != ($(CHECKPOLICY) $(POLICYCOMPAT) -V |cut -f 1 -d ' ') .endif POLICYVER := policy.$(POLICYVERTMP) +POLICYBIN = policy.bin INSTALLDIR = $(DESTDIR)/etc/security/sebsd POLICYPATH = $(INSTALLDIR)/policy SRCPATH = $(INSTALLDIR)/src CONTEXTPATH = $(INSTALLDIR)/contexts -LOADPATH = $(POLICYPATH)/$(POLICYVER) +LOADPATH = $(POLICYPATH)/$(POLICYBIN) FCPATH = $(CONTEXTPATH)/files/file_contexts ALL_PROGRAM_MACROS := macros/program/*.te @@ -101,15 +102,18 @@ install -m 644 appconfig/root_default_contexts $@ -$(LOADPATH): policy.conf $(CHECKPOLICY) +$(LOADPATH): $(POLICYPATH)/$(POLICYVER) + ln -s $(POLICYVER) $(LOADPATH) + +$(POLICYPATH)/$(POLICYVER): policy.conf $(CHECKPOLICY) mkdir -p $(POLICYPATH) $(CHECKPOLICY) $(POLICYVERCOMPATARGS) -o $@ policy.conf # Note: Can't use install, so not sure how to deal with mode, user, and group # other than by default. -policy: policy.bin +policy: $(POLICYBIN) -policy.bin: $(POLICYVER) +$(POLICYBIN): $(POLICYVER) ln -s $(POLICYVER) $@ $(POLICYVER): policy.conf $(CHECKPOLICY) @@ -168,7 +172,7 @@ @-rm $@.tmp $@.root clean: - rm -f policy.bin $(POLICYVER) + rm -f $(POLICYBIN) $(POLICYVER) rm -f policy.conf rm -f tmp/* rm -f $(FC) From owner-p4-projects@FreeBSD.ORG Sun May 8 04:49:42 2005 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 6942B16A4E2; Sun, 8 May 2005 04:49:41 +0000 (GMT) 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 18F5516A4E0 for ; Sun, 8 May 2005 04:49:41 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0531C43D5A for ; Sun, 8 May 2005 04:49:41 +0000 (GMT) (envelope-from marcel@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 j484nex5032377 for ; Sun, 8 May 2005 04:49:40 GMT (envelope-from marcel@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j484nem3032374 for perforce@freebsd.org; Sun, 8 May 2005 04:49:40 GMT (envelope-from marcel@freebsd.org) Date: Sun, 8 May 2005 04:49:40 GMT Message-Id: <200505080449.j484nem3032374@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to marcel@freebsd.org using -f From: Marcel Moolenaar To: Perforce Change Reviews Subject: PERFORCE change 76673 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 May 2005 04:49:42 -0000 http://perforce.freebsd.org/chv.cgi?CH=76673 Change 76673 by marcel@marcel_nfs on 2005/05/08 04:49:02 Initialization step 1: disable sync signals Affected files ... .. //depot/projects/tty/sys/dev/vga/vga.c#5 edit Differences ... ==== //depot/projects/tty/sys/dev/vga/vga.c#5 (text+ko) ==== @@ -37,6 +37,12 @@ #include #include +/* Convenience macros. */ +#define CRTC_READ(sc, reg) \ + bus_space_read_1(sc->vga_crtc.bst, sc->vga_crtc.bsh, reg) +#define CRTC_WRITE(sc, reg, val) \ + bus_space_write_1(sc->vga_crtc.bst, sc->vga_crtc.bsh, reg, val) + struct vga_softc vga_console; devclass_t vga_devclass; char vga_device_name[] = "vga"; @@ -52,6 +58,7 @@ vga_init(struct vga_softc *sc) { int error; + uint8_t x; sc->vga_screen = sc->vga_fb; error = bus_space_subregion(sc->vga_fb.bst, sc->vga_fb.bsh, @@ -59,6 +66,11 @@ if (error) return (error); + /* Disable the sync. signals. */ + CRTC_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_MODE_CONTROL); + x = CRTC_READ(sc, VGA_CRTC_DATA); + CRTC_WRITE(sc, VGA_CRTC_DATA, x & ~VGA_CRTC_MC_HR); + /* TODO -- set the VGA adapter in 640x480x16 mode */ sc->vga_enable = 1; From owner-p4-projects@FreeBSD.ORG Sun May 8 07:19:42 2005 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 1DE5116A4E3; Sun, 8 May 2005 07:19:42 +0000 (GMT) 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 E8E4B16A4E1 for ; Sun, 8 May 2005 07:19:41 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id C0E9E43D6D for ; Sun, 8 May 2005 07:19:41 +0000 (GMT) (envelope-from marcel@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 j487JfLp038672 for ; Sun, 8 May 2005 07:19:41 GMT (envelope-from marcel@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j487Jfq1038669 for perforce@freebsd.org; Sun, 8 May 2005 07:19:41 GMT (envelope-from marcel@freebsd.org) Date: Sun, 8 May 2005 07:19:41 GMT Message-Id: <200505080719.j487Jfq1038669@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to marcel@freebsd.org using -f From: Marcel Moolenaar To: Perforce Change Reviews Subject: PERFORCE change 76675 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 May 2005 07:19:43 -0000 http://perforce.freebsd.org/chv.cgi?CH=76675 Change 76675 by marcel@marcel_nfs on 2005/05/08 07:19:29 Initialization step 2a+4: Reprogram the general registers, CRTC and sequencer. Reenable the sync signals. To do: reprogram the graphics controller, attribute controller and clear the frame buffer. Tested on: i386 Affected files ... .. //depot/projects/tty/sys/dev/vga/vga.c#6 edit Differences ... ==== //depot/projects/tty/sys/dev/vga/vga.c#6 (text+ko) ==== @@ -42,6 +42,10 @@ bus_space_read_1(sc->vga_crtc.bst, sc->vga_crtc.bsh, reg) #define CRTC_WRITE(sc, reg, val) \ bus_space_write_1(sc->vga_crtc.bst, sc->vga_crtc.bsh, reg, val) +#define REG_READ(sc, reg) \ + bus_space_read_1(sc->vga_reg.bst, sc->vga_reg.bsh, reg) +#define REG_WRITE(sc, reg, val) \ + bus_space_write_1(sc->vga_reg.bst, sc->vga_reg.bsh, reg, val) struct vga_softc vga_console; devclass_t vga_devclass; @@ -71,7 +75,90 @@ x = CRTC_READ(sc, VGA_CRTC_DATA); CRTC_WRITE(sc, VGA_CRTC_DATA, x & ~VGA_CRTC_MC_HR); - /* TODO -- set the VGA adapter in 640x480x16 mode */ + /* Unprotect CRTC registers 0-7. */ + CRTC_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_VERT_RETRACE_END); + x = CRTC_READ(sc, VGA_CRTC_DATA); + CRTC_WRITE(sc, VGA_CRTC_DATA, x & ~VGA_CRTC_VRE_PR); + + /* + * Set the VGA adapter in mode 0x12 (640x480x16). + */ + /* Reprogram the CRTC. */ + CRTC_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_HORIZ_TOTAL); + CRTC_WRITE(sc, VGA_CRTC_DATA, 0x5f); /* 760 */ + CRTC_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_HORIZ_DISP_END); + CRTC_WRITE(sc, VGA_CRTC_DATA, 0x4f); /* 640 - 8 */ + CRTC_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_START_HORIZ_BLANK); + CRTC_WRITE(sc, VGA_CRTC_DATA, 0x50); /* 640 */ + CRTC_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_END_HORIZ_BLANK); + CRTC_WRITE(sc, VGA_CRTC_DATA, VGA_CRTC_EHB_CR + 2); + CRTC_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_START_HORIZ_RETRACE); + CRTC_WRITE(sc, VGA_CRTC_DATA, 0x54); /* 672 */ + CRTC_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_END_HORIZ_RETRACE); + CRTC_WRITE(sc, VGA_CRTC_DATA, VGA_CRTC_EHR_EHB + 0); + CRTC_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_VERT_TOTAL); + CRTC_WRITE(sc, VGA_CRTC_DATA, 0x0b); /* 523 */ + CRTC_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_OVERFLOW); + CRTC_WRITE(sc, VGA_CRTC_DATA, VGA_CRTC_OF_VT9 | VGA_CRTC_OF_LC8 | + VGA_CRTC_OF_VBS8 | VGA_CRTC_OF_VRS8 | VGA_CRTC_OF_VDE8); + CRTC_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_PRESET_ROW_SCAN); + CRTC_WRITE(sc, VGA_CRTC_DATA, 0); + CRTC_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_MAX_SCAN_LINE); + CRTC_WRITE(sc, VGA_CRTC_DATA, VGA_CRTC_MSL_LC9); + CRTC_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_CURSOR_START); + CRTC_WRITE(sc, VGA_CRTC_DATA, 0); + CRTC_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_CURSOR_END); + CRTC_WRITE(sc, VGA_CRTC_DATA, 0); + CRTC_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_START_ADDR_HIGH); + CRTC_WRITE(sc, VGA_CRTC_DATA, 0); + CRTC_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_START_ADDR_LOW); + CRTC_WRITE(sc, VGA_CRTC_DATA, 0); + CRTC_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_CURSOR_LOC_HIGH); + CRTC_WRITE(sc, VGA_CRTC_DATA, 0); + CRTC_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_CURSOR_LOC_LOW); + CRTC_WRITE(sc, VGA_CRTC_DATA, 0x59); + CRTC_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_VERT_RETRACE_START); + CRTC_WRITE(sc, VGA_CRTC_DATA, 0xea); /* 480 + 10 */ + CRTC_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_VERT_RETRACE_END); + CRTC_WRITE(sc, VGA_CRTC_DATA, 0x8c); + CRTC_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_VERT_DISPLAY_END); + CRTC_WRITE(sc, VGA_CRTC_DATA, 0xdf); /* 480 - 1*/ + CRTC_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_OFFSET); + CRTC_WRITE(sc, VGA_CRTC_DATA, 0x28); + CRTC_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_UNDERLINE_LOC); + CRTC_WRITE(sc, VGA_CRTC_DATA, 0); + CRTC_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_START_VERT_BLANK); + CRTC_WRITE(sc, VGA_CRTC_DATA, 0xe7); /* 480 + 7 */ + CRTC_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_END_VERT_BLANK); + CRTC_WRITE(sc, VGA_CRTC_DATA, 0x04); + CRTC_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_MODE_CONTROL); + CRTC_WRITE(sc, VGA_CRTC_DATA, VGA_CRTC_MC_WB | VGA_CRTC_MC_AW | + VGA_CRTC_MC_SRS | VGA_CRTC_MC_CMS); + CRTC_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_LINE_COMPARE); + CRTC_WRITE(sc, VGA_CRTC_DATA, 0xff); /* 480 + 31 */ + /* Reprogram the general registers. */ + REG_WRITE(sc, VGA_GEN_MISC_OUTPUT_W, VGA_GEN_MO_VSP | VGA_GEN_MO_HSP | + VGA_GEN_MO_PB | VGA_GEN_MO_ER | VGA_GEN_MO_IOA); + REG_WRITE(sc, VGA_EXT_FEATURE_CTRL, 0); + /* Reprogram the sequencer. */ + REG_WRITE(sc, VGA_SEQ_ADDRESS, VGA_SEQ_RESET); + REG_WRITE(sc, VGA_SEQ_DATA, VGA_SEQ_RST_SR | VGA_SEQ_RST_NAR); + REG_WRITE(sc, VGA_SEQ_ADDRESS, VGA_SEQ_CLOCKING_MODE); + REG_WRITE(sc, VGA_SEQ_DATA, VGA_SEQ_CM_89); + REG_WRITE(sc, VGA_SEQ_ADDRESS, VGA_SEQ_MAP_MASK); + REG_WRITE(sc, VGA_SEQ_DATA, VGA_SEQ_MM_EM3 | VGA_SEQ_MM_EM2 | + VGA_SEQ_MM_EM1 | VGA_SEQ_MM_EM0); + REG_WRITE(sc, VGA_SEQ_ADDRESS, VGA_SEQ_CHAR_MAP_SELECT); + REG_WRITE(sc, VGA_SEQ_DATA, 0x0); + REG_WRITE(sc, VGA_SEQ_ADDRESS, VGA_SEQ_MEMORY_MODE); + REG_WRITE(sc, VGA_SEQ_DATA, VGA_SEQ_MM_OE | VGA_SEQ_MM_EM); + /* Reprogram the attribute controller. */ + /* Reprogram the graphics controller. */ + + /* Enable the sync signals. */ + CRTC_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_MODE_CONTROL); + x = CRTC_READ(sc, VGA_CRTC_DATA); + CRTC_WRITE(sc, VGA_CRTC_DATA, x | VGA_CRTC_MC_HR); sc->vga_enable = 1; return (0); From owner-p4-projects@FreeBSD.ORG Sun May 8 07:44:14 2005 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id D509716A4E3; Sun, 8 May 2005 07:44:13 +0000 (GMT) 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 89E3516A4E1 for ; Sun, 8 May 2005 07:44:13 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5C65F43D86 for ; Sun, 8 May 2005 07:44:13 +0000 (GMT) (envelope-from marcel@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 j487iDHe040133 for ; Sun, 8 May 2005 07:44:13 GMT (envelope-from marcel@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j487iDR9040128 for perforce@freebsd.org; Sun, 8 May 2005 07:44:13 GMT (envelope-from marcel@freebsd.org) Date: Sun, 8 May 2005 07:44:13 GMT Message-Id: <200505080744.j487iDR9040128@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to marcel@freebsd.org using -f From: Marcel Moolenaar To: Perforce Change Reviews Subject: PERFORCE change 76677 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 May 2005 07:44:14 -0000 http://perforce.freebsd.org/chv.cgi?CH=76677 Change 76677 by marcel@marcel_nfs on 2005/05/08 07:43:16 Simplify the register I/O blocks. We have no need for compatibility with monochrome adapters, so can assume that the VGA adapter has the CRT controller registers at 0x3D0. We can always arrange for this to be the case. This means that we can treat the registers as being in a single I/O port range and thus that we have a single tag & handle for it. Affected files ... .. //depot/projects/tty/sys/dev/ic/vga.h#2 edit Differences ... ==== //depot/projects/tty/sys/dev/ic/vga.h#2 (text+ko) ==== @@ -30,92 +30,24 @@ #define _DEV_IC_VGA_H_ /* - * The VGA adapter uses two I/O port blocks. The first is either located - * at 0x3B0 or ar 0x3D0, depending on whether the adapter is in monochrome - * mode or not (resp). This block houses the CRT controller registers and - * CRTC register numbers are relative offsets to the base of this block. - * The second I/O port block is located at 0x3C0 and houses the other - * registers, of which the register numbers are offsets to the base of this - * I/O block. + * The VGA adapter uses two I/O port blocks. One of these blocks, the CRT + * controller registers can be located either at 0x3B0 or at 0x3D0 in I/O + * port space. This allows compatibility with the monochrome adapter, which + * as the CRT controller at 0x3B0. + * + * It is assumed that compatibility with the monochrome adapter is not of + * interest anymore. As such, the CRT controller is located at 0x3D0 in I/O + * port space. This means that the 2 I/O blocks are adjacent in I/O port + * space and can therefore be treated as a single logical I/O port block. + * This simplifies matters. */ #define VGA_MEM_BASE 0xA0000 #define VGA_MEM_SIZE 0x20000 -#define VGA_IO0_BASE 0x3c0 -#define VGA_IO0_SIZE 0x10 -#define VGA_IO1_COLOR 0x3d0 -#define VGA_IO1_MONO 0x3b0 -#define VGA_IO1_SIZE 0x0c +#define VGA_REG_BASE 0x3c0 +#define VGA_REG_SIZE 0x10+0x0c -/* CRT controller registers (base=CRTC {0x3B0, 0x3D0}). */ -#define VGA_CRTC_ADDRESS 0x04 -#define VGA_CRTC_HORIZ_TOTAL 0 -#define VGA_CRTC_HORIZ_DISP_END 1 -#define VGA_CRTC_START_HORIZ_BLANK 2 -#define VGA_CRTC_END_HORIZ_BLANK 3 -#define VGA_CRTC_EHB_CR 0x80 /* Compatible read */ -#define VGA_CRTC_EHB_DES 0x60 /* Display enable skew */ -#define VGA_CRTC_EHB_EHB 0x1F /* End horizontal blank */ -#define VGA_CRTC_START_HORIZ_RETRACE 4 -#define VGA_CRTC_END_HORIZ_RETRACE 5 -#define VGA_CRTC_EHR_EHB 0x80 /* End horizontal blanking */ -#define VGA_CRTC_EHR_HRD 0x60 /* Horizontal retrace delay */ -#define VGA_CRTC_EHR_EHR 0x1F /* End horizontal retrace */ -#define VGA_CRTC_VERT_TOTAL 6 -#define VGA_CRTC_OVERFLOW 7 -#define VGA_CRTC_OF_VRS9 0x80 /* Vertical retrace start */ -#define VGA_CRTC_OF_VDE9 0x40 /* Vertical disp. enable end */ -#define VGA_CRTC_OF_VT9 0x20 /* Vertical total (bit 9) */ -#define VGA_CRTC_OF_LC8 0x10 /* Line compare */ -#define VGA_CRTC_OF_VBS8 0x08 /* Start vertical blanking */ -#define VGA_CRTC_OF_VRS8 0x04 /* Vertical retrace start */ -#define VGA_CRTC_OF_VDE8 0x02 /* Vertical disp. enable end */ -#define VGA_CRTC_OF_VT8 0x01 /* Vertical total (bit 8) */ -#define VGA_CRTC_PRESET_ROW_SCAN 8 -#define VGA_CRTC_PRS_BP 0x60 /* Byte panning */ -#define VGA_CRTC_PRS_PRS 0x1F /* Preset row scan */ -#define VGA_CRTC_MAX_SCAN_LINE 9 -#define VGA_CRTC_MSL_2T4 0x80 /* 200-to-400 line conversion */ -#define VGA_CRTC_MSL_LC9 0x40 /* Line compare (bit 9) */ -#define VGA_CRTC_MSL_VBS9 0x20 /* Start vertical blanking */ -#define VGA_CRTC_MSL_MSL 0x1F /* Maximum scan line */ -#define VGA_CRTC_CURSOR_START 10 -#define VGA_CRTC_CS_COO 0x20 /* Cursor on/off */ -#define VGA_CRTC_CS_CS 0x1F /* Cursor start */ -#define VGA_CRTC_CURSOR_END 11 -#define VGA_CRTC_CE_CSK 0x60 /* Cursor skew */ -#define VGA_CRTC_CE_CE 0x1F /* Cursor end */ -#define VGA_CRTC_START_ADDR_HIGH 12 -#define VGA_CRTC_START_ADDR_LOW 13 -#define VGA_CRTC_CURSOR_LOC_HIGH 14 -#define VGA_CRTC_CURSOR_LOC_LOW 15 -#define VGA_CRTC_VERT_RETRACE_START 16 -#define VGA_CRTC_VERT_RETRACE_END 17 -#define VGA_CRTC_VRE_PR 0x80 /* Protect register 0-7 */ -#define VGA_CRTC_VRE_BW 0x40 /* Bandwidth */ -#define VGA_CRTC_VRE_VRE 0x1F /* Vertical retrace end */ -#define VGA_CRTC_VERT_DISPLAY_END 18 -#define VGA_CRTC_OFFSET 19 -#define VGA_CRTC_UNDERLINE_LOC 20 -#define VGA_CRTC_UL_DW 0x40 /* Double word mode */ -#define VGA_CRTC_UL_CB4 0x20 /* Count by four */ -#define VGA_CRTC_UL_UL 0x1F /* Underline location */ -#define VGA_CRTC_START_VERT_BLANK 21 -#define VGA_CRTC_END_VERT_BLANK 22 -#define VGA_CRTC_MODE_CONTROL 23 -#define VGA_CRTC_MC_HR 0x80 /* hardware reset */ -#define VGA_CRTC_MC_WB 0x40 /* Word/byte mode */ -#define VGA_CRTC_MC_AW 0x20 /* Address wrap */ -#define VGA_CRTC_MC_CBT 0x08 /* Count by two */ -#define VGA_CRTC_MC_HRS 0x04 /* Horizontal retrace select */ -#define VGA_CRTC_MC_SRS 0x02 /* Select row scan counter */ -#define VGA_CRTC_MC_CMS 0x01 /* Compatibility mode support */ -#define VGA_CRTC_LINE_COMPARE 24 -#define VGA_CRTC_DATA 0x05 -#define VGA_CRTC_FEATURE_CTRL 0x0a /* Write only. */ -#define VGA_CRTC_INPUT_STAT_1 0x0a /* Read only. */ - -/* Attribute controller registers (base=0x3C0). */ +/* Attribute controller registers. */ #define VGA_AC_WRITE 0x00 #define VGA_AC_READ 0x01 #define VGA_AC_PALETTE(x) x /* 0 <= x <= 15 */ @@ -140,8 +72,9 @@ #define VGA_AC_CS_C67 0x0C /* Color reg. addr. bits 6+7 */ #define VGA_AC_CS_C45 0x03 /* Color reg. addr. bits 4+5 */ -/* General registers (base=0x3c0). */ +/* General registers. */ #define VGA_GEN_MISC_OUTPUT_W 0x02 /* Write only. */ +#define VGA_GEN_MISC_OUTPUT_R 0x0c /* Read only. */ #define VGA_GEN_MO_VSP 0x80 /* Vertical sync. polarity */ #define VGA_GEN_MO_HSP 0x40 /* Horiz. sync. polarity */ #define VGA_GEN_MO_PB 0x20 /* Page bit for odd/even */ @@ -150,18 +83,14 @@ #define VGA_GEN_MO_IOA 0x01 /* Input/output address */ #define VGA_GEN_INPUT_STAT_0 0x02 /* Read only. */ #define VGA_GEN_IS0_SS 0x10 /* Switch sense */ -#define VGA_GEN_FEATURE_CTRL 0x0a /* Read only. */ +#define VGA_GEN_FEATURE_CTRL_W 0x1a /* Write only. */ +#define VGA_GEN_FEATURE_CTRL_R 0x0a /* Read only. */ #define VGA_GEN_FC_VSS 0x80 /* vertical sync. select */ -#define VGA_GEN_MISC_OUTPUT_R 0x0c /* Read only. */ +#define VGA_GEN_INPUT_STAT_1 0x1a /* Read only. */ +#define VGA_GEN_IS1_VR 0x08 /* Vertical retrace */ +#define VGA_GEN_IS1_DE 0x01 /* Display enable not */ -/* External registers (base=CRTC). */ -#define VGA_EXT_FEATURE_CTRL 0x0a /* Write only. */ -#define VGA_EXT_FC_VSS VGA_GEN_FC_VSS -#define VGA_EXT_INPUT_STAT_1 0x0a /* Read only. */ -#define VGA_EXT_IS1_VR 0x08 /* Vertical retrace */ -#define VGA_EXT_IS1_DE 0x01 /* Display enable not */ - -/* Sequencer registers (base=0x3c0). */ +/* Sequencer registers. */ #define VGA_SEQ_ADDRESS 0x04 #define VGA_SEQ_RESET 0 #define VGA_SEQ_RST_SR 0x02 /* Synchronous reset */ @@ -189,14 +118,14 @@ #define VGA_SEQ_MM_AG 0x01 /* Alpha/graphics mode */ #define VGA_SEQ_DATA 0x05 -/* Color registers (base=0x3c0). */ +/* Color registers. */ #define VGA_PEL_MASK 0x06 #define VGA_PEL_ADDR_RD_MODE 0x07 /* Write only. */ #define VGA_DAC_STATE 0x07 /* Read only. */ #define VGA_PEL_ADDR_WR_MODE 0x08 #define VGA_PEL_DATA 0x09 -/* Graphics controller registers (base=0x3C0). */ +/* Graphics controller registers. */ #define VGA_GC_ADDRESS 0x0e #define VGA_GC_SET_RESET 0 #define VGA_GC_ENABLE_SET_RESET 1 @@ -220,4 +149,70 @@ #define VGA_GC_BIT_MASK 8 #define VGA_GC_DATA 0x0f +/* CRT controller registers. */ +#define VGA_CRTC_ADDRESS 0x14 +#define VGA_CRTC_HORIZ_TOTAL 0 +#define VGA_CRTC_HORIZ_DISP_END 1 +#define VGA_CRTC_START_HORIZ_BLANK 2 +#define VGA_CRTC_END_HORIZ_BLANK 3 +#define VGA_CRTC_EHB_CR 0x80 /* Compatible read */ +#define VGA_CRTC_EHB_DES 0x60 /* Display enable skew */ +#define VGA_CRTC_EHB_EHB 0x1F /* End horizontal blank */ +#define VGA_CRTC_START_HORIZ_RETRACE 4 +#define VGA_CRTC_END_HORIZ_RETRACE 5 +#define VGA_CRTC_EHR_EHB 0x80 /* End horizontal blanking */ +#define VGA_CRTC_EHR_HRD 0x60 /* Horizontal retrace delay */ +#define VGA_CRTC_EHR_EHR 0x1F /* End horizontal retrace */ +#define VGA_CRTC_VERT_TOTAL 6 +#define VGA_CRTC_OVERFLOW 7 +#define VGA_CRTC_OF_VRS9 0x80 /* Vertical retrace start */ +#define VGA_CRTC_OF_VDE9 0x40 /* Vertical disp. enable end */ +#define VGA_CRTC_OF_VT9 0x20 /* Vertical total (bit 9) */ +#define VGA_CRTC_OF_LC8 0x10 /* Line compare */ +#define VGA_CRTC_OF_VBS8 0x08 /* Start vertical blanking */ +#define VGA_CRTC_OF_VRS8 0x04 /* Vertical retrace start */ +#define VGA_CRTC_OF_VDE8 0x02 /* Vertical disp. enable end */ +#define VGA_CRTC_OF_VT8 0x01 /* Vertical total (bit 8) */ +#define VGA_CRTC_PRESET_ROW_SCAN 8 +#define VGA_CRTC_PRS_BP 0x60 /* Byte panning */ +#define VGA_CRTC_PRS_PRS 0x1F /* Preset row scan */ +#define VGA_CRTC_MAX_SCAN_LINE 9 +#define VGA_CRTC_MSL_2T4 0x80 /* 200-to-400 line conversion */ +#define VGA_CRTC_MSL_LC9 0x40 /* Line compare (bit 9) */ +#define VGA_CRTC_MSL_VBS9 0x20 /* Start vertical blanking */ +#define VGA_CRTC_MSL_MSL 0x1F /* Maximum scan line */ +#define VGA_CRTC_CURSOR_START 10 +#define VGA_CRTC_CS_COO 0x20 /* Cursor on/off */ +#define VGA_CRTC_CS_CS 0x1F /* Cursor start */ +#define VGA_CRTC_CURSOR_END 11 +#define VGA_CRTC_CE_CSK 0x60 /* Cursor skew */ +#define VGA_CRTC_CE_CE 0x1F /* Cursor end */ +#define VGA_CRTC_START_ADDR_HIGH 12 +#define VGA_CRTC_START_ADDR_LOW 13 +#define VGA_CRTC_CURSOR_LOC_HIGH 14 +#define VGA_CRTC_CURSOR_LOC_LOW 15 +#define VGA_CRTC_VERT_RETRACE_START 16 +#define VGA_CRTC_VERT_RETRACE_END 17 +#define VGA_CRTC_VRE_PR 0x80 /* Protect register 0-7 */ +#define VGA_CRTC_VRE_BW 0x40 /* Bandwidth */ +#define VGA_CRTC_VRE_VRE 0x1F /* Vertical retrace end */ +#define VGA_CRTC_VERT_DISPLAY_END 18 +#define VGA_CRTC_OFFSET 19 +#define VGA_CRTC_UNDERLINE_LOC 20 +#define VGA_CRTC_UL_DW 0x40 /* Double word mode */ +#define VGA_CRTC_UL_CB4 0x20 /* Count by four */ +#define VGA_CRTC_UL_UL 0x1F /* Underline location */ +#define VGA_CRTC_START_VERT_BLANK 21 +#define VGA_CRTC_END_VERT_BLANK 22 +#define VGA_CRTC_MODE_CONTROL 23 +#define VGA_CRTC_MC_HR 0x80 /* hardware reset */ +#define VGA_CRTC_MC_WB 0x40 /* Word/byte mode */ +#define VGA_CRTC_MC_AW 0x20 /* Address wrap */ +#define VGA_CRTC_MC_CBT 0x08 /* Count by two */ +#define VGA_CRTC_MC_HRS 0x04 /* Horizontal retrace select */ +#define VGA_CRTC_MC_SRS 0x02 /* Select row scan counter */ +#define VGA_CRTC_MC_CMS 0x01 /* Compatibility mode support */ +#define VGA_CRTC_LINE_COMPARE 24 +#define VGA_CRTC_DATA 0x15 + #endif /* !_DEV_IC_VGA_H_ */ From owner-p4-projects@FreeBSD.ORG Sun May 8 08:12:49 2005 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 80B9416A4E3; Sun, 8 May 2005 08:12:49 +0000 (GMT) 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 5365F16A4E1 for ; Sun, 8 May 2005 08:12:49 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1EB4B43D9F for ; Sun, 8 May 2005 08:12:49 +0000 (GMT) (envelope-from marcel@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 j488Cme3041741 for ; Sun, 8 May 2005 08:12:48 GMT (envelope-from marcel@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j488CmNF041738 for perforce@freebsd.org; Sun, 8 May 2005 08:12:48 GMT (envelope-from marcel@freebsd.org) Date: Sun, 8 May 2005 08:12:48 GMT Message-Id: <200505080812.j488CmNF041738@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to marcel@freebsd.org using -f From: Marcel Moolenaar To: Perforce Change Reviews Subject: PERFORCE change 76678 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 May 2005 08:12:50 -0000 http://perforce.freebsd.org/chv.cgi?CH=76678 Change 76678 by marcel@marcel_nfs on 2005/05/08 08:12:38 Simplify resource allocation by eliminating the need for a separate CRTC register resource. Remove the screen sub-region as well. Affected files ... .. //depot/projects/tty/sys/dev/vga/vga.c#7 edit .. //depot/projects/tty/sys/dev/vga/vga.h#5 edit .. //depot/projects/tty/sys/dev/vga/vga_bus_pci.c#3 edit .. //depot/projects/tty/sys/dev/vga/vga_con.c#2 edit .. //depot/projects/tty/sys/dev/vga/vga_cpu_alpha.c#4 edit .. //depot/projects/tty/sys/dev/vga/vga_cpu_amd64.c#4 edit .. //depot/projects/tty/sys/dev/vga/vga_cpu_i386.c#5 edit .. //depot/projects/tty/sys/dev/vga/vga_cpu_ia64.c#4 edit .. //depot/projects/tty/sys/dev/vga/vga_cpu_sparc64.c#3 edit Differences ... ==== //depot/projects/tty/sys/dev/vga/vga.c#7 (text+ko) ==== @@ -38,10 +38,6 @@ #include /* Convenience macros. */ -#define CRTC_READ(sc, reg) \ - bus_space_read_1(sc->vga_crtc.bst, sc->vga_crtc.bsh, reg) -#define CRTC_WRITE(sc, reg, val) \ - bus_space_write_1(sc->vga_crtc.bst, sc->vga_crtc.bsh, reg, val) #define REG_READ(sc, reg) \ bus_space_read_1(sc->vga_reg.bst, sc->vga_reg.bsh, reg) #define REG_WRITE(sc, reg, val) \ @@ -61,85 +57,82 @@ int vga_init(struct vga_softc *sc) { - int error; uint8_t x; - sc->vga_screen = sc->vga_fb; - error = bus_space_subregion(sc->vga_fb.bst, sc->vga_fb.bsh, - (sc->vga_mono) ? 0x10000 : 0x18000, 4096, &sc->vga_screen.bsh); - if (error) - return (error); + /* Make sure the VGA adapter is not in monochrome emulation mode. */ + x = REG_READ(sc, VGA_GEN_MISC_OUTPUT_R); + REG_WRITE(sc, VGA_GEN_MISC_OUTPUT_W, x | VGA_GEN_MO_IOA); - /* Disable the sync. signals. */ - CRTC_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_MODE_CONTROL); - x = CRTC_READ(sc, VGA_CRTC_DATA); - CRTC_WRITE(sc, VGA_CRTC_DATA, x & ~VGA_CRTC_MC_HR); + /* Now, disable the sync. signals. */ + REG_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_MODE_CONTROL); + x = REG_READ(sc, VGA_CRTC_DATA); + REG_WRITE(sc, VGA_CRTC_DATA, x & ~VGA_CRTC_MC_HR); /* Unprotect CRTC registers 0-7. */ - CRTC_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_VERT_RETRACE_END); - x = CRTC_READ(sc, VGA_CRTC_DATA); - CRTC_WRITE(sc, VGA_CRTC_DATA, x & ~VGA_CRTC_VRE_PR); + REG_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_VERT_RETRACE_END); + x = REG_READ(sc, VGA_CRTC_DATA); + REG_WRITE(sc, VGA_CRTC_DATA, x & ~VGA_CRTC_VRE_PR); /* * Set the VGA adapter in mode 0x12 (640x480x16). */ /* Reprogram the CRTC. */ - CRTC_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_HORIZ_TOTAL); - CRTC_WRITE(sc, VGA_CRTC_DATA, 0x5f); /* 760 */ - CRTC_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_HORIZ_DISP_END); - CRTC_WRITE(sc, VGA_CRTC_DATA, 0x4f); /* 640 - 8 */ - CRTC_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_START_HORIZ_BLANK); - CRTC_WRITE(sc, VGA_CRTC_DATA, 0x50); /* 640 */ - CRTC_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_END_HORIZ_BLANK); - CRTC_WRITE(sc, VGA_CRTC_DATA, VGA_CRTC_EHB_CR + 2); - CRTC_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_START_HORIZ_RETRACE); - CRTC_WRITE(sc, VGA_CRTC_DATA, 0x54); /* 672 */ - CRTC_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_END_HORIZ_RETRACE); - CRTC_WRITE(sc, VGA_CRTC_DATA, VGA_CRTC_EHR_EHB + 0); - CRTC_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_VERT_TOTAL); - CRTC_WRITE(sc, VGA_CRTC_DATA, 0x0b); /* 523 */ - CRTC_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_OVERFLOW); - CRTC_WRITE(sc, VGA_CRTC_DATA, VGA_CRTC_OF_VT9 | VGA_CRTC_OF_LC8 | + REG_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_HORIZ_TOTAL); + REG_WRITE(sc, VGA_CRTC_DATA, 0x5f); /* 760 */ + REG_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_HORIZ_DISP_END); + REG_WRITE(sc, VGA_CRTC_DATA, 0x4f); /* 640 - 8 */ + REG_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_START_HORIZ_BLANK); + REG_WRITE(sc, VGA_CRTC_DATA, 0x50); /* 640 */ + REG_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_END_HORIZ_BLANK); + REG_WRITE(sc, VGA_CRTC_DATA, VGA_CRTC_EHB_CR + 2); + REG_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_START_HORIZ_RETRACE); + REG_WRITE(sc, VGA_CRTC_DATA, 0x54); /* 672 */ + REG_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_END_HORIZ_RETRACE); + REG_WRITE(sc, VGA_CRTC_DATA, VGA_CRTC_EHR_EHB + 0); + REG_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_VERT_TOTAL); + REG_WRITE(sc, VGA_CRTC_DATA, 0x0b); /* 523 */ + REG_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_OVERFLOW); + REG_WRITE(sc, VGA_CRTC_DATA, VGA_CRTC_OF_VT9 | VGA_CRTC_OF_LC8 | VGA_CRTC_OF_VBS8 | VGA_CRTC_OF_VRS8 | VGA_CRTC_OF_VDE8); - CRTC_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_PRESET_ROW_SCAN); - CRTC_WRITE(sc, VGA_CRTC_DATA, 0); - CRTC_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_MAX_SCAN_LINE); - CRTC_WRITE(sc, VGA_CRTC_DATA, VGA_CRTC_MSL_LC9); - CRTC_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_CURSOR_START); - CRTC_WRITE(sc, VGA_CRTC_DATA, 0); - CRTC_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_CURSOR_END); - CRTC_WRITE(sc, VGA_CRTC_DATA, 0); - CRTC_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_START_ADDR_HIGH); - CRTC_WRITE(sc, VGA_CRTC_DATA, 0); - CRTC_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_START_ADDR_LOW); - CRTC_WRITE(sc, VGA_CRTC_DATA, 0); - CRTC_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_CURSOR_LOC_HIGH); - CRTC_WRITE(sc, VGA_CRTC_DATA, 0); - CRTC_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_CURSOR_LOC_LOW); - CRTC_WRITE(sc, VGA_CRTC_DATA, 0x59); - CRTC_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_VERT_RETRACE_START); - CRTC_WRITE(sc, VGA_CRTC_DATA, 0xea); /* 480 + 10 */ - CRTC_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_VERT_RETRACE_END); - CRTC_WRITE(sc, VGA_CRTC_DATA, 0x8c); - CRTC_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_VERT_DISPLAY_END); - CRTC_WRITE(sc, VGA_CRTC_DATA, 0xdf); /* 480 - 1*/ - CRTC_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_OFFSET); - CRTC_WRITE(sc, VGA_CRTC_DATA, 0x28); - CRTC_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_UNDERLINE_LOC); - CRTC_WRITE(sc, VGA_CRTC_DATA, 0); - CRTC_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_START_VERT_BLANK); - CRTC_WRITE(sc, VGA_CRTC_DATA, 0xe7); /* 480 + 7 */ - CRTC_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_END_VERT_BLANK); - CRTC_WRITE(sc, VGA_CRTC_DATA, 0x04); - CRTC_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_MODE_CONTROL); - CRTC_WRITE(sc, VGA_CRTC_DATA, VGA_CRTC_MC_WB | VGA_CRTC_MC_AW | + REG_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_PRESET_ROW_SCAN); + REG_WRITE(sc, VGA_CRTC_DATA, 0); + REG_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_MAX_SCAN_LINE); + REG_WRITE(sc, VGA_CRTC_DATA, VGA_CRTC_MSL_LC9); + REG_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_CURSOR_START); + REG_WRITE(sc, VGA_CRTC_DATA, 0); + REG_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_CURSOR_END); + REG_WRITE(sc, VGA_CRTC_DATA, 0); + REG_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_START_ADDR_HIGH); + REG_WRITE(sc, VGA_CRTC_DATA, 0); + REG_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_START_ADDR_LOW); + REG_WRITE(sc, VGA_CRTC_DATA, 0); + REG_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_CURSOR_LOC_HIGH); + REG_WRITE(sc, VGA_CRTC_DATA, 0); + REG_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_CURSOR_LOC_LOW); + REG_WRITE(sc, VGA_CRTC_DATA, 0x59); + REG_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_VERT_RETRACE_START); + REG_WRITE(sc, VGA_CRTC_DATA, 0xea); /* 480 + 10 */ + REG_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_VERT_RETRACE_END); + REG_WRITE(sc, VGA_CRTC_DATA, 0x8c); + REG_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_VERT_DISPLAY_END); + REG_WRITE(sc, VGA_CRTC_DATA, 0xdf); /* 480 - 1*/ + REG_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_OFFSET); + REG_WRITE(sc, VGA_CRTC_DATA, 0x28); + REG_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_UNDERLINE_LOC); + REG_WRITE(sc, VGA_CRTC_DATA, 0); + REG_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_START_VERT_BLANK); + REG_WRITE(sc, VGA_CRTC_DATA, 0xe7); /* 480 + 7 */ + REG_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_END_VERT_BLANK); + REG_WRITE(sc, VGA_CRTC_DATA, 0x04); + REG_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_MODE_CONTROL); + REG_WRITE(sc, VGA_CRTC_DATA, VGA_CRTC_MC_WB | VGA_CRTC_MC_AW | VGA_CRTC_MC_SRS | VGA_CRTC_MC_CMS); - CRTC_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_LINE_COMPARE); - CRTC_WRITE(sc, VGA_CRTC_DATA, 0xff); /* 480 + 31 */ + REG_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_LINE_COMPARE); + REG_WRITE(sc, VGA_CRTC_DATA, 0xff); /* 480 + 31 */ /* Reprogram the general registers. */ REG_WRITE(sc, VGA_GEN_MISC_OUTPUT_W, VGA_GEN_MO_VSP | VGA_GEN_MO_HSP | VGA_GEN_MO_PB | VGA_GEN_MO_ER | VGA_GEN_MO_IOA); - REG_WRITE(sc, VGA_EXT_FEATURE_CTRL, 0); + REG_WRITE(sc, VGA_GEN_FEATURE_CTRL_W, 0); /* Reprogram the sequencer. */ REG_WRITE(sc, VGA_SEQ_ADDRESS, VGA_SEQ_RESET); REG_WRITE(sc, VGA_SEQ_DATA, VGA_SEQ_RST_SR | VGA_SEQ_RST_NAR); @@ -156,9 +149,9 @@ /* Reprogram the graphics controller. */ /* Enable the sync signals. */ - CRTC_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_MODE_CONTROL); - x = CRTC_READ(sc, VGA_CRTC_DATA); - CRTC_WRITE(sc, VGA_CRTC_DATA, x | VGA_CRTC_MC_HR); + REG_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_MODE_CONTROL); + x = REG_READ(sc, VGA_CRTC_DATA); + REG_WRITE(sc, VGA_CRTC_DATA, x | VGA_CRTC_MC_HR); sc->vga_enable = 1; return (0); ==== //depot/projects/tty/sys/dev/vga/vga.h#5 (text+ko) ==== @@ -46,25 +46,19 @@ #define VGA_BUSTYPE_PCI 2 int vga_console:1; int vga_enable:1; - int vga_mono:1; /* Bus spaces */ - struct vga_spc vga_spc[4]; + struct vga_spc vga_spc[2]; #define VGA_RES_FB 0 -#define VGA_RES_SCREEN 1 -#define VGA_RES_REG 2 -#define VGA_RES_CRTC 3 +#define VGA_RES_REG 1 }; #define vga_fb vga_spc[VGA_RES_FB] -#define vga_screen vga_spc[VGA_RES_SCREEN] #define vga_reg vga_spc[VGA_RES_REG] -#define vga_crtc vga_spc[VGA_RES_CRTC] struct vga_consdata { struct vga_spc fb; struct vga_spc reg; - struct vga_spc crtc; }; int vga_get_console(struct vga_consdata*); @@ -73,15 +67,6 @@ extern devclass_t vga_devclass; extern char vga_device_name[]; -static __inline int -vga_is_mono(struct vga_spc *sp) -{ - uint8_t misc; - - misc = bus_space_read_1(sp->bst, sp->bsh, VGA_GEN_MISC_OUTPUT_R); - return ((misc & VGA_GEN_MO_IOA) ? 0 : 1); -} - int vga_attach(device_t); int vga_bitblt(struct vga_softc *, int, int); int vga_init(struct vga_softc *); ==== //depot/projects/tty/sys/dev/vga/vga_bus_pci.c#3 (text+ko) ==== @@ -91,25 +91,15 @@ /* Set the legacy resources */ bus_set_resource(dev, SYS_RES_MEMORY, VGA_RES_FB, VGA_MEM_BASE, VGA_MEM_SIZE); - bus_set_resource(dev, SYS_RES_IOPORT, VGA_RES_REG, VGA_IO0_BASE, - VGA_IO0_SIZE); - error = vga_pci_alloc(dev, sc, SYS_RES_MEMORY, VGA_RES_FB); if (error) return (error); + bus_set_resource(dev, SYS_RES_IOPORT, VGA_RES_REG, VGA_REG_BASE, + VGA_REG_SIZE); error = vga_pci_alloc(dev, sc, SYS_RES_IOPORT, VGA_RES_REG); if (error) return (error); - /* Determine if the VGA controller is in color or monochrome mode. */ - sc->vga_mono = vga_is_mono(&sc->vga_reg); - - bus_set_resource(dev, SYS_RES_IOPORT, VGA_RES_CRTC, - (sc->vga_mono) ? VGA_IO1_MONO : VGA_IO1_COLOR, VGA_IO1_SIZE); - error = vga_pci_alloc(dev, sc, SYS_RES_IOPORT, VGA_RES_CRTC); - if (error) - return (error); - return (vga_attach(dev)); } ==== //depot/projects/tty/sys/dev/vga/vga_con.c#2 (text+ko) ==== @@ -56,14 +56,11 @@ return (-1); vga_console.vga_fb = cd.fb; - vga_console.vga_screen = cd.fb; vga_console.vga_reg = cd.reg; - vga_console.vga_crtc = cd.crtc; if (!vga_probe(&vga_console)) return (-1); - vga_console.vga_mono = vga_is_mono(&vga_console.vga_reg); return (0); } ==== //depot/projects/tty/sys/dev/vga/vga_cpu_alpha.c#4 (text+ko) ==== @@ -42,8 +42,6 @@ cd->fb.bst = busspace_isa_mem; cd->fb.bsh = VGA_MEM_BASE; cd->reg.bst = busspace_isa_io; - cd->reg.bsh = VGA_IO0_BASE; - cd->crtc.bst = busspace_isa_io; - cd->crtc.bsh = (vga_is_mono(&cd->reg)) ? VGA_IO1_MONO : VGA_IO1_COLOR; + cd->reg.bsh = VGA_REG_BASE; return (0); } ==== //depot/projects/tty/sys/dev/vga/vga_cpu_amd64.c#4 (text+ko) ==== @@ -48,8 +48,6 @@ cd->fb.bst = AMD64_BUS_SPACE_MEM; cd->fb.bsh = KERNBASE + VGA_MEM_BASE; cd->reg.bst = AMD64_BUS_SPACE_IO; - cd->reg.bsh = VGA_IO0_BASE; - cd->crtc.bst = AMD64_BUS_SPACE_IO; - cd->crtc.bsh = (vga_is_mono(&cd->reg)) ? VGA_IO1_MONO : VGA_IO1_COLOR; + cd->reg.bsh = VGA_REG_BASE; return (0); } ==== //depot/projects/tty/sys/dev/vga/vga_cpu_i386.c#5 (text+ko) ==== @@ -48,8 +48,6 @@ cd->fb.bst = I386_BUS_SPACE_MEM; cd->fb.bsh = KERNBASE + VGA_MEM_BASE; cd->reg.bst = I386_BUS_SPACE_IO; - cd->reg.bsh = VGA_IO0_BASE; - cd->crtc.bst = I386_BUS_SPACE_IO; - cd->crtc.bsh = (vga_is_mono(&cd->reg)) ? VGA_IO1_MONO : VGA_IO1_COLOR; + cd->reg.bsh = VGA_REG_BASE; return (0); } ==== //depot/projects/tty/sys/dev/vga/vga_cpu_ia64.c#4 (text+ko) ==== @@ -42,8 +42,6 @@ cd->fb.bst = IA64_BUS_SPACE_MEM; cd->fb.bsh = IA64_PHYS_TO_RR6(VGA_MEM_BASE); cd->reg.bst = IA64_BUS_SPACE_IO; - cd->reg.bsh = VGA_IO0_BASE; - cd->crtc.bst = IA64_BUS_SPACE_IO; - cd->crtc.bsh = (vga_is_mono(&cd->reg)) ? VGA_IO1_MONO : VGA_IO1_COLOR; + cd->reg.bsh = VGA_REG_BASE; return (0); } ==== //depot/projects/tty/sys/dev/vga/vga_cpu_sparc64.c#3 (text+ko) ==== @@ -42,7 +42,7 @@ int vga_get_console(struct vga_consdata *cd) { - static struct bus_space_tag bst_store[3]; + static struct bus_space_tag bst_store[2]; char odev[32]; ihandle_t stdout; phandle_t chosen, oh, options; @@ -75,9 +75,5 @@ cd->reg.bst = &bst_store[1]; cd->reg.bsh = sparc64_fake_bustag(PCI_IO_BUS_SPACE, 0x1fe020003c0, cd->reg.bst); - cd->crtc.bst = &bst_store[2]; - cd->crtc.bsh = (vga_is_mono(&cd->reg)) ? - sparc64_fake_bustag(PCI_IO_BUS_SPACE, 0x1fe020003b0, cd->crtc.bst) : - sparc64_fake_bustag(PCI_IO_BUS_SPACE, 0x1fe020003d0, cd->crtc.bst); return (0); } From owner-p4-projects@FreeBSD.ORG Sun May 8 18:49:46 2005 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id B1A4C16A4E7; Sun, 8 May 2005 18:49:45 +0000 (GMT) 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 56CAD16A4E4 for ; Sun, 8 May 2005 18:49:45 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2699143D5A for ; Sun, 8 May 2005 18:49:45 +0000 (GMT) (envelope-from csjp@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 j48InjAG089830 for ; Sun, 8 May 2005 18:49:45 GMT (envelope-from csjp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j48Ini1u089827 for perforce@freebsd.org; Sun, 8 May 2005 18:49:44 GMT (envelope-from csjp@freebsd.org) Date: Sun, 8 May 2005 18:49:44 GMT Message-Id: <200505081849.j48Ini1u089827@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to csjp@freebsd.org using -f From: "Christian S.J. Peron" To: Perforce Change Reviews Subject: PERFORCE change 76699 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 May 2005 18:49:46 -0000 http://perforce.freebsd.org/chv.cgi?CH=76699 Change 76699 by csjp@csjp_xor on 2005/05/08 18:49:44 -create the MAC_CHKEXEC kernel option so that people can compile this straight into their kernel. -create MD5_HASH_SIZE and SHA1_HASH_SIZE constants. This makes the code a bit more cleaner by adding context. -plug these new constants into the code where applicable Affected files ... .. //depot/projects/trustedbsd/mac/sys/conf/files#116 edit .. //depot/projects/trustedbsd/mac/sys/conf/options#73 edit .. //depot/projects/trustedbsd/mac/sys/security/mac_chkexec/mac_chkexec.c#6 edit .. //depot/projects/trustedbsd/mac/sys/security/mac_chkexec/mac_chkexec.h#3 edit .. //depot/projects/trustedbsd/mac/usr.sbin/getfhash/getfhash.c#3 edit Differences ... ==== //depot/projects/trustedbsd/mac/sys/conf/files#116 (text+ko) ==== @@ -308,6 +308,7 @@ crypto/sha1.c optional netgraph_mppc_encryption crypto/sha1.c optional crypto crypto/sha1.c optional ipsec +crypto/sha1.c optional mac_chkexec crypto/sha2/sha2.c optional crypto crypto/sha2/sha2.c optional geom_bde crypto/sha2/sha2.c optional ipsec @@ -1743,6 +1744,7 @@ security/mac/mac_vfs.c optional mac security/mac_biba/mac_biba.c optional mac_biba security/mac_bsdextended/mac_bsdextended.c optional mac_bsdextended +security/mac_chkexec/mac_chkexec.c optional mac_chkexec security/mac_ifoff/mac_ifoff.c optional mac_ifoff security/mac_lomac/mac_lomac.c optional mac_lomac security/mac_mls/mac_mls.c optional mac_mls ==== //depot/projects/trustedbsd/mac/sys/conf/options#73 (text+ko) ==== @@ -97,6 +97,7 @@ MAC_ALWAYS_LABEL_MBUF opt_mac.h MAC_BIBA opt_dontuse.h MAC_BSDEXTENDED opt_dontuse.h +MAC_CHKEXEC opt_dontuse.h MAC_DEBUG opt_mac.h MAC_IFOFF opt_dontuse.h MAC_LOMAC opt_dontuse.h ==== //depot/projects/trustedbsd/mac/sys/security/mac_chkexec/mac_chkexec.c#6 (text+ko) ==== @@ -127,8 +127,8 @@ hashalgo, sizeof(hashalgo), "Current trusted exec algorithm"); static struct hash_algo ha_table[] = { - { mac_chkexec_calc_vnode_sha1, 20, MAC_VCSUM_SHA1, "sha1" }, - { mac_chkexec_calc_vnode_md5, 16, MAC_VCSUM_MD5, "md5" }, + { mac_chkexec_calc_vnode_sha1, SHA1_HASH_SIZE, MAC_VCSUM_SHA1, "sha1" }, + { mac_chkexec_calc_vnode_md5, MD5_HASH_SIZE, MAC_VCSUM_MD5, "md5" }, { NULL, 0, 0, NULL }, }; ==== //depot/projects/trustedbsd/mac/sys/security/mac_chkexec/mac_chkexec.h#3 (text+ko) ==== @@ -31,7 +31,9 @@ #define MAC_CHKEXEC_ATTRN EXTATTR_NAMESPACE_SYSTEM #define MAC_CHKEXEC "chkexec" #define MAC_CHKEXEC_DEP "chkexec_depend" -#define MAXCSUMSIZE 32 +#define SHA1_HASH_SIZE 20 +#define MD5_HASH_SIZE 16 +#define MAXCSUMSIZE 32 #ifdef _KERNEL struct vcache { ==== //depot/projects/trustedbsd/mac/usr.sbin/getfhash/getfhash.c#3 (text+ko) ==== @@ -125,11 +125,11 @@ return; } if (sum.vs_flags == MAC_VCSUM_SHA1) { - nbytes = 20; + nbytes = SHA1_HASH_SIZE; algo = "sha1"; } else if (sum.vs_flags == MAC_VCSUM_MD5) { - nbytes = 16; + nbytes = MD5_HASH_SIZE; algo = "md5"; } else { warnx("%s: invalid checksum algorithm", From owner-p4-projects@FreeBSD.ORG Sun May 8 19:41:55 2005 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 46F1416A4E8; Sun, 8 May 2005 19:41:55 +0000 (GMT) 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 1EA1716A4E6 for ; Sun, 8 May 2005 19:41:55 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id E37D843D88 for ; Sun, 8 May 2005 19:41:54 +0000 (GMT) (envelope-from marcel@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 j48JfsSQ092065 for ; Sun, 8 May 2005 19:41:54 GMT (envelope-from marcel@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j48JfspL092062 for perforce@freebsd.org; Sun, 8 May 2005 19:41:54 GMT (envelope-from marcel@freebsd.org) Date: Sun, 8 May 2005 19:41:54 GMT Message-Id: <200505081941.j48JfspL092062@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to marcel@freebsd.org using -f From: Marcel Moolenaar To: Perforce Change Reviews Subject: PERFORCE change 76703 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 May 2005 19:41:56 -0000 http://perforce.freebsd.org/chv.cgi?CH=76703 Change 76703 by marcel@marcel_nfs on 2005/05/08 19:41:42 IFC @76698 Affected files ... .. //depot/projects/tty/contrib/ipfilter/tools/ipmon.c#2 integrate .. //depot/projects/tty/games/fortune/datfiles/limerick#4 integrate .. //depot/projects/tty/gnu/usr.bin/gdb/libgdb/fbsd-threads.c#4 integrate .. //depot/projects/tty/lib/libc/gmon/mcount.c#4 integrate .. //depot/projects/tty/lib/msun/i387/s_ceilf.S#2 integrate .. //depot/projects/tty/lib/msun/i387/s_floorf.S#2 integrate .. //depot/projects/tty/lib/msun/i387/s_truncf.S#2 integrate .. //depot/projects/tty/libexec/talkd/process.c#2 integrate .. //depot/projects/tty/release/doc/en_US.ISO8859-1/relnotes/common/new.sgml#21 integrate .. //depot/projects/tty/release/doc/share/sgml/release.dsl#4 integrate .. //depot/projects/tty/share/examples/etc/make.conf#13 integrate .. //depot/projects/tty/share/examples/mdoc/example.4#4 integrate .. //depot/projects/tty/share/man/man4/Makefile#15 integrate .. //depot/projects/tty/share/man/man4/ichsmb.4#2 integrate .. //depot/projects/tty/share/man/man4/man4.i386/Makefile#11 integrate .. //depot/projects/tty/share/man/man4/man4.i386/acpi_ibm.4#1 branch .. //depot/projects/tty/share/man/man4/ng_nat.4#1 branch .. //depot/projects/tty/sys/amd64/amd64/machdep.c#13 integrate .. //depot/projects/tty/sys/boot/pc98/boot2/Makefile#8 integrate .. //depot/projects/tty/sys/boot/pc98/boot2/boot.c#4 integrate .. //depot/projects/tty/sys/boot/pc98/boot2/boot.h#3 integrate .. //depot/projects/tty/sys/boot/pc98/boot2/boot2.S#2 integrate .. //depot/projects/tty/sys/boot/pc98/boot2/disk.c#5 integrate .. //depot/projects/tty/sys/boot/pc98/boot2/io.c#4 integrate .. //depot/projects/tty/sys/boot/pc98/boot2/sys.c#5 integrate .. //depot/projects/tty/sys/boot/pc98/boot2/table.c#3 integrate .. //depot/projects/tty/sys/boot/pc98/btx/btx/Makefile#4 integrate .. //depot/projects/tty/sys/boot/pc98/btx/btx/btx.S#3 integrate .. //depot/projects/tty/sys/boot/pc98/btx/btxldr/Makefile#4 integrate .. //depot/projects/tty/sys/boot/pc98/btx/btxldr/btxldr.S#2 integrate .. //depot/projects/tty/sys/boot/pc98/kgzldr/Makefile#5 integrate .. //depot/projects/tty/sys/boot/pc98/kgzldr/crt.s#2 integrate .. //depot/projects/tty/sys/boot/pc98/libpc98/Makefile#6 integrate .. //depot/projects/tty/sys/boot/pc98/libpc98/biosdisk.c#5 integrate .. //depot/projects/tty/sys/boot/pc98/libpc98/biosmem.c#3 integrate .. //depot/projects/tty/sys/boot/pc98/libpc98/comconsole.c#3 integrate .. //depot/projects/tty/sys/boot/pc98/libpc98/gatea20.c#3 integrate .. //depot/projects/tty/sys/boot/pc98/libpc98/time.c#3 integrate .. //depot/projects/tty/sys/boot/pc98/libpc98/vidconsole.c#5 integrate .. //depot/projects/tty/sys/boot/pc98/loader/Makefile#5 integrate .. //depot/projects/tty/sys/boot/pc98/loader/main.c#5 integrate .. //depot/projects/tty/sys/cam/scsi/scsi_da.c#13 integrate .. //depot/projects/tty/sys/compat/ndis/kern_ndis.c#6 integrate .. //depot/projects/tty/sys/compat/ndis/ndis_var.h#5 integrate .. //depot/projects/tty/sys/compat/ndis/ntoskrnl_var.h#6 integrate .. //depot/projects/tty/sys/compat/ndis/subr_hal.c#6 integrate .. //depot/projects/tty/sys/compat/ndis/subr_ndis.c#6 integrate .. //depot/projects/tty/sys/compat/ndis/subr_ntoskrnl.c#6 integrate .. //depot/projects/tty/sys/compat/ndis/subr_usbd.c#2 integrate .. //depot/projects/tty/sys/conf/NOTES#20 integrate .. //depot/projects/tty/sys/conf/files#25 integrate .. //depot/projects/tty/sys/conf/options#19 integrate .. //depot/projects/tty/sys/dev/bge/if_bge.c#17 integrate .. //depot/projects/tty/sys/dev/digi/CX.bios.h#2 integrate .. //depot/projects/tty/sys/dev/digi/CX.fepos.h#2 integrate .. //depot/projects/tty/sys/dev/digi/CX_PCI.bios.h#2 integrate .. //depot/projects/tty/sys/dev/digi/CX_PCI.fepos.h#2 integrate .. //depot/projects/tty/sys/dev/digi/EPCX.bios.h#2 integrate .. //depot/projects/tty/sys/dev/digi/EPCX.fepos.h#2 integrate .. //depot/projects/tty/sys/dev/digi/EPCX_PCI.bios.h#2 integrate .. //depot/projects/tty/sys/dev/digi/EPCX_PCI.fepos.h#2 integrate .. //depot/projects/tty/sys/dev/digi/Xe.bios.h#2 integrate .. //depot/projects/tty/sys/dev/digi/Xe.fepos.h#2 integrate .. //depot/projects/tty/sys/dev/digi/Xem.bios.h#2 integrate .. //depot/projects/tty/sys/dev/digi/Xem.fepos.h#2 integrate .. //depot/projects/tty/sys/dev/if_ndis/if_ndis.c#6 integrate .. //depot/projects/tty/sys/dev/if_ndis/if_ndis_pci.c#6 integrate .. //depot/projects/tty/sys/dev/if_ndis/if_ndisvar.h#6 integrate .. //depot/projects/tty/sys/dev/iir/iir_ctrl.c#10 integrate .. //depot/projects/tty/sys/dev/nve/if_nve.c#3 integrate .. //depot/projects/tty/sys/fs/ntfs/ntfs_subr.c#9 integrate .. //depot/projects/tty/sys/fs/smbfs/smbfs_subr.c#6 integrate .. //depot/projects/tty/sys/i386/i386/machdep.c#14 integrate .. //depot/projects/tty/sys/i386/i386/sys_machdep.c#9 integrate .. //depot/projects/tty/sys/kern/kern_exit.c#14 integrate .. //depot/projects/tty/sys/kern/subr_bus.c#11 integrate .. //depot/projects/tty/sys/kern/subr_rman.c#9 integrate .. //depot/projects/tty/sys/kern/uipc_usrreq.c#12 integrate .. //depot/projects/tty/sys/kern/vfs_subr.c#17 integrate .. //depot/projects/tty/sys/modules/Makefile#19 integrate .. //depot/projects/tty/sys/modules/libalias/Makefile#1 branch .. //depot/projects/tty/sys/modules/netgraph/Makefile#8 integrate .. //depot/projects/tty/sys/modules/netgraph/nat/Makefile#1 branch .. //depot/projects/tty/sys/net/if_mib.c#4 integrate .. //depot/projects/tty/sys/netgraph/ng_nat.c#1 branch .. //depot/projects/tty/sys/netgraph/ng_nat.h#1 branch .. //depot/projects/tty/sys/netinet/ip_divert.c#11 integrate .. //depot/projects/tty/sys/netinet/libalias/alias.c#2 integrate .. //depot/projects/tty/sys/netinet/libalias/alias.h#2 integrate .. //depot/projects/tty/sys/netinet/libalias/alias_cuseeme.c#2 integrate .. //depot/projects/tty/sys/netinet/libalias/alias_db.c#3 integrate .. //depot/projects/tty/sys/netinet/libalias/alias_ftp.c#2 integrate .. //depot/projects/tty/sys/netinet/libalias/alias_irc.c#2 integrate .. //depot/projects/tty/sys/netinet/libalias/alias_local.h#2 integrate .. //depot/projects/tty/sys/netinet/libalias/alias_nbt.c#2 integrate .. //depot/projects/tty/sys/netinet/libalias/alias_old.c#2 integrate .. //depot/projects/tty/sys/netinet/libalias/alias_pptp.c#2 integrate .. //depot/projects/tty/sys/netinet/libalias/alias_proxy.c#2 integrate .. //depot/projects/tty/sys/netinet/libalias/alias_skinny.c#2 integrate .. //depot/projects/tty/sys/netinet/libalias/alias_smedia.c#2 integrate .. //depot/projects/tty/sys/netinet/libalias/alias_util.c#2 integrate .. //depot/projects/tty/sys/netinet/raw_ip.c#11 integrate .. //depot/projects/tty/sys/netinet/tcp_subr.c#15 integrate .. //depot/projects/tty/sys/netinet/udp_usrreq.c#10 integrate .. //depot/projects/tty/sys/sys/diskpc98.h#6 integrate .. //depot/projects/tty/sys/sys/imgact_aout.h#4 integrate .. //depot/projects/tty/sys/sys/param.h#17 integrate .. //depot/projects/tty/tools/regression/lib/libc/resolv/resolv.t#1 branch .. //depot/projects/tty/tools/regression/net80211/ccmp/test_ccmp.c#2 integrate .. //depot/projects/tty/tools/regression/net80211/tkip/test_tkip.c#2 integrate .. //depot/projects/tty/tools/regression/net80211/wep/test_wep.c#2 integrate .. //depot/projects/tty/usr.bin/make/hash_tables.c#2 integrate .. //depot/projects/tty/usr.bin/make/main.c#10 integrate .. //depot/projects/tty/usr.bin/make/parse.c#7 integrate .. //depot/projects/tty/usr.bin/make/var.c#7 integrate .. //depot/projects/tty/usr.bin/make/var.h#4 integrate .. //depot/projects/tty/usr.bin/tar/Makefile#6 integrate .. //depot/projects/tty/usr.bin/tar/tree.c#2 integrate .. //depot/projects/tty/usr.bin/tar/tree.h#2 integrate .. //depot/projects/tty/usr.bin/tar/write.c#6 integrate .. //depot/projects/tty/usr.sbin/ppp/ppp.8.m4#11 integrate .. //depot/projects/tty/usr.sbin/sysinstall/menus.c#16 integrate Differences ... ==== //depot/projects/tty/contrib/ipfilter/tools/ipmon.c#2 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/contrib/ipfilter/tools/ipmon.c,v 1.2 2005/04/25 18:20:15 darrenr Exp $ */ +/* $FreeBSD: src/contrib/ipfilter/tools/ipmon.c,v 1.3 2005/05/08 00:29:15 grehan Exp $ */ /* * Copyright (C) 1993-2001, 2003 by Darren Reed. @@ -1024,7 +1024,7 @@ (void) sprintf(t, "%*.*s%u", len, len, ipf->fl_ifname, ipf->fl_unit); t += strlen(t); #endif -#ifdef __sgi +#if (defined(__sgi) || defined(__powerpc__)) if ((ipf->fl_group[0] == 255) && (ipf->fl_group[1] == '\0')) #else if ((ipf->fl_group[0] == -1) && (ipf->fl_group[1] == '\0')) ==== //depot/projects/tty/games/fortune/datfiles/limerick#4 (text+ko) ==== @@ -1,4 +1,4 @@ -%% $FreeBSD: src/games/fortune/datfiles/limerick,v 1.7 2005/02/01 16:34:38 ru Exp $ +%% $FreeBSD: src/games/fortune/datfiles/limerick,v 1.8 2005/05/07 17:56:50 schweikh Exp $ A bad little girl in Madrid, A most reprehensible kid, Told her Tante Louise @@ -3438,18 +3438,13 @@ Who had an affair with a eunuch. At the height of their passion He dealt her a ration -% -There was a young lady from Munich -Who had an affair with a eunuch. - At the height of their passion - He dealt her a ration From a squirt gun concealed in his tunic. % There was a young lady from Norway Who hung by her heels in a doorway. She told her young man, "Get off the divan, -I think I've discovered one more way " +I think I've discovered one more way" % There was a young lady from Prentice Who had an affair with a dentist. @@ -3578,7 +3573,7 @@ Of Mozart's quartet in F major. % There was a young lady named Ciss -Who said, "I think skating's a bliss " +Who said, "I think skating's a bliss" But she'll never restate, For a wheel off her skate .siht ekil gnihtemos pu hsinif reh edaM @@ -4509,7 +4504,7 @@ Whose lovemaking was rather brisk. So quick was his action, The Lorentz Contraction -Shortened his rod to a disc !! +Shortened his rod to a disc! % There was a young plumber named Lee Who was plumbing his girl by the sea. ==== //depot/projects/tty/gnu/usr.bin/gdb/libgdb/fbsd-threads.c#4 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/gnu/usr.bin/gdb/libgdb/fbsd-threads.c,v 1.11 2005/04/12 03:04:04 davidxu Exp $ */ +/* $FreeBSD: src/gnu/usr.bin/gdb/libgdb/fbsd-threads.c,v 1.12 2005/05/06 11:01:15 davidxu Exp $ */ /* FreeBSD libthread_db assisted debugging support. Copyright 1999, 2000, 2001 Free Software Foundation, Inc. @@ -660,6 +660,8 @@ if (! IS_THREAD(ptid)) return; + if (fbsd_thread_core != 0) + return; /* Enable thread event reporting for this thread. */ err = td_thr_event_enable_p (th_p, 1); if (err != TD_OK) ==== //depot/projects/tty/lib/libc/gmon/mcount.c#4 (text+ko) ==== @@ -35,7 +35,7 @@ static char sccsid[] = "@(#)mcount.c 8.1 (Berkeley) 6/4/93"; #endif #include -__FBSDID("$FreeBSD: src/lib/libc/gmon/mcount.c,v 1.20 2004/10/16 06:32:43 obrien Exp $"); +__FBSDID("$FreeBSD: src/lib/libc/gmon/mcount.c,v 1.21 2005/05/06 07:37:01 davidxu Exp $"); #include #include @@ -49,6 +49,7 @@ void eintr(void); void user(void); #endif +#include /* * mcount is called on entry to each function compiled with the profiling @@ -92,7 +93,8 @@ #ifdef _KERNEL MCOUNT_ENTER(s); #else - p->state = GMON_PROF_BUSY; + if (!atomic_cmpset_acq_int(&p->state, GMON_PROF_ON, GMON_PROF_BUSY)) + return; #endif frompci = frompc - p->lowpc; @@ -260,11 +262,11 @@ #ifdef _KERNEL MCOUNT_EXIT(s); #else - p->state = GMON_PROF_ON; + atomic_store_rel_int(&p->state, GMON_PROF_ON); #endif return; overflow: - p->state = GMON_PROF_ERROR; + atomic_store_rel_int(&p->state, GMON_PROF_ERROR); #ifdef _KERNEL MCOUNT_EXIT(s); #endif ==== //depot/projects/tty/lib/msun/i387/s_ceilf.S#2 (text+ko) ==== @@ -5,7 +5,7 @@ #include -__FBSDID("$FreeBSD: src/lib/msun/i387/s_ceilf.S,v 1.1 2005/01/13 18:58:25 das Exp $"); +__FBSDID("$FreeBSD: src/lib/msun/i387/s_ceilf.S,v 1.2 2005/05/06 15:44:20 deischen Exp $"); /* RCSID("$NetBSD: s_ceilf.S,v 1.3 1995/05/08 23:52:44 jtc Exp $") */ ENTRY(ceilf) @@ -13,17 +13,17 @@ movl %esp,%ebp subl $8,%esp - fstcw -12(%ebp) /* store fpu control word */ - movw -12(%ebp),%dx + fstcw -4(%ebp) /* store fpu control word */ + movw -4(%ebp),%dx orw $0x0800,%dx /* round towards +oo */ andw $0xfbff,%dx - movw %dx,-16(%ebp) - fldcw -16(%ebp) /* load modfied control word */ + movw %dx,-8(%ebp) + fldcw -8(%ebp) /* load modfied control word */ flds 8(%ebp); /* round */ frndint - fldcw -12(%ebp) /* restore original control word */ + fldcw -4(%ebp) /* restore original control word */ leave ret ==== //depot/projects/tty/lib/msun/i387/s_floorf.S#2 (text+ko) ==== @@ -5,7 +5,7 @@ #include -__FBSDID("$FreeBSD: src/lib/msun/i387/s_floorf.S,v 1.1 2005/01/13 18:58:25 das Exp $"); +__FBSDID("$FreeBSD: src/lib/msun/i387/s_floorf.S,v 1.2 2005/05/06 15:44:20 deischen Exp $"); /* RCSID("$NetBSD: s_floorf.S,v 1.3 1995/05/09 00:04:32 jtc Exp $") */ ENTRY(floorf) @@ -13,17 +13,17 @@ movl %esp,%ebp subl $8,%esp - fstcw -12(%ebp) /* store fpu control word */ - movw -12(%ebp),%dx + fstcw -4(%ebp) /* store fpu control word */ + movw -4(%ebp),%dx orw $0x0400,%dx /* round towards -oo */ andw $0xf7ff,%dx - movw %dx,-16(%ebp) - fldcw -16(%ebp) /* load modfied control word */ + movw %dx,-8(%ebp) + fldcw -8(%ebp) /* load modfied control word */ flds 8(%ebp); /* round */ frndint - fldcw -12(%ebp) /* restore original control word */ + fldcw -4(%ebp) /* restore original control word */ leave ret ==== //depot/projects/tty/lib/msun/i387/s_truncf.S#2 (text+ko) ==== @@ -4,23 +4,23 @@ */ #include -__FBSDID("$FreeBSD: src/lib/msun/i387/s_truncf.S,v 1.1 2005/04/16 21:12:55 das Exp $") +__FBSDID("$FreeBSD: src/lib/msun/i387/s_truncf.S,v 1.2 2005/05/06 15:44:20 deischen Exp $") ENTRY(truncf) pushl %ebp movl %esp,%ebp subl $8,%esp - fstcw -12(%ebp) /* store fpu control word */ - movw -12(%ebp),%dx + fstcw -4(%ebp) /* store fpu control word */ + movw -4(%ebp),%dx orw $0x0c00,%dx /* round towards -oo */ - movw %dx,-16(%ebp) - fldcw -16(%ebp) /* load modfied control word */ + movw %dx,-8(%ebp) + fldcw -8(%ebp) /* load modfied control word */ flds 8(%ebp) /* round */ frndint - fldcw -12(%ebp) /* restore original control word */ + fldcw -4(%ebp) /* restore original control word */ leave ret ==== //depot/projects/tty/libexec/talkd/process.c#2 (text+ko) ==== @@ -36,7 +36,7 @@ static char sccsid[] = "@(#)process.c 8.2 (Berkeley) 11/16/93"; #endif static const char rcsid[] = - "$FreeBSD: src/libexec/talkd/process.c,v 1.10 2002/02/05 21:06:56 imp Exp $"; + "$FreeBSD: src/libexec/talkd/process.c,v 1.11 2005/05/06 15:28:54 delphij Exp $"; #endif /* not lint */ /* @@ -62,11 +62,12 @@ #include "extern.h" +extern int debug; + void process_request(CTL_MSG *mp, CTL_RESPONSE *rp) { CTL_MSG *ptr; - extern int debug; char *s; rp->vers = TALK_VERSION; ==== //depot/projects/tty/release/doc/en_US.ISO8859-1/relnotes/common/new.sgml#21 (text+ko) ==== @@ -3,7 +3,7 @@ The &os; Project - $FreeBSD: src/release/doc/en_US.ISO8859-1/relnotes/common/new.sgml,v 1.852 2005/05/02 05:56:30 bmah Exp $ + $FreeBSD: src/release/doc/en_US.ISO8859-1/relnotes/common/new.sgml,v 1.855 2005/05/07 13:46:20 brueffer Exp $ 2000 @@ -163,6 +163,28 @@ FreeBSD-SA-05:05.cvs. &merged; + An error in the default permissions on the /dev/iir device node, which + allowed unprivileged local users can send commands to the + hardware supported by the &man.iir.4; driver, has been fixed. + For more information, see security advisory + FreeBSD-SA-05:06.iir. + &merged; + + A bug in the validation of &man.i386.get.ldt.2; system call + input arguments, which may allow kernel memory may be disclosed + to the user process, has been fixed. For more information, see + security advisory + FreeBSD-SA-05:07.ldt. + &merged; + + Several information disclosure vulnerabilities in various + parts of the kernel have been fixed. For more information, see + security advisory + FreeBSD-SA-05:08.kmem. + &merged; + + @@ -302,7 +324,7 @@ setting the debug.acpi.do_powerstate and hw.pci.do_powerstate sysctls to 0. - The acpi_ibm driver for IBM laptops + The &man.acpi.ibm.4; driver for IBM laptops has been added. The &man.acpi.fujitsu.4; driver for handling ==== //depot/projects/tty/release/doc/share/sgml/release.dsl#4 (text+ko) ==== @@ -1,4 +1,4 @@ - + @@ -117,9 +117,9 @@ (element quote (make sequence - (literal "``") + (literal "“") (process-children) - (literal "''"))) + (literal "”"))) (define ($create-refentry-xref-link$ #!optional (n (current-node))) ==== //depot/projects/tty/share/examples/etc/make.conf#13 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/share/examples/etc/make.conf,v 1.262 2005/04/13 10:02:58 phk Exp $ +# $FreeBSD: src/share/examples/etc/make.conf,v 1.264 2005/05/08 10:11:33 des Exp $ # # NOTE: Please would any committer updating this file also update the # make.conf(5) manual page, if necessary, which is located in @@ -31,9 +31,9 @@ # Currently the following CPU types are recognized: # Intel x86 architecture: # (AMD CPUs) opteron athlon64 athlon-mp athlon-xp athlon-4 -# athlon-tbird athlon k8 k6-3 k6-2 k6 k5 nocona -# (Intel CPUs) pentium4[m] prescott pentium3[m] pentium2 pentiumpro -# pentium-mmx pentium i486 i386 +# athlon-tbird athlon k8 k6-3 k6-2 k6 k5 +# (Intel CPUs) nocona pentium4[m] prescott pentium3[m] pentium-m +# pentium2 pentiumpro pentium-mmx pentium i486 i386 # Alpha/AXP architecture: ev67 ev6 pca56 ev56 ev5 ev45 ev4 # AMD64 architecture: opteron, athlon64, nocona # Intel ia64 architecture: itanium2, itanium ==== //depot/projects/tty/share/examples/mdoc/example.4#4 (text+ko) ==== @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $FreeBSD: src/share/examples/mdoc/example.4,v 1.20 2005/01/12 20:56:15 keramida Exp $ +.\" $FreeBSD: src/share/examples/mdoc/example.4,v 1.21 2005/05/07 11:02:34 brueffer Exp $ .\" .\" Note: The date here should be updated whenever a non-trivial .\" change is made to the manual page. @@ -105,8 +105,7 @@ manual page example first appeared in .At v6 . .Sh AUTHORS -This -manual page was written by +This manual page was written by .An Mike Pritchard Aq mpp@FreeBSD.org . .Sh BUGS The actual code for this device driver is vaporware. ==== //depot/projects/tty/share/man/man4/Makefile#15 (text+ko) ==== @@ -1,5 +1,5 @@ # @(#)Makefile 8.1 (Berkeley) 6/18/93 -# $FreeBSD: src/share/man/man4/Makefile,v 1.315 2005/04/19 04:01:22 jkoshy Exp $ +# $FreeBSD: src/share/man/man4/Makefile,v 1.316 2005/05/06 15:33:12 glebius Exp $ MAN= aac.4 \ acpi.4 \ @@ -194,6 +194,7 @@ ng_l2tp.4 \ ng_lmi.4 \ ng_mppc.4 \ + ng_nat.4 \ ng_netflow.4 \ ng_one2many.4 \ ng_ppp.4 \ ==== //depot/projects/tty/share/man/man4/ichsmb.4#2 (text+ko) ==== @@ -32,7 +32,7 @@ .\" .\" Author: Archie Cobbs .\" -.\" $FreeBSD: src/share/man/man4/ichsmb.4,v 1.6 2002/08/12 16:25:20 mp Exp $ +.\" $FreeBSD: src/share/man/man4/ichsmb.4,v 1.7 2005/05/05 12:00:43 wilko Exp $ .\" .Dd October 5, 2000 .Dt ICHSMB 4 @@ -48,7 +48,8 @@ .Sh DESCRIPTION This driver provides access to the SMBus controller logical device contained in the Intel 82801AA (ICH), 82801AB (ICH0), -82801BA (ICH2), 82801CA (ICH3), and 82801DC (ICH4) PCI chips. +82801BA (ICH2), 82801CA (ICH3), 82801DC (ICH4) and +82801EB (ICH5) PCI chips. .Sh SEE ALSO .Xr smb 4 , .Xr smbus 4 ==== //depot/projects/tty/share/man/man4/man4.i386/Makefile#11 (text+ko) ==== @@ -1,7 +1,8 @@ -# $FreeBSD: src/share/man/man4/man4.i386/Makefile,v 1.177 2005/03/20 15:27:38 philip Exp $ +# $FreeBSD: src/share/man/man4/man4.i386/Makefile,v 1.178 2005/05/07 13:42:15 brueffer Exp $ MAN= acpi_asus.4 \ acpi_fujitsu.4 \ + acpi_ibm.4 \ acpi_panasonic.4 \ acpi_toshiba.4 \ aic.4 \ ==== //depot/projects/tty/sys/amd64/amd64/machdep.c#13 (text+ko) ==== @@ -39,7 +39,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/amd64/machdep.c,v 1.635 2005/05/04 22:26:40 davidxu Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/machdep.c,v 1.636 2005/05/05 18:19:53 peter Exp $"); #include "opt_atalk.h" #include "opt_atpic.h" @@ -1374,7 +1374,6 @@ int fill_regs(struct thread *td, struct reg *regs) { - struct pcb *pcb; struct trapframe *tp; tp = td->td_frame; @@ -1398,7 +1397,6 @@ regs->r_rflags = tp->tf_rflags; regs->r_rsp = tp->tf_rsp; regs->r_ss = tp->tf_ss; - pcb = td->td_pcb; return (0); } ==== //depot/projects/tty/sys/boot/pc98/boot2/Makefile#8 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/boot/pc98/boot2/Makefile,v 1.22 2005/04/03 04:58:15 imp Exp $ +# $FreeBSD: src/sys/boot/pc98/boot2/Makefile,v 1.23 2005/05/08 14:17:27 nyan Exp $ # PROG= boot @@ -10,7 +10,7 @@ CFLAGS= -Os -mrtd \ -fno-guess-branch-probability \ -fno-unit-at-a-time \ - -D_KERNEL -DPC98 -DBOOTWAIT=${BOOTWAIT} -DTIMEOUT=${TIMEOUT} + -D_KERNEL -DBOOTWAIT=${BOOTWAIT} -DTIMEOUT=${TIMEOUT} CFLAGS+= -DBOOTSEG=${BOOTSEG} -DBOOTSTACK=${BOOTSTACK} CFLAGS+= ${CWARNFLAGS} CFLAGS+= -I${.CURDIR}/../../.. -I. ==== //depot/projects/tty/sys/boot/pc98/boot2/boot.c#4 (text+ko) ==== @@ -49,7 +49,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/boot/pc98/boot2/boot.c,v 1.12 2004/12/01 04:59:32 scottl Exp $"); +__FBSDID("$FreeBSD: src/sys/boot/pc98/boot2/boot.c,v 1.13 2005/05/08 14:17:27 nyan Exp $"); #include "boot.h" #include @@ -81,24 +81,16 @@ void boot(int drive) { - int ret; -#ifdef PC98 - int i; + int i, ret; unsigned char disk_equips; -#endif /* Pick up the story from the Bios on geometry of disks */ -#ifdef PC98 for(ret = 0; ret < 2; ret ++) { if (*(unsigned char*)V(0xA155d) & (1 << ret)) { bootinfo.bi_bios_geom[ret] = get_diskinfo(ret + 0x80); } } -#else /* IBM-PC */ - for(ret = 0; ret < N_BIOS_GEOM; ret ++) - bootinfo.bi_bios_geom[ret] = get_diskinfo(ret + 0x80); -#endif /* PC98 */ bootinfo.bi_basemem = memsize(0); bootinfo.bi_extmem = memsize(1); @@ -106,17 +98,14 @@ gateA20(); -#ifdef PC98 /* set machine type to PC98_SYSTEM_PARAMETER */ machine_check(); -#endif /* PC98 */ /* * The default boot device is the first partition in the * compatibility slice on the boot drive. */ dosdev = drive; -#ifdef PC98 maj = (drive&0x70) >> 3; /* a good first bet */ if (maj == 4) { /* da */ disk_equips = *(unsigned char *)V(0xA1482); @@ -132,29 +121,6 @@ } else { unit = drive & 0x0f; } -#else /* IBM-PC */ - maj = 2; - unit = drive & 0x7f; -#ifdef dontneed - slice = 0; - part = 0; -#endif - if (drive & 0x80) { - /* Hard drive. Adjust. */ - maj = 0; -#if BOOT_HD_BIAS > 0 - if (unit >= BOOT_HD_BIAS) { - /* - * The drive is probably a SCSI drive with a unit - * number BOOT_HD_BIAS less than the BIOS drive - * number. - */ - maj = 4; - unit -= BOOT_HD_BIAS; - } -#endif - } -#endif /* PC98 */ readfile("boot.config", boot_config, BOOT_CONFIG_SIZE); name = "/boot/loader"; if (boot_config[0] != '\0') { @@ -173,11 +139,7 @@ ouraddr, bootinfo.bi_basemem, bootinfo.bi_extmem, (loadflags & RB_SERIAL) ? "serial" : "internal", (loadflags & RB_DUAL) ? "/dual" : "", -#ifdef PC98 dosdev & 0x0f, devs[maj], unit, 'a' + part, -#else - dosdev & 0x7f, devs[maj], unit, 'a' + part, -#endif name ? name : "*specify_a_kernel_name*", boot_help); @@ -242,11 +204,7 @@ startaddr = head.a_entry & 0x00FFFFFF; addr = startaddr; printf("Booting %d:%s(%d,%c)%s @ 0x%x\n" -#ifdef PC98 , dosdev & 0x0f -#else - , dosdev & 0x7f -#endif , devs[maj] , unit , 'a'+part ==== //depot/projects/tty/sys/boot/pc98/boot2/boot.h#3 (text+ko) ==== @@ -24,7 +24,7 @@ * the rights to redistribute these changes. * * from: Mach, Revision 2.2 92/04/04 11:35:03 rpd - * $FreeBSD: src/sys/boot/pc98/boot2/boot.h,v 1.6 2004/07/30 09:42:04 nyan Exp $ + * $FreeBSD: src/sys/boot/pc98/boot2/boot.h,v 1.7 2005/05/08 14:17:27 nyan Exp $ */ #include @@ -89,9 +89,7 @@ #endif /* !CDBOOT */ void memcpy(const void *from, void *to, size_t len); void twiddle(void); -#ifdef PC98 void machine_check(void); -#endif /* probe_keyboard.c */ int probe_keyboard(void); @@ -107,7 +105,4 @@ void read(char *buffer, int count); int openrd(void); -#ifdef PC98 #define V(ra) (ra - BOOTSEG * 0x10) -#endif - ==== //depot/projects/tty/sys/boot/pc98/boot2/boot2.S#2 (text+ko) ==== @@ -25,7 +25,7 @@ * * from: Mach, Revision 2.2 92/04/04 11:35:26 rpd * boot2.S,v 1.6 1995/01/25 21:37:40 bde Exp - * $FreeBSD: src/sys/boot/pc98/boot2/boot2.S,v 1.3 2001/05/24 11:18:32 nyan Exp $ + * $FreeBSD: src/sys/boot/pc98/boot2/boot2.S,v 1.4 2005/05/08 14:17:27 nyan Exp $ */ /* * Ported to PC-9801 by Yoshio Kimura @@ -173,9 +173,7 @@ movl %esp, EXT(dflt_name) #endif -#ifdef PC98 movb 0xA1584 - BOOTSEG * 0x10, %dl -#endif movzbl %dl, %edx /* discard head (%dh) and random high bits */ pushl %edx call EXT(boot) ==== //depot/projects/tty/sys/boot/pc98/boot2/disk.c#5 (text+ko) ==== @@ -40,7 +40,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/boot/pc98/boot2/disk.c,v 1.11 2004/07/30 09:42:04 nyan Exp $"); +__FBSDID("$FreeBSD: src/sys/boot/pc98/boot2/disk.c,v 1.13 2005/05/08 14:17:27 nyan Exp $"); #include "boot.h" #include @@ -98,12 +98,11 @@ #ifdef EMBEDDED_DISKLABEL dl = &disklabel; #else /* EMBEDDED_DISKLABEL */ -#ifdef PC98 p = Bread(dosdev_copy, 1); dptr = (struct pc98_partition *)p; slice = WHOLE_DISK_SLICE; for (i = 0; i < NDOSPART; i++, dptr++) - if (dptr->dp_mid == DOSPTYP_386BSD) { + if (dptr->dp_mid == DOSMID_386BSD) { slice = BASE_SLICE + i; sector = dptr->dp_scyl * spc; break; @@ -111,20 +110,6 @@ p = Bread(dosdev, sector + LABELSECTOR); dl=((struct disklabel *)p); disklabel = *dl; /* structure copy (maybe useful later)*/ -#else - p = Bread(dosdev_copy, 0); - dptr = (struct dos_partition *)(p+DOSPARTOFF); - slice = WHOLE_DISK_SLICE; - for (i = 0; i < NDOSPART; i++, dptr++) - if (dptr->dp_typ == DOSPTYP_386BSD) { - slice = BASE_SLICE + i; - sector = dptr->dp_start; - break; - } - p = Bread(dosdev_copy, sector + LABELSECTOR); - dl=((struct disklabel *)p); - disklabel = *dl; /* structure copy (maybe useful later)*/ -#endif /* PC98 */ #endif /* EMBEDDED_DISKLABEL */ if (dl->d_magic != DISKMAGIC) { printf("bad disklabel\n"); @@ -133,16 +118,6 @@ /* This little trick is for OnTrack DiskManager disks */ boff = dl->d_partitions[part].p_offset - dl->d_partitions[2].p_offset + sector; - -#ifndef PC98 - bsize = dl->d_partitions[part].p_size; - if (bsize == 0) { - printf("empty partition\n"); - return 1; - } - -#endif - } #endif /* RAWBOOT */ return 0; @@ -176,12 +151,6 @@ int cyl, head, sec, nsec; cyl = sector/spc; -#ifndef PC98 - if (cyl > 1023) { - printf("Error: C:%d > 1023 (BIOS limit)\n", cyl); - for(;;); /* loop forever */ - } -#endif head = (sector % spc) / spt; sec = sector % spt; nsec = spt - sec; ==== //depot/projects/tty/sys/boot/pc98/boot2/io.c#4 (text+ko) ==== @@ -27,16 +27,13 @@ */ #include -__FBSDID("$FreeBSD: src/sys/boot/pc98/boot2/io.c,v 1.6 2004/07/30 09:42:04 nyan Exp $"); +__FBSDID("$FreeBSD: src/sys/boot/pc98/boot2/io.c,v 1.7 2005/05/08 14:17:27 nyan Exp $"); #include "boot.h" #include #include -#ifdef PC98 #include -#endif - static int getchar(int in_buf); /* @@ -159,15 +156,10 @@ void delay1ms(void) { -#ifdef PC98 int i = 800; + while (--i >= 0) (void)outb(0x5f,0); /* about 600ns */ -#else - int i = 800; - while (--i >= 0) - (void)inb(0x84); -#endif } static __inline int @@ -193,7 +185,6 @@ static __inline unsigned pword(unsigned physaddr) { -#ifdef PC98 static int counter = 0; int i; @@ -201,28 +192,13 @@ (void)outb(0x5f, 0); return (counter++); -#else - unsigned result; - - /* - * Give the fs prefix separately because gas omits it for - * "movl %fs:0x46c, %eax". - */ - __asm __volatile("fs; movl %1, %0" : "=r" (result) - : "m" (*(unsigned *)physaddr)); - return (result); -#endif } int gets(char *buf) { #define bios_tick pword(0x46c) -#ifdef PC98 #define BIOS_TICK_MS 1 -#else -#define BIOS_TICK_MS 55 -#endif unsigned initial_bios_tick; char *ptr=buf; ==== //depot/projects/tty/sys/boot/pc98/boot2/sys.c#5 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/boot/pc98/boot2/sys.c,v 1.6 2004/07/30 09:42:04 nyan Exp $"); +__FBSDID("$FreeBSD: src/sys/boot/pc98/boot2/sys.c,v 1.7 2005/05/08 14:17:27 nyan Exp $"); /* * Ported to PC-9801 by Yoshio Kimura @@ -262,11 +262,7 @@ } biosdrive = biosdrivedigit - '0'; if (biosdrivedigit == '\0') { -#ifdef PC98 biosdrive = dosdev & 0x0f; -#else - biosdrive = unit; -#endif #if BOOT_HD_BIAS > 0 /* XXX */ if (maj == 4) @@ -275,29 +271,16 @@ } switch(maj) { -#ifdef PC98 case 4: /* da */ dosdev_copy = biosdrive | 0xA0; /* SCSI HD or MO */ -#else /* IBM-PC */ - case 0: - case 4: - dosdev_copy = biosdrive | 0x80; -#endif break; -#ifdef PC98 case 0: /* wd */ case 2: /* 1200KB fd */ dosdev_copy = (maj << 3) | unit | 0x80; -#else - case 2: - dosdev_copy = biosdrive; -#endif break; -#ifdef PC98 case 6: /* 1440KB fd */ dosdev_copy = (maj << 3) | unit; break; -#endif default: printf("Unknown device\n"); return 1; ==== //depot/projects/tty/sys/boot/pc98/boot2/table.c#3 (text+ko) ==== @@ -49,7 +49,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/boot/pc98/boot2/table.c,v 1.4 2003/09/08 09:11:20 obrien Exp $"); +__FBSDID("$FreeBSD: src/sys/boot/pc98/boot2/table.c,v 1.5 2005/05/08 14:17:27 nyan Exp $"); #include "boot.h" @@ -85,16 +85,12 @@ {0xFFFF, 0x0, 0x0, 0x93, 0xCF, 0x0}, /* 0x10 : kernel data */ /* 0x92? */ {0xFFFF, RUN, RUN, 0x9E, 0x40, 0x0}, /* 0x18 : boot code */ -#ifdef PC98 /* * The limit of boot data should be more than or equal to 0x9FFFF * for saving BIOS parameter and EPSON machine ID into 2'nd T-VRAM, * because base address is normally 0x10000. */ {0xFFFF, RUN, RUN, 0x92, 0x4F, 0x0}, /* 0x20 : boot data */ -#else - {0xFFFF, RUN, RUN, 0x92, 0x40, 0x0}, /* 0x20 : boot data */ -#endif {0xFFFF, RUN, RUN, 0x9E, 0x0, 0x0}, /* 0x28 : boot code, 16 bits */ {0xFFFF, 0x0, 0x0, 0x92, 0x0, 0x0}, /* 0x30 : boot data, 16 bits */ #ifdef BDE_DEBUGGER ==== //depot/projects/tty/sys/boot/pc98/btx/btx/Makefile#4 (text+ko) ==== >>> TRUNCATED FOR MAIL (1000 lines) <<< From owner-p4-projects@FreeBSD.ORG Sun May 8 19:55:12 2005 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id AF88B16A4E8; Sun, 8 May 2005 19:55:11 +0000 (GMT) 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 81A2E16A4E6 for ; Sun, 8 May 2005 19:55:11 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6951043D9D for ; Sun, 8 May 2005 19:55:11 +0000 (GMT) (envelope-from marcel@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 j48JtBoe092539 for ; Sun, 8 May 2005 19:55:11 GMT (envelope-from marcel@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j48JtBfi092536 for perforce@freebsd.org; Sun, 8 May 2005 19:55:11 GMT (envelope-from marcel@freebsd.org) Date: Sun, 8 May 2005 19:55:11 GMT Message-Id: <200505081955.j48JtBfi092536@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to marcel@freebsd.org using -f From: Marcel Moolenaar To: Perforce Change Reviews Subject: PERFORCE change 76704 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 May 2005 19:55:12 -0000 http://perforce.freebsd.org/chv.cgi?CH=76704 Change 76704 by marcel@marcel_nfs on 2005/05/08 19:54:21 Wordsmithing after proofreading. Add a reference to R.F. Ferraro's "Programmer's guide to the galaxy^WEGA, VGA, and Super VGA cards". Affected files ... .. //depot/projects/tty/sys/dev/ic/vga.h#3 edit Differences ... ==== //depot/projects/tty/sys/dev/ic/vga.h#3 (text+ko) ==== @@ -31,15 +31,20 @@ /* * The VGA adapter uses two I/O port blocks. One of these blocks, the CRT - * controller registers can be located either at 0x3B0 or at 0x3D0 in I/O + * controller registers, can be located either at 0x3B0 or at 0x3D0 in I/O * port space. This allows compatibility with the monochrome adapter, which - * as the CRT controller at 0x3B0. + * has the CRT controller registers at 0x3B0. * * It is assumed that compatibility with the monochrome adapter is not of - * interest anymore. As such, the CRT controller is located at 0x3D0 in I/O - * port space. This means that the 2 I/O blocks are adjacent in I/O port - * space and can therefore be treated as a single logical I/O port block. - * This simplifies matters. + * interest anymore. As such, the CRT controller can be located at 0x3D0 in + * I/O port space unconditionally. This means that the 2 I/O blocks are + * always adjacent and can therefore be treated as a single logical I/O port + * range. In practical terms: there only has to be a single tag and handle + * to access all registers. + * + * The following definitions are taken from or inspired by: + * Programmer's Guide to the EGA, VGA, and Super VGA Cards -- 3rd ed., + * Richard F. Ferraro, Addison-Wesley, ISBN 0-201-62490-7 */ #define VGA_MEM_BASE 0xA0000 From owner-p4-projects@FreeBSD.ORG Sun May 8 20:03:22 2005 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 203E916A4E8; Sun, 8 May 2005 20:03:22 +0000 (GMT) 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 C141816A4E6 for ; Sun, 8 May 2005 20:03:21 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id ACB3443D73 for ; Sun, 8 May 2005 20:03:21 +0000 (GMT) (envelope-from csjp@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 j48K3Lkt092867 for ; Sun, 8 May 2005 20:03:21 GMT (envelope-from csjp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j48K3LMe092864 for perforce@freebsd.org; Sun, 8 May 2005 20:03:21 GMT (envelope-from csjp@freebsd.org) Date: Sun, 8 May 2005 20:03:21 GMT Message-Id: <200505082003.j48K3LMe092864@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to csjp@freebsd.org using -f From: "Christian S.J. Peron" To: Perforce Change Reviews Subject: PERFORCE change 76705 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 May 2005 20:03:22 -0000 http://perforce.freebsd.org/chv.cgi?CH=76705 Change 76705 by csjp@csjp_xor on 2005/05/08 20:03:07 Add entry into MACREADME for mac_chkexec Affected files ... .. //depot/projects/trustedbsd/mac/MACREADME#26 edit Differences ... ==== //depot/projects/trustedbsd/mac/MACREADME#26 (text+ko) ==== @@ -22,6 +22,7 @@ mac_biba_load="NO" # Biba MAC policy (boot only) mac_bsdextended_load="NO" # BSD/extended MAC policy +mac_chkexec_load="NO" # Trusted execution policy mac_ifoff="NO" # Interface silencing policy mac_lomac_load="NO" # Low-Watermark Mandatory Access Control mac_mls_load="NO" # MLS MAC policy (boot only) From owner-p4-projects@FreeBSD.ORG Sun May 8 20:04:24 2005 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id D54ED16A4E8; Sun, 8 May 2005 20:04:23 +0000 (GMT) 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 94FF216A4E6 for ; Sun, 8 May 2005 20:04:23 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6B2D943D31 for ; Sun, 8 May 2005 20:04:23 +0000 (GMT) (envelope-from csjp@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 j48K4NDk092928 for ; Sun, 8 May 2005 20:04:23 GMT (envelope-from csjp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j48K4NRc092925 for perforce@freebsd.org; Sun, 8 May 2005 20:04:23 GMT (envelope-from csjp@freebsd.org) Date: Sun, 8 May 2005 20:04:23 GMT Message-Id: <200505082004.j48K4NRc092925@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to csjp@freebsd.org using -f From: "Christian S.J. Peron" To: Perforce Change Reviews Subject: PERFORCE change 76706 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 May 2005 20:04:24 -0000 http://perforce.freebsd.org/chv.cgi?CH=76706 Change 76706 by csjp@csjp_xor on 2005/05/08 20:04:10 Hook mac_chkexec into the module build Affected files ... .. //depot/projects/trustedbsd/mac/sys/modules/Makefile#78 edit Differences ... ==== //depot/projects/trustedbsd/mac/sys/modules/Makefile#78 (text+ko) ==== @@ -134,6 +134,7 @@ lpt \ mac_biba \ mac_bsdextended \ + mac_chkexec \ mac_ifoff \ mac_lomac \ mac_mls \ From owner-p4-projects@FreeBSD.ORG Sun May 8 20:29:55 2005 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 2392916A4E8; Sun, 8 May 2005 20:29:55 +0000 (GMT) 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 F0CF616A4E6 for ; Sun, 8 May 2005 20:29:54 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id DAEE443D66 for ; Sun, 8 May 2005 20:29:54 +0000 (GMT) (envelope-from marcel@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 j48KTsqH094005 for ; Sun, 8 May 2005 20:29:54 GMT (envelope-from marcel@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j48KTsNW094002 for perforce@freebsd.org; Sun, 8 May 2005 20:29:54 GMT (envelope-from marcel@freebsd.org) Date: Sun, 8 May 2005 20:29:54 GMT Message-Id: <200505082029.j48KTsNW094002@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to marcel@freebsd.org using -f From: Marcel Moolenaar To: Perforce Change Reviews Subject: PERFORCE change 76708 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 May 2005 20:29:56 -0000 http://perforce.freebsd.org/chv.cgi?CH=76708 Change 76708 by marcel@marcel_nfs on 2005/05/08 20:29:27 Fill in the cn_name field of the consdev structure to avoid confusing (for the end-user) warnings. Quick and dirty. Will be cleaned up when get back to this code. Affected files ... .. //depot/projects/tty/sys/dev/vtc/vtc_con.c#2 edit .. //depot/projects/tty/sys/dev/vtc/vtc_core.c#3 edit Differences ... ==== //depot/projects/tty/sys/dev/vtc/vtc_con.c#2 (text+ko) ==== @@ -38,6 +38,8 @@ #include +extern char vtc_device_name[]; /* XXX Should be in a header file. */ + static cn_checkc_t vtc_cncheckc; static cn_getc_t vtc_cngetc; static cn_init_t vtc_cninit; @@ -66,6 +68,7 @@ cur_vc = vc; } } + strlcpy(cp->cn_name, vtc_device_name, sizeof(cp->cn_name)); cp->cn_arg = cur_vc; cp->cn_pri = (cur_vc != NULL) ? CN_INTERNAL : CN_DEAD; } ==== //depot/projects/tty/sys/dev/vtc/vtc_core.c#3 (text+ko) ==== @@ -33,13 +33,15 @@ #include #include +char vtc_device_name[] = "vtc"; + static int vtc_modevent(module_t mod, int type, void *data) { switch (type) { case MOD_LOAD: - printf("vtc: \n"); + printf("%s: \n", vtc_device_name); return (0); case MOD_UNLOAD: From owner-p4-projects@FreeBSD.ORG Sun May 8 20:42:10 2005 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 8651116A4E8; Sun, 8 May 2005 20:42:10 +0000 (GMT) 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 2B68916A4E6 for ; Sun, 8 May 2005 20:42:10 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1480343D39 for ; Sun, 8 May 2005 20:42:10 +0000 (GMT) (envelope-from csjp@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 j48Kg9Uv094555 for ; Sun, 8 May 2005 20:42:09 GMT (envelope-from csjp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j48Kg9N2094549 for perforce@freebsd.org; Sun, 8 May 2005 20:42:09 GMT (envelope-from csjp@freebsd.org) Date: Sun, 8 May 2005 20:42:09 GMT Message-Id: <200505082042.j48Kg9N2094549@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to csjp@freebsd.org using -f From: "Christian S.J. Peron" To: Perforce Change Reviews Subject: PERFORCE change 76709 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 May 2005 20:42:11 -0000 http://perforce.freebsd.org/chv.cgi?CH=76709 Change 76709 by csjp@csjp_xor on 2005/05/08 20:41:49 -unbreak the MACALL kernel build by adding options KDB which is now required by options DDB -add MAC_CHKEXEC to the MACALL kernel config -fix handling of sha1.h header file and adjust the Makefile to so that is does'nt have the sha1.h header hack. (I am not sure real sure why is was hooked into the build like this in the first place). Affected files ... .. //depot/projects/trustedbsd/mac/sys/i386/conf/MACALL#5 edit .. //depot/projects/trustedbsd/mac/sys/modules/mac_chkexec/Makefile#2 edit .. //depot/projects/trustedbsd/mac/sys/security/mac_chkexec/mac_chkexec.c#7 edit Differences ... ==== //depot/projects/trustedbsd/mac/sys/i386/conf/MACALL#5 (text+ko) ==== @@ -46,6 +46,7 @@ options MAC_SEEOTHERUIDS options MAC_STUB options MAC_TEST +options MAC_CHKEXEC #options SEBSD options SCHED_4BSD #4BSD scheduler @@ -79,7 +80,8 @@ # Debugging for use in -current options ALT_BREAK_TO_DEBUGGER options BREAK_TO_DEBUGGER -options DDB #Enable the kernel debugger +options KDB # Enable the kernel debugger +options DDB # Support DDB. options INVARIANTS #Enable calls of extra sanity checking options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS options WITNESS #Enable checks to detect deadlocks and cycles ==== //depot/projects/trustedbsd/mac/sys/modules/mac_chkexec/Makefile#2 (text+ko) ==== @@ -1,6 +1,6 @@ .PATH: ${.CURDIR}/../../crypto .PATH: ${.CURDIR}/../../security/mac_chkexec -CFLAGS+= -I${.CURDIR}/../../crypto -g +CFLAGS+= -g # # Un comment the following line to enable debugging CFLAGS+= -DDEBUG ==== //depot/projects/trustedbsd/mac/sys/security/mac_chkexec/mac_chkexec.c#7 (text+ko) ==== @@ -60,7 +60,7 @@ #include #include -#include "sha1.h" +#include /* * Prototypes From owner-p4-projects@FreeBSD.ORG Sun May 8 20:43:12 2005 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 2CA5016A4E8; Sun, 8 May 2005 20:43:12 +0000 (GMT) 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 0708B16A4E6 for ; Sun, 8 May 2005 20:43:12 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id CB67B43D76 for ; Sun, 8 May 2005 20:43:11 +0000 (GMT) (envelope-from marcel@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 j48KhBm9094648 for ; Sun, 8 May 2005 20:43:11 GMT (envelope-from marcel@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j48KhBAS094645 for perforce@freebsd.org; Sun, 8 May 2005 20:43:11 GMT (envelope-from marcel@freebsd.org) Date: Sun, 8 May 2005 20:43:11 GMT Message-Id: <200505082043.j48KhBAS094645@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to marcel@freebsd.org using -f From: Marcel Moolenaar To: Perforce Change Reviews Subject: PERFORCE change 76710 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 May 2005 20:43:13 -0000 http://perforce.freebsd.org/chv.cgi?CH=76710 Change 76710 by marcel@marcel_nfs on 2005/05/08 20:42:49 IFC @76707 Affected files ... .. //depot/projects/tty/lib/libarchive/archive_entry.c#5 integrate .. //depot/projects/tty/sys/dev/uart/uart_tty.c#7 integrate Differences ... ==== //depot/projects/tty/lib/libarchive/archive_entry.c#5 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include "archive_platform.h" -__FBSDID("$FreeBSD: src/lib/libarchive/archive_entry.c,v 1.25 2005/03/13 02:53:42 kientzle Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/archive_entry.c,v 1.26 2005/05/08 19:10:41 kientzle Exp $"); #include #include @@ -575,7 +575,8 @@ if (entry->ae_symlink.aes_mbs != NULL || entry->ae_symlink.aes_wcs != NULL) aes_set_mbs(&entry->ae_symlink, target); - aes_set_mbs(&entry->ae_hardlink, target); + else + aes_set_mbs(&entry->ae_hardlink, target); } void ==== //depot/projects/tty/sys/dev/uart/uart_tty.c#7 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/uart/uart_tty.c,v 1.21 2005/01/06 01:43:26 imp Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/uart/uart_tty.c,v 1.22 2005/05/08 20:25:09 marcel Exp $"); #include #include @@ -76,6 +76,7 @@ if (uart_probe(&uart_console)) return; + strlcpy(cp->cn_name, uart_driver_name, sizeof(cp->cn_name)); cp->cn_pri = (boothowto & RB_SERIAL) ? CN_REMOTE : CN_NORMAL; cp->cn_arg = &uart_console; } From owner-p4-projects@FreeBSD.ORG Sun May 8 23:05:04 2005 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id F2BC216A4E8; Sun, 8 May 2005 23:05:03 +0000 (GMT) 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 AC46716A4E6 for ; Sun, 8 May 2005 23:05:03 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 78B9B43D83 for ; Sun, 8 May 2005 23:05:03 +0000 (GMT) (envelope-from marcel@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 j48N539Q007043 for ; Sun, 8 May 2005 23:05:03 GMT (envelope-from marcel@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j48N53v3007036 for perforce@freebsd.org; Sun, 8 May 2005 23:05:03 GMT (envelope-from marcel@freebsd.org) Date: Sun, 8 May 2005 23:05:03 GMT Message-Id: <200505082305.j48N53v3007036@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to marcel@freebsd.org using -f From: Marcel Moolenaar To: Perforce Change Reviews Subject: PERFORCE change 76713 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 May 2005 23:05:04 -0000 http://perforce.freebsd.org/chv.cgi?CH=76713 Change 76713 by marcel@marcel_nfs on 2005/05/08 23:04:54 Initialization step 2b+3: Reprogram the graphics controller, reprogram the attribute controller and clear the frame buffer. While here again: Wait for the vertical retrace before we pull the sync. signals off the cable. This has 2 purposes; 1) it avoids flicker and 2) it makes sure the internal flip-flop of the attribute controller is reset. At this point, when the VGA is probed and is not the console, the display clears and we're in graphics mode. Time for the visual feedback of this -- show a beastie logo... Affected files ... .. //depot/projects/tty/sys/dev/vga/vga.c#8 edit Differences ... ==== //depot/projects/tty/sys/dev/vga/vga.c#8 (text+ko) ==== @@ -63,20 +63,38 @@ x = REG_READ(sc, VGA_GEN_MISC_OUTPUT_R); REG_WRITE(sc, VGA_GEN_MISC_OUTPUT_W, x | VGA_GEN_MO_IOA); + /* + * Wait for the vertical retrace. + * NOTE: this code reads the VGA_GEN_INPUT_STAT_1 register, which has + * the side-effect of clearing the internal flip-flip of the attribute + * controller's write register. This means that because this code is + * here, we know for sure that the first write to the attribute + * controller will be a write to the address register. Removing this + * code therefore also removes that guarantee and appropriate measures + * need to be taken. + */ + do { + x = REG_READ(sc, VGA_GEN_INPUT_STAT_1); + x &= VGA_GEN_IS1_VR | VGA_GEN_IS1_DE; + } while (x != (VGA_GEN_IS1_VR | VGA_GEN_IS1_DE)); + /* Now, disable the sync. signals. */ REG_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_MODE_CONTROL); x = REG_READ(sc, VGA_CRTC_DATA); REG_WRITE(sc, VGA_CRTC_DATA, x & ~VGA_CRTC_MC_HR); + /* + * Set the VGA adapter in mode 0x12 (640x480x16). + */ + /* Unprotect CRTC registers 0-7. */ REG_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_VERT_RETRACE_END); x = REG_READ(sc, VGA_CRTC_DATA); REG_WRITE(sc, VGA_CRTC_DATA, x & ~VGA_CRTC_VRE_PR); /* - * Set the VGA adapter in mode 0x12 (640x480x16). + * Reprogram the CRTC. */ - /* Reprogram the CRTC. */ REG_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_HORIZ_TOTAL); REG_WRITE(sc, VGA_CRTC_DATA, 0x5f); /* 760 */ REG_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_HORIZ_DISP_END); @@ -129,11 +147,17 @@ VGA_CRTC_MC_SRS | VGA_CRTC_MC_CMS); REG_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_LINE_COMPARE); REG_WRITE(sc, VGA_CRTC_DATA, 0xff); /* 480 + 31 */ - /* Reprogram the general registers. */ + + /* + * Reprogram the general registers. + */ REG_WRITE(sc, VGA_GEN_MISC_OUTPUT_W, VGA_GEN_MO_VSP | VGA_GEN_MO_HSP | VGA_GEN_MO_PB | VGA_GEN_MO_ER | VGA_GEN_MO_IOA); REG_WRITE(sc, VGA_GEN_FEATURE_CTRL_W, 0); - /* Reprogram the sequencer. */ + + /* + * Reprogram the sequencer. + */ REG_WRITE(sc, VGA_SEQ_ADDRESS, VGA_SEQ_RESET); REG_WRITE(sc, VGA_SEQ_DATA, VGA_SEQ_RST_SR | VGA_SEQ_RST_NAR); REG_WRITE(sc, VGA_SEQ_ADDRESS, VGA_SEQ_CLOCKING_MODE); @@ -142,13 +166,95 @@ REG_WRITE(sc, VGA_SEQ_DATA, VGA_SEQ_MM_EM3 | VGA_SEQ_MM_EM2 | VGA_SEQ_MM_EM1 | VGA_SEQ_MM_EM0); REG_WRITE(sc, VGA_SEQ_ADDRESS, VGA_SEQ_CHAR_MAP_SELECT); - REG_WRITE(sc, VGA_SEQ_DATA, 0x0); + REG_WRITE(sc, VGA_SEQ_DATA, 0); REG_WRITE(sc, VGA_SEQ_ADDRESS, VGA_SEQ_MEMORY_MODE); REG_WRITE(sc, VGA_SEQ_DATA, VGA_SEQ_MM_OE | VGA_SEQ_MM_EM); - /* Reprogram the attribute controller. */ - /* Reprogram the graphics controller. */ + + /* + * Reprogram the attribute controller. The internal flip-flop is + * known to be clear and the next first will be to the address + * register. + */ + REG_WRITE(sc, VGA_AC_WRITE, VGA_AC_PALETTE(0)); + REG_WRITE(sc, VGA_AC_WRITE, 0); + REG_WRITE(sc, VGA_AC_WRITE, VGA_AC_PALETTE(1)); + REG_WRITE(sc, VGA_AC_WRITE, VGA_AC_PAL_B); + REG_WRITE(sc, VGA_AC_WRITE, VGA_AC_PALETTE(2)); + REG_WRITE(sc, VGA_AC_WRITE, VGA_AC_PAL_G); + REG_WRITE(sc, VGA_AC_WRITE, VGA_AC_PALETTE(3)); + REG_WRITE(sc, VGA_AC_WRITE, VGA_AC_PAL_G | VGA_AC_PAL_B); + REG_WRITE(sc, VGA_AC_WRITE, VGA_AC_PALETTE(4)); + REG_WRITE(sc, VGA_AC_WRITE, VGA_AC_PAL_R); + REG_WRITE(sc, VGA_AC_WRITE, VGA_AC_PALETTE(5)); + REG_WRITE(sc, VGA_AC_WRITE, VGA_AC_PAL_R | VGA_AC_PAL_B); + REG_WRITE(sc, VGA_AC_WRITE, VGA_AC_PALETTE(6)); + REG_WRITE(sc, VGA_AC_WRITE, VGA_AC_PAL_SG | VGA_AC_PAL_R); + REG_WRITE(sc, VGA_AC_WRITE, VGA_AC_PALETTE(7)); + REG_WRITE(sc, VGA_AC_WRITE, VGA_AC_PAL_R | VGA_AC_PAL_G | VGA_AC_PAL_B); + REG_WRITE(sc, VGA_AC_WRITE, VGA_AC_PALETTE(8)); + REG_WRITE(sc, VGA_AC_WRITE, VGA_AC_PAL_SR | VGA_AC_PAL_SG | + VGA_AC_PAL_SB); + REG_WRITE(sc, VGA_AC_WRITE, VGA_AC_PALETTE(9)); + REG_WRITE(sc, VGA_AC_WRITE, VGA_AC_PAL_SR | VGA_AC_PAL_SG | + VGA_AC_PAL_SB | VGA_AC_PAL_B); + REG_WRITE(sc, VGA_AC_WRITE, VGA_AC_PALETTE(10)); + REG_WRITE(sc, VGA_AC_WRITE, VGA_AC_PAL_SR | VGA_AC_PAL_SG | + VGA_AC_PAL_SB | VGA_AC_PAL_G); + REG_WRITE(sc, VGA_AC_WRITE, VGA_AC_PALETTE(11)); + REG_WRITE(sc, VGA_AC_WRITE, VGA_AC_PAL_SR | VGA_AC_PAL_SG | + VGA_AC_PAL_SB | VGA_AC_PAL_G | VGA_AC_PAL_B); + REG_WRITE(sc, VGA_AC_WRITE, VGA_AC_PALETTE(12)); + REG_WRITE(sc, VGA_AC_WRITE, VGA_AC_PAL_SR | VGA_AC_PAL_SG | + VGA_AC_PAL_SB | VGA_AC_PAL_R); + REG_WRITE(sc, VGA_AC_WRITE, VGA_AC_PALETTE(13)); + REG_WRITE(sc, VGA_AC_WRITE, VGA_AC_PAL_SR | VGA_AC_PAL_SG | + VGA_AC_PAL_SB | VGA_AC_PAL_R | VGA_AC_PAL_B); + REG_WRITE(sc, VGA_AC_WRITE, VGA_AC_PALETTE(14)); + REG_WRITE(sc, VGA_AC_WRITE, VGA_AC_PAL_SR | VGA_AC_PAL_SG | + VGA_AC_PAL_SB | VGA_AC_PAL_R | VGA_AC_PAL_G); + REG_WRITE(sc, VGA_AC_WRITE, VGA_AC_PALETTE(15)); + REG_WRITE(sc, VGA_AC_WRITE, VGA_AC_PAL_SR | VGA_AC_PAL_SG | + VGA_AC_PAL_SB | VGA_AC_PAL_R | VGA_AC_PAL_G | VGA_AC_PAL_B); + REG_WRITE(sc, VGA_AC_WRITE, VGA_AC_MODE_CONTROL); + REG_WRITE(sc, VGA_AC_WRITE, VGA_AC_MC_GA); + REG_WRITE(sc, VGA_AC_WRITE, VGA_AC_OVERSCAN_COLOR); + REG_WRITE(sc, VGA_AC_WRITE, 0); + REG_WRITE(sc, VGA_AC_WRITE, VGA_AC_COLOR_PLANE_ENABLE); + REG_WRITE(sc, VGA_AC_WRITE, 0x0f); + REG_WRITE(sc, VGA_AC_WRITE, VGA_AC_HORIZ_PIXEL_PANNING); + REG_WRITE(sc, VGA_AC_WRITE, 0); + REG_WRITE(sc, VGA_AC_WRITE, VGA_AC_COLOR_SELECT); + REG_WRITE(sc, VGA_AC_WRITE, 0); + + /* + * Reprogram the graphics controller. + */ + REG_WRITE(sc, VGA_GC_ADDRESS, VGA_GC_SET_RESET); + REG_WRITE(sc, VGA_GC_DATA, 0); + REG_WRITE(sc, VGA_GC_ADDRESS, VGA_GC_ENABLE_SET_RESET); + REG_WRITE(sc, VGA_GC_DATA, 0); + REG_WRITE(sc, VGA_GC_ADDRESS, VGA_GC_COLOR_COMPARE); + REG_WRITE(sc, VGA_GC_DATA, 0); + REG_WRITE(sc, VGA_GC_ADDRESS, VGA_GC_DATA_ROTATE); + REG_WRITE(sc, VGA_GC_DATA, 0); + REG_WRITE(sc, VGA_GC_ADDRESS, VGA_GC_READ_MAP_SELECT); + REG_WRITE(sc, VGA_GC_DATA, 0); + REG_WRITE(sc, VGA_GC_ADDRESS, VGA_GC_MODE); + REG_WRITE(sc, VGA_GC_DATA, 0); + REG_WRITE(sc, VGA_GC_ADDRESS, VGA_GC_MISCELLANEOUS); + REG_WRITE(sc, VGA_GC_DATA, 0x04 + VGA_GC_MISC_GA); + REG_WRITE(sc, VGA_GC_ADDRESS, VGA_GC_COLOR_DONT_CARE); + REG_WRITE(sc, VGA_GC_DATA, 0x0f); + REG_WRITE(sc, VGA_GC_ADDRESS, VGA_GC_BIT_MASK); + REG_WRITE(sc, VGA_GC_DATA, 0xff); + + /* + * Done. Clear the frame buffer. All bit planes are enabled, so + * a single write should clear all planes. + */ + bus_space_set_multi_1(sc->vga_fb.bst, sc->vga_fb.bsh, 0, 0, 65536); - /* Enable the sync signals. */ + /* Re-enable the sync signals. */ REG_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_MODE_CONTROL); x = REG_READ(sc, VGA_CRTC_DATA); REG_WRITE(sc, VGA_CRTC_DATA, x | VGA_CRTC_MC_HR); From owner-p4-projects@FreeBSD.ORG Sun May 8 23:10:10 2005 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 5997416A4E8; Sun, 8 May 2005 23:10:10 +0000 (GMT) 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 34DB716A4E6 for ; Sun, 8 May 2005 23:10:10 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1DF2F43D49 for ; Sun, 8 May 2005 23:10:10 +0000 (GMT) (envelope-from sam@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 j48NAAbq007333 for ; Sun, 8 May 2005 23:10:10 GMT (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j48NA99Q007330 for perforce@freebsd.org; Sun, 8 May 2005 23:10:09 GMT (envelope-from sam@freebsd.org) Date: Sun, 8 May 2005 23:10:09 GMT Message-Id: <200505082310.j48NA99Q007330@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Subject: PERFORCE change 76714 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 May 2005 23:10:11 -0000 http://perforce.freebsd.org/chv.cgi?CH=76714 Change 76714 by sam@sam_ebb on 2005/05/08 23:09:20 set priority on outbound management frames Affected files ... .. //depot/projects/vap/sys/net80211/ieee80211_output.c#9 edit Differences ... ==== //depot/projects/vap/sys/net80211/ieee80211_output.c#9 (text+ko) ==== @@ -259,7 +259,7 @@ ieee80211_pwrsave(ni, m); goto reclaim; } - /* calculate priority so we can find the tx queue */ + /* calculate priority so drivers can find the tx queue */ if (ieee80211_classify(ni, m)) { IEEE80211_DPRINTF(vap, IEEE80211_MSG_OUTPUT, "%s: discard, classification failure\n", @@ -402,6 +402,9 @@ ether_sprintf(wh->i_addr1), __func__); wh->i_fc[1] |= IEEE80211_FC1_WEP; } + + IEEE80211_NODE_STAT(ni, tx_mgmt); + #ifdef IEEE80211_DEBUG /* avoid printing too many frames */ if ((ieee80211_msg_debug(vap) && doprint(vap, type)) || @@ -416,7 +419,12 @@ #endif BPF_MTAP(ifp, m); /* 802.11 tx path */ - IEEE80211_NODE_STAT(ni, tx_mgmt); + if (ni->ni_flags & IEEE80211_NODE_QOS) { + /* NB: force all management frames to highest queue */ + M_WME_SETAC(m, WME_AC_VO); + } else + M_WME_SETAC(m, WME_AC_BE); + IF_ENQUEUE(&ic->ic_mgtq, m); /* NB: alternate tx path */ if_start(ic->ic_ifp); /* dispatch to device */ return 0; From owner-p4-projects@FreeBSD.ORG Sun May 8 23:12:14 2005 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 12A1B16A4E8; Sun, 8 May 2005 23:12:14 +0000 (GMT) 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 C953216A4E6 for ; Sun, 8 May 2005 23:12:13 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9957F43D67 for ; Sun, 8 May 2005 23:12:13 +0000 (GMT) (envelope-from sam@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 j48NCDpr007522 for ; Sun, 8 May 2005 23:12:13 GMT (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j48NCD57007519 for perforce@freebsd.org; Sun, 8 May 2005 23:12:13 GMT (envelope-from sam@freebsd.org) Date: Sun, 8 May 2005 23:12:13 GMT Message-Id: <200505082312.j48NCD57007519@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Subject: PERFORCE change 76716 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 May 2005 23:12:14 -0000 http://perforce.freebsd.org/chv.cgi?CH=76716 Change 76716 by sam@sam_ebb on 2005/05/08 23:11:36 o assume 802.11 layer sets priority for outbound frames o count packets on base device (not quite right, we only count data frames on recv to avoid counting beacons while xmit stats include mgmt+ctl frames that come from above) Affected files ... .. //depot/projects/vap/sys/dev/ath/if_ath.c#8 edit Differences ... ==== //depot/projects/vap/sys/dev/ath/if_ath.c#8 (text+ko) ==== @@ -1375,12 +1375,8 @@ goto bad; } pktlen = bf->bf_m->m_pkthdr.len; /* NB: don't reference below */ - if (ath_tx_start(sc, ni, bf, bf->bf_m) == 0) { -#if 0 /*XXX*/ - ifp->if_opackets++; -#endif + if (ath_tx_start(sc, ni, bf, bf->bf_m) == 0) continue; - } bad: if (ni != NULL) ieee80211_free_node(ni); @@ -1601,10 +1597,6 @@ bfstaged, bf_list); ATH_TXBUF_UNLOCK(sc); } - } else { -#if 0 - ifp->if_opackets++; -#endif } } else { if (an->an_ff_buf[pri] != NULL) { @@ -1691,7 +1683,6 @@ continue; } } - ifp->if_opackets++; /* * Encapsulate the packet in prep for transmission. */ @@ -3680,6 +3671,10 @@ ds->ds_rxstat.rs_rssi, ds->ds_rxstat.rs_tstamp); } + if (type == IEEE80211_FC0_TYPE_DATA) { + ifp->if_ipackets++; + ifp->if_ibytes += len; + } if (sc->sc_diversity) { /* @@ -4124,6 +4119,7 @@ an = ATH_NODE(ni); flags = HAL_TXDESC_CLRDMASK; /* XXX needed for crypto errs */ + pri = M_WME_GETAC(m0); /* set by the 802.11 layer */ /* * Calculate Atheros packet type from IEEE80211 packet header, * setup for rate calculations, and select h/w transmit queue. @@ -4144,12 +4140,6 @@ if (shortPreamble) txrate |= rt->info[rix].shortPreamble; try0 = ATH_TXMAXTRY; - /* NB: force all management frames to highest queue */ - if (ni->ni_flags & IEEE80211_NODE_QOS) { - /* NB: force all management frames to highest queue */ - pri = WME_AC_VO; - } else - pri = WME_AC_BE; flags |= HAL_TXDESC_INTREQ; /* force interrupt */ break; case IEEE80211_FC0_TYPE_CTL: @@ -4158,12 +4148,6 @@ txrate = rt->info[rix].rateCode; if (shortPreamble) txrate |= rt->info[rix].shortPreamble; - /* NB: force all ctl frames to highest queue */ - if (ni->ni_flags & IEEE80211_NODE_QOS) { - /* NB: force all ctl frames to highest queue */ - pri = WME_AC_VO; - } else - pri = WME_AC_BE; flags |= HAL_TXDESC_INTREQ; /* force interrupt */ break; case IEEE80211_FC0_TYPE_DATA: @@ -4175,17 +4159,12 @@ &rix, &try0, &txrate); sc->sc_txrate = txrate; /* for LED blinking */ sc->sc_lastdatarix = rix; /* for fast frames */ - /* - * Default all non-QoS traffic to the best-effort queue. - */ if (wh->i_fc[0] & IEEE80211_FC0_SUBTYPE_QOS) { - pri = M_WME_GETAC(m0); if (cap->cap_wmeParams[pri].wmep_noackPolicy) { flags |= HAL_TXDESC_NOACK; sc->sc_stats.ast_tx_noack++; } - } else - pri = WME_AC_BE; + } break; default: if_printf(ifp, "bogus frame type 0x%x (%s)\n", @@ -4447,6 +4426,8 @@ ath_hal_txstart(ah, txq->axq_qnum); ATH_TXQ_UNLOCK(txq); + ifp->if_opackets++; + return 0; #undef updateCTSForBursting #undef CTS_DURATION From owner-p4-projects@FreeBSD.ORG Mon May 9 00:04:30 2005 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id BA60616A4E8; Mon, 9 May 2005 00:04:29 +0000 (GMT) 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 939C516A4E6 for ; Mon, 9 May 2005 00:04:29 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6B1FD43D7C for ; Mon, 9 May 2005 00:04:29 +0000 (GMT) (envelope-from marcel@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 j4904Tx5010053 for ; Mon, 9 May 2005 00:04:29 GMT (envelope-from marcel@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j4904TbM010050 for perforce@freebsd.org; Mon, 9 May 2005 00:04:29 GMT (envelope-from marcel@freebsd.org) Date: Mon, 9 May 2005 00:04:29 GMT Message-Id: <200505090004.j4904TbM010050@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to marcel@freebsd.org using -f From: Marcel Moolenaar To: Perforce Change Reviews Subject: PERFORCE change 76720 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 May 2005 00:04:30 -0000 http://perforce.freebsd.org/chv.cgi?CH=76720 Change 76720 by marcel@marcel_nfs on 2005/05/09 00:03:29 IFC @76719 Affected files ... .. //depot/projects/tty/share/man/man4/man4.i386/ep.4#9 integrate .. //depot/projects/tty/sys/compat/ndis/kern_windrv.c#3 integrate .. //depot/projects/tty/sys/compat/ndis/ntoskrnl_var.h#7 integrate .. //depot/projects/tty/sys/compat/ndis/subr_hal.c#7 integrate .. //depot/projects/tty/sys/dev/if_ndis/if_ndis_pccard.c#6 integrate .. //depot/projects/tty/sys/dev/if_ndis/if_ndis_pci.c#7 integrate .. //depot/projects/tty/sys/vm/vm_meter.c#8 integrate .. //depot/projects/tty/usr.sbin/ndiscvt/windrv_stub.c#2 integrate Differences ... ==== //depot/projects/tty/share/man/man4/man4.i386/ep.4#9 (text+ko) ==== @@ -27,7 +27,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/share/man/man4/man4.i386/ep.4,v 1.34 2005/02/13 23:45:49 ru Exp $ +.\" $FreeBSD: src/share/man/man4/man4.i386/ep.4,v 1.35 2005/05/08 22:36:10 imp Exp $ .\" .Dd September 5, 2004 .Dt EP 4 i386 @@ -94,7 +94,7 @@ .It 3Com 3C569B-J-TPO, 3C569B-J-COMBO CBUS .It -3Com 3C574-TX, 3CCFE574BT, 3CXFE574BT, 3C3FE574BT PCMCIA +3Com 3C574, 3C574TX, 3C574-TX, 3CCFE574BT, 3CXFE574BT, 3C3FE574BT PCMCIA .It 3Com 3C579-TP, 3C579-BNC EISA .It ==== //depot/projects/tty/sys/compat/ndis/kern_windrv.c#3 (text+ko) ==== @@ -31,7 +31,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/compat/ndis/kern_windrv.c,v 1.8 2005/04/24 20:21:21 wpaul Exp $"); +__FBSDID("$FreeBSD: src/sys/compat/ndis/kern_windrv.c,v 1.10 2005/05/08 23:19:20 wpaul Exp $"); #include #include @@ -204,7 +204,7 @@ STAILQ_FOREACH(d, &drvdb_head, link) { if (d->windrv_devlist == NULL) continue; - match = matchfunc(d->windrv_devlist, ctx); + match = matchfunc(d->windrv_bustype, d->windrv_devlist, ctx); if (match == TRUE) { mtx_unlock(&drvdb_mtx); return(d); @@ -307,6 +307,8 @@ return(0); } +#define WINDRV_LOADED htonl(0x42534F44) + /* * Loader routine for actual Windows driver modules, ultimately * calls the driver's DriverEntry() routine. @@ -327,12 +329,17 @@ struct drvdb_ent *new; struct driver_object *drv; int status; + uint32_t *ptr; /* * First step: try to relocate and dynalink the executable * driver image. */ + ptr = (uint32_t *)(img + 8); + if (*ptr == WINDRV_LOADED) + goto skipreloc; + /* Perform text relocation */ if (pe_relocate(img)) return(ENOEXEC); @@ -357,6 +364,10 @@ return(ENOEXEC); } + *ptr = WINDRV_LOADED; + +skipreloc: + /* Next step: find the driver entry point. */ pe_get_optional_header(img, &opt_hdr); ==== //depot/projects/tty/sys/compat/ndis/ntoskrnl_var.h#7 (text+ko) ==== @@ -29,7 +29,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/compat/ndis/ntoskrnl_var.h,v 1.34 2005/05/05 03:56:09 wpaul Exp $ + * $FreeBSD: src/sys/compat/ndis/ntoskrnl_var.h,v 1.35 2005/05/08 23:19:20 wpaul Exp $ */ #ifndef _NTOSKRNL_VAR_H_ @@ -1225,7 +1225,7 @@ extern image_patch_table ntoskrnl_functbl[]; typedef void (*funcptr)(void); -typedef int (*matchfuncptr)(void *, void *); +typedef int (*matchfuncptr)(interface_type, void *, void *); __BEGIN_DECLS extern int windrv_libinit(void); ==== //depot/projects/tty/sys/compat/ndis/subr_hal.c#7 (text+ko) ==== @@ -31,7 +31,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/compat/ndis/subr_hal.c,v 1.22 2005/05/05 03:56:09 wpaul Exp $"); +__FBSDID("$FreeBSD: src/sys/compat/ndis/subr_hal.c,v 1.23 2005/05/08 23:07:50 wpaul Exp $"); #include #include @@ -394,9 +394,9 @@ IMPORT_SFUNC(READ_PORT_ULONG, 1), IMPORT_SFUNC(READ_PORT_USHORT, 1), IMPORT_SFUNC(READ_PORT_UCHAR, 1), - IMPORT_SFUNC(READ_PORT_BUFFER_ULONG, 2), - IMPORT_SFUNC(READ_PORT_BUFFER_USHORT, 2), - IMPORT_SFUNC(READ_PORT_BUFFER_UCHAR, 2), + IMPORT_SFUNC(READ_PORT_BUFFER_ULONG, 3), + IMPORT_SFUNC(READ_PORT_BUFFER_USHORT, 3), + IMPORT_SFUNC(READ_PORT_BUFFER_UCHAR, 3), IMPORT_FFUNC(KfAcquireSpinLock, 1), IMPORT_FFUNC(KfReleaseSpinLock, 1), IMPORT_SFUNC(KeGetCurrentIrql, 0), ==== //depot/projects/tty/sys/dev/if_ndis/if_ndis_pccard.c#6 (text+ko) ==== @@ -31,7 +31,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/if_ndis/if_ndis_pccard.c,v 1.11 2005/04/24 20:21:22 wpaul Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/if_ndis/if_ndis_pccard.c,v 1.13 2005/05/08 23:19:20 wpaul Exp $"); #include #include @@ -69,7 +69,8 @@ static int ndis_attach_pccard (device_t); static struct resource_list *ndis_get_resource_list (device_t, device_t); -static int ndis_devcompare (struct ndis_pccard_type *, device_t); +static int ndis_devcompare (interface_type, + struct ndis_pccard_type *, device_t); extern int ndisdrv_modevent (module_t, int, void *); extern int ndis_attach (device_t); extern int ndis_shutdown (device_t); @@ -111,13 +112,17 @@ DRIVER_MODULE(ndis, pccard, ndis_driver, ndis_devclass, ndisdrv_modevent, 0); static int -ndis_devcompare(t, dev) +ndis_devcompare(bustype, t, dev) + interface_type bustype; struct ndis_pccard_type *t; device_t dev; { const char *prodstr, *vendstr; int error; + if (bustype != PCMCIABus) + return(FALSE); + error = pccard_get_product_str(dev, &prodstr); if (error) return(FALSE); @@ -185,7 +190,8 @@ db = windrv_match((matchfuncptr)ndis_devcompare, dev); if (db == NULL) return (ENXIO); - + sc->ndis_dobj = db->windrv_object; + sc->ndis_regvals = db->windrv_regvals; resource_list_init(&sc->ndis_rl); sc->ndis_io_rid = 0; ==== //depot/projects/tty/sys/dev/if_ndis/if_ndis_pci.c#7 (text+ko) ==== @@ -31,7 +31,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/if_ndis/if_ndis_pci.c,v 1.16 2005/05/08 02:06:57 wpaul Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/if_ndis/if_ndis_pci.c,v 1.17 2005/05/08 23:19:20 wpaul Exp $"); #include #include @@ -68,7 +68,8 @@ static int ndis_attach_pci (device_t); static struct resource_list *ndis_get_resource_list (device_t, device_t); -static int ndis_devcompare (struct ndis_pci_type *, device_t); +static int ndis_devcompare (interface_type, + struct ndis_pci_type *, device_t); extern int ndisdrv_modevent (module_t, int, void *); extern int ndis_attach (device_t); extern int ndis_shutdown (device_t); @@ -103,10 +104,14 @@ DRIVER_MODULE(ndis, cardbus, ndis_driver, ndis_devclass, ndisdrv_modevent, 0); static int -ndis_devcompare(t, dev) +ndis_devcompare(bustype, t, dev) + interface_type bustype; struct ndis_pci_type *t; device_t dev; { + if (bustype != PCIBus) + return(FALSE); + while(t->ndis_name != NULL) { if ((pci_get_vendor(dev) == t->ndis_vid) && (pci_get_device(dev) == t->ndis_did) && ==== //depot/projects/tty/sys/vm/vm_meter.c#8 (text+ko) ==== @@ -30,7 +30,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/vm/vm_meter.c,v 1.84 2005/04/12 23:15:28 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/vm/vm_meter.c,v 1.85 2005/05/08 23:56:16 marcel Exp $"); #include #include @@ -55,7 +55,7 @@ /* * Virtual memory MPSAFE temporary workarounds. */ -#if defined(__alpha__) || defined(__amd64__) || defined(__i386__) || defined(__sparc64__) +#if !defined(__arm__) && !defined(__powerpc__) int debug_mpsafevm = 1; #else int debug_mpsafevm; ==== //depot/projects/tty/usr.sbin/ndiscvt/windrv_stub.c#2 (text+ko) ==== @@ -31,7 +31,7 @@ */ #include -__FBSDID("$FreeBSD: src/usr.sbin/ndiscvt/windrv_stub.c,v 1.1 2005/04/24 20:21:22 wpaul Exp $"); +__FBSDID("$FreeBSD: src/usr.sbin/ndiscvt/windrv_stub.c,v 1.2 2005/05/08 23:07:51 wpaul Exp $"); #include #include @@ -71,14 +71,14 @@ #ifdef NDIS_PCI_DEV_TABLE -static struct ndis_pci_type ndis_devs[] = { +static struct ndis_pci_type ndis_devs_pci[] = { NDIS_PCI_DEV_TABLE { 0, 0, 0, NULL } }; #endif #ifdef NDIS_PCMCIA_DEV_TABLE -static struct ndis_pccard_type ndis_devs[] = { +static struct ndis_pccard_type ndis_devs_pccard[] = { NDIS_PCMCIA_DEV_TABLE { NULL, NULL, NULL } }; @@ -206,15 +206,6 @@ int error = 0; vm_offset_t drv_data_start; vm_offset_t drv_data_end; - interface_type drv_type; - -#ifdef NDIS_PCI_DEV_TABLE - drv_type = PCIBus; -#endif - -#ifdef NDIS_PCMCIA_DEV_TABLE - drv_type = PCMCIABus; -#endif drv_data_start = (vm_offset_t)&DRV_DATA_START; drv_data_end = (vm_offset_t)&DRV_DATA_END; @@ -225,14 +216,25 @@ windrv_loaded++; if (windrv_loaded > 1) break; - windrv_load(mod, drv_data_start, drv_data_len, drv_type, - ndis_devs, &ndis_regvals); +#ifdef NDIS_PCI_DEV_TABLE + windrv_load(mod, drv_data_start, drv_data_len, PCIBus, + ndis_devs_pci, &ndis_regvals); +#endif +#ifdef NDIS_PCMCIA_DEV_TABLE + windrv_load(mod, drv_data_start, drv_data_len, PCMCIABus, + ndis_devs_pccard, &ndis_regvals); +#endif break; case MOD_UNLOAD: windrv_loaded--; if (windrv_loaded > 0) break; +#ifdef NDIS_PCI_DEV_TABLE windrv_unload(mod, drv_data_start, drv_data_len); +#endif +#ifdef NDIS_PCMCIA_DEV_TABLE + windrv_unload(mod, drv_data_start, drv_data_len); +#endif break; case MOD_SHUTDOWN: break; From owner-p4-projects@FreeBSD.ORG Mon May 9 04:29:52 2005 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 4663216A4E8; Mon, 9 May 2005 04:29:52 +0000 (GMT) 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 1270E16A4E6 for ; Mon, 9 May 2005 04:29:52 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id DCC6943D5F for ; Mon, 9 May 2005 04:29:51 +0000 (GMT) (envelope-from sam@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 j494TpAw026427 for ; Mon, 9 May 2005 04:29:51 GMT (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j494TpB7026424 for perforce@freebsd.org; Mon, 9 May 2005 04:29:51 GMT (envelope-from sam@freebsd.org) Date: Mon, 9 May 2005 04:29:51 GMT Message-Id: <200505090429.j494TpB7026424@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Subject: PERFORCE change 76725 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 May 2005 04:29:52 -0000 http://perforce.freebsd.org/chv.cgi?CH=76725 Change 76725 by sam@sam_ebb on 2005/05/09 04:29:50 disambiguate mutex's Affected files ... .. //depot/projects/vap/sys/net80211/ieee80211_scan_sta.c#2 edit Differences ... ==== //depot/projects/vap/sys/net80211/ieee80211_scan_sta.c#2 (text+ko) ==== @@ -102,7 +102,7 @@ if (st == NULL) return 0; mtx_init(&st->st_lock, "stacache", "802.11 sta scan cache", MTX_DEF); - mtx_init(&st->st_scanlock, "stascan", "802.11 sta scan cache", MTX_DEF); + mtx_init(&st->st_scanlock, "stascan", "802.11 sta scangen", MTX_DEF); TAILQ_INIT(&st->st_entry); st->st_inact = IEEE80211_INACT_SCAN; ss->ss_priv = st; From owner-p4-projects@FreeBSD.ORG Mon May 9 04:30:54 2005 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id E2A8216A4E8; Mon, 9 May 2005 04:30:53 +0000 (GMT) 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 BEE9216A4E6 for ; Mon, 9 May 2005 04:30:53 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id A274243D48 for ; Mon, 9 May 2005 04:30:53 +0000 (GMT) (envelope-from sam@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 j494Ur6A026537 for ; Mon, 9 May 2005 04:30:53 GMT (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j494UriN026534 for perforce@freebsd.org; Mon, 9 May 2005 04:30:53 GMT (envelope-from sam@freebsd.org) Date: Mon, 9 May 2005 04:30:53 GMT Message-Id: <200505090430.j494UriN026534@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Subject: PERFORCE change 76726 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 May 2005 04:30:54 -0000 http://perforce.freebsd.org/chv.cgi?CH=76726 Change 76726 by sam@sam_ebb on 2005/05/09 04:30:35 o remove meaningless setup for wme on the com o auto-enable dynamic turbo Affected files ... .. //depot/projects/vap/sys/net80211/ieee80211.c#8 edit Differences ... ==== //depot/projects/vap/sys/net80211/ieee80211.c#8 (text+ko) ==== @@ -151,11 +151,6 @@ /* arbitrarily pick the first channel */ ic->ic_curchan = &ic->ic_channels[0]; - /* - * Enable WME by default if we're capable. - */ - if (ic->ic_caps & IEEE80211_C_WME) - ic->ic_flags |= IEEE80211_F_WME; /* NB: must be after ic_curchan is setup */ (void) ieee80211_setmode(ic, ic->ic_curmode); @@ -281,6 +276,8 @@ #endif if (vap->iv_caps & IEEE80211_C_FF) vap->iv_flags |= IEEE80211_F_FF; + if (vap->iv_caps & IEEE80211_C_TURBOP) + vap->iv_flags |= IEEE80211_F_TURBOP; vap->iv_des_chan = IEEE80211_CHAN_ANYC; /* any channel is ok */ vap->iv_dtim_period = IEEE80211_DTIM_DEFAULT; From owner-p4-projects@FreeBSD.ORG Mon May 9 04:33:58 2005 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 439AA16A4E8; Mon, 9 May 2005 04:33:58 +0000 (GMT) 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 0943A16A4E6 for ; Mon, 9 May 2005 04:33:58 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id DF98443D94 for ; Mon, 9 May 2005 04:33:57 +0000 (GMT) (envelope-from sam@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 j494Xvqu026627 for ; Mon, 9 May 2005 04:33:57 GMT (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j494XvHW026624 for perforce@freebsd.org; Mon, 9 May 2005 04:33:57 GMT (envelope-from sam@freebsd.org) Date: Mon, 9 May 2005 04:33:57 GMT Message-Id: <200505090433.j494XvHW026624@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Subject: PERFORCE change 76727 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 May 2005 04:33:58 -0000 http://perforce.freebsd.org/chv.cgi?CH=76727 Change 76727 by sam@sam_ebb on 2005/05/09 04:33:19 o add dynamic turbo base/boost switching based on beacon when operating in station mode o don't futz with the count of sta's in power save mode when operating in station mode; this insures drivers can use it to decide when to queue multicast frames (just started doing pwr-save stuff in station mode for background scanning) Affected files ... .. //depot/projects/vap/sys/net80211/ieee80211_input.c#9 edit .. //depot/projects/vap/sys/net80211/ieee80211_node.c#6 edit .. //depot/projects/vap/sys/net80211/ieee80211_node.h#6 edit Differences ... ==== //depot/projects/vap/sys/net80211/ieee80211_input.c#9 (text+ko) ==== @@ -533,7 +533,7 @@ IEEE80211_NODE_STAT_ADD(ni, rx_bytes, m->m_pkthdr.len); #define FF_LLC_SIZE (sizeof(struct ether_header) + sizeof(struct llc)) - if ((ni->ni_flags & IEEE80211_NODE_FF) && + if (IEEE80211_ATH_CAP(vap, ni, FF) && m->m_pkthdr.len >= 3*FF_LLC_SIZE) { struct llc *llc; @@ -1920,14 +1920,16 @@ caps |= IEEE80211_NODE_TURBOP; if (ath->ath_capability & ATHEROS_CAP_FAST_FRAME) caps |= IEEE80211_NODE_FF; + if (ath->ath_capability & ATHEROS_CAP_BOOST) + caps |= IEEE80211_NODE_BOOST; if ((ni->ni_flags ^ caps) & IEEE80211_NODE_ATH) { IEEE80211_NOTE(vap, IEEE80211_MSG_SUPERG, ni, - "ath ie: caps 0x%x defkeyix 0x%x, use 0x%x\n", + "ath ie: caps 0x%x defkeyix 0x%x, use 0x%x", ath->ath_capability, LE_READ_2(ath->ath_defkeyix), caps); ni->ni_flags = (ni->ni_flags &~ IEEE80211_NODE_ATH) | caps; return 1; } else - return 0; /* NB: no change */ + return 0; } void @@ -2298,8 +2300,22 @@ ieee80211_wme_updateparams(vap); } else ni->ni_flags &= ~IEEE80211_NODE_QOS; - if (scan.ath != NULL) - ieee80211_parse_athparams(ni, scan.ath, wh); + if (scan.ath != NULL && + ieee80211_parse_athparams(ni, scan.ath, wh) > 0 && + IEEE80211_ATH_CAP(vap, ni, TURBOP)) { + u_int16_t curflags, newflags; + /* + * Check for turbo mode switch. Calculate flags + * for the new mode and effect the switch. + */ + newflags = curflags = ic->ic_bsschan->ic_flags; + if (ni->ni_flags & IEEE80211_NODE_BOOST) + newflags |= IEEE80211_CHAN_TURBO; + else + newflags &= ~IEEE80211_CHAN_TURBO; + if (newflags != curflags) + ieee80211_dturbo_switch(ic, newflags); + } if (scan.doth != NULL) ieee80211_parse_dothparams(vap, scan.doth, wh); /* NB: don't need the rest of this */ @@ -2894,7 +2910,8 @@ struct mbuf *m; if (enable) { - if ((ni->ni_flags & IEEE80211_NODE_PWR_MGT) == 0) + if (vap->iv_opmode != IEEE80211_M_STA && + (ni->ni_flags & IEEE80211_NODE_PWR_MGT) == 0) vap->iv_ps_sta++; ni->ni_flags |= IEEE80211_NODE_PWR_MGT; IEEE80211_NOTE(vap, IEEE80211_MSG_POWER, ni, @@ -2902,7 +2919,8 @@ return; } - if (ni->ni_flags & IEEE80211_NODE_PWR_MGT) + if (vap->iv_opmode != IEEE80211_M_STA && + (ni->ni_flags & IEEE80211_NODE_PWR_MGT)) vap->iv_ps_sta--; ni->ni_flags &= ~IEEE80211_NODE_PWR_MGT; IEEE80211_NOTE(vap, IEEE80211_MSG_POWER, ni, ==== //depot/projects/vap/sys/net80211/ieee80211_node.c#6 (text+ko) ==== @@ -522,7 +522,8 @@ /* NB: preserve ni_table */ if (ni->ni_flags & IEEE80211_NODE_PWR_MGT) { - vap->iv_ps_sta--; + if (vap->iv_opmode != IEEE80211_M_STA) + vap->iv_ps_sta--; ni->ni_flags &= ~IEEE80211_NODE_PWR_MGT; IEEE80211_NOTE(vap, IEEE80211_MSG_POWER, ni, "power save mode off, %u sta's in ps mode", vap->iv_ps_sta); ==== //depot/projects/vap/sys/net80211/ieee80211_node.h#6 (text+ko) ==== @@ -105,6 +105,7 @@ #define IEEE80211_NODE_PWR_MGT 0x0010 /* power save mode enabled */ #define IEEE80211_NODE_FF 0x0020 /* Atheros fast-frames enabled*/ #define IEEE80211_NODE_TURBOP 0x0040 /* Atheros Turbo' enabled */ +#define IEEE80211_NODE_BOOST 0x0080 /* Atheros Turbo' boosted */ u_int16_t ni_associd; /* assoc response */ u_int16_t ni_txpower; /* current transmit power */ u_int16_t ni_vlan; /* vlan tag */ @@ -153,7 +154,8 @@ }; MALLOC_DECLARE(M_80211_NODE); -#define IEEE80211_NODE_ATH (IEEE80211_NODE_FF | IEEE80211_NODE_TURBOP) +#define IEEE80211_NODE_ATH \ + (IEEE80211_NODE_FF | IEEE80211_NODE_TURBOP | IEEE80211_NODE_BOOST) #define IEEE80211_NODE_AID(ni) IEEE80211_AID(ni->ni_associd) From owner-p4-projects@FreeBSD.ORG Mon May 9 04:35:00 2005 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 1F09B16A4E8; Mon, 9 May 2005 04:35:00 +0000 (GMT) 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 D736016A4E6 for ; Mon, 9 May 2005 04:34:59 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id B600243D2F for ; Mon, 9 May 2005 04:34:59 +0000 (GMT) (envelope-from sam@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 j494Yx9v026652 for ; Mon, 9 May 2005 04:34:59 GMT (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j494Yxnf026649 for perforce@freebsd.org; Mon, 9 May 2005 04:34:59 GMT (envelope-from sam@freebsd.org) Date: Mon, 9 May 2005 04:34:59 GMT Message-Id: <200505090434.j494Yxnf026649@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Subject: PERFORCE change 76728 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 May 2005 04:35:00 -0000 http://perforce.freebsd.org/chv.cgi?CH=76728 Change 76728 by sam@sam_ebb on 2005/05/09 04:34:28 o more tx fragmentation fixups/cleanups o fixup ath ie addition logic (not entirely right; more tbd) Affected files ... .. //depot/projects/vap/sys/net80211/ieee80211_output.c#10 edit Differences ... ==== //depot/projects/vap/sys/net80211/ieee80211_output.c#10 (text+ko) ==== @@ -63,7 +63,8 @@ static struct mbuf *ieee80211_encap_fastframe(struct ieee80211vap *vap, struct mbuf *m1, const struct ether_header *eh1, struct mbuf *m2, const struct ether_header *eh2); -static int ieee80211_frag(struct ieee80211vap *, struct mbuf *, int hdrsize); +static int ieee80211_fragment(struct ieee80211vap *, struct mbuf *, + u_int hdrsize, u_int ciphdrsize, u_int mtu); #ifdef IEEE80211_DEBUG /* @@ -833,7 +834,8 @@ } /* check if xmit fragmentation is required */ txfrag = (m->m_pkthdr.len > vap->iv_fragthreshold && - !IEEE80211_IS_MULTICAST(wh->i_addr1)); + !IEEE80211_IS_MULTICAST(wh->i_addr1) && + (m->m_flags & M_FF) == 0); /* NB: don't fragment ff's */ if (key != NULL) { /* * IEEE 802.1X: send EAPOL frames always in the clear. @@ -853,7 +855,8 @@ } } } - if (txfrag && !ieee80211_frag(vap, m, hdrsize)) + if (txfrag && !ieee80211_fragment(vap, m, hdrsize, + key != NULL ? key->wk_cipher->ic_header : 0, vap->iv_fragthreshold)) goto bad; IEEE80211_NODE_STAT(ni, tx_data); @@ -997,7 +1000,7 @@ } /* - * Fragment the frame according to the vap's threshold. + * Fragment the frame according to the specified mtu. * The size of the 802.11 header (w/o padding) is provided * so we don't need to recalculate it. We create a new * mbuf for each fragment and chain it through m_nextpkt; @@ -1005,22 +1008,24 @@ * packet's mbufs but that significantly more complicated. */ static int -ieee80211_frag(struct ieee80211vap *vap, struct mbuf *m0, int hdrsize) +ieee80211_fragment(struct ieee80211vap *vap, struct mbuf *m0, + u_int hdrsize, u_int ciphdrsize, u_int mtu) { struct ieee80211_frame *wh, *whf; struct mbuf *m, *prev, *next; - u_int fragno, fragsize, off, remainder; + u_int totalhdrsize, fragno, fragsize, off, remainder; wh = mtod(m0, struct ieee80211_frame *); + totalhdrsize = hdrsize + ciphdrsize; fragno = 1; - off = vap->iv_fragthreshold; + off = mtu - totalhdrsize; remainder = m0->m_pkthdr.len - off; prev = m0; KASSERT(prev->m_nextpkt == NULL, ("mbuf already chained?")); do { fragsize = remainder; - if (fragsize > vap->iv_fragthreshold) - fragsize = vap->iv_fragthreshold; + if (fragsize > mtu) + fragsize = mtu; KASSERT(fragsize < MCLBYTES, ("fragment size %u too big!", fragsize)); if (fragsize > MHLEN) @@ -1029,6 +1034,8 @@ m = m_gethdr(M_DONTWAIT, MT_DATA); if (m == NULL) goto bad; + /* leave room to prepend any cipher header */ + M_ALIGN(m, fragsize - ciphdrsize); /* form the header in the fragment */ whf = mtod(m, struct ieee80211_frame *); @@ -1040,10 +1047,11 @@ /* NB: destination is known to be contiguous */ /* XXX? datapad? */ - m_copydata(m0, off, fragsize - hdrsize, + m_copydata(m0, off, fragsize - totalhdrsize, mtod(m, u_int8_t *) + hdrsize); - m->m_len = fragsize; - m->m_pkthdr.len = fragsize; + m->m_len = fragsize - ciphdrsize; + m->m_pkthdr.len = fragsize - ciphdrsize; + m->m_flags |= M_FRAG; /* chain up the fragment */ prev->m_nextpkt = m; @@ -1052,12 +1060,13 @@ prev = m; /* deduct fragment just formed */ - remainder -= fragsize; - off += fragsize; + remainder -= fragsize - totalhdrsize; + off += fragsize - totalhdrsize; } while (remainder != 0); /* strip first mbuf now that everything has been copied */ - m_adj(m0, m0->m_pkthdr.len - vap->iv_fragthreshold); + m_adj(m0, m0->m_pkthdr.len - mtu); + m0->m_flags |= M_FIRSTFRAG | M_FRAG; return 1; bad: /* reclaim fragments but leave original frame for caller to free */ @@ -1417,11 +1426,12 @@ .ath_defkeyix = { 0x7f, 0xff, }, }; struct ieee80211_ath_ie *ath = (struct ieee80211_ath_ie *) frm; + struct ieee80211vap *vap = ni->ni_vap; memcpy(frm, &info, sizeof(info)); - if (ni->ni_flags & IEEE80211_NODE_FF) + if (IEEE80211_ATH_CAP(vap, ni, FF)) ath->ath_capability |= ATHEROS_CAP_FAST_FRAME; - if (ni->ni_flags & IEEE80211_NODE_TURBOP) + if (IEEE80211_ATH_CAP(vap, ni, TURBOP)) ath->ath_capability |= ATHEROS_CAP_TURBO_PRIME; return frm + sizeof(info); } @@ -1829,7 +1839,7 @@ frm = ieee80211_add_doth(frm, ic); if ((vap->iv_flags & IEEE80211_F_WME) && ni->ni_wme_ie != NULL) frm = ieee80211_add_wme_info(frm, &ic->ic_wme); - if (ni->ni_ath_ie != NULL) /* XXX */ + if (ni->ni_ath_ie != NULL) frm = ieee80211_add_ath(frm, ni); if (vap->iv_opt_ie != NULL) { memcpy(frm, vap->iv_opt_ie, vap->iv_opt_ie_len); From owner-p4-projects@FreeBSD.ORG Mon May 9 04:36:02 2005 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id EF63616A4E9; Mon, 9 May 2005 04:36:01 +0000 (GMT) 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 B26FD16A4E6 for ; Mon, 9 May 2005 04:36:01 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8F47D43D80 for ; Mon, 9 May 2005 04:36:01 +0000 (GMT) (envelope-from sam@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 j494a11F026780 for ; Mon, 9 May 2005 04:36:01 GMT (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j494a1pI026777 for perforce@freebsd.org; Mon, 9 May 2005 04:36:01 GMT (envelope-from sam@freebsd.org) Date: Mon, 9 May 2005 04:36:01 GMT Message-Id: <200505090436.j494a1pI026777@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Subject: PERFORCE change 76729 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 May 2005 04:36:02 -0000 http://perforce.freebsd.org/chv.cgi?CH=76729 Change 76729 by sam@sam_ebb on 2005/05/09 04:35:25 order channel list so selection gives priority to preferred channels (needs more work) Affected files ... .. //depot/projects/vap/sys/net80211/ieee80211_scan_ap.c#2 edit Differences ... ==== //depot/projects/vap/sys/net80211/ieee80211_scan_ap.c#2 (text+ko) ==== @@ -112,10 +112,10 @@ return 0; } -static int +static struct ieee80211_channel * find11gchannel(struct ieee80211com *ic, int i, int freq) { - const struct ieee80211_channel *c; + struct ieee80211_channel *c; int j; /* @@ -126,72 +126,169 @@ for (j = i+1; j < ic->ic_nchans; j++) { c = &ic->ic_channels[j]; if (c->ic_freq == freq && IEEE80211_IS_CHAN_ANYG(c)) - return 1; + return c; } for (j = 0; j < i; j++) { c = &ic->ic_channels[j]; if (c->ic_freq == freq && IEEE80211_IS_CHAN_ANYG(c)) - return 1; + return c; + } + return NULL; +} + +static void +add_channels(struct ieee80211com *ic, + struct ieee80211_scan_state *ss, + enum ieee80211_phymode mode, const u_int16_t freq[], int nfreq) +{ +#define N(a) (sizeof(a) / sizeof(a[0])) + static const u_int chanflags[] = { + IEEE80211_CHAN_B, /* IEEE80211_MODE_AUTO */ + IEEE80211_CHAN_A, /* IEEE80211_MODE_11A */ + IEEE80211_CHAN_B, /* IEEE80211_MODE_11B */ + IEEE80211_CHAN_PUREG, /* IEEE80211_MODE_11G */ + IEEE80211_CHAN_FHSS, /* IEEE80211_MODE_FH */ + IEEE80211_CHAN_108A, /* IEEE80211_MODE_TURBO_A */ + IEEE80211_CHAN_108G, /* IEEE80211_MODE_TURBO_G */ + }; + struct ieee80211_channel *c, *cg; + u_int modeflags; + int i; + + KASSERT(mode < N(chanflags), ("Unexpected mode %u", mode)); + modeflags = chanflags[mode]; + for (i = 0; i < nfreq; i++) { + c = ieee80211_find_channel(ic, freq[i], modeflags); + if (c == NULL || isclr(ic->ic_chan_active, c->ic_ieee)) + continue; + if (mode == IEEE80211_MODE_AUTO) { + /* + * XXX special-case 11b/g channels so we select + * the g channel if both are present. + */ + if (IEEE80211_IS_CHAN_B(c) && + (cg = find11gchannel(ic, i, c->ic_freq)) != NULL) + c = cg; + } + if (ss->ss_last >= IEEE80211_SCAN_MAX) + break; + ss->ss_chans[ss->ss_last++] = c; } - return 0; +#undef N } +static const u_int16_t rcl1[] = /* 8 FCC channel: 52, 56, 60, 64, 36, 40, 44, 48 */ +{ 5260, 5280, 5300, 5320, 5180, 5200, 5220, 5240 }; +static const u_int16_t rcl2[] = /* 4 MKK channels: 34, 38, 42, 46 */ +{ 5170, 5190, 5210, 5230 }; +static const u_int16_t rcl3[] = /* 2.4Ghz ch: 1,6,11,7,13 */ +{ 2412, 2437, 2462, 2442, 2472 }; +static const u_int16_t rcl4[] = /* 5 FCC channel: 149, 153, 161, 165 */ +{ 5745, 5765, 5785, 5805, 5825 }; +static const u_int16_t rcl7[] = /* 11 ETSI channel: 100,104,108,112,116,120,124,128,132,136,140 */ +{ 5500, 5520, 5540, 5560, 5580, 5600, 5620, 5640, 5660, 5680, 5700 }; +static const u_int16_t rcl8[] = /* 2.4Ghz ch: 2,3,4,5,8,9,10,12 */ +{ 2417, 2422, 2427, 2432, 2447, 2452, 2457, 2467 }; +static const u_int16_t rcl9[] = /* 2.4Ghz ch: 14 */ +{ 2484 }; +static const u_int16_t rcl10[] = /* Added Korean channels 2312-2372 */ +{ 2312, 2317, 2322, 2327, 2332, 2337, 2342, 2347, 2352, 2357, 2362, 2367, 2372 }; +static const u_int16_t rcl11[] = /* Added Japan channels in 4.9/5.0 spectrum */ +{ 5040, 5060, 5080, 4920, 4940, 4960, 4980 }; +#ifdef ATH_TURBO_SCAN +static const u_int16_t rcl5[] = /* 3 turbo channels */ +{ 5210, 5250, 5290 }; +static const u_int16_t rcl6[] = /* 2 turbo channels */ +{ 5760, 5800 }; +static const u_int16_t rcl6x[] = /* 4 FCC3 turbo channels */ +{ 5540, 5580, 5620, 5660 }; +static const u_int16_t rcl12[] = /* 2.4Ghz Turbo channel 6 */ +{ 2437 }; +#endif /* ATH_TURBO_SCAN */ + +static const struct { + u_int16_t mode; + u_int16_t count; + const u_int16_t *list; +} scanTable[] = { +#define X(a) .count = sizeof(a)/sizeof(a[0]), .list = a + { IEEE80211_MODE_11B, X(rcl3) }, + { IEEE80211_MODE_11A, X(rcl1) }, + { IEEE80211_MODE_11A, X(rcl2) }, + { IEEE80211_MODE_11B, X(rcl8) }, + { IEEE80211_MODE_11B, X(rcl9) }, + { IEEE80211_MODE_11A, X(rcl4) }, +#ifdef ATH_TURBO_SCAN + { IEEE80211_MODE_TURBO_A, X(rcl5) }, + { IEEE80211_MODE_TURBO_A, X(rcl6) }, + { IEEE80211_MODE_TURBO_A, X(rcl6x) }, +#endif /* ATH_TURBO_SCAN */ + { IEEE80211_MODE_11A, X(rcl7) }, + { IEEE80211_MODE_11B, X(rcl10) }, + { IEEE80211_MODE_11A, X(rcl11) }, +#ifdef ATH_TURBO_SCAN + { IEEE80211_MODE_TURBO_G, X(rcl12) }, +#endif /* ATH_TURBO_SCAN */ +#undef X +}; + /* * Start an ap scan. */ static int ap_start(struct ieee80211_scan_state *ss, struct ieee80211vap *vap) { +#define N(a) (sizeof(a) / sizeof(a[0])) struct ieee80211com *ic = vap->iv_ic; - struct ieee80211_channel *c; + enum ieee80211_phymode mode; int i; ss->ss_last = 0; - if (vap->iv_des_mode == IEEE80211_MODE_AUTO) { - for (i = 0; i < ic->ic_nchans; i++) { - c = &ic->ic_channels[i]; - if (IEEE80211_IS_CHAN_TURBO(c)) { -#ifdef IEEE80211_F_XR - /* XR is not supported on turbo channels */ - if (vap->iv_flags & IEEE80211_F_XR) - continue; -#endif - /* dynamic channels are scanned in base mode */ - if (!IEEE80211_IS_CHAN_ST(c)) - continue; - } else { + /* + * Use the table of ordered channels to construct the list + * of channels for scanning. Any channels in the ordered + * list not in the master list will be discarded. + * XXX add channels not listed in fixed tables + */ + for (i = 0; i < N(scanTable); i++) { + mode = scanTable[i].mode; + if (vap->iv_des_mode != IEEE80211_MODE_AUTO) { + /* + * If a desired mode was specified, scan only + * channels that satisfy that constraint. + */ + if (vap->iv_des_mode != mode) { /* - * Use any 11g channel instead of 11b one. + * The scan table marks 2.4Ghz channels as b + * so if the desired mode is 11g, then use + * the 11b channel list but upgrade the mode. */ - if (IEEE80211_IS_CHAN_B(c) && - find11gchannel(ic, i, c->ic_freq)) + if (vap->iv_des_mode != IEEE80211_MODE_11G || + mode != IEEE80211_MODE_11B) continue; + mode = IEEE80211_MODE_11G; /* upgrade */ } - if (ss->ss_last >= IEEE80211_SCAN_MAX) - break; - ss->ss_chans[ss->ss_last++] = c; + } else { + /* + * This lets ieee80211_scan_add_channels + * upgrade an 11b channel to 11g if available. + */ + if (mode == IEEE80211_MODE_11B) + mode = IEEE80211_MODE_AUTO; } - } else { - static const u_int chanflags[] = { - 0, /* IEEE80211_MODE_AUTO */ - IEEE80211_CHAN_A, /* IEEE80211_MODE_11A */ - IEEE80211_CHAN_B, /* IEEE80211_MODE_11B */ - IEEE80211_CHAN_PUREG, /* IEEE80211_MODE_11G */ - IEEE80211_CHAN_FHSS, /* IEEE80211_MODE_FH */ - IEEE80211_CHAN_108A, /* IEEE80211_MODE_TURBO_A */ - IEEE80211_CHAN_108G, /* IEEE80211_MODE_TURBO_G */ - }; - u_int modeflags; - - modeflags = chanflags[vap->iv_des_mode]; - for (i = 0; i < ic->ic_nchans; i++) { - c = &ic->ic_channels[i]; - if ((c->ic_flags & modeflags) != modeflags) - continue; - if (ss->ss_last >= IEEE80211_SCAN_MAX) - break; - ss->ss_chans[ss->ss_last++] = c; - } +#ifdef IEEE80211_F_XR + /* XR does not operate on turbo channels */ + if ((vap->iv_flags & IEEE80211_F_XR) && + (mode == IEEE80211_MODE_TURBO_A || + mode == IEEE80211_MODE_TURBO_G)) + continue; +#endif + /* + * Add the list of the channels; any that are not + * in the master channel list will be discarded. + */ + add_channels(ic, ss, mode, + scanTable[i].list, scanTable[i].count); } ss->ss_next = 0; /* XXX tunables */ @@ -210,6 +307,7 @@ #endif /* IEEE80211_DEBUG */ return ap_restart(ss, vap); +#undef N } /* From owner-p4-projects@FreeBSD.ORG Mon May 9 04:37:04 2005 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id C016F16A4E8; Mon, 9 May 2005 04:37:03 +0000 (GMT) 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 9C26616A4E6 for ; Mon, 9 May 2005 04:37:03 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 67A6643D7B for ; Mon, 9 May 2005 04:37:03 +0000 (GMT) (envelope-from sam@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 j494b3iS026821 for ; Mon, 9 May 2005 04:37:03 GMT (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j494b32N026818 for perforce@freebsd.org; Mon, 9 May 2005 04:37:03 GMT (envelope-from sam@freebsd.org) Date: Mon, 9 May 2005 04:37:03 GMT Message-Id: <200505090437.j494b32N026818@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Subject: PERFORCE change 76730 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 May 2005 04:37:04 -0000 http://perforce.freebsd.org/chv.cgi?CH=76730 Change 76730 by sam@sam_ebb on 2005/05/09 04:36:50 o get correct rate table for turboA o check for ff usage properly o more tx fragmentation stuff Affected files ... .. //depot/projects/vap/sys/dev/ath/if_ath.c#9 edit Differences ... ==== //depot/projects/vap/sys/dev/ath/if_ath.c#9 (text+ko) ==== @@ -1663,7 +1663,7 @@ pri = M_WME_GETAC(m); txq = sc->sc_ac2q[pri]; - if (ni->ni_flags & IEEE80211_NODE_FF) { + if (IEEE80211_ATH_CAP(ni->ni_vap, ni, FF)) { /* * Check queue length; if too deep drop this * frame (tail drop considered good). @@ -4032,7 +4032,8 @@ cip = k->wk_cipher; hdrlen += cip->ic_header; pktlen += cip->ic_header + cip->ic_trailer; - if ((k->wk_flags & IEEE80211_KEY_SWMIC) == 0) + if ((k->wk_flags & IEEE80211_KEY_SWMIC) == 0 && + (m0->m_flags & M_FRAG) == 0) pktlen += cip->ic_miclen; keyix = k->wk_keyix; @@ -4192,8 +4193,7 @@ if (ismcast) { flags |= HAL_TXDESC_NOACK; /* no ack on broad/multicast */ sc->sc_stats.ast_tx_noack++; - } else if (pktlen > vap->iv_rtsthreshold && - !IEEE80211_ATH_CAP(vap, ni, FF)) { + } else if (pktlen > vap->iv_rtsthreshold && (m0->m_flags & M_FF) == 0) { flags |= HAL_TXDESC_RTSENA; /* RTS based on frame length */ cix = rt->info[rix].controlRate; sc->sc_stats.ast_tx_rts++; @@ -4230,6 +4230,13 @@ dur = rt->info[rix].spAckDuration; else dur = rt->info[rix].lpAckDuration; + if (wh->i_fc[1] & IEEE80211_FC1_MORE_FRAG) { + KASSERT(m0->m_nextpkt != NULL, + ("next fragment missing, fc[1] 0x%x", wh->i_fc[1])); + /* SIFS+ACK+time for next fragment */ + dur += dur + ath_hal_computetxtime(ah, rt, + m0->m_nextpkt->m_len, rix, shortPreamble); + } *(u_int16_t *)wh->i_dur = htole16(dur); } @@ -5323,7 +5330,7 @@ sc->sc_rates[mode] = ath_hal_getratetable(ah, HAL_MODE_11G); break; case IEEE80211_MODE_TURBO_A: - sc->sc_rates[mode] = ath_hal_getratetable(ah, HAL_MODE_108A); + sc->sc_rates[mode] = ath_hal_getratetable(ah, HAL_MODE_TURBO); break; case IEEE80211_MODE_TURBO_G: sc->sc_rates[mode] = ath_hal_getratetable(ah, HAL_MODE_108G); From owner-p4-projects@FreeBSD.ORG Mon May 9 15:36:28 2005 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 71B1716A4EC; Mon, 9 May 2005 15:36:28 +0000 (GMT) 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 41EA416A4E9 for ; Mon, 9 May 2005 15:36:28 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2E91243D77 for ; Mon, 9 May 2005 15:36:28 +0000 (GMT) (envelope-from sam@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 j49FaSWf075966 for ; Mon, 9 May 2005 15:36:28 GMT (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j49FaR5x075963 for perforce@freebsd.org; Mon, 9 May 2005 15:36:27 GMT (envelope-from sam@freebsd.org) Date: Mon, 9 May 2005 15:36:27 GMT Message-Id: <200505091536.j49FaR5x075963@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Subject: PERFORCE change 76751 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 May 2005 15:36:29 -0000 http://perforce.freebsd.org/chv.cgi?CH=76751 Change 76751 by sam@sam_ebb on 2005/05/09 15:36:15 fix mismerge; ap mode works Affected files ... .. //depot/projects/vap/sys/dev/ath/if_ath.c#10 edit .. //depot/projects/vap/sys/dev/ath/if_athvar.h#6 edit Differences ... ==== //depot/projects/vap/sys/dev/ath/if_ath.c#10 (text+ko) ==== @@ -2766,8 +2766,6 @@ * Enable the CAB queue before the beacon queue to * insure cab frames are triggered by this beacon. */ - if (sc->sc_boff.bo_tim[4] & 1) /* NB: only at DTIM */ - ath_hal_txstart(ah, cabq->axq_qnum); if (avp->av_boff.bo_tim[4] & 1) { /* NB: only at DTIM */ struct ath_buf *bfmcast; /* ==== //depot/projects/vap/sys/dev/ath/if_athvar.h#6 (text+ko) ==== @@ -330,7 +330,6 @@ u_int sc_bmisscount; /* missed beacon transmits */ u_int32_t sc_ant_tx[8]; /* recent tx frames/antenna */ struct ath_txq *sc_cabq; /* tx q for cab frames */ - struct ieee80211_beacon_offsets sc_boff;/* dynamic update state */ struct task sc_bmisstask; /* bmiss int processing */ struct task sc_bstucktask; /* stuck beacon processing */ enum { From owner-p4-projects@FreeBSD.ORG Mon May 9 16:17:18 2005 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 0EDAD16A4EA; Mon, 9 May 2005 16:17:18 +0000 (GMT) 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 D4E3A16A4E8 for ; Mon, 9 May 2005 16:17:17 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9F89343D96 for ; Mon, 9 May 2005 16:17:17 +0000 (GMT) (envelope-from sam@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 j49GHH0w077824 for ; Mon, 9 May 2005 16:17:17 GMT (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j49GHHhv077821 for perforce@freebsd.org; Mon, 9 May 2005 16:17:17 GMT (envelope-from sam@freebsd.org) Date: Mon, 9 May 2005 16:17:17 GMT Message-Id: <200505091617.j49GHHhv077821@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Subject: PERFORCE change 76752 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 May 2005 16:17:19 -0000 http://perforce.freebsd.org/chv.cgi?CH=76752 Change 76752 by sam@sam_ebb on 2005/05/09 16:16:16 dump compatibility baggage Affected files ... .. //depot/projects/vap/sys/net80211/ieee80211_ioctl.c#8 edit .. //depot/projects/vap/sys/net80211/ieee80211_var.h#9 edit Differences ... ==== //depot/projects/vap/sys/net80211/ieee80211_ioctl.c#8 (text+ko) ==== @@ -93,378 +93,7 @@ ieee80211_init_scan(&vap->iv_if, 0); } -/* - * XXX - * Wireless LAN specific configuration interface, which is compatible - * with wicontrol(8). - */ - -struct wi_read_ap_args { - int i; /* result count */ - struct wi_apinfo *ap; /* current entry in result buffer */ - caddr_t max; /* result buffer bound */ - struct ieee80211com *ic; -}; - -static void -wi_read_ap_result(void *arg, const struct ieee80211_scan_entry *se) -{ - struct wi_read_ap_args *sa = arg; - struct ieee80211com *ic = sa->ic; - struct wi_apinfo *ap = sa->ap; - int j; - - if ((caddr_t)(ap + 1) > sa->max) - return; - memset(ap, 0, sizeof(struct wi_apinfo)); - IEEE80211_ADDR_COPY(ap->bssid, se->se_bssid); - ap->namelen = se->se_ssid[1]; - if (ap->namelen) - memcpy(ap->name, se->se_ssid+2, ap->namelen); - ap->channel = ieee80211_chan2ieee(ic, se->se_chan); - ap->signal = se->se_rssi; - ap->capinfo = se->se_capinfo; - ap->interval = se->se_intval; - for (j = 0; j < se->se_rates[1]; j++) { - if (se->se_rates[j] & IEEE80211_RATE_BASIC) { - ap->rate = (se->se_rates[j] & - IEEE80211_RATE_VAL) * 5; /* XXX */ - } - } - for (j = 0; j < se->se_xrates[1]; j++) { - if (se->se_xrates[j] & IEEE80211_RATE_BASIC) { - ap->rate = (se->se_xrates[j] & - IEEE80211_RATE_VAL) * 5; /* XXX */ - } - } - sa->i++; - sa->ap++; -} - -struct wi_read_prism2_args { - int i; /* result count */ - struct wi_scan_res *res;/* current entry in result buffer */ - caddr_t max; /* result buffer bound */ - struct ieee80211com *ic; -}; - -static void -wi_read_prism2_result(void *arg, const struct ieee80211_scan_entry *se) -{ - struct wi_read_prism2_args *sa = arg; - struct ieee80211com *ic = sa->ic; - struct wi_scan_res *res = sa->res; - int nr, nxr; - - if ((caddr_t)(res + 1) > sa->max) - return; - res->wi_chan = ieee80211_chan2ieee(ic, se->se_chan); - res->wi_noise = 0; - res->wi_signal = se->se_rssi; - IEEE80211_ADDR_COPY(res->wi_bssid, se->se_bssid); - res->wi_interval = se->se_intval; - res->wi_capinfo = se->se_capinfo; - res->wi_ssid_len = se->se_ssid[1]; - memcpy(res->wi_ssid, se->se_ssid+2, IEEE80211_NWID_LEN); - /* NB: assumes wi_srates holds <= ni->ni_rates */ - nr = se->se_rates[1]; - memcpy(res->wi_srates, se->se_rates+2, nr); - nxr = se->se_xrates[1]; - memcpy(res->wi_srates+nr, se->se_xrates+2, nxr); - if (nr+nxr < 10) - res->wi_srates[nr+nxr] = 0; - res->wi_rate = 0; /* XXX no current rate */ - res->wi_rsvd = 0; - - sa->i++; - sa->res++; -} - -struct wi_read_sigcache_args { - int i; /* result count */ - struct wi_sigcache *wsc;/* current entry in result buffer */ - caddr_t max; /* result buffer bound */ - struct ieee80211vap *vap; -}; - -static void -wi_read_sigcache(void *arg, struct ieee80211_node *ni) -{ - struct wi_read_sigcache_args *sa = arg; - struct wi_sigcache *wsc = sa->wsc; - - if ((caddr_t)(wsc + 1) > sa->max) - return; - if (ni->ni_vap != sa->vap) - return; - memset(wsc, 0, sizeof(struct wi_sigcache)); - IEEE80211_ADDR_COPY(wsc->macsrc, ni->ni_macaddr); - wsc->signal = sa->vap->iv_ic->ic_node_getrssi(ni); - - sa->wsc++; - sa->i++; -} - -int -ieee80211_cfgget(struct ifnet *ifp, u_long cmd, caddr_t data) -{ - struct ieee80211vap *vap = ifp->if_softc; - struct ieee80211com *ic = vap->iv_ic; - int i, j, error; - struct ifreq *ifr = (struct ifreq *)data; - struct wi_req wreq; - struct wi_ltv_keys *keys; - - error = copyin(ifr->ifr_data, &wreq, sizeof(wreq)); - if (error) - return error; - wreq.wi_len = 0; - switch (wreq.wi_type) { - case WI_RID_SERIALNO: - /* nothing appropriate */ - break; - case WI_RID_NODENAME: - strcpy((char *)&wreq.wi_val[1], hostname); - wreq.wi_val[0] = htole16(strlen(hostname)); - wreq.wi_len = (1 + strlen(hostname) + 1) / 2; - break; - case WI_RID_CURRENT_SSID: - if (vap->iv_state != IEEE80211_S_RUN) { - wreq.wi_val[0] = 0; - wreq.wi_len = 1; - break; - } - wreq.wi_val[0] = htole16(vap->iv_bss->ni_esslen); - memcpy(&wreq.wi_val[1], vap->iv_bss->ni_essid, - vap->iv_bss->ni_esslen); - wreq.wi_len = (1 + vap->iv_bss->ni_esslen + 1) / 2; - break; - case WI_RID_OWN_SSID: - case WI_RID_DESIRED_SSID: - wreq.wi_val[0] = htole16(vap->iv_des_esslen); - memcpy(&wreq.wi_val[1], vap->iv_des_essid, vap->iv_des_esslen); - wreq.wi_len = (1 + vap->iv_des_esslen + 1) / 2; - break; - case WI_RID_CURRENT_BSSID: - if (vap->iv_state == IEEE80211_S_RUN) - IEEE80211_ADDR_COPY(wreq.wi_val, vap->iv_bss->ni_bssid); - else - memset(wreq.wi_val, 0, IEEE80211_ADDR_LEN); - wreq.wi_len = IEEE80211_ADDR_LEN / 2; - break; - case WI_RID_CHANNEL_LIST: - memset(wreq.wi_val, 0, sizeof(wreq.wi_val)); - /* - * Since channel 0 is not available for DS, channel 1 - * is assigned to LSB on WaveLAN. - */ - if (ic->ic_phytype == IEEE80211_T_DS) - i = 1; - else - i = 0; - for (j = 0; i <= IEEE80211_CHAN_MAX; i++, j++) - if (isset(ic->ic_chan_avail, i)) { - setbit((u_int8_t *)wreq.wi_val, j); - wreq.wi_len = j / 16 + 1; - } - break; - case WI_RID_OWN_CHNL: - wreq.wi_val[0] = htole16( - ieee80211_chan2ieee(ic, ic->ic_bsschan)); - wreq.wi_len = 1; - break; - case WI_RID_CURRENT_CHAN: - wreq.wi_val[0] = htole16( - ieee80211_chan2ieee(ic, ic->ic_curchan)); - wreq.wi_len = 1; - break; - case WI_RID_COMMS_QUALITY: - wreq.wi_val[0] = 0; /* quality */ - wreq.wi_val[1] = htole16(ic->ic_node_getrssi(vap->iv_bss)); - wreq.wi_val[2] = 0; /* noise */ - wreq.wi_len = 3; - break; - case WI_RID_PROMISC: - wreq.wi_val[0] = htole16((ifp->if_flags & IFF_PROMISC) ? 1 : 0); - wreq.wi_len = 1; - break; - case WI_RID_PORTTYPE: - wreq.wi_val[0] = htole16(vap->iv_opmode); - wreq.wi_len = 1; - break; - case WI_RID_MAC_NODE: - IEEE80211_ADDR_COPY(wreq.wi_val, vap->iv_myaddr); - wreq.wi_len = IEEE80211_ADDR_LEN / 2; - break; - case WI_RID_TX_RATE: - if (vap->iv_fixed_rate != -1 && - ic->ic_bsschan != IEEE80211_CHAN_ANYC) { - i = ieee80211_chan2mode(ic->ic_bsschan); - j = ic->ic_sup_rates[i].rs_rates[vap->iv_fixed_rate] & IEEE80211_RATE_VAL; - wreq.wi_val[0] = htole16(j / 2); - } else - wreq.wi_val[0] = 0; /* auto */ - wreq.wi_len = 1; - break; - case WI_RID_CUR_TX_RATE: - wreq.wi_val[0] = htole16( - (vap->iv_bss->ni_rates.rs_rates[vap->iv_bss->ni_txrate] & - IEEE80211_RATE_VAL) / 2); - wreq.wi_len = 1; - break; - case WI_RID_RTS_THRESH: - wreq.wi_val[0] = htole16(vap->iv_rtsthreshold); - wreq.wi_len = 1; - break; - case WI_RID_CREATE_IBSS: - wreq.wi_val[0] = - htole16((vap->iv_flags & IEEE80211_F_IBSSON) ? 1 : 0); - wreq.wi_len = 1; - break; - case WI_RID_MICROWAVE_OVEN: - wreq.wi_val[0] = 0; /* no ... not supported */ - wreq.wi_len = 1; - break; - case WI_RID_ROAMING_MODE: - wreq.wi_val[0] = htole16(ic->ic_roaming); /* XXX map */ - wreq.wi_len = 1; - break; - case WI_RID_SYSTEM_SCALE: - wreq.wi_val[0] = htole16(1); /* low density ... not supp */ - wreq.wi_len = 1; - break; - case WI_RID_PM_ENABLED: - wreq.wi_val[0] = - htole16((vap->iv_flags & IEEE80211_F_PMGTON) ? 1 : 0); - wreq.wi_len = 1; - break; - case WI_RID_MAX_SLEEP: - wreq.wi_val[0] = htole16(ic->ic_lintval); - wreq.wi_len = 1; - break; - case WI_RID_CUR_BEACON_INT: - wreq.wi_val[0] = htole16(vap->iv_bss->ni_intval); - wreq.wi_len = 1; - break; - case WI_RID_WEP_AVAIL: - wreq.wi_val[0] = htole16(1); /* always available */ - wreq.wi_len = 1; - break; - case WI_RID_CNFAUTHMODE: - wreq.wi_val[0] = htole16(1); /* TODO: open system only */ - wreq.wi_len = 1; - break; - case WI_RID_ENCRYPTION: - wreq.wi_val[0] = - htole16((vap->iv_flags & IEEE80211_F_PRIVACY) ? 1 : 0); - wreq.wi_len = 1; - break; - case WI_RID_TX_CRYPT_KEY: - wreq.wi_val[0] = htole16(vap->iv_def_txkey); - wreq.wi_len = 1; - break; - case WI_RID_DEFLT_CRYPT_KEYS: - keys = (struct wi_ltv_keys *)&wreq; - /* do not show keys to non-root user */ - error = suser(curthread); - if (error) { - memset(keys, 0, sizeof(*keys)); - error = 0; - break; - } - for (i = 0; i < IEEE80211_WEP_NKID; i++) { - keys->wi_keys[i].wi_keylen = - htole16(vap->iv_nw_keys[i].wk_keylen); - memcpy(keys->wi_keys[i].wi_keydat, - vap->iv_nw_keys[i].wk_key, - vap->iv_nw_keys[i].wk_keylen); - } - wreq.wi_len = sizeof(*keys) / 2; - break; - case WI_RID_MAX_DATALEN: - wreq.wi_val[0] = htole16(vap->iv_fragthreshold); - wreq.wi_len = 1; - break; - case WI_RID_IFACE_STATS: - /* XXX: should be implemented in lower drivers */ - break; - case WI_RID_READ_APS: - /* - * Don't return results until active scan completes. - */ - if ((ic->ic_flags & IEEE80211_F_SCAN) == 0) { - struct wi_read_ap_args args; - - args.i = 0; - args.ap = (void *)((char *)wreq.wi_val + sizeof(i)); - args.max = (void *)(&wreq + 1); - args.ic = ic; - ieee80211_scan_iterate(ic, wi_read_ap_result, &args); - memcpy(wreq.wi_val, &args.i, sizeof(args.i)); - wreq.wi_len = (sizeof(int) + - sizeof(struct wi_apinfo) * args.i) / 2; - } else - error = EINPROGRESS; - break; - case WI_RID_PRISM2: - /* NB: we lie so WI_RID_SCAN_RES can include rates */ - wreq.wi_val[0] = 1; - wreq.wi_len = sizeof(u_int16_t) / 2; - break; - case WI_RID_SCAN_RES: /* compatibility interface */ - if ((ic->ic_flags & IEEE80211_F_SCAN) == 0) { - struct wi_read_prism2_args args; - struct wi_scan_p2_hdr *p2; - - /* NB: use Prism2 format so we can include rate info */ - p2 = (struct wi_scan_p2_hdr *)wreq.wi_val; - args.i = 0; - args.res = (void *)&p2[1]; - args.max = (void *)(&wreq + 1); - args.ic = ic; - ieee80211_scan_iterate(ic, wi_read_prism2_result,&args); - p2->wi_rsvd = 0; - p2->wi_reason = args.i; - wreq.wi_len = (sizeof(*p2) + - sizeof(struct wi_scan_res) * args.i) / 2; - } else - error = EINPROGRESS; - break; - case WI_RID_READ_CACHE: { - struct wi_read_sigcache_args args; - args.i = 0; - args.wsc = (struct wi_sigcache *) wreq.wi_val; - args.max = (void *)(&wreq + 1); - args.vap = vap; - ieee80211_iterate_nodes(&ic->ic_sta, wi_read_sigcache, &args); - wreq.wi_len = sizeof(struct wi_sigcache) * args.i / 2; - break; - } - default: - error = EINVAL; - break; - } - if (error == 0) { - wreq.wi_len++; - error = copyout(&wreq, ifr->ifr_data, sizeof(wreq)); - } - return error; -} - static int -findrate(struct ieee80211com *ic, enum ieee80211_phymode mode, int rate) -{ -#define IEEERATE(_ic,_m,_i) \ - ((_ic)->ic_sup_rates[_m].rs_rates[_i] & IEEE80211_RATE_VAL) - int i, nrates = ic->ic_sup_rates[mode].rs_nrates; - for (i = 0; i < nrates; i++) - if (IEEERATE(ic, mode, i) == rate) - return i; - return -1; -#undef IEEERATE -} - -static int find11gchannel(struct ieee80211com *ic, int i, int freq) { for (; i < ic->ic_nchans; i++) { @@ -600,312 +229,6 @@ return 0; } -int -ieee80211_cfgset(struct ifnet *ifp, u_long cmd, caddr_t data) -{ - struct ieee80211vap *vap = ifp->if_softc; - struct ieee80211com *ic = vap->iv_ic; - int i, j, len, error, rate; - struct ifreq *ifr = (struct ifreq *)data; - struct wi_ltv_keys *keys; - struct wi_req wreq; - - error = copyin(ifr->ifr_data, &wreq, sizeof(wreq)); - if (error) - return error; - len = wreq.wi_len ? (wreq.wi_len - 1) * 2 : 0; - switch (wreq.wi_type) { - case WI_RID_SERIALNO: - case WI_RID_NODENAME: - return EPERM; - case WI_RID_CURRENT_SSID: - return EPERM; - case WI_RID_OWN_SSID: - case WI_RID_DESIRED_SSID: - if (le16toh(wreq.wi_val[0]) * 2 > len || - le16toh(wreq.wi_val[0]) > IEEE80211_NWID_LEN) { - error = ENOSPC; - break; - } - memset(vap->iv_des_essid, 0, sizeof(vap->iv_des_essid)); - vap->iv_des_esslen = le16toh(wreq.wi_val[0]) * 2; - memcpy(vap->iv_des_essid, &wreq.wi_val[1], vap->iv_des_esslen); - error = ENETRESET; - break; - case WI_RID_CURRENT_BSSID: - return EPERM; - case WI_RID_OWN_CHNL: - case WI_RID_CURRENT_CHAN: - if (len != 2) - return EINVAL; - error = ieee80211_setchannel(vap, le16toh(wreq.wi_val[0])); - break; - case WI_RID_COMMS_QUALITY: - return EPERM; - case WI_RID_PROMISC: - if (len != 2) - return EINVAL; - if (ifp->if_flags & IFF_PROMISC) { - if (wreq.wi_val[0] == 0) { - ifp->if_flags &= ~IFF_PROMISC; - error = ENETRESET; - } - } else { - if (wreq.wi_val[0] != 0) { - ifp->if_flags |= IFF_PROMISC; - error = ENETRESET; - } - } - break; - case WI_RID_PORTTYPE: - return EINVAL; -#if 0 - case WI_RID_MAC_NODE: - if (len != IEEE80211_ADDR_LEN) - return EINVAL; - IEEE80211_ADDR_COPY(LLADDR(ifp->if_sadl), wreq.wi_val); - /* if_init will copy lladdr into ic_myaddr */ - error = ENETRESET; - break; -#endif - case WI_RID_TX_RATE: - if (len != 2) - return EINVAL; - if (wreq.wi_val[0] == 0) { - /* auto */ - vap->iv_fixed_rate = -1; - break; - } - rate = 2 * le16toh(wreq.wi_val[0]); - if (ic->ic_curmode == IEEE80211_MODE_AUTO) { - /* - * In autoselect mode search for the rate. We take - * the first instance which may not be right, but we - * are limited by the interface. Note that we also - * lock the mode to insure the rate is meaningful - * when it is used. - */ - for (j = IEEE80211_MODE_11A; - j < IEEE80211_MODE_MAX; j++) { - if ((ic->ic_modecaps & (1<ic_curmode = j; - goto setrate; - } - } - } else { - i = findrate(ic, ic->ic_curmode, rate); - if (i != -1) - goto setrate; - } - return EINVAL; - setrate: - vap->iv_fixed_rate = i; - error = IS_UP(vap) ? ic->ic_reset(ifp) : 0; - break; - case WI_RID_CUR_TX_RATE: - return EPERM; - case WI_RID_RTS_THRESH: - if (len != 2) - return EINVAL; - if (le16toh(wreq.wi_val[0]) != IEEE80211_MAX_LEN) - return EINVAL; /* TODO: RTS */ - break; - case WI_RID_CREATE_IBSS: - if (len != 2) - return EINVAL; - if (wreq.wi_val[0] != 0) { - if ((vap->iv_caps & IEEE80211_C_IBSS) == 0) - return EINVAL; - if ((vap->iv_flags & IEEE80211_F_IBSSON) == 0) { - vap->iv_flags |= IEEE80211_F_IBSSON; - if (vap->iv_opmode == IEEE80211_M_IBSS && - vap->iv_state == IEEE80211_S_SCAN) - error = IS_UP_AUTO(vap) ? ENETRESET : 0; - } - } else { - if (vap->iv_flags & IEEE80211_F_IBSSON) { - vap->iv_flags &= ~IEEE80211_F_IBSSON; - if (vap->iv_flags & IEEE80211_F_SIBSS) { - vap->iv_flags &= ~IEEE80211_F_SIBSS; - error = IS_UP_AUTO(vap) ? ENETRESET : 0; - } - } - } - break; - case WI_RID_MICROWAVE_OVEN: - if (len != 2) - return EINVAL; - if (wreq.wi_val[0] != 0) - return EINVAL; /* not supported */ - break; - case WI_RID_ROAMING_MODE: - if (len != 2) - return EINVAL; - i = le16toh(wreq.wi_val[0]); - if (i > IEEE80211_ROAMING_MANUAL) - return EINVAL; /* not supported */ - vap->iv_ic->ic_roaming = i; - break; - case WI_RID_SYSTEM_SCALE: - if (len != 2) - return EINVAL; - if (le16toh(wreq.wi_val[0]) != 1) - return EINVAL; /* not supported */ - break; - case WI_RID_PM_ENABLED: - if (len != 2) - return EINVAL; - if (wreq.wi_val[0] != 0) { - if ((vap->iv_caps & IEEE80211_C_PMGT) == 0) - return EINVAL; - if ((vap->iv_flags & IEEE80211_F_PMGTON) == 0) { - vap->iv_flags |= IEEE80211_F_PMGTON; - error = IS_UP(vap) ? ic->ic_reset(ifp) : 0; - } - } else { - if (vap->iv_flags & IEEE80211_F_PMGTON) { - vap->iv_flags &= ~IEEE80211_F_PMGTON; - error = IS_UP(vap) ? ic->ic_reset(ifp) : 0; - } - } - break; - case WI_RID_MAX_SLEEP: - if (len != 2) - return EINVAL; - ic->ic_lintval = le16toh(wreq.wi_val[0]); - if (vap->iv_flags & IEEE80211_F_PMGTON) - error = IS_UP(vap) ? ic->ic_reset(ifp) : 0; - break; - case WI_RID_CUR_BEACON_INT: - return EPERM; - case WI_RID_WEP_AVAIL: - return EPERM; - case WI_RID_CNFAUTHMODE: - if (len != 2) - return EINVAL; - i = le16toh(wreq.wi_val[0]); - if (i > IEEE80211_AUTH_WPA) - return EINVAL; - vap->iv_bss->ni_authmode = i; /* XXX ENETRESET? */ - error = ENETRESET; - break; - case WI_RID_ENCRYPTION: - if (len != 2) - return EINVAL; - if (wreq.wi_val[0] != 0) { - if ((vap->iv_caps & IEEE80211_C_WEP) == 0) - return EINVAL; - if ((vap->iv_flags & IEEE80211_F_PRIVACY) == 0) { - vap->iv_flags |= IEEE80211_F_PRIVACY; - error = ENETRESET; - } - } else { - if (vap->iv_flags & IEEE80211_F_PRIVACY) { - vap->iv_flags &= ~IEEE80211_F_PRIVACY; - error = ENETRESET; - } - } - break; - case WI_RID_TX_CRYPT_KEY: - if (len != 2) - return EINVAL; - i = le16toh(wreq.wi_val[0]); - if (i >= IEEE80211_WEP_NKID) - return EINVAL; - vap->iv_def_txkey = i; - error = IS_UP(vap) ? ic->ic_reset(ifp) : 0; - break; - case WI_RID_DEFLT_CRYPT_KEYS: - if (len != sizeof(struct wi_ltv_keys)) - return EINVAL; - keys = (struct wi_ltv_keys *)&wreq; - for (i = 0; i < IEEE80211_WEP_NKID; i++) { - len = le16toh(keys->wi_keys[i].wi_keylen); - if (len != 0 && len < IEEE80211_WEP_KEYLEN) - return EINVAL; - if (len > IEEE80211_KEYBUF_SIZE) - return EINVAL; - } - for (i = 0; i < IEEE80211_WEP_NKID; i++) { - struct ieee80211_key *k = &vap->iv_nw_keys[i]; - - len = le16toh(keys->wi_keys[i].wi_keylen); - k->wk_keylen = len; - k->wk_flags = IEEE80211_KEY_XMIT | IEEE80211_KEY_RECV; - memset(k->wk_key, 0, sizeof(k->wk_key)); - memcpy(k->wk_key, keys->wi_keys[i].wi_keydat, len); -#if 0 - k->wk_type = IEEE80211_CIPHER_WEP; -#endif - } - error = ENETRESET; - break; - case WI_RID_MAX_DATALEN: - if (len != 2) - return EINVAL; - len = le16toh(wreq.wi_val[0]); - if (len < 350 /* ? */ || len > IEEE80211_MAX_LEN) - return EINVAL; - vap->iv_fragthreshold = len; - error = IS_UP(vap) ? ic->ic_reset(ifp) : 0; - break; - case WI_RID_IFACE_STATS: - error = EPERM; - break; - case WI_RID_SCAN_REQ: /* XXX wicontrol */ - ieee80211_start_scan(vap, - IEEE80211_SCAN_NOPICK | IEEE80211_SCAN_ACTIVE); - break; - case WI_RID_SCAN_APS: - len--; /* XXX: tx rate? */ - /* FALLTHRU */ - case WI_RID_CHANNEL_LIST: -#if 0 -/* XXX fill in scan list */ - memset(chanlist, 0, sizeof(chanlist)); - /* - * Since channel 0 is not available for DS, channel 1 - * is assigned to LSB on WaveLAN. - */ - if (ic->ic_phytype == IEEE80211_T_DS) - i = 1; - else - i = 0; - for (j = 0; i <= IEEE80211_CHAN_MAX; i++, j++) { - if ((j / 8) >= len) - break; - if (isclr((u_int8_t *)wreq.wi_val, j)) - continue; - if (isclr(ic->ic_chan_active, i)) { - if (wreq.wi_type != WI_RID_CHANNEL_LIST) - continue; - if (isclr(ic->ic_chan_avail, i)) - return EPERM; - } - setbit(chanlist, i); - } - error = ieee80211_setupscan(vap, chanlist); - if (wreq.wi_type == WI_RID_CHANNEL_LIST) { - /* NB: ignore error from ieee80211_setupscan */ - error = ENETRESET; - } else if (error == 0) -#endif - ieee80211_start_scan(vap, - IEEE80211_SCAN_NOPICK | IEEE80211_SCAN_ACTIVE); - break; - default: - error = EINVAL; - break; - } - if (error == ENETRESET && !IS_UP_AUTO(vap)) - error = 0; - return error; -} - static int cap2cipher(int flag) { @@ -2573,15 +1896,6 @@ (struct ieee80211req *) data); } break; - case SIOCGIFGENERIC: - error = ieee80211_cfgget(ifp, cmd, data); - break; - case SIOCSIFGENERIC: - error = suser(curthread); - if (error) - break; - error = ieee80211_cfgset(ifp, cmd, data); - break; case SIOCG80211STATS: ifr = (struct ifreq *)data; copyout(&vap->iv_stats, ifr->ifr_data, sizeof (vap->iv_stats)); ==== //depot/projects/vap/sys/net80211/ieee80211_var.h#9 (text+ko) ==== @@ -374,8 +374,6 @@ int ieee80211_media_change(struct ifnet *); void ieee80211_media_status(struct ifnet *, struct ifmediareq *); int ieee80211_ioctl(struct ifnet *, u_long, caddr_t); -int ieee80211_cfgget(struct ifnet *, u_long, caddr_t); -int ieee80211_cfgset(struct ifnet *, u_long, caddr_t); int ieee80211_rate2media(struct ieee80211com *, int, enum ieee80211_phymode); int ieee80211_media2rate(int); From owner-p4-projects@FreeBSD.ORG Mon May 9 18:37:10 2005 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id D2E6516A4F2; Mon, 9 May 2005 18:37:09 +0000 (GMT) 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 AA92616A4EA for ; Mon, 9 May 2005 18:37:09 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 70C2C43D5A for ; Mon, 9 May 2005 18:37:09 +0000 (GMT) (envelope-from sam@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 j49Ib9Yu090387 for ; Mon, 9 May 2005 18:37:09 GMT (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j49Ib9dH090384 for perforce@freebsd.org; Mon, 9 May 2005 18:37:09 GMT (envelope-from sam@freebsd.org) Date: Mon, 9 May 2005 18:37:09 GMT Message-Id: <200505091837.j49Ib9dH090384@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Subject: PERFORCE change 76758 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 May 2005 18:37:10 -0000 http://perforce.freebsd.org/chv.cgi?CH=76758 Change 76758 by sam@sam_ebb on 2005/05/09 18:36:38 misc cleanups Affected files ... .. //depot/projects/vap/sys/dev/ath/if_ath.c#11 edit Differences ... ==== //depot/projects/vap/sys/dev/ath/if_ath.c#11 (text+ko) ==== @@ -664,6 +664,64 @@ return 0; } +/* + * Hardware supports the bssid mask and a unique address + * was requested. Assign a new mac address and expand + * our bssid mask to cover the active virtual ap's with + * distinct addresses. + */ +static void +assign_address(struct ath_softc *sc, struct ieee80211vap *vap) +{ + struct ieee80211com *ic = vap->iv_ic; + struct ieee80211vap *v; + int id_mask, id; + + /* do a full search to mark all the allocated vaps */ + id_mask = 0; + TAILQ_FOREACH(v, &ic->ic_vaps, iv_next) + id_mask |= (1 << ATH_GET_VAP_ID(v->iv_myaddr)); + for (id = 0; id < ATH_BCBUF; id++) { + /* get the first available slot */ + if ((id_mask & (1 << id)) == 0) { + ATH_SET_VAP_BSSID(vap->iv_myaddr, id); + break; + } + } +} + +/* + * Return an open beacon slot. The caller is assumed to + * check one is available. + */ +static int +find_bslot(struct ath_softc *sc) +{ + int slot, bslot; + + KASSERT(sc->sc_nvaps <= ATH_BCBUF, + ("too many virtual ap's: %d", sc->sc_nvaps)); + bslot = 0; + for (slot = 0; slot < ATH_BCBUF; slot++) + if (sc->sc_bslot[slot] == NULL) { + /* + * XXX hack, space out slots to better + * deal with misses + */ + if (slot+1 < ATH_BCBUF && + sc->sc_bslot[slot+1] == NULL) { + bslot = slot+1; + break; + } + bslot = slot; + /* NB: keep looking for a double slot */ + } + return bslot; +} + +/* + * Create a virtual ap. + */ static struct ieee80211vap * ath_vap_create(struct ieee80211com *ic, const char name[IFNAMSIZ], int unit, int opmode, int flags) @@ -697,7 +755,7 @@ /* permit multiple ap's and/or wds links */ /* XXX device capability */ if (sc->sc_nvaps != 0 && ic->ic_opmode != IEEE80211_M_HOSTAP) - return NULL; + return NULL; if (opmode == IEEE80211_M_HOSTAP && STAILQ_EMPTY(&sc->sc_bbuf)) return NULL; /* @@ -732,31 +790,9 @@ vap->iv_key_update_end = ath_key_update_end; if ((flags & IEEE80211_CLONE_BSSID) && - sc->sc_nvaps != 0 && opmode != IEEE80211_M_WDS && sc->sc_hasbmask) { - struct ieee80211vap *v; - int id_mask, id; - - /* - * Hardware supports the bssid mask and a unique - * bssid was requested. Assign a new mac address - * and expand our bssid mask to cover the active - * virtual ap's with distinct addresses. - */ - KASSERT(sc->sc_nvaps <= ATH_BCBUF, - ("too many virtual ap's: %d", sc->sc_nvaps)); + sc->sc_nvaps != 0 && opmode != IEEE80211_M_WDS && sc->sc_hasbmask) + assign_address(sc, vap); - /* do a full search to mark all the allocated vaps */ - id_mask = 0; - TAILQ_FOREACH(v, &ic->ic_vaps, iv_next) - id_mask |= (1 << ATH_GET_VAP_ID(v->iv_myaddr)); - for (id = 0; id < ATH_BCBUF; id++) { - /* get the first available slot */ - if ((id_mask & (1 << id)) == 0) { - ATH_SET_VAP_BSSID(vap->iv_myaddr, id); - break; - } - } - } avp->av_bslot = -1; switch (opmode) { case IEEE80211_M_HOSTAP: @@ -773,26 +809,11 @@ avp->av_bcbuf = STAILQ_FIRST(&sc->sc_bbuf); STAILQ_REMOVE_HEAD(&sc->sc_bbuf, bf_list); if (opmode == IEEE80211_M_HOSTAP || !sc->sc_hasveol) { - int slot; /* * Assign the vap to a beacon xmit slot. As * above, this cannot fail to find one. */ - avp->av_bslot = 0; - for (slot = 0; slot < ATH_BCBUF; slot++) - if (sc->sc_bslot[slot] == NULL) { - /* - * XXX hack, space out slots to better - * deal with misses - */ - if (slot+1 < ATH_BCBUF && - sc->sc_bslot[slot+1] == NULL) { - avp->av_bslot = slot+1; - break; - } - avp->av_bslot = slot; - /* NB: keep looking for a double slot */ - } + avp->av_bslot = find_bslot(sc); KASSERT(sc->sc_bslot[avp->av_bslot] == NULL, ("beacon slot %u not empty?", avp->av_bslot)); sc->sc_bslot[avp->av_bslot] = vap; @@ -829,6 +850,9 @@ return vap; } +/* + * Delete/destroy a virtual ap. + */ void ath_vap_delete(struct ieee80211vap *vap) { @@ -1157,15 +1181,12 @@ ath_update_txpow(sc); /* - * Setup the hardware after reset: the key cache - * is filled as needed and the receive engine is - * set going. Frame transmit is handled entirely - * in the frame output path; there's nothing to do - * here except setup the interrupt mask. + * Setup the hardware after reset. All we need + * to do is set the receive engine going. Frame + * transmit is handled entirely in the frame output + * path; there's nothing to do here except setup + * the interrupt mask. */ -#if 0 - ath_initkeytable(sc); /* XXX still needed? */ -#endif if (ath_startrecv(sc) != 0) { if_printf(ifp, "unable to start recv logic\n"); goto done; @@ -2084,8 +2105,8 @@ */ ni = sc->sc_keyixmap[keyix]; if (ni != NULL) { + sc->sc_keyixmap[keyix] = NULL; ieee80211_free_node(ni); - sc->sc_keyixmap[keyix] = NULL; } /* * Handle split tx/rx keying required for TKIP with h/w MIC. @@ -2095,8 +2116,8 @@ ath_hal_keyreset(ah, keyix+32); /* RX key */ ni = sc->sc_keyixmap[keyix+32]; if (ni != NULL) { /* as above... */ + sc->sc_keyixmap[keyix+32] = NULL; ieee80211_free_node(ni); - sc->sc_keyixmap[keyix+32] = NULL; } } if (keyix >= IEEE80211_WEP_NKID) { From owner-p4-projects@FreeBSD.ORG Mon May 9 20:08:03 2005 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id BE12116A4EB; Mon, 9 May 2005 20:08:02 +0000 (GMT) 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 7947016A4EA for ; Mon, 9 May 2005 20:08:02 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4DBB143D90 for ; Mon, 9 May 2005 20:08:02 +0000 (GMT) (envelope-from sam@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 j49K825N093673 for ; Mon, 9 May 2005 20:08:02 GMT (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j49K80LP093668 for perforce@freebsd.org; Mon, 9 May 2005 20:08:00 GMT (envelope-from sam@freebsd.org) Date: Mon, 9 May 2005 20:08:00 GMT Message-Id: <200505092008.j49K80LP093668@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Subject: PERFORCE change 76761 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 May 2005 20:08:03 -0000 http://perforce.freebsd.org/chv.cgi?CH=76761 Change 76761 by sam@sam_ebb on 2005/05/09 20:07:14 IFC @ 76760 Affected files ... .. //depot/projects/wifi/UPDATING#15 integrate .. //depot/projects/wifi/bin/csh/config.h#5 integrate .. //depot/projects/wifi/contrib/ipfilter/tools/ipmon.c#2 integrate .. //depot/projects/wifi/contrib/pf/authpf/authpf.8#2 integrate .. //depot/projects/wifi/contrib/pf/authpf/authpf.c#2 integrate .. //depot/projects/wifi/contrib/pf/authpf/pathnames.h#2 integrate .. //depot/projects/wifi/contrib/pf/ftp-proxy/ftp-proxy.8#2 integrate .. //depot/projects/wifi/contrib/pf/ftp-proxy/ftp-proxy.c#2 integrate .. //depot/projects/wifi/contrib/pf/ftp-proxy/getline.c#2 integrate .. //depot/projects/wifi/contrib/pf/ftp-proxy/util.c#2 integrate .. //depot/projects/wifi/contrib/pf/ftp-proxy/util.h#2 integrate .. //depot/projects/wifi/contrib/pf/man/pf.4#3 integrate .. //depot/projects/wifi/contrib/pf/man/pf.conf.5#4 integrate .. //depot/projects/wifi/contrib/pf/man/pf.os.5#2 integrate .. //depot/projects/wifi/contrib/pf/man/pflog.4#2 integrate .. //depot/projects/wifi/contrib/pf/man/pfsync.4#3 integrate .. //depot/projects/wifi/contrib/pf/pfctl/parse.y#2 integrate .. //depot/projects/wifi/contrib/pf/pfctl/pf_print_state.c#2 integrate .. //depot/projects/wifi/contrib/pf/pfctl/pfctl.8#2 integrate .. //depot/projects/wifi/contrib/pf/pfctl/pfctl.c#2 integrate .. //depot/projects/wifi/contrib/pf/pfctl/pfctl.h#2 integrate .. //depot/projects/wifi/contrib/pf/pfctl/pfctl_altq.c#2 integrate .. //depot/projects/wifi/contrib/pf/pfctl/pfctl_optimize.c#1 branch .. //depot/projects/wifi/contrib/pf/pfctl/pfctl_osfp.c#2 integrate .. //depot/projects/wifi/contrib/pf/pfctl/pfctl_parser.c#2 integrate .. //depot/projects/wifi/contrib/pf/pfctl/pfctl_parser.h#2 integrate .. //depot/projects/wifi/contrib/pf/pfctl/pfctl_qstats.c#2 integrate .. //depot/projects/wifi/contrib/pf/pfctl/pfctl_radix.c#2 integrate .. //depot/projects/wifi/contrib/pf/pfctl/pfctl_table.c#2 integrate .. //depot/projects/wifi/contrib/pf/pflogd/pflogd.8#2 integrate .. //depot/projects/wifi/contrib/pf/pflogd/pflogd.c#2 integrate .. //depot/projects/wifi/contrib/pf/pflogd/pidfile.c#2 integrate .. //depot/projects/wifi/contrib/pf/pflogd/privsep.c#2 integrate .. //depot/projects/wifi/contrib/pf/pflogd/privsep_fdpass.c#2 integrate .. //depot/projects/wifi/contrib/smbfs/lib/smb/ctx.c#2 integrate .. //depot/projects/wifi/games/fortune/datfiles/limerick#3 integrate .. //depot/projects/wifi/gnu/usr.bin/gdb/libgdb/fbsd-threads.c#6 integrate .. //depot/projects/wifi/lib/libalias/HISTORY#2 delete .. //depot/projects/wifi/lib/libalias/Makefile#3 integrate .. //depot/projects/wifi/lib/libalias/alias.c#3 delete .. //depot/projects/wifi/lib/libalias/alias.h#2 delete .. //depot/projects/wifi/lib/libalias/alias_cuseeme.c#2 delete .. //depot/projects/wifi/lib/libalias/alias_db.c#2 delete .. //depot/projects/wifi/lib/libalias/alias_ftp.c#2 delete .. //depot/projects/wifi/lib/libalias/alias_irc.c#2 delete .. //depot/projects/wifi/lib/libalias/alias_local.h#2 delete .. //depot/projects/wifi/lib/libalias/alias_nbt.c#2 delete .. //depot/projects/wifi/lib/libalias/alias_old.c#3 delete .. //depot/projects/wifi/lib/libalias/alias_pptp.c#2 delete .. //depot/projects/wifi/lib/libalias/alias_proxy.c#2 delete .. //depot/projects/wifi/lib/libalias/alias_skinny.c#3 delete .. //depot/projects/wifi/lib/libalias/alias_smedia.c#2 delete .. //depot/projects/wifi/lib/libalias/alias_util.c#2 delete .. //depot/projects/wifi/lib/libalias/libalias.3#3 delete .. //depot/projects/wifi/lib/libarchive/archive_entry.c#4 integrate .. //depot/projects/wifi/lib/libc/gen/getbootfile.c#2 integrate .. //depot/projects/wifi/lib/libc/gen/getgrouplist.c#2 integrate .. //depot/projects/wifi/lib/libc/gmon/mcount.c#2 integrate .. //depot/projects/wifi/lib/libc/net/getnameinfo.c#3 integrate .. //depot/projects/wifi/lib/libc/stdio/fopen.3#2 integrate .. //depot/projects/wifi/lib/libc/sys/accept.2#2 integrate .. //depot/projects/wifi/lib/libc/yp/yplib.c#4 integrate .. //depot/projects/wifi/lib/msun/i387/s_ceilf.S#2 integrate .. //depot/projects/wifi/lib/msun/i387/s_floorf.S#2 integrate .. //depot/projects/wifi/lib/msun/i387/s_truncf.S#2 integrate .. //depot/projects/wifi/libexec/talkd/process.c#2 integrate .. //depot/projects/wifi/release/Makefile#8 integrate .. //depot/projects/wifi/release/doc/en_US.ISO8859-1/relnotes/common/new.sgml#13 integrate .. //depot/projects/wifi/release/doc/share/sgml/release.dsl#2 integrate .. //depot/projects/wifi/release/scripts/package-split.py#4 integrate .. //depot/projects/wifi/release/scripts/package-trees.sh#2 integrate .. //depot/projects/wifi/sbin/ifconfig/ifpfsync.c#2 integrate .. //depot/projects/wifi/sbin/ipfw/ipfw.8#10 integrate .. //depot/projects/wifi/sbin/kldstat/kldstat.8#3 integrate .. //depot/projects/wifi/sbin/kldstat/kldstat.c#2 integrate .. //depot/projects/wifi/sbin/pfctl/Makefile#2 integrate .. //depot/projects/wifi/share/dict/freebsd#2 integrate .. //depot/projects/wifi/share/examples/etc/make.conf#14 integrate .. //depot/projects/wifi/share/examples/mdoc/example.4#3 integrate .. //depot/projects/wifi/share/man/man4/Makefile#21 integrate .. //depot/projects/wifi/share/man/man4/ichsmb.4#2 integrate .. //depot/projects/wifi/share/man/man4/man4.i386/Makefile#5 integrate .. //depot/projects/wifi/share/man/man4/man4.i386/acpi_asus.4#3 integrate .. //depot/projects/wifi/share/man/man4/man4.i386/acpi_ibm.4#1 branch .. //depot/projects/wifi/share/man/man4/man4.i386/ep.4#5 integrate .. //depot/projects/wifi/share/man/man4/ng_nat.4#1 branch .. //depot/projects/wifi/sys/amd64/amd64/machdep.c#10 integrate .. //depot/projects/wifi/sys/boot/pc98/boot2/Makefile#4 integrate .. //depot/projects/wifi/sys/boot/pc98/boot2/boot.c#3 integrate .. //depot/projects/wifi/sys/boot/pc98/boot2/boot.h#2 integrate .. //depot/projects/wifi/sys/boot/pc98/boot2/boot2.S#2 integrate .. //depot/projects/wifi/sys/boot/pc98/boot2/disk.c#2 integrate .. //depot/projects/wifi/sys/boot/pc98/boot2/io.c#2 integrate .. //depot/projects/wifi/sys/boot/pc98/boot2/sys.c#2 integrate .. //depot/projects/wifi/sys/boot/pc98/boot2/table.c#2 integrate .. //depot/projects/wifi/sys/boot/pc98/btx/btx/Makefile#3 integrate .. //depot/projects/wifi/sys/boot/pc98/btx/btx/btx.S#3 integrate .. //depot/projects/wifi/sys/boot/pc98/btx/btxldr/Makefile#3 integrate .. //depot/projects/wifi/sys/boot/pc98/btx/btxldr/btxldr.S#2 integrate .. //depot/projects/wifi/sys/boot/pc98/kgzldr/Makefile#3 integrate .. //depot/projects/wifi/sys/boot/pc98/kgzldr/crt.s#2 integrate .. //depot/projects/wifi/sys/boot/pc98/libpc98/Makefile#3 integrate .. //depot/projects/wifi/sys/boot/pc98/libpc98/biosdisk.c#2 integrate .. //depot/projects/wifi/sys/boot/pc98/libpc98/biosmem.c#2 integrate .. //depot/projects/wifi/sys/boot/pc98/libpc98/comconsole.c#2 integrate .. //depot/projects/wifi/sys/boot/pc98/libpc98/gatea20.c#2 integrate .. //depot/projects/wifi/sys/boot/pc98/libpc98/time.c#2 integrate .. //depot/projects/wifi/sys/boot/pc98/libpc98/vidconsole.c#3 integrate .. //depot/projects/wifi/sys/boot/pc98/loader/Makefile#4 integrate .. //depot/projects/wifi/sys/boot/pc98/loader/main.c#3 integrate .. //depot/projects/wifi/sys/cam/scsi/scsi_da.c#4 integrate .. //depot/projects/wifi/sys/compat/ndis/kern_ndis.c#12 integrate .. //depot/projects/wifi/sys/compat/ndis/kern_windrv.c#7 integrate .. //depot/projects/wifi/sys/compat/ndis/ndis_var.h#10 integrate .. //depot/projects/wifi/sys/compat/ndis/ntoskrnl_var.h#12 integrate .. //depot/projects/wifi/sys/compat/ndis/subr_hal.c#10 integrate .. //depot/projects/wifi/sys/compat/ndis/subr_ndis.c#13 integrate .. //depot/projects/wifi/sys/compat/ndis/subr_ntoskrnl.c#14 integrate .. //depot/projects/wifi/sys/compat/ndis/subr_usbd.c#3 integrate .. //depot/projects/wifi/sys/conf/NOTES#22 integrate .. //depot/projects/wifi/sys/conf/files#25 integrate .. //depot/projects/wifi/sys/conf/options#17 integrate .. //depot/projects/wifi/sys/contrib/pf/net/if_pflog.c#3 integrate .. //depot/projects/wifi/sys/contrib/pf/net/if_pflog.h#2 integrate .. //depot/projects/wifi/sys/contrib/pf/net/if_pfsync.c#4 integrate .. //depot/projects/wifi/sys/contrib/pf/net/if_pfsync.h#2 integrate .. //depot/projects/wifi/sys/contrib/pf/net/pf.c#10 integrate .. //depot/projects/wifi/sys/contrib/pf/net/pf_if.c#4 integrate .. //depot/projects/wifi/sys/contrib/pf/net/pf_ioctl.c#4 integrate .. //depot/projects/wifi/sys/contrib/pf/net/pf_norm.c#2 integrate .. //depot/projects/wifi/sys/contrib/pf/net/pf_osfp.c#2 integrate .. //depot/projects/wifi/sys/contrib/pf/net/pf_subr.c#2 integrate .. //depot/projects/wifi/sys/contrib/pf/net/pf_table.c#2 integrate .. //depot/projects/wifi/sys/contrib/pf/net/pfvar.h#2 integrate .. //depot/projects/wifi/sys/dev/acpi_support/acpi_asus.c#5 integrate .. //depot/projects/wifi/sys/dev/acpica/Osd/OsdSchedule.c#4 integrate .. //depot/projects/wifi/sys/dev/acpica/acpi.c#13 integrate .. //depot/projects/wifi/sys/dev/acpica/acpivar.h#10 integrate .. //depot/projects/wifi/sys/dev/arcmsr/arcmsr.c#4 integrate .. //depot/projects/wifi/sys/dev/ata/ata-all.c#10 integrate .. //depot/projects/wifi/sys/dev/ata/ata-all.h#8 integrate .. //depot/projects/wifi/sys/dev/ata/ata-chipset.c#12 integrate .. //depot/projects/wifi/sys/dev/ata/ata-dma.c#7 integrate .. //depot/projects/wifi/sys/dev/ata/ata-lowlevel.c#12 integrate .. //depot/projects/wifi/sys/dev/ata/ata-pci.c#8 integrate .. //depot/projects/wifi/sys/dev/ata/ata-queue.c#7 integrate .. //depot/projects/wifi/sys/dev/ata/atapi-cd.c#8 integrate .. //depot/projects/wifi/sys/dev/bge/if_bge.c#9 integrate .. //depot/projects/wifi/sys/dev/digi/CX.bios.h#2 integrate .. //depot/projects/wifi/sys/dev/digi/CX.fepos.h#2 integrate .. //depot/projects/wifi/sys/dev/digi/CX_PCI.bios.h#2 integrate .. //depot/projects/wifi/sys/dev/digi/CX_PCI.fepos.h#2 integrate .. //depot/projects/wifi/sys/dev/digi/EPCX.bios.h#2 integrate .. //depot/projects/wifi/sys/dev/digi/EPCX.fepos.h#2 integrate .. //depot/projects/wifi/sys/dev/digi/EPCX_PCI.bios.h#2 integrate .. //depot/projects/wifi/sys/dev/digi/EPCX_PCI.fepos.h#2 integrate .. //depot/projects/wifi/sys/dev/digi/Xe.bios.h#2 integrate .. //depot/projects/wifi/sys/dev/digi/Xe.fepos.h#2 integrate .. //depot/projects/wifi/sys/dev/digi/Xem.bios.h#2 integrate .. //depot/projects/wifi/sys/dev/digi/Xem.fepos.h#2 integrate .. //depot/projects/wifi/sys/dev/if_ndis/if_ndis.c#16 integrate .. //depot/projects/wifi/sys/dev/if_ndis/if_ndis_pccard.c#6 integrate .. //depot/projects/wifi/sys/dev/if_ndis/if_ndis_pci.c#8 integrate .. //depot/projects/wifi/sys/dev/if_ndis/if_ndisvar.h#8 integrate .. //depot/projects/wifi/sys/dev/iir/iir_ctrl.c#3 integrate .. //depot/projects/wifi/sys/dev/nve/if_nve.c#3 integrate .. //depot/projects/wifi/sys/dev/uart/uart_tty.c#3 integrate .. //depot/projects/wifi/sys/dev/usb/uvisor.c#3 integrate .. //depot/projects/wifi/sys/dev/wl/if_wl.c#3 integrate .. //depot/projects/wifi/sys/dev/wl/if_wl_i82586.h#1 branch .. //depot/projects/wifi/sys/fs/ntfs/ntfs_subr.c#4 integrate .. //depot/projects/wifi/sys/fs/smbfs/smbfs_smb.c#4 integrate .. //depot/projects/wifi/sys/fs/smbfs/smbfs_subr.c#3 integrate .. //depot/projects/wifi/sys/fs/smbfs/smbfs_subr.h#4 integrate .. //depot/projects/wifi/sys/fs/unionfs/union_vnops.c#14 integrate .. //depot/projects/wifi/sys/i386/i386/machdep.c#12 integrate .. //depot/projects/wifi/sys/i386/i386/sys_machdep.c#8 integrate .. //depot/projects/wifi/sys/i386/isa/ic/if_wl_i82586.h#3 delete .. //depot/projects/wifi/sys/kern/imgact_aout.c#6 integrate .. //depot/projects/wifi/sys/kern/imgact_elf.c#5 integrate .. //depot/projects/wifi/sys/kern/kern_descrip.c#14 integrate .. //depot/projects/wifi/sys/kern/kern_exec.c#13 integrate .. //depot/projects/wifi/sys/kern/kern_exit.c#9 integrate .. //depot/projects/wifi/sys/kern/subr_bus.c#14 integrate .. //depot/projects/wifi/sys/kern/subr_devstat.c#3 integrate .. //depot/projects/wifi/sys/kern/subr_rman.c#5 integrate .. //depot/projects/wifi/sys/kern/uipc_mbuf.c#10 integrate .. //depot/projects/wifi/sys/kern/uipc_sem.c#5 integrate .. //depot/projects/wifi/sys/kern/uipc_syscalls.c#13 integrate .. //depot/projects/wifi/sys/kern/uipc_usrreq.c#10 integrate .. //depot/projects/wifi/sys/kern/vfs_subr.c#26 integrate .. //depot/projects/wifi/sys/modules/Makefile#23 integrate .. //depot/projects/wifi/sys/modules/acpi/acpi/Makefile#4 integrate .. //depot/projects/wifi/sys/modules/libalias/Makefile#1 branch .. //depot/projects/wifi/sys/modules/netgraph/Makefile#7 integrate .. //depot/projects/wifi/sys/modules/netgraph/nat/Makefile#1 branch .. //depot/projects/wifi/sys/modules/sem/Makefile#2 integrate .. //depot/projects/wifi/sys/net/bpf.c#10 integrate .. //depot/projects/wifi/sys/net/if_mib.c#3 integrate .. //depot/projects/wifi/sys/net/if_tap.c#7 integrate .. //depot/projects/wifi/sys/net/if_tun.c#6 integrate .. //depot/projects/wifi/sys/netgraph/ng_device.c#9 integrate .. //depot/projects/wifi/sys/netgraph/ng_nat.c#1 branch .. //depot/projects/wifi/sys/netgraph/ng_nat.h#1 branch .. //depot/projects/wifi/sys/netinet/ip_divert.c#7 integrate .. //depot/projects/wifi/sys/netinet/ip_dummynet.c#7 integrate .. //depot/projects/wifi/sys/netinet/ip_fastfwd.c#5 integrate .. //depot/projects/wifi/sys/netinet/ip_fw.h#6 integrate .. //depot/projects/wifi/sys/netinet/ip_fw2.c#11 integrate .. //depot/projects/wifi/sys/netinet/ip_icmp.c#5 integrate .. //depot/projects/wifi/sys/netinet/ip_icmp.h#4 integrate .. //depot/projects/wifi/sys/netinet/ip_input.c#7 integrate .. //depot/projects/wifi/sys/netinet/libalias/Makefile#2 delete .. //depot/projects/wifi/sys/netinet/libalias/alias.c#2 integrate .. //depot/projects/wifi/sys/netinet/libalias/alias.h#2 integrate .. //depot/projects/wifi/sys/netinet/libalias/alias_cuseeme.c#2 integrate .. //depot/projects/wifi/sys/netinet/libalias/alias_db.c#2 integrate .. //depot/projects/wifi/sys/netinet/libalias/alias_ftp.c#2 integrate .. //depot/projects/wifi/sys/netinet/libalias/alias_irc.c#2 integrate .. //depot/projects/wifi/sys/netinet/libalias/alias_local.h#2 integrate .. //depot/projects/wifi/sys/netinet/libalias/alias_nbt.c#2 integrate .. //depot/projects/wifi/sys/netinet/libalias/alias_old.c#2 integrate .. //depot/projects/wifi/sys/netinet/libalias/alias_pptp.c#2 integrate .. //depot/projects/wifi/sys/netinet/libalias/alias_proxy.c#2 integrate .. //depot/projects/wifi/sys/netinet/libalias/alias_skinny.c#2 integrate .. //depot/projects/wifi/sys/netinet/libalias/alias_smedia.c#2 integrate .. //depot/projects/wifi/sys/netinet/libalias/alias_util.c#2 integrate .. //depot/projects/wifi/sys/netinet/raw_ip.c#5 integrate .. //depot/projects/wifi/sys/netinet/tcp_subr.c#13 integrate .. //depot/projects/wifi/sys/netinet/udp_usrreq.c#6 integrate .. //depot/projects/wifi/sys/nfsclient/nfs_socket.c#8 integrate .. //depot/projects/wifi/sys/posix4/ksem.h#1 branch .. //depot/projects/wifi/sys/powerpc/conf/GENERIC#4 integrate .. //depot/projects/wifi/sys/security/mac/mac_posix_sem.c#1 branch .. //depot/projects/wifi/sys/security/mac_biba/mac_biba.c#5 integrate .. //depot/projects/wifi/sys/security/mac_mls/mac_mls.c#5 integrate .. //depot/projects/wifi/sys/security/mac_stub/mac_stub.c#5 integrate .. //depot/projects/wifi/sys/security/mac_test/mac_test.c#6 integrate .. //depot/projects/wifi/sys/sys/diskpc98.h#4 integrate .. //depot/projects/wifi/sys/sys/imgact_aout.h#2 integrate .. //depot/projects/wifi/sys/sys/mac.h#4 integrate .. //depot/projects/wifi/sys/sys/mac_policy.h#5 integrate .. //depot/projects/wifi/sys/sys/mbuf.h#10 integrate .. //depot/projects/wifi/sys/sys/param.h#12 integrate .. //depot/projects/wifi/sys/ufs/ffs/ffs_softdep.c#10 integrate .. //depot/projects/wifi/sys/vm/vm_fault.c#6 integrate .. //depot/projects/wifi/sys/vm/vm_meter.c#7 integrate .. //depot/projects/wifi/sys/vm/vm_object.c#11 integrate .. //depot/projects/wifi/sys/vm/vm_object.h#6 integrate .. //depot/projects/wifi/sys/vm/vnode_pager.c#17 integrate .. //depot/projects/wifi/tools/regression/lib/libc/resolv/Makefile#1 branch .. //depot/projects/wifi/tools/regression/lib/libc/resolv/mach#1 branch .. //depot/projects/wifi/tools/regression/lib/libc/resolv/resolv.c#1 branch .. //depot/projects/wifi/tools/regression/lib/libc/resolv/resolv.t#1 branch .. //depot/projects/wifi/tools/regression/net80211/ccmp/test_ccmp.c#3 integrate .. //depot/projects/wifi/tools/regression/net80211/tkip/test_tkip.c#3 integrate .. //depot/projects/wifi/tools/regression/net80211/wep/test_wep.c#3 integrate .. //depot/projects/wifi/usr.bin/make/arch.c#12 integrate .. //depot/projects/wifi/usr.bin/make/compat.c#10 integrate .. //depot/projects/wifi/usr.bin/make/for.c#11 integrate .. //depot/projects/wifi/usr.bin/make/hash_tables.c#2 integrate .. //depot/projects/wifi/usr.bin/make/job.c#16 integrate .. //depot/projects/wifi/usr.bin/make/main.c#19 integrate .. //depot/projects/wifi/usr.bin/make/parse.c#15 integrate .. //depot/projects/wifi/usr.bin/make/suff.c#10 integrate .. //depot/projects/wifi/usr.bin/make/var.c#14 integrate .. //depot/projects/wifi/usr.bin/make/var.h#7 integrate .. //depot/projects/wifi/usr.bin/smbutil/Makefile#2 integrate .. //depot/projects/wifi/usr.bin/tar/Makefile#8 integrate .. //depot/projects/wifi/usr.bin/tar/tree.c#2 integrate .. //depot/projects/wifi/usr.bin/tar/tree.h#2 integrate .. //depot/projects/wifi/usr.bin/tar/write.c#6 integrate .. //depot/projects/wifi/usr.sbin/authpf/Makefile#2 integrate .. //depot/projects/wifi/usr.sbin/mount_smbfs/Makefile#3 integrate .. //depot/projects/wifi/usr.sbin/ndiscvt/windrv_stub.c#2 integrate .. //depot/projects/wifi/usr.sbin/ppp/ppp.8.m4#10 integrate .. //depot/projects/wifi/usr.sbin/sysinstall/menus.c#8 integrate Differences ... ==== //depot/projects/wifi/UPDATING#15 (text+ko) ==== @@ -21,6 +21,11 @@ developers choose to disable these features on build machines to maximize performance. +20050503: + The packet filter (pf) code has been updated to OpenBSD 3.7 + Please note the changed anchor syntax and the fact that + authpf(8) now needs a mounted fdescfs(5) to function. + 20050415: The NO_MIXED_MODE kernel option has been removed from the i386 amd64 platforms as its use has been superceded by the new local @@ -198,7 +203,6 @@ make kernel KERNCONF=YOUR_KERNEL_HERE [1] [3] - src/etc/rc.d/preseedrandom [10] mergemaster -p [5] make installworld mergemaster [4] @@ -331,4 +335,4 @@ Contact Warner Losh if you have any questions about your use of this document. -$FreeBSD: src/UPDATING,v 1.401 2005/04/18 14:33:18 scottl Exp $ +$FreeBSD: src/UPDATING,v 1.403 2005/05/09 16:44:22 imp Exp $ ==== //depot/projects/wifi/bin/csh/config.h#5 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/bin/csh/config.h,v 1.11 2005/04/24 19:50:22 mp Exp $ */ +/* $FreeBSD: src/bin/csh/config.h,v 1.12 2005/05/04 20:21:57 mp Exp $ */ /* config.h. Generated by configure. */ /* config.h.in. Generated from configure.in by autoheader. */ @@ -99,7 +99,7 @@ #define HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY 1 /* Define to 1 if `ut_host' is member of `struct utmp'. */ -/* #undef HAVE_STRUCT_UTMP_UT_HOST */ +#define HAVE_STRUCT_UTMP_UT_HOST 1 /* Define to 1 if `ut_tv' is member of `struct utmp'. */ /* #undef HAVE_STRUCT_UTMP_UT_TV */ ==== //depot/projects/wifi/contrib/ipfilter/tools/ipmon.c#2 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/contrib/ipfilter/tools/ipmon.c,v 1.2 2005/04/25 18:20:15 darrenr Exp $ */ +/* $FreeBSD: src/contrib/ipfilter/tools/ipmon.c,v 1.3 2005/05/08 00:29:15 grehan Exp $ */ /* * Copyright (C) 1993-2001, 2003 by Darren Reed. @@ -1024,7 +1024,7 @@ (void) sprintf(t, "%*.*s%u", len, len, ipf->fl_ifname, ipf->fl_unit); t += strlen(t); #endif -#ifdef __sgi +#if (defined(__sgi) || defined(__powerpc__)) if ((ipf->fl_group[0] == 255) && (ipf->fl_group[1] == '\0')) #else if ((ipf->fl_group[0] == -1) && (ipf->fl_group[1] == '\0')) ==== //depot/projects/wifi/contrib/pf/authpf/authpf.8#2 (text+ko) ==== @@ -1,4 +1,4 @@ -.\" $OpenBSD: authpf.8,v 1.31 2003/12/10 04:10:37 beck Exp $ +.\" $OpenBSD: authpf.8,v 1.38 2005/01/04 09:57:04 jmc Exp $ .\" .\" Copyright (c) 2002 Bob Beck (beck@openbsd.org>. All rights reserved. .\" @@ -60,6 +60,10 @@ requires that the .Xr pf 4 system be enabled before use. +.Nm +can also maintain the list of IP address of connected users +in the "authpf_users" +.Pa table . .Pp .Nm is meant to be used with users who can connect via @@ -93,11 +97,16 @@ .Nm rules: .Bd -literal -offset indent -nat-anchor authpf -rdr-anchor authpf -binat-anchor authpf -anchor authpf +nat-anchor "authpf/*" +rdr-anchor "authpf/*" +binat-anchor "authpf/*" +anchor "authpf/*" .Ed +.Pp +The "/*" at the end of the anchor name is required for +.Xr pf 4 +to process the rulesets attached to the anchor by +.Nm authpf . .Sh FILTER AND TRANSLATION RULES Filter and translation rules for .Nm @@ -113,10 +122,14 @@ .Em user_id is assigned the user name. .Pp -Filter and nat rules will first be searched for in +Filter and translation rules are stored in a file called +.Pa authpf.rules . +This file will first be searched for in .Pa /etc/authpf/users/$USER/ and then in .Pa /etc/authpf/ . +Only one of these files will be used if both are present. +.Pp Per-user rules from the .Pa /etc/authpf/users/$USER/ directory are intended to be used when non-default rules @@ -124,21 +137,11 @@ It is important to ensure that a user can not write or change these configuration files. .Pp -Filter and translation rules are loaded from the file -.Pa /etc/authpf/users/$USER/authpf.rules . -If this file does not exist the file -.Pa /etc/authpf/authpf.rules -is used. The .Pa authpf.rules file must exist in one of the above locations for .Nm to run. -.Pp -Translation rules are also loaded from this file. -The use of translation rules in an -.Pa authpf.rules -file is optional. .Sh CONFIGURATION Options are controlled by the .Pa /etc/authpf/authpf.conf @@ -154,6 +157,10 @@ Use the specified .Pa anchor name instead of "authpf". +.It table=name +Use the specified +.Pa table +name instead of "authpf_users". .El .Sh USER MESSAGES On successful invocation, @@ -218,9 +225,15 @@ hijack the session. Note that TCP keepalives are not sufficient for this, since they are not secure. +Also note that +.Ar AllowTcpForwarding +should be disabled for +.Nm +users to prevent them from circumventing restrictions imposed by the +packet filter ruleset. .Pp .Nm -will remove statetable entries that were created during a user's +will remove state table entries that were created during a user's session. This ensures that there will be no unauthenticated traffic allowed to pass after the controlling @@ -391,15 +404,15 @@ # ssh and use us as a dns server. internal_if="fxp1" gateway_addr="10.0.1.1" -nat-anchor authpf -rdr-anchor authpf -binat-anchor authpf +nat-anchor "authpf/*" +rdr-anchor "authpf/*" +binat-anchor "authpf/*" block in on $internal_if from any to any pass in quick on $internal_if proto tcp from any to $gateway_addr \e port = ssh pass in quick on $internal_if proto udp from any to $gateway_addr \e port = domain -anchor authpf +anchor "authpf/*" .Ed .Pp .Sy For a switched, wired net @@ -465,6 +478,33 @@ 129.128.11.10.60539 > 198.137.240.92.22: S 2131494121:2131494121(0) win \e 16384 (DF) .Ed +.Pp +.Sy Using the authpf_users table +\- Simple +.Nm +settings can be implemented without an anchor by just using the "authpf_users" +.Pa table . +For example, the following +.Xr pf.conf 5 +lines will give SMTP and IMAP access to logged in users: +.Bd -literal +table persist +pass in on $ext_if proto tcp from \e + to port { smtp imap } keep state +.Ed +.Pp +It is also possible to use the "authpf_users" +.Pa table +in combination with anchors. +For example, +.Xr pf 4 +processing can be sped up by looking up the anchor +only for packets coming from logged in users: +.Bd -literal +table persist +anchor "authpf/*" from +rdr-anchor "authpf/*" from +.Ed .Sh FILES .Bl -tag -width "/etc/authpf/authpf.conf" -compact .It Pa /etc/authpf/authpf.conf ==== //depot/projects/wifi/contrib/pf/authpf/authpf.c#2 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $OpenBSD: authpf.c,v 1.75 2004/01/29 01:55:10 deraadt Exp $ */ +/* $OpenBSD: authpf.c,v 1.89 2005/02/10 04:24:15 joel Exp $ */ /* * Copyright (C) 1998 - 2002 Bob Beck (beck@openbsd.org). @@ -26,13 +26,15 @@ */ #include -__FBSDID("$FreeBSD: src/contrib/pf/authpf/authpf.c,v 1.5 2004/06/16 23:39:30 mlaier Exp $"); +__FBSDID("$FreeBSD: src/contrib/pf/authpf/authpf.c,v 1.6 2005/05/03 16:55:19 mlaier Exp $"); #include #include #include #include +#include #include +#include #include #include @@ -40,6 +42,7 @@ #include #include +#include #include #include #include @@ -48,9 +51,6 @@ #include #include -#include -#include - #include "pathnames.h" extern int symset(const char *, const char *, int); @@ -61,11 +61,13 @@ static int check_luser(char *, char *); static int remove_stale_rulesets(void); static int change_filter(int, const char *, const char *); +static int change_table(int, const char *, const char *); static void authpf_kill_states(void); int dev; /* pf device */ char anchorname[PF_ANCHOR_NAME_SIZE] = "authpf"; -char rulesetname[PF_RULESET_NAME_SIZE]; +char rulesetname[MAXPATHLEN - PF_ANCHOR_NAME_SIZE - 2]; +char tablename[PF_TABLE_NAME_SIZE] = "authpf_users"; FILE *pidfp; char *infile; /* file name printed by yyerror() in parse.y */ @@ -94,10 +96,12 @@ { int lockcnt = 0, n, pidfd; FILE *config; - struct in_addr ina; + struct in6_addr ina; struct passwd *pw; char *cp; uid_t uid; + char *shell; + login_cap_t *lc; config = fopen(PATH_CONFFILE, "r"); @@ -121,7 +125,8 @@ exit(1); } *cp = '\0'; - if (inet_pton(AF_INET, ipsrc, &ina) != 1) { + if (inet_pton(AF_INET, ipsrc, &ina) != 1 && + inet_pton(AF_INET6, ipsrc, &ina) != 1) { syslog(LOG_ERR, "cannot determine IP from SSH_CLIENT %s", ipsrc); exit(1); @@ -135,16 +140,31 @@ uid = getuid(); pw = getpwuid(uid); + endpwent(); if (pw == NULL) { syslog(LOG_ERR, "cannot find user for uid %u", uid); goto die; } - if (strcmp(pw->pw_shell, PATH_AUTHPF_SHELL)) { + + if ((lc = login_getclass(pw->pw_class)) != NULL) + shell = (char *)login_getcapstr(lc, "shell", pw->pw_shell, + pw->pw_shell); + else + shell = pw->pw_shell; + + login_close(lc); + + if (strcmp(shell, PATH_AUTHPF_SHELL)) { syslog(LOG_ERR, "wrong shell for user %s, uid %u", pw->pw_name, pw->pw_uid); + if (shell != pw->pw_shell) + free(shell); goto die; } + if (shell != pw->pw_shell) + free(shell); + /* * Paranoia, but this data _does_ come from outside authpf, and * truncation would be bad. @@ -155,11 +175,11 @@ } if ((n = snprintf(rulesetname, sizeof(rulesetname), "%s(%ld)", - luser, (long)getpid())) < 0 || n >= sizeof(rulesetname)) { + luser, (long)getpid())) < 0 || (u_int)n >= sizeof(rulesetname)) { syslog(LOG_INFO, "%s(%ld) too large, ruleset name will be %ld", luser, (long)getpid(), (long)getpid()); if ((n = snprintf(rulesetname, sizeof(rulesetname), "%ld", - (long)getpid())) < 0 || n >= sizeof(rulesetname)) { + (long)getpid())) < 0 || (u_int)n >= sizeof(rulesetname)) { syslog(LOG_ERR, "pid too large for ruleset name"); goto die; } @@ -269,12 +289,17 @@ rewind(pidfp); fprintf(pidfp, "%ld\n%s\n", (long)getpid(), luser); fflush(pidfp); - (void) ftruncate(fileno(pidfp), ftell(pidfp)); + (void) ftruncate(fileno(pidfp), ftello(pidfp)); if (change_filter(1, luser, ipsrc) == -1) { printf("Unable to modify filters\r\n"); do_death(0); } + if (change_table(1, luser, ipsrc) == -1) { + printf("Unable to modify table\r\n"); + change_filter(0, luser, ipsrc); + do_death(0); + } signal(SIGTERM, need_death); signal(SIGINT, need_death); @@ -284,7 +309,7 @@ signal(SIGSTOP, need_death); signal(SIGTSTP, need_death); while (1) { - printf("\r\nHello %s, ", luser); + printf("\r\nHello %s. ", luser); printf("You are authenticated from host \"%s\"\r\n", ipsrc); setproctitle("%s@%s", luser, ipsrc); print_message(PATH_MESSAGE); @@ -359,6 +384,11 @@ sizeof(anchorname)) >= sizeof(anchorname)) goto parse_error; } + if (strcasecmp(pair[0], "table") == 0) { + if (!pair[1][0] || strlcpy(tablename, pair[1], + sizeof(tablename)) >= sizeof(tablename)) + goto parse_error; + } } while (!feof(f) && !ferror(f)); fclose(f); return (0); @@ -542,12 +572,10 @@ remove_stale_rulesets(void) { struct pfioc_ruleset prs; - const int action[PF_RULESET_MAX] = { PF_SCRUB, - PF_PASS, PF_NAT, PF_BINAT, PF_RDR }; u_int32_t nr, mnr; memset(&prs, 0, sizeof(prs)); - strlcpy(prs.anchor, anchorname, sizeof(prs.anchor)); + strlcpy(prs.path, anchorname, sizeof(prs.path)); if (ioctl(dev, DIOCGETRULESETS, &prs)) { if (errno == EINVAL) return (0); @@ -574,20 +602,25 @@ (*s && (t == prs.name || *s != ')'))) return (1); if (kill(pid, 0) && errno != EPERM) { - int i; + int i; + struct pfioc_trans_e t_e[PF_RULESET_MAX+1]; + struct pfioc_trans t; - for (i = 0; i < PF_RULESET_MAX; ++i) { - struct pfioc_rule pr; - - memset(&pr, 0, sizeof(pr)); - memcpy(pr.anchor, prs.anchor, sizeof(pr.anchor)); - memcpy(pr.ruleset, prs.name, sizeof(pr.ruleset)); - pr.rule.action = action[i]; - if ((ioctl(dev, DIOCBEGINRULES, &pr) || - ioctl(dev, DIOCCOMMITRULES, &pr)) && - errno != EINVAL) - return (1); + bzero(&t, sizeof(t)); + bzero(t_e, sizeof(t_e)); + t.size = PF_RULESET_MAX+1; + t.esize = sizeof(t_e[0]); + t.array = t_e; + for (i = 0; i < PF_RULESET_MAX+1; ++i) { + t_e[i].rs_num = i; + snprintf(t_e[i].anchor, sizeof(t_e[i].anchor), + "%s/%s", anchorname, prs.name); } + t_e[PF_RULESET_MAX].rs_num = PF_RULESET_TABLE; + if ((ioctl(dev, DIOCXBEGIN, &t) || + ioctl(dev, DIOCXCOMMIT, &t)) && + errno != EINVAL) + return (1); mnr--; } else nr++; @@ -601,85 +634,67 @@ static int change_filter(int add, const char *luser, const char *ipsrc) { - char fn[MAXPATHLEN]; - FILE *f = NULL; - struct pfctl pf; - struct pfr_buffer t; - int i; + char *pargv[13] = { + "pfctl", "-p", "/dev/pf", "-q", "-a", "anchor/ruleset", + "-D", "user_ip=X", "-D", "user_id=X", "-f", + "file", NULL + }; + char *fdpath = NULL, *userstr = NULL, *ipstr = NULL; + char *rsn = NULL, *fn = NULL; + pid_t pid; + int s; if (luser == NULL || !luser[0] || ipsrc == NULL || !ipsrc[0]) { syslog(LOG_ERR, "invalid luser/ipsrc"); goto error; } + if (asprintf(&rsn, "%s/%s", anchorname, rulesetname) == -1) + goto no_mem; + if (asprintf(&fdpath, "/dev/fd/%d", dev) == -1) + goto no_mem; + if (asprintf(&ipstr, "user_ip=%s", ipsrc) == -1) + goto no_mem; + if (asprintf(&userstr, "user_id=%s", luser) == -1) + goto no_mem; + if (add) { - if ((i = snprintf(fn, sizeof(fn), "%s/%s/authpf.rules", - PATH_USER_DIR, luser)) < 0 || i >= sizeof(fn)) { - syslog(LOG_ERR, "user rule path too long"); - goto error; - } - if ((f = fopen(fn, "r")) == NULL && errno != ENOENT) { - syslog(LOG_ERR, "cannot open %s (%m)", fn); - goto error; - } - if (f == NULL) { - if (strlcpy(fn, PATH_PFRULES, sizeof(fn)) >= - sizeof(fn)) { - syslog(LOG_ERR, "rule path too long"); - goto error; - } - if ((f = fopen(fn, "r")) == NULL) { - syslog(LOG_ERR, "cannot open %s (%m)", fn); - goto error; - } + struct stat sb; + + if (asprintf(&fn, "%s/%s/authpf.rules", PATH_USER_DIR, luser) + == -1) + goto no_mem; + if (stat(fn, &sb) == -1) { + free(fn); + if ((fn = strdup(PATH_PFRULES)) == NULL) + goto no_mem; } } + pargv[2] = fdpath; + pargv[5] = rsn; + pargv[7] = userstr; + pargv[9] = ipstr; + if (!add) + pargv[11] = "/dev/null"; + else + pargv[11] = fn; - if (pfctl_load_fingerprints(dev, 0)) { - syslog(LOG_ERR, "unable to load kernel's OS fingerprints"); - goto error; - } - bzero(&t, sizeof(t)); - t.pfrb_type = PFRB_TRANS; - memset(&pf, 0, sizeof(pf)); - for (i = 0; i < PF_RULESET_MAX; ++i) { - if (pfctl_add_trans(&t, i, anchorname, rulesetname)) { - syslog(LOG_ERR, "pfctl_add_trans %m"); - goto error; - } - } - if (pfctl_trans(dev, &t, DIOCXBEGIN, 0)) { - syslog(LOG_ERR, "DIOCXBEGIN (%s) %m", add?"add":"remove"); - goto error; + switch (pid = fork()) { + case -1: + err(1, "fork failed"); + case 0: + execvp(PATH_PFCTL, pargv); + warn("exec of %s failed", PATH_PFCTL); + _exit(1); } - if (add) { - if (symset("user_ip", ipsrc, 0) || - symset("user_id", luser, 0)) { - syslog(LOG_ERR, "symset"); - goto error; - } - - pf.dev = dev; - pf.trans = &t; - pf.anchor = anchorname; - pf.ruleset = rulesetname; - - infile = fn; - if (parse_rules(f, &pf) < 0) { - syslog(LOG_ERR, "syntax error in rule file: " - "authpf rules not loaded"); + /* parent */ + waitpid(pid, &s, 0); + if (s != 0) { + if (WIFEXITED(s)) { + syslog(LOG_ERR, "pfctl exited abnormally"); goto error; } - - infile = NULL; - fclose(f); - f = NULL; - } - - if (pfctl_trans(dev, &t, DIOCXCOMMIT, 0)) { - syslog(LOG_ERR, "DIOCXCOMMIT (%s) %m", add?"add":"remove"); - goto error; } if (add) { @@ -691,18 +706,63 @@ ipsrc, luser, Tend.tv_sec - Tstart.tv_sec); } return (0); - +no_mem: + syslog(LOG_ERR, "malloc failed"); error: - if (f != NULL) - fclose(f); - if (pfctl_trans(dev, &t, DIOCXROLLBACK, 0)) - syslog(LOG_ERR, "DIOCXROLLBACK (%s) %m", add?"add":"remove"); - + free(fdpath); + fdpath = NULL; + free(rsn); + rsn = NULL; + free(userstr); + userstr = NULL; + free(ipstr); + ipstr = NULL; + free(fn); + fn = NULL; infile = NULL; return (-1); } /* + * Add/remove this IP from the "authpf_users" table. + */ +static int +change_table(int add, const char *luser, const char *ipsrc) +{ + struct pfioc_table io; + struct pfr_addr addr; + + bzero(&io, sizeof(io)); + strlcpy(io.pfrio_table.pfrt_name, tablename, sizeof(io.pfrio_table)); + io.pfrio_buffer = &addr; + io.pfrio_esize = sizeof(addr); + io.pfrio_size = 1; + + bzero(&addr, sizeof(addr)); + if (ipsrc == NULL || !ipsrc[0]) + return (-1); + if (inet_pton(AF_INET, ipsrc, &addr.pfra_ip4addr) == 1) { + addr.pfra_af = AF_INET; + addr.pfra_net = 32; + } else if (inet_pton(AF_INET6, ipsrc, &addr.pfra_ip6addr) == 1) { + addr.pfra_af = AF_INET6; + addr.pfra_net = 128; + } else { + syslog(LOG_ERR, "invalid ipsrc"); + return (-1); + } + + if (ioctl(dev, add ? DIOCRADDADDRS : DIOCRDELADDRS, &io) && + errno != ESRCH) { + syslog(LOG_ERR, "cannot %s %s from table %s: %s", + add ? "add" : "remove", ipsrc, tablename, + strerror(errno)); + return (-1); + } + return (0); +} + +/* * This is to kill off states that would otherwise be left behind stateful * rules. This means we don't need to allow in more traffic than we really * want to, since we don't have to worry about any luser sessions lasting @@ -713,24 +773,32 @@ authpf_kill_states(void) { struct pfioc_state_kill psk; - struct in_addr target; + struct pf_addr target; memset(&psk, 0, sizeof(psk)); - psk.psk_af = AF_INET; + memset(&target, 0, sizeof(target)); - inet_pton(AF_INET, ipsrc, &target); + if (inet_pton(AF_INET, ipsrc, &target.v4) == 1) + psk.psk_af = AF_INET; + else if (inet_pton(AF_INET6, ipsrc, &target.v6) == 1) + psk.psk_af = AF_INET6; + else { + syslog(LOG_ERR, "inet_pton(%s) failed", ipsrc); + return; + } /* Kill all states from ipsrc */ - psk.psk_src.addr.v.a.addr.v4 = target; + memcpy(&psk.psk_src.addr.v.a.addr, &target, + sizeof(psk.psk_src.addr.v.a.addr)); memset(&psk.psk_src.addr.v.a.mask, 0xff, sizeof(psk.psk_src.addr.v.a.mask)); if (ioctl(dev, DIOCKILLSTATES, &psk)) syslog(LOG_ERR, "DIOCKILLSTATES failed (%m)"); /* Kill all states to ipsrc */ - psk.psk_af = AF_INET; memset(&psk.psk_src, 0, sizeof(psk.psk_src)); - psk.psk_dst.addr.v.a.addr.v4 = target; + memcpy(&psk.psk_dst.addr.v.a.addr, &target, + sizeof(psk.psk_dst.addr.v.a.addr)); memset(&psk.psk_dst.addr.v.a.mask, 0xff, sizeof(psk.psk_dst.addr.v.a.mask)); if (ioctl(dev, DIOCKILLSTATES, &psk)) @@ -758,6 +826,7 @@ if (active) { change_filter(0, luser, ipsrc); + change_table(0, luser, ipsrc); authpf_kill_states(); remove_stale_rulesets(); } @@ -768,157 +837,3 @@ syslog(LOG_ERR, "cannot unlink %s (%m)", pidfile); exit(ret); } - -/* - * callbacks for parse_rules(void) - */ - -int -pfctl_add_rule(struct pfctl *pf, struct pf_rule *r) -{ - u_int8_t rs_num; - struct pfioc_rule pr; - - switch (r->action) { - case PF_PASS: >>> TRUNCATED FOR MAIL (1000 lines) <<< From owner-p4-projects@FreeBSD.ORG Mon May 9 21:28:42 2005 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 960D416A4EC; Mon, 9 May 2005 21:28:41 +0000 (GMT) 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 5A20816A4EB for ; Mon, 9 May 2005 21:28:41 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2895E43D80 for ; Mon, 9 May 2005 21:28:41 +0000 (GMT) (envelope-from csjp@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 j49LSfc3009906 for ; Mon, 9 May 2005 21:28:41 GMT (envelope-from csjp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j49LSeLs009903 for perforce@freebsd.org; Mon, 9 May 2005 21:28:40 GMT (envelope-from csjp@freebsd.org) Date: Mon, 9 May 2005 21:28:40 GMT Message-Id: <200505092128.j49LSeLs009903@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to csjp@freebsd.org using -f From: "Christian S.J. Peron" To: Perforce Change Reviews Subject: PERFORCE change 76765 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 May 2005 21:28:42 -0000 http://perforce.freebsd.org/chv.cgi?CH=76765 Change 76765 by csjp@csjp_xor on 2005/05/09 21:27:45 Do not include absolute path Affected files ... .. //depot/projects/trustedbsd/mac/usr.sbin/getfhash/Makefile#2 edit .. //depot/projects/trustedbsd/mac/usr.sbin/getfhash/getfhash.c#4 edit Differences ... ==== //depot/projects/trustedbsd/mac/usr.sbin/getfhash/Makefile#2 (text+ko) ==== @@ -2,6 +2,5 @@ LINKS= ${BINDIR}/getfhash ${BINDIR}/setfhash NO_MAN= WARNS= 6 -CFLAGS += -I/usr/src/sys - +CFLAGS+= -I../../sys .include ==== //depot/projects/trustedbsd/mac/usr.sbin/getfhash/getfhash.c#4 (text+ko) ==== From owner-p4-projects@FreeBSD.ORG Tue May 10 00:53:54 2005 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id D9B5716A4ED; Tue, 10 May 2005 00:53:53 +0000 (GMT) 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 93AE316A4EB for ; Tue, 10 May 2005 00:53:53 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 832A243D39 for ; Tue, 10 May 2005 00:53:53 +0000 (GMT) (envelope-from csjp@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 j4A0rrcD024065 for ; Tue, 10 May 2005 00:53:53 GMT (envelope-from csjp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j4A0rrvP024062 for perforce@freebsd.org; Tue, 10 May 2005 00:53:53 GMT (envelope-from csjp@freebsd.org) Date: Tue, 10 May 2005 00:53:53 GMT Message-Id: <200505100053.j4A0rrvP024062@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to csjp@freebsd.org using -f From: "Christian S.J. Peron" To: Perforce Change Reviews Subject: PERFORCE change 76767 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 May 2005 00:53:54 -0000 http://perforce.freebsd.org/chv.cgi?CH=76767 Change 76767 by csjp@csjp_xor on 2005/05/10 00:53:05 Second thought, remove any CFLAGS hacks Affected files ... .. //depot/projects/trustedbsd/mac/usr.sbin/getfhash/Makefile#3 edit .. //depot/projects/trustedbsd/mac/usr.sbin/getfhash/getfhash.c#5 edit Differences ... ==== //depot/projects/trustedbsd/mac/usr.sbin/getfhash/Makefile#3 (text+ko) ==== @@ -2,5 +2,5 @@ LINKS= ${BINDIR}/getfhash ${BINDIR}/setfhash NO_MAN= WARNS= 6 -CFLAGS+= -I../../sys + .include ==== //depot/projects/trustedbsd/mac/usr.sbin/getfhash/getfhash.c#5 (text+ko) ==== @@ -43,7 +43,6 @@ static void set_hash(const char *); static int print_hash_from_stdin(void); - static int depth; static int dflag; static int rflag; From owner-p4-projects@FreeBSD.ORG Tue May 10 05:31:27 2005 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 74B6B16A4F1; Tue, 10 May 2005 05:31:27 +0000 (GMT) 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 291A516A4EE for ; Tue, 10 May 2005 05:31:27 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id E9E1143D2D for ; Tue, 10 May 2005 05:31:26 +0000 (GMT) (envelope-from marcel@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 j4A5VQ1v040539 for ; Tue, 10 May 2005 05:31:26 GMT (envelope-from marcel@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j4A5VQls040536 for perforce@freebsd.org; Tue, 10 May 2005 05:31:26 GMT (envelope-from marcel@freebsd.org) Date: Tue, 10 May 2005 05:31:26 GMT Message-Id: <200505100531.j4A5VQls040536@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to marcel@freebsd.org using -f From: Marcel Moolenaar To: Perforce Change Reviews Subject: PERFORCE change 76769 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 May 2005 05:31:28 -0000 http://perforce.freebsd.org/chv.cgi?CH=76769 Change 76769 by marcel@marcel_nfs on 2005/05/10 05:31:23 o Define the VGA framebuffer resource size as 64K, not as 128K. We program the VGA to use a 64K page size. o Disable access to the palettes by default, as it's the normal operating mode. o Remove some EGA specific definitions. Affected files ... .. //depot/projects/tty/sys/dev/ic/vga.h#4 edit Differences ... ==== //depot/projects/tty/sys/dev/ic/vga.h#4 (text+ko) ==== @@ -48,21 +48,21 @@ */ #define VGA_MEM_BASE 0xA0000 -#define VGA_MEM_SIZE 0x20000 +#define VGA_MEM_SIZE 0x10000 #define VGA_REG_BASE 0x3c0 #define VGA_REG_SIZE 0x10+0x0c /* Attribute controller registers. */ #define VGA_AC_WRITE 0x00 #define VGA_AC_READ 0x01 -#define VGA_AC_PALETTE(x) x /* 0 <= x <= 15 */ +#define VGA_AC_PALETTE(x) (x) /* 0 <= x <= 15 */ #define VGA_AC_PAL_SR 0x20 /* Secondary red */ #define VGA_AC_PAL_SG 0x10 /* Secondary green */ #define VGA_AC_PAL_SB 0x08 /* Secondary blue */ #define VGA_AC_PAL_R 0x04 /* Red */ #define VGA_AC_PAL_G 0x02 /* Green */ #define VGA_AC_PAL_B 0x01 /* Blue */ -#define VGA_AC_MODE_CONTROL 16 +#define VGA_AC_MODE_CONTROL (32+16) #define VGA_AC_MC_IPS 0x80 /* Internal palette size */ #define VGA_AC_MC_PCS 0x40 /* Pixel clock select */ #define VGA_AC_MC_PPC 0x20 /* Pixel panning compat. */ @@ -70,10 +70,10 @@ #define VGA_AC_MC_ELG 0x04 /* Enable line graphics cc. */ #define VGA_AC_MC_DT 0x02 /* Display type */ #define VGA_AC_MC_GA 0x01 /* Graphics/alphanumeric */ -#define VGA_AC_OVERSCAN_COLOR 17 -#define VGA_AC_COLOR_PLANE_ENABLE 18 -#define VGA_AC_HORIZ_PIXEL_PANNING 19 -#define VGA_AC_COLOR_SELECT 20 +#define VGA_AC_OVERSCAN_COLOR (32+17) +#define VGA_AC_COLOR_PLANE_ENABLE (32+18) +#define VGA_AC_HORIZ_PIXEL_PANNING (32+19) +#define VGA_AC_COLOR_SELECT (32+20) #define VGA_AC_CS_C67 0x0C /* Color reg. addr. bits 6+7 */ #define VGA_AC_CS_C45 0x03 /* Color reg. addr. bits 4+5 */ @@ -87,10 +87,8 @@ #define VGA_GEN_MO_ER 0x02 /* Enable RAM */ #define VGA_GEN_MO_IOA 0x01 /* Input/output address */ #define VGA_GEN_INPUT_STAT_0 0x02 /* Read only. */ -#define VGA_GEN_IS0_SS 0x10 /* Switch sense */ #define VGA_GEN_FEATURE_CTRL_W 0x1a /* Write only. */ #define VGA_GEN_FEATURE_CTRL_R 0x0a /* Read only. */ -#define VGA_GEN_FC_VSS 0x80 /* vertical sync. select */ #define VGA_GEN_INPUT_STAT_1 0x1a /* Read only. */ #define VGA_GEN_IS1_VR 0x08 /* Vertical retrace */ #define VGA_GEN_IS1_DE 0x01 /* Display enable not */ @@ -120,7 +118,6 @@ #define VGA_SEQ_MM_C4 0x08 /* Chain four */ #define VGA_SEQ_MM_OE 0x04 /* Odd/even */ #define VGA_SEQ_MM_EM 0x02 /* Extended memory */ -#define VGA_SEQ_MM_AG 0x01 /* Alpha/graphics mode */ #define VGA_SEQ_DATA 0x05 /* Color registers. */ From owner-p4-projects@FreeBSD.ORG Tue May 10 05:38:36 2005 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 7CB0616A4F0; Tue, 10 May 2005 05:38:36 +0000 (GMT) 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 5679716A4EE for ; Tue, 10 May 2005 05:38:36 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2B3F043D60 for ; Tue, 10 May 2005 05:38:36 +0000 (GMT) (envelope-from marcel@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 j4A5caX8040917 for ; Tue, 10 May 2005 05:38:36 GMT (envelope-from marcel@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j4A5cZdX040914 for perforce@freebsd.org; Tue, 10 May 2005 05:38:35 GMT (envelope-from marcel@freebsd.org) Date: Tue, 10 May 2005 05:38:35 GMT Message-Id: <200505100538.j4A5cZdX040914@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to marcel@freebsd.org using -f From: Marcel Moolenaar To: Perforce Change Reviews Subject: PERFORCE change 76770 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 May 2005 05:38:37 -0000 http://perforce.freebsd.org/chv.cgi?CH=76770 Change 76770 by marcel@marcel_nfs on 2005/05/10 05:37:55 o Add convenience macros to read from and write to the frame buffer. o Reorder the programming sequence to first program the registers that define the overall operating mode. Then initialize the rest. This just "feels" better. I don't think it matters. o Properly clear the frame buffer. The way the VGA operates, a read is needed to load the 32-bit latch, after which a write actually triggers a write. Writing only doesn't take any effect. Affected files ... .. //depot/projects/tty/sys/dev/vga/vga.c#9 edit Differences ... ==== //depot/projects/tty/sys/dev/vga/vga.c#9 (text+ko) ==== @@ -38,6 +38,10 @@ #include /* Convenience macros. */ +#define MEM_READ(sc, ofs) \ + bus_space_read_1(sc->vga_fb.bst, sc->vga_fb.bsh, ofs) +#define MEM_WRITE(sc, ofs, val) \ + bus_space_write_1(sc->vga_fb.bst, sc->vga_fb.bsh, ofs, val) #define REG_READ(sc, reg) \ bus_space_read_1(sc->vga_reg.bst, sc->vga_reg.bsh, reg) #define REG_WRITE(sc, reg, val) \ @@ -57,12 +61,18 @@ int vga_init(struct vga_softc *sc) { + u_int ofs; uint8_t x; /* Make sure the VGA adapter is not in monochrome emulation mode. */ x = REG_READ(sc, VGA_GEN_MISC_OUTPUT_R); REG_WRITE(sc, VGA_GEN_MISC_OUTPUT_W, x | VGA_GEN_MO_IOA); + /* Unprotect CRTC registers 0-7. */ + REG_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_VERT_RETRACE_END); + x = REG_READ(sc, VGA_CRTC_DATA); + REG_WRITE(sc, VGA_CRTC_DATA, x & ~VGA_CRTC_VRE_PR); + /* * Wait for the vertical retrace. * NOTE: this code reads the VGA_GEN_INPUT_STAT_1 register, which has @@ -84,17 +94,27 @@ REG_WRITE(sc, VGA_CRTC_DATA, x & ~VGA_CRTC_MC_HR); /* - * Set the VGA adapter in mode 0x12 (640x480x16). + * Part 1: Reprogram the overall operating mode. */ - /* Unprotect CRTC registers 0-7. */ - REG_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_VERT_RETRACE_END); - x = REG_READ(sc, VGA_CRTC_DATA); - REG_WRITE(sc, VGA_CRTC_DATA, x & ~VGA_CRTC_VRE_PR); - - /* - * Reprogram the CRTC. - */ + /* Asynchronous sequencer reset. */ + REG_WRITE(sc, VGA_SEQ_ADDRESS, VGA_SEQ_RESET); + REG_WRITE(sc, VGA_SEQ_DATA, VGA_SEQ_RST_SR); + /* Clock select. */ + REG_WRITE(sc, VGA_GEN_MISC_OUTPUT_W, VGA_GEN_MO_VSP | VGA_GEN_MO_HSP | + VGA_GEN_MO_PB | VGA_GEN_MO_ER | VGA_GEN_MO_IOA); + /* Set sequencer clocking and memory mode. */ + REG_WRITE(sc, VGA_SEQ_ADDRESS, VGA_SEQ_CLOCKING_MODE); + REG_WRITE(sc, VGA_SEQ_DATA, VGA_SEQ_CM_89); + REG_WRITE(sc, VGA_SEQ_ADDRESS, VGA_SEQ_MEMORY_MODE); + REG_WRITE(sc, VGA_SEQ_DATA, VGA_SEQ_MM_OE | VGA_SEQ_MM_EM); + /* Set the graphics controller in graphics mode. */ + REG_WRITE(sc, VGA_GC_ADDRESS, VGA_GC_MISCELLANEOUS); + REG_WRITE(sc, VGA_GC_DATA, 0x04 + VGA_GC_MISC_GA); + /* Set the attribute controller in graphics mode. */ + REG_WRITE(sc, VGA_AC_WRITE, VGA_AC_MODE_CONTROL); + REG_WRITE(sc, VGA_AC_WRITE, VGA_AC_MC_GA); + /* Program the CRT controller. */ REG_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_HORIZ_TOTAL); REG_WRITE(sc, VGA_CRTC_DATA, 0x5f); /* 760 */ REG_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_HORIZ_DISP_END); @@ -112,32 +132,16 @@ REG_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_OVERFLOW); REG_WRITE(sc, VGA_CRTC_DATA, VGA_CRTC_OF_VT9 | VGA_CRTC_OF_LC8 | VGA_CRTC_OF_VBS8 | VGA_CRTC_OF_VRS8 | VGA_CRTC_OF_VDE8); - REG_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_PRESET_ROW_SCAN); - REG_WRITE(sc, VGA_CRTC_DATA, 0); REG_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_MAX_SCAN_LINE); REG_WRITE(sc, VGA_CRTC_DATA, VGA_CRTC_MSL_LC9); - REG_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_CURSOR_START); - REG_WRITE(sc, VGA_CRTC_DATA, 0); - REG_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_CURSOR_END); - REG_WRITE(sc, VGA_CRTC_DATA, 0); - REG_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_START_ADDR_HIGH); - REG_WRITE(sc, VGA_CRTC_DATA, 0); - REG_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_START_ADDR_LOW); - REG_WRITE(sc, VGA_CRTC_DATA, 0); - REG_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_CURSOR_LOC_HIGH); - REG_WRITE(sc, VGA_CRTC_DATA, 0); - REG_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_CURSOR_LOC_LOW); - REG_WRITE(sc, VGA_CRTC_DATA, 0x59); REG_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_VERT_RETRACE_START); REG_WRITE(sc, VGA_CRTC_DATA, 0xea); /* 480 + 10 */ REG_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_VERT_RETRACE_END); - REG_WRITE(sc, VGA_CRTC_DATA, 0x8c); + REG_WRITE(sc, VGA_CRTC_DATA, 0x0c); REG_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_VERT_DISPLAY_END); REG_WRITE(sc, VGA_CRTC_DATA, 0xdf); /* 480 - 1*/ REG_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_OFFSET); REG_WRITE(sc, VGA_CRTC_DATA, 0x28); - REG_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_UNDERLINE_LOC); - REG_WRITE(sc, VGA_CRTC_DATA, 0); REG_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_START_VERT_BLANK); REG_WRITE(sc, VGA_CRTC_DATA, 0xe7); /* 480 + 7 */ REG_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_END_VERT_BLANK); @@ -147,34 +151,55 @@ VGA_CRTC_MC_SRS | VGA_CRTC_MC_CMS); REG_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_LINE_COMPARE); REG_WRITE(sc, VGA_CRTC_DATA, 0xff); /* 480 + 31 */ + /* Re-enable the sequencer. */ + REG_WRITE(sc, VGA_SEQ_ADDRESS, VGA_SEQ_RESET); + REG_WRITE(sc, VGA_SEQ_DATA, VGA_SEQ_RST_SR | VGA_SEQ_RST_NAR); /* - * Reprogram the general registers. + * Part 2: Reprogram the remaining registers. */ - REG_WRITE(sc, VGA_GEN_MISC_OUTPUT_W, VGA_GEN_MO_VSP | VGA_GEN_MO_HSP | - VGA_GEN_MO_PB | VGA_GEN_MO_ER | VGA_GEN_MO_IOA); REG_WRITE(sc, VGA_GEN_FEATURE_CTRL_W, 0); - /* - * Reprogram the sequencer. - */ - REG_WRITE(sc, VGA_SEQ_ADDRESS, VGA_SEQ_RESET); - REG_WRITE(sc, VGA_SEQ_DATA, VGA_SEQ_RST_SR | VGA_SEQ_RST_NAR); - REG_WRITE(sc, VGA_SEQ_ADDRESS, VGA_SEQ_CLOCKING_MODE); - REG_WRITE(sc, VGA_SEQ_DATA, VGA_SEQ_CM_89); REG_WRITE(sc, VGA_SEQ_ADDRESS, VGA_SEQ_MAP_MASK); REG_WRITE(sc, VGA_SEQ_DATA, VGA_SEQ_MM_EM3 | VGA_SEQ_MM_EM2 | VGA_SEQ_MM_EM1 | VGA_SEQ_MM_EM0); REG_WRITE(sc, VGA_SEQ_ADDRESS, VGA_SEQ_CHAR_MAP_SELECT); REG_WRITE(sc, VGA_SEQ_DATA, 0); - REG_WRITE(sc, VGA_SEQ_ADDRESS, VGA_SEQ_MEMORY_MODE); - REG_WRITE(sc, VGA_SEQ_DATA, VGA_SEQ_MM_OE | VGA_SEQ_MM_EM); + + REG_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_PRESET_ROW_SCAN); + REG_WRITE(sc, VGA_CRTC_DATA, 0); + REG_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_CURSOR_START); + REG_WRITE(sc, VGA_CRTC_DATA, 0); + REG_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_CURSOR_END); + REG_WRITE(sc, VGA_CRTC_DATA, 0); + REG_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_START_ADDR_HIGH); + REG_WRITE(sc, VGA_CRTC_DATA, 0); + REG_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_START_ADDR_LOW); + REG_WRITE(sc, VGA_CRTC_DATA, 0); + REG_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_CURSOR_LOC_HIGH); + REG_WRITE(sc, VGA_CRTC_DATA, 0); + REG_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_CURSOR_LOC_LOW); + REG_WRITE(sc, VGA_CRTC_DATA, 0x59); + REG_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_UNDERLINE_LOC); + REG_WRITE(sc, VGA_CRTC_DATA, 0); + + REG_WRITE(sc, VGA_GC_ADDRESS, VGA_GC_SET_RESET); + REG_WRITE(sc, VGA_GC_DATA, 0); + REG_WRITE(sc, VGA_GC_ADDRESS, VGA_GC_ENABLE_SET_RESET); + REG_WRITE(sc, VGA_GC_DATA, 0); + REG_WRITE(sc, VGA_GC_ADDRESS, VGA_GC_COLOR_COMPARE); + REG_WRITE(sc, VGA_GC_DATA, 0); + REG_WRITE(sc, VGA_GC_ADDRESS, VGA_GC_DATA_ROTATE); + REG_WRITE(sc, VGA_GC_DATA, 0); + REG_WRITE(sc, VGA_GC_ADDRESS, VGA_GC_READ_MAP_SELECT); + REG_WRITE(sc, VGA_GC_DATA, 0); + REG_WRITE(sc, VGA_GC_ADDRESS, VGA_GC_MODE); + REG_WRITE(sc, VGA_GC_DATA, 0); + REG_WRITE(sc, VGA_GC_ADDRESS, VGA_GC_COLOR_DONT_CARE); + REG_WRITE(sc, VGA_GC_DATA, 0x0f); + REG_WRITE(sc, VGA_GC_ADDRESS, VGA_GC_BIT_MASK); + REG_WRITE(sc, VGA_GC_DATA, 0xff); - /* - * Reprogram the attribute controller. The internal flip-flop is - * known to be clear and the next first will be to the address - * register. - */ REG_WRITE(sc, VGA_AC_WRITE, VGA_AC_PALETTE(0)); REG_WRITE(sc, VGA_AC_WRITE, 0); REG_WRITE(sc, VGA_AC_WRITE, VGA_AC_PALETTE(1)); @@ -215,8 +240,6 @@ REG_WRITE(sc, VGA_AC_WRITE, VGA_AC_PALETTE(15)); REG_WRITE(sc, VGA_AC_WRITE, VGA_AC_PAL_SR | VGA_AC_PAL_SG | VGA_AC_PAL_SB | VGA_AC_PAL_R | VGA_AC_PAL_G | VGA_AC_PAL_B); - REG_WRITE(sc, VGA_AC_WRITE, VGA_AC_MODE_CONTROL); - REG_WRITE(sc, VGA_AC_WRITE, VGA_AC_MC_GA); REG_WRITE(sc, VGA_AC_WRITE, VGA_AC_OVERSCAN_COLOR); REG_WRITE(sc, VGA_AC_WRITE, 0); REG_WRITE(sc, VGA_AC_WRITE, VGA_AC_COLOR_PLANE_ENABLE); @@ -227,32 +250,13 @@ REG_WRITE(sc, VGA_AC_WRITE, 0); /* - * Reprogram the graphics controller. - */ - REG_WRITE(sc, VGA_GC_ADDRESS, VGA_GC_SET_RESET); - REG_WRITE(sc, VGA_GC_DATA, 0); - REG_WRITE(sc, VGA_GC_ADDRESS, VGA_GC_ENABLE_SET_RESET); - REG_WRITE(sc, VGA_GC_DATA, 0); - REG_WRITE(sc, VGA_GC_ADDRESS, VGA_GC_COLOR_COMPARE); - REG_WRITE(sc, VGA_GC_DATA, 0); - REG_WRITE(sc, VGA_GC_ADDRESS, VGA_GC_DATA_ROTATE); - REG_WRITE(sc, VGA_GC_DATA, 0); - REG_WRITE(sc, VGA_GC_ADDRESS, VGA_GC_READ_MAP_SELECT); - REG_WRITE(sc, VGA_GC_DATA, 0); - REG_WRITE(sc, VGA_GC_ADDRESS, VGA_GC_MODE); - REG_WRITE(sc, VGA_GC_DATA, 0); - REG_WRITE(sc, VGA_GC_ADDRESS, VGA_GC_MISCELLANEOUS); - REG_WRITE(sc, VGA_GC_DATA, 0x04 + VGA_GC_MISC_GA); - REG_WRITE(sc, VGA_GC_ADDRESS, VGA_GC_COLOR_DONT_CARE); - REG_WRITE(sc, VGA_GC_DATA, 0x0f); - REG_WRITE(sc, VGA_GC_ADDRESS, VGA_GC_BIT_MASK); - REG_WRITE(sc, VGA_GC_DATA, 0xff); - - /* * Done. Clear the frame buffer. All bit planes are enabled, so - * a single write should clear all planes. + * a single-paged loop should clear all planes. */ - bus_space_set_multi_1(sc->vga_fb.bst, sc->vga_fb.bsh, 0, 0, 65536); + for (ofs = 0; ofs < 38400; ofs++) { + MEM_READ(sc, ofs); + MEM_WRITE(sc, ofs, 0); + } /* Re-enable the sync signals. */ REG_WRITE(sc, VGA_CRTC_ADDRESS, VGA_CRTC_MODE_CONTROL); From owner-p4-projects@FreeBSD.ORG Tue May 10 11:27:46 2005 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id B34A316A4D1; Tue, 10 May 2005 11:27:45 +0000 (GMT) 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 6FC6716A4CE; Tue, 10 May 2005 11:27:45 +0000 (GMT) Received: from gw-kit.locore.ca (gw-kit.locore.ca [67.43.130.39]) by mx1.FreeBSD.org (Postfix) with ESMTP id 18B2F43D4C; Tue, 10 May 2005 11:27:45 +0000 (GMT) (envelope-from jake@locore.ca) Received: from [10.0.0.3] (ws.locore.ca [10.0.0.3]) by gw-kit.locore.ca (Postfix) with ESMTP id 58DCB163A66; Tue, 10 May 2005 07:27:44 -0400 (EDT) Message-ID: <42809AAF.5060904@locore.ca> Date: Tue, 10 May 2005 07:27:43 -0400 From: Jake Burkholder User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050424) X-Accept-Language: en-us, en MIME-Version: 1.0 To: John Baldwin References: <200504171042.j3HAgeTQ054345@repoman.freebsd.org> <87f1dd37c46f5e61c68035b9989ae5b7@FreeBSD.org> In-Reply-To: <87f1dd37c46f5e61c68035b9989ae5b7@FreeBSD.org> Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit cc: Perforce Change Reviews cc: David Xu Subject: Re: PERFORCE change 75366 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 May 2005 11:27:46 -0000 John Baldwin wrote: > > On Apr 17, 2005, at 6:42 AM, David Xu wrote: > >> http://perforce.freebsd.org/chv.cgi?CH=75366 >> >> Change 75366 by davidxu@davidxu_alona on 2005/04/17 10:42:05 >> >> Implement cpu_set_user_tls for sparc64. >> >> Affected files ... >> >> .. >> //depot/projects/davidxu_thread/src/sys/sparc64/sparc64/vm_machdep.c#6 >> edit >> >> Differences ... >> >> ==== >> //depot/projects/davidxu_thread/src/sys/sparc64/sparc64/vm_machdep.c#6 >> (text+ko) ==== >> >> @@ -194,6 +194,15 @@ >> td->td_retval[1] = tf->tf_out[1]; >> } >> >> +void >> +cpu_set_user_tls(struct thread *td, void *tls_base, size_t tls_size, >> + int tls_seg __unused) >> +{ >> + if (td == curthread) >> + flushw(); >> + td->td_frame->tf_global[7] = tls_base; >> +} >> + > > > I think for at least this one and Alpha you might want a critical > section in the curthread case like you do on i386 and amd64 since > calling the Alpha PAL and setting tls_base + flushw() are more than > one instruction long. > Just FWIW, you don't need a flushw when setting the global registers since they're not windowed and guaranteed to be reloaded on return to user mode. Jake From owner-p4-projects@FreeBSD.ORG Tue May 10 13:37:54 2005 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id DF5BC16A4D0; Tue, 10 May 2005 13:37:53 +0000 (GMT) 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 89B7416A4D2 for ; Tue, 10 May 2005 13:37:53 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6CBF343D41 for ; Tue, 10 May 2005 13:37:53 +0000 (GMT) (envelope-from areisse@nailabs.com) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j4ADbrLO073460 for ; Tue, 10 May 2005 13:37:53 GMT (envelope-from areisse@nailabs.com) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j4ADbrmL073457 for perforce@freebsd.org; Tue, 10 May 2005 13:37:53 GMT (envelope-from areisse@nailabs.com) Date: Tue, 10 May 2005 13:37:53 GMT Message-Id: <200505101337.j4ADbrmL073457@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to areisse@nailabs.com using -f From: Andrew Reisse To: Perforce Change Reviews Subject: PERFORCE change 76783 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 May 2005 13:37:54 -0000 http://perforce.freebsd.org/chv.cgi?CH=76783 Change 76783 by areisse@areisse_ibook on 2005/05/10 13:37:42 Support for returning values from mac_syscall. On FreeBSD, the implementation of mpo_syscall would store the return value directly into the thread structure. On Darwin, the syscall handlers have an explicit storage for the return value. Affected files ... .. //depot/projects/trustedbsd/sedarwin7/src/darwin/xnu/bsd/sys/mac_policy.h#5 edit .. //depot/projects/trustedbsd/sedarwin7/src/darwin/xnu/security/mac_base.c#3 edit Differences ... ==== //depot/projects/trustedbsd/sedarwin7/src/darwin/xnu/bsd/sys/mac_policy.h#5 (text+ko) ==== @@ -82,7 +82,8 @@ * may implement new services without reserving explicit * system call numbers. */ - int (*mpo_syscall)(struct proc *p, int call, void *arg); + int (*mpo_syscall)(struct proc *p, int call, void *arg, + int *retv); /* * Label operations. ==== //depot/projects/trustedbsd/sedarwin7/src/darwin/xnu/security/mac_base.c#3 (text+ko) ==== @@ -1140,7 +1140,7 @@ if (strcmp(mpc->mpc_name, target) == 0 && mpc->mpc_ops->mpo_syscall != NULL) { error = mpc->mpc_ops->mpo_syscall(p, - uap->call, uap->arg); + uap->call, uap->arg, retv); goto out; } } @@ -1150,7 +1150,7 @@ if (strcmp(mpc->mpc_name, target) == 0 && mpc->mpc_ops->mpo_syscall != NULL) { error = mpc->mpc_ops->mpo_syscall(p, - uap->call, uap->arg); + uap->call, uap->arg, retv); break; } } From owner-p4-projects@FreeBSD.ORG Tue May 10 13:43:00 2005 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 8282016A4D1; Tue, 10 May 2005 13:43:00 +0000 (GMT) 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 4512B16A4CE for ; Tue, 10 May 2005 13:43:00 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2727043D69 for ; Tue, 10 May 2005 13:43:00 +0000 (GMT) (envelope-from areisse@nailabs.com) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j4ADh004073729 for ; Tue, 10 May 2005 13:43:00 GMT (envelope-from areisse@nailabs.com) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j4ADgxbt073724 for perforce@freebsd.org; Tue, 10 May 2005 13:42:59 GMT (envelope-from areisse@nailabs.com) Date: Tue, 10 May 2005 13:42:59 GMT Message-Id: <200505101342.j4ADgxbt073724@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to areisse@nailabs.com using -f From: Andrew Reisse To: Perforce Change Reviews Subject: PERFORCE change 76784 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 May 2005 13:43:01 -0000 http://perforce.freebsd.org/chv.cgi?CH=76784 Change 76784 by areisse@areisse_ibook on 2005/05/10 13:42:32 Post-merge fixes: -Include file paths -32 vs 64bit access_vector_t -Conditional policy support Affected files ... .. //depot/projects/trustedbsd/sedarwin7/src/sedarwin/sedarwin/Makefile#3 edit .. //depot/projects/trustedbsd/sedarwin7/src/sedarwin/sedarwin/avc/avc.c#3 edit .. //depot/projects/trustedbsd/sedarwin7/src/sedarwin/sedarwin/sebsd_syscall.c#3 edit .. //depot/projects/trustedbsd/sedarwin7/src/sedarwin/sedarwin/ss/conditional.c#2 edit .. //depot/projects/trustedbsd/sedarwin7/src/sedarwin/sedarwin/ss/conditional.h#2 edit .. //depot/projects/trustedbsd/sedarwin7/src/sedarwin/sedarwin/ss/policydb.c#3 edit .. //depot/projects/trustedbsd/sedarwin7/src/sedarwin/sedarwin/ss/services.c#3 edit Differences ... ==== //depot/projects/trustedbsd/sedarwin7/src/sedarwin/sedarwin/Makefile#3 (text+ko) ==== @@ -5,7 +5,7 @@ OBJS = sebsd.o sebsd_syscall.o sebsd_sysctl.o ss/avtab.o ss/ebitmap.o \ ss/hashtab.o ss/init.o ss/policydb.o ss/queue.o ss/services.o \ - ss/sidtab.o ss/symtab.o avc/avc.o ss/mach_av.o + ss/sidtab.o ss/symtab.o avc/avc.o ss/mach_av.o ss/conditional.o sedarwin.kext.tar: sedarwin.o ==== //depot/projects/trustedbsd/sedarwin7/src/sedarwin/sedarwin/avc/avc.c#3 (text+ko) ==== @@ -96,11 +96,12 @@ #else static inline void avc_cache_stats_incr(int type) { } - if (rc) + static inline void avc_cache_stats_add(int type, unsigned val) { } #endif +#if 0 /** * avc_dump_av - Display an access vector in human-readable form. * @tclass: target security class @@ -151,6 +152,7 @@ printk(" }"); } +#endif /** * avc_dump_query - Display a SID pair and a class in human-readable form. ==== //depot/projects/trustedbsd/sedarwin7/src/sedarwin/sedarwin/sebsd_syscall.c#3 (text+ko) ==== @@ -223,10 +223,11 @@ } int -sebsd_syscall(struct proc *td, int call, void *args) +sebsd_syscall(struct proc *td, int call, void *args, int *retv) { int err = EINVAL; struct lp_args p; + struct sebsd_get_bools gb; switch(call) { case SEBSDCALL_LOAD_POLICY: @@ -317,7 +318,7 @@ if (err) return (err); security_get_bool(str, &active, &pending); - *td->td_retval = active | (pending << 1); + *retv = active | (pending << 1); return (0); } @@ -325,7 +326,7 @@ { char *str; - err = thread_has_security(td, SECURITY__SETBOOL); + err = cred_has_security(td->p_ucred, SECURITY__SETBOOL); if (err) return (err); @@ -346,7 +347,7 @@ } case SEBSDCALL_COMMIT_BOOLS: - err = thread_has_security(td, SECURITY__SETBOOL); + err = cred_has_security(td->p_ucred, SECURITY__SETBOOL); if (err) return (err); ==== //depot/projects/trustedbsd/sedarwin7/src/sedarwin/sedarwin/ss/conditional.c#2 (text+ko) ==== @@ -14,9 +14,9 @@ #include #endif /* FreeBSD _KERNEL */ -#include -#include -#include +#include +#include +#include /* * cond_evaluate_expr evaluates a conditional expr ==== //depot/projects/trustedbsd/sedarwin7/src/sedarwin/sedarwin/ss/conditional.h#2 (text+ko) ==== @@ -10,10 +10,10 @@ #ifndef _CONDITIONAL_H_ #define _CONDITIONAL_H_ -#include -#include -#include -#include +#include +#include +#include +#include #define COND_EXPR_MAXDEPTH 10 ==== //depot/projects/trustedbsd/sedarwin7/src/sedarwin/sedarwin/ss/policydb.c#3 (text+ko) ==== @@ -27,6 +27,7 @@ #include #include #include +#include #define _DEBUG_HASHES ==== //depot/projects/trustedbsd/sedarwin7/src/sedarwin/sedarwin/ss/services.c#3 (text+ko) ==== @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -221,9 +222,9 @@ * Initialize the access vectors to the default values. */ avd->allowed = 0; - avd->decided = 0xffffffffffffffffLL; + avd->decided = 0xffffffff; avd->auditallow = 0; - avd->auditdeny = 0xffffffffffffffffLL; + avd->auditdeny = 0xffffffff; avd->seqno = latest_granting; /* @@ -310,7 +311,7 @@ avd->allowed = requested; avd->decided = requested; avd->auditallow = 0; - avd->auditdeny = 0xffffffffffffffffLL; + avd->auditdeny = 0xffffffffLL; avd->seqno = latest_granting; return 0; } From owner-p4-projects@FreeBSD.ORG Tue May 10 23:37:12 2005 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id AA50016A4D1; Tue, 10 May 2005 23:37:11 +0000 (GMT) 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 4D1F916A4CE for ; Tue, 10 May 2005 23:37:11 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1FD9A43D46 for ; Tue, 10 May 2005 23:37:11 +0000 (GMT) (envelope-from marcel@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 j4ANbBqA014960 for ; Tue, 10 May 2005 23:37:11 GMT (envelope-from marcel@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j4ANbAAs014957 for perforce@freebsd.org; Tue, 10 May 2005 23:37:10 GMT (envelope-from marcel@freebsd.org) Date: Tue, 10 May 2005 23:37:10 GMT Message-Id: <200505102337.j4ANbAAs014957@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to marcel@freebsd.org using -f From: Marcel Moolenaar To: Perforce Change Reviews Subject: PERFORCE change 76799 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 May 2005 23:37:12 -0000 http://perforce.freebsd.org/chv.cgi?CH=76799 Change 76799 by marcel@marcel_nfs on 2005/05/10 23:36:16 IFC @76798 Affected files ... .. //depot/projects/tty/UPDATING#16 integrate .. //depot/projects/tty/gnu/lib/libregex/FREEBSD-upgrade#3 integrate .. //depot/projects/tty/gnu/lib/libregex/Makefile#5 integrate .. //depot/projects/tty/gnu/lib/libregex/config.h#1 branch .. //depot/projects/tty/gnu/lib/libregex/posix/regex.h#3 integrate .. //depot/projects/tty/gnu/lib/libregex/regcomp.c#1 branch .. //depot/projects/tty/gnu/lib/libregex/regex.c#5 integrate .. //depot/projects/tty/gnu/lib/libregex/regex_internal.c#1 branch .. //depot/projects/tty/gnu/lib/libregex/regex_internal.h#1 branch .. //depot/projects/tty/gnu/lib/libregex/regexec.c#1 branch .. //depot/projects/tty/share/man/man4/Makefile#16 integrate .. //depot/projects/tty/share/man/man4/man4.i386/acpi_asus.4#4 integrate .. //depot/projects/tty/share/man/man4/mn.4#1 branch .. //depot/projects/tty/share/misc/bsd-family-tree#10 integrate .. //depot/projects/tty/sys/boot/pc98/boot2/io.c#5 integrate .. //depot/projects/tty/sys/conf/files.pc98#16 integrate .. //depot/projects/tty/sys/dev/acpi_support/acpi_asus.c#3 integrate .. //depot/projects/tty/sys/dev/acpica/Osd/OsdSchedule.c#7 integrate .. //depot/projects/tty/sys/dev/acpica/acpi.c#13 integrate .. //depot/projects/tty/sys/dev/acpica/acpivar.h#13 integrate .. //depot/projects/tty/sys/dev/ct/ct_isa.c#6 integrate .. //depot/projects/tty/sys/dev/syscons/syscons.h#4 integrate .. //depot/projects/tty/sys/dev/wl/if_wl.c#9 integrate .. //depot/projects/tty/sys/dev/wl/if_wl_i82586.h#1 branch .. //depot/projects/tty/sys/i386/i386/nexus.c#9 integrate .. //depot/projects/tty/sys/i386/i386/vm_machdep.c#13 integrate .. //depot/projects/tty/sys/i386/isa/atpic.c#6 integrate .. //depot/projects/tty/sys/i386/isa/ic/if_wl_i82586.h#3 delete .. //depot/projects/tty/sys/i386/isa/lptreg.h#2 delete .. //depot/projects/tty/sys/i386/isa/npx.c#10 integrate .. //depot/projects/tty/sys/i386/isa/prof_machdep.c#5 integrate .. //depot/projects/tty/sys/i386/isa/spkr.c#9 integrate .. //depot/projects/tty/sys/ia64/include/bus.h#10 integrate .. //depot/projects/tty/sys/modules/acpi/acpi/Makefile#4 integrate .. //depot/projects/tty/sys/modules/fdc/Makefile#4 integrate .. //depot/projects/tty/sys/modules/pmc/Makefile#2 integrate .. //depot/projects/tty/sys/modules/sio/Makefile#3 integrate .. //depot/projects/tty/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c#9 integrate .. //depot/projects/tty/sys/netgraph/ng_nat.c#2 integrate .. //depot/projects/tty/sys/nfsclient/nfs_socket.c#14 integrate .. //depot/projects/tty/sys/pc98/cbus/30line.h#1 branch .. //depot/projects/tty/sys/pc98/cbus/cbus.h#1 branch .. //depot/projects/tty/sys/pc98/cbus/cbus_dma.c#1 branch .. //depot/projects/tty/sys/pc98/cbus/clock.c#1 branch .. //depot/projects/tty/sys/pc98/cbus/fdc.c#1 branch .. //depot/projects/tty/sys/pc98/cbus/fdc_cbus.c#1 branch .. //depot/projects/tty/sys/pc98/cbus/fdcreg.h#1 branch .. //depot/projects/tty/sys/pc98/cbus/fdcvar.h#1 branch .. //depot/projects/tty/sys/pc98/cbus/gdc.c#1 branch .. //depot/projects/tty/sys/pc98/cbus/nmi.c#1 branch .. //depot/projects/tty/sys/pc98/cbus/olpt.c#1 branch .. //depot/projects/tty/sys/pc98/cbus/olptreg.h#1 branch .. //depot/projects/tty/sys/pc98/cbus/pckbd.c#1 branch .. //depot/projects/tty/sys/pc98/cbus/pmc.c#1 branch .. //depot/projects/tty/sys/pc98/cbus/ppc.c#1 branch .. //depot/projects/tty/sys/pc98/cbus/ppcreg.h#1 branch .. //depot/projects/tty/sys/pc98/cbus/sc_machdep.h#1 branch .. //depot/projects/tty/sys/pc98/cbus/scgdcrndr.c#1 branch .. //depot/projects/tty/sys/pc98/cbus/scterm-sck.c#1 branch .. //depot/projects/tty/sys/pc98/cbus/scvtb.c#1 branch .. //depot/projects/tty/sys/pc98/cbus/sio.c#1 branch .. //depot/projects/tty/sys/pc98/cbus/sio_cbus.c#1 branch .. //depot/projects/tty/sys/pc98/cbus/syscons_cbus.c#1 branch .. //depot/projects/tty/sys/pc98/i386/busio.s#4 delete .. //depot/projects/tty/sys/pc98/i386/busiosubr.c#4 delete .. //depot/projects/tty/sys/pc98/i386/machdep.c#14 delete .. //depot/projects/tty/sys/pc98/pc98/30line.h#3 delete .. //depot/projects/tty/sys/pc98/pc98/busio.s#1 branch .. //depot/projects/tty/sys/pc98/pc98/busiosubr.c#1 branch .. //depot/projects/tty/sys/pc98/pc98/clock.c#11 delete .. //depot/projects/tty/sys/pc98/pc98/fd.c#10 delete .. //depot/projects/tty/sys/pc98/pc98/fdc_cbus.c#2 delete .. //depot/projects/tty/sys/pc98/pc98/fdcvar.h#2 delete .. //depot/projects/tty/sys/pc98/pc98/fdreg.h#3 delete .. //depot/projects/tty/sys/pc98/pc98/isa_dma.c#5 delete .. //depot/projects/tty/sys/pc98/pc98/machdep.c#1 branch .. //depot/projects/tty/sys/pc98/pc98/nmi.c#3 delete .. //depot/projects/tty/sys/pc98/pc98/olpt.c#8 delete .. //depot/projects/tty/sys/pc98/pc98/pc98.h#5 delete .. //depot/projects/tty/sys/pc98/pc98/pc98_machdep.c#4 integrate .. //depot/projects/tty/sys/pc98/pc98/pc98gdc.c#11 delete .. //depot/projects/tty/sys/pc98/pc98/pc98kbd.c#6 delete .. //depot/projects/tty/sys/pc98/pc98/pmc.c#3 delete .. //depot/projects/tty/sys/pc98/pc98/ppc.c#7 delete .. //depot/projects/tty/sys/pc98/pc98/ppcreg.h#2 delete .. //depot/projects/tty/sys/pc98/pc98/sc_machdep.h#2 delete .. //depot/projects/tty/sys/pc98/pc98/scgdcrndr.c#3 delete .. //depot/projects/tty/sys/pc98/pc98/scterm-sck.c#4 delete .. //depot/projects/tty/sys/pc98/pc98/scvtbpc98.c#3 delete .. //depot/projects/tty/sys/pc98/pc98/sio.c#15 delete .. //depot/projects/tty/sys/pc98/pc98/sio_cbus.c#4 delete .. //depot/projects/tty/sys/pc98/pc98/syscons_pc98.c#4 delete .. //depot/projects/tty/sys/pccard/pccard_nbk.c#6 integrate .. //depot/projects/tty/usr.bin/make/GNode.h#2 integrate .. //depot/projects/tty/usr.bin/make/Makefile#6 integrate .. //depot/projects/tty/usr.bin/make/arch.c#4 integrate .. //depot/projects/tty/usr.bin/make/compat.c#6 delete .. //depot/projects/tty/usr.bin/make/compat.h#2 delete .. //depot/projects/tty/usr.bin/make/for.c#6 integrate .. //depot/projects/tty/usr.bin/make/globals.h#3 integrate .. //depot/projects/tty/usr.bin/make/job.c#6 integrate .. //depot/projects/tty/usr.bin/make/job.h#5 integrate .. //depot/projects/tty/usr.bin/make/main.c#11 integrate .. //depot/projects/tty/usr.bin/make/make.c#4 integrate .. //depot/projects/tty/usr.bin/make/make.h#6 integrate .. //depot/projects/tty/usr.bin/make/nonints.h#7 delete .. //depot/projects/tty/usr.bin/make/parse.c#8 integrate .. //depot/projects/tty/usr.bin/make/parse.h#2 integrate .. //depot/projects/tty/usr.bin/make/suff.c#5 integrate .. //depot/projects/tty/usr.bin/make/targ.c#4 integrate .. //depot/projects/tty/usr.bin/make/var.c#8 integrate .. //depot/projects/tty/usr.bin/make/var.h#5 integrate .. //depot/projects/tty/usr.bin/make/var_modify.c#4 delete .. //depot/projects/tty/usr.bin/sed/main.c#6 integrate .. //depot/projects/tty/usr.bin/sed/sed.1#7 integrate Differences ... ==== //depot/projects/tty/UPDATING#16 (text+ko) ==== @@ -203,7 +203,6 @@ make kernel KERNCONF=YOUR_KERNEL_HERE [1] [3] - src/etc/rc.d/preseedrandom [10] mergemaster -p [5] make installworld mergemaster [4] @@ -336,4 +335,4 @@ Contact Warner Losh if you have any questions about your use of this document. -$FreeBSD: src/UPDATING,v 1.402 2005/05/03 17:43:13 mlaier Exp $ +$FreeBSD: src/UPDATING,v 1.403 2005/05/09 16:44:22 imp Exp $ ==== //depot/projects/tty/gnu/lib/libregex/FREEBSD-upgrade#3 (text+ko) ==== @@ -1,12 +1,18 @@ -$FreeBSD: src/gnu/lib/libregex/FREEBSD-upgrade,v 1.2 2004/07/06 00:10:40 ache Exp $ +$FreeBSD: src/gnu/lib/libregex/FREEBSD-upgrade,v 1.3 2005/05/10 12:04:01 tjr Exp $ -GNU regex (from grep): +GNU regex (from glibc): -originals can be found at: -http://download.fedora.redhat.com/pub/fedora/linux/core/2/SRPMS/grep-2.5.1-26.src.rpm - Imported by: -cvs import \ - -m "Import of GNU regex from GNU grep 2.5.1 (trimmed)." \ - src/gnu/lib/libregex FSF from_grep_v2_5_1 +cvs -z 9 -d :pserver:anoncvs@sources.redhat.com:/cvs/glibc login +# enter "anoncvs" as the password +cvs -z 9 -d :pserver:anoncvs@sources.redhat.com:/cvs/glibc \ + co -r fedora-glibc-2_3_4-21 libc/posix libc/include +mkdir regex regex/posix +cd libc/posix +cp regcomp.c regex.c regex_internal.c regex_internal.h regexec.c $OLDPWD/regex/ +cp regex.h $OLDPWD/regex/posix/ +cd - +cp libc/include/regex.h regex/ +cd regex +cvs import src/gnu/lib/libregex FSF fedora-glibc-2_3_4-21 ==== //depot/projects/tty/gnu/lib/libregex/Makefile#5 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/gnu/lib/libregex/Makefile,v 1.30 2004/09/19 12:15:25 ru Exp $ +# $FreeBSD: src/gnu/lib/libregex/Makefile,v 1.31 2005/05/10 11:37:37 tjr Exp $ SUBDIR= doc @@ -14,7 +14,7 @@ PXINCS= posix/regex.h PXINCSDIR= ${INCSDIR}/posix -CFLAGS+=-D_REGEX_RE_COMP -DSTDC_HEADERS +CFLAGS+=-DHAVE_CONFIG_H -I${.CURDIR} CLEANFILES= regex.h.patched gnuregex.c regex.h.patched: regex.h ==== //depot/projects/tty/gnu/lib/libregex/posix/regex.h#3 (text+ko) ==== @@ -1,28 +1,29 @@ /* Definitions for data structures and routines for the regular - expression library, version 0.12. - Copyright (C) 1985,1989-1993,1995-1998, 2000 Free Software Foundation, Inc. - - This file is part of the GNU C Library. Its master source is NOT part of - the C library, however. The master source lives in /gd/gnu/lib. + expression library. + Copyright (C) 1985,1989-93,1995-98,2000,2001,2002,2003 + Free Software Foundation, Inc. + This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. + Lesser General Public License for more details. - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ #ifndef _REGEX_H #define _REGEX_H 1 +#include + /* Allow the use in C++ code. */ #ifdef __cplusplus extern "C" { @@ -165,6 +166,23 @@ treated as 'a\{1'. */ #define RE_INVALID_INTERVAL_ORD (RE_DEBUG << 1) +/* If this bit is set, then ignore case when matching. + If not set, then case is significant. */ +#define RE_ICASE (RE_INVALID_INTERVAL_ORD << 1) + +/* This bit is used internally like RE_CONTEXT_INDEP_ANCHORS but only + for ^, because it is difficult to scan the regex backwards to find + whether ^ should be special. */ +#define RE_CARET_ANCHORS_HERE (RE_ICASE << 1) + +/* If this bit is set, then \{ cannot be first in an bre or + immediately after an alternation or begin-group operator. */ +#define RE_CONTEXT_INVALID_DUP (RE_CARET_ANCHORS_HERE << 1) + +/* If this bit is set, then no_sub will be set to 1 during + re_compile_pattern. */ +#define RE_NO_SUB (RE_CONTEXT_INVALID_DUP << 1) + /* This global variable defines the particular regexp syntax to use (for some interfaces). When a regexp is compiled, the syntax used is stored in the pattern buffer, so changing this does not affect @@ -186,7 +204,8 @@ #define RE_SYNTAX_GNU_AWK \ ((RE_SYNTAX_POSIX_EXTENDED | RE_BACKSLASH_ESCAPE_IN_LISTS | RE_DEBUG) \ - & ~(RE_DOT_NOT_NULL | RE_INTERVALS | RE_CONTEXT_INDEP_OPS)) + & ~(RE_DOT_NOT_NULL | RE_INTERVALS | RE_CONTEXT_INDEP_OPS \ + | RE_CONTEXT_INVALID_OPS )) #define RE_SYNTAX_POSIX_AWK \ (RE_SYNTAX_POSIX_EXTENDED | RE_BACKSLASH_ESCAPE_IN_LISTS \ @@ -218,7 +237,7 @@ | RE_INTERVALS | RE_NO_EMPTY_RANGES) #define RE_SYNTAX_POSIX_BASIC \ - (_RE_SYNTAX_POSIX_COMMON | RE_BK_PLUS_QM) + (_RE_SYNTAX_POSIX_COMMON | RE_BK_PLUS_QM | RE_CONTEXT_INVALID_DUP) /* Differs from ..._POSIX_BASIC only in that RE_BK_PLUS_QM becomes RE_LIMITED_OPS, i.e., \? \+ \| are not recognized. Actually, this @@ -283,6 +302,10 @@ /* Like REG_NOTBOL, except for the end-of-line. */ #define REG_NOTEOL (1 << 1) +/* Use PMATCH[0] to delimit the start and end of the search in the + buffer. */ +#define REG_STARTEND (1 << 2) + /* If any error codes are removed, changed, or added, update the `re_error_msg' table in regex.c. */ @@ -298,7 +321,7 @@ /* POSIX regcomp return error codes. (In the order listed in the standard.) */ REG_BADPAT, /* Invalid pattern. */ - REG_ECOLLATE, /* Not implemented. */ + REG_ECOLLATE, /* Inalid collating element. */ REG_ECTYPE, /* Invalid character class name. */ REG_EESCAPE, /* Trailing backslash. */ REG_ESUBREG, /* Invalid back reference. */ @@ -530,10 +553,14 @@ # endif # endif #endif -/* For now unconditionally define __restrict_arr to expand to nothing. - Ideally we would have a test for the compiler which allows defining - it to restrict. */ -#define __restrict_arr +/* gcc 3.1 and up support the [restrict] syntax. */ +#ifndef __restrict_arr +# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1) +# define __restrict_arr __restrict +# else +# define __restrict_arr +# endif +#endif /* POSIX compatibility. */ extern int regcomp _RE_ARGS ((regex_t *__restrict __preg, ==== //depot/projects/tty/gnu/lib/libregex/regex.c#5 (text+ko) ==== @@ -1,86 +1,52 @@ -/* $FreeBSD: src/gnu/lib/libregex/regex.c,v 1.14 2004/07/04 02:46:55 tjr Exp $ */ -/* Extended regular expression matching and search library, - version 0.12. - (Implements POSIX draft P1003.2/D11.2, except for some of the - internationalization features.) - Copyright (C) 1993-1999, 2000, 2001 Free Software Foundation, Inc. +/* $FreeBSD: src/gnu/lib/libregex/regex.c,v 1.15 2005/05/10 10:52:30 tjr Exp $ */ +/* Extended regular expression matching and search library. + Copyright (C) 2002, 2003 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Isamu Hasegawa . The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. + Lesser General Public License for more details. - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -/* AIX requires this to be the first thing in the file. */ -#if defined _AIX && !defined REGEX_MALLOC - #pragma alloca -#endif - -#undef _GNU_SOURCE -#define _GNU_SOURCE + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ #ifdef HAVE_CONFIG_H -# include +#include "config.h" #endif -#ifndef PARAMS -# if defined __GNUC__ || (defined __STDC__ && __STDC__) -# define PARAMS(args) args -# else -# define PARAMS(args) () -# endif /* GCC. */ -#endif /* Not PARAMS. */ - -#if defined STDC_HEADERS && !defined emacs -# include +#ifdef _AIX +#pragma alloca #else -/* We need this for `regex.h', and perhaps for the Emacs include files. */ -# include +# ifndef allocax /* predefined by HP cc +Olibcalls */ +# ifdef __GNUC__ +# define alloca(size) __builtin_alloca (size) +# else +# if HAVE_ALLOCA_H +# include +# else +# ifdef __hpux + void *alloca (); +# else +# if !defined __OS2__ && !defined WIN32 + char *alloca (); +# else +# include /* OS/2 defines alloca in here */ +# endif +# endif +# endif +# endif +# endif #endif -#define WIDE_CHAR_SUPPORT (HAVE_WCTYPE_H && HAVE_WCHAR_H && HAVE_BTOWC) - -/* For platform which support the ISO C amendement 1 functionality we - support user defined character classes. */ -#if defined _LIBC || WIDE_CHAR_SUPPORT -/* Solaris 2.5 has a bug: must be included before . */ -# include -# include -#endif - -/* This is for multi byte string support. */ -#ifdef MBS_SUPPORT -# define CHAR_TYPE wchar_t -# define US_CHAR_TYPE wchar_t/* unsigned character type */ -# define COMPILED_BUFFER_VAR wc_buffer -# define OFFSET_ADDRESS_SIZE 1 /* the size which STORE_NUMBER macro use */ -# define CHAR_CLASS_SIZE ((__alignof__(wctype_t)+sizeof(wctype_t))/sizeof(CHAR_TYPE)+1) -# define PUT_CHAR(c) \ - do { \ - if (MB_CUR_MAX == 1) \ - putchar (c); \ - else \ - printf ("%C", (wint_t) c); /* Should we use wide stream?? */ \ - } while (0) -# define TRUE 1 -# define FALSE 0 -#else -# define CHAR_TYPE char -# define US_CHAR_TYPE unsigned char /* unsigned character type */ -# define COMPILED_BUFFER_VAR bufp->buffer -# define OFFSET_ADDRESS_SIZE 2 -# define PUT_CHAR(c) putchar (c) -#endif /* MBS_SUPPORT */ - #ifdef _LIBC /* We have to keep the namespace clean. */ # define regfree(preg) __regfree (preg) @@ -103,7792 +69,30 @@ __re_search_2 (bufp, st1, s1, st2, s2, startpos, range, regs, stop) # define re_compile_fastmap(bufp) __re_compile_fastmap (bufp) -# define btowc __btowc - -/* We are also using some library internals. */ -# include -# include -# include -# include +# include "../locale/localeinfo.h" #endif -/* This is for other GNU distributions with internationalized messages. */ -#if HAVE_LIBINTL_H || defined _LIBC -# include -# ifdef _LIBC -# undef gettext -# define gettext(msgid) __dcgettext ("libc", msgid, LC_MESSAGES) -# endif -#else -# define gettext(msgid) (msgid) -#endif +/* POSIX says that must be included (by the caller) before + . */ +#include -#ifndef gettext_noop -/* This define is so xgettext can find the internationalizable - strings. */ -# define gettext_noop(String) String -#endif - -/* The `emacs' switch turns on certain matching commands - that make sense only in Emacs. */ -#ifdef emacs - -# include "lisp.h" -# include "buffer.h" -# include "syntax.h" - -#else /* not emacs */ - -/* If we are not linking with Emacs proper, - we can't use the relocating allocator - even if config.h says that we can. */ -# undef REL_ALLOC - -# if defined STDC_HEADERS || defined _LIBC -# include -# else -char *malloc (); -char *realloc (); -# endif - -/* When used in Emacs's lib-src, we need to get bzero and bcopy somehow. - If nothing else has been done, use the method below. */ -# ifdef INHIBIT_STRING_HEADER -# if !(defined HAVE_BZERO && defined HAVE_BCOPY) -# if !defined bzero && !defined bcopy -# undef INHIBIT_STRING_HEADER -# endif -# endif -# endif +/* On some systems, limits.h sets RE_DUP_MAX to a lower value than + GNU regex allows. Include it before , which correctly + #undefs RE_DUP_MAX and sets it to the right value. */ +#include -/* This is the normal way of making sure we have a bcopy and a bzero. - This is used in most programs--a few other programs avoid this - by defining INHIBIT_STRING_HEADER. */ -# ifndef INHIBIT_STRING_HEADER -# if defined HAVE_STRING_H || defined STDC_HEADERS || defined _LIBC -# include -# ifndef bzero -# ifndef _LIBC -# define bzero(s, n) (memset (s, '\0', n), (s)) -# else -# define bzero(s, n) __bzero (s, n) -# endif -# endif -# else -# include -# ifndef memcmp -# define memcmp(s1, s2, n) bcmp (s1, s2, n) -# endif -# ifndef memcpy -# define memcpy(d, s, n) (bcopy (s, d, n), (d)) -# endif -# endif -# endif - -/* Define the syntax stuff for \<, \>, etc. */ - -/* This must be nonzero for the wordchar and notwordchar pattern - commands in re_match_2. */ -# ifndef Sword -# define Sword 1 -# endif - -# ifdef SWITCH_ENUM_BUG -# define SWITCH_ENUM_CAST(x) ((int)(x)) -# else -# define SWITCH_ENUM_CAST(x) (x) -# endif - -#endif /* not emacs */ - -#if defined _LIBC || HAVE_LIMITS_H -# include -#endif - -#ifndef MB_LEN_MAX -# define MB_LEN_MAX 1 -#endif - -/* Get the interface, including the syntax bits. */ #include +#include "regex_internal.h" -/* isalpha etc. are used for the character classes. */ -#include +#include "regex_internal.c" +#include "regcomp.c" +#include "regexec.c" -/* Jim Meyering writes: - - "... Some ctype macros are valid only for character codes that - isascii says are ASCII (SGI's IRIX-4.0.5 is one such system --when - using /bin/cc or gcc but without giving an ansi option). So, all - ctype uses should be through macros like ISPRINT... If - STDC_HEADERS is defined, then autoconf has verified that the ctype - macros don't need to be guarded with references to isascii. ... - Defining isascii to 1 should let any compiler worth its salt - eliminate the && through constant folding." - Solaris defines some of these symbols so we must undefine them first. */ - -#undef ISASCII -#if defined STDC_HEADERS || (!defined isascii && !defined HAVE_ISASCII) -# define ISASCII(c) 1 -#else -# define ISASCII(c) isascii(c) -#endif - -#ifdef isblank -# define ISBLANK(c) (ISASCII (c) && isblank (c)) -#else -# define ISBLANK(c) ((c) == ' ' || (c) == '\t') -#endif -#ifdef isgraph -# define ISGRAPH(c) (ISASCII (c) && isgraph (c)) -#else -# define ISGRAPH(c) (ISASCII (c) && isprint (c) && !isspace (c)) -#endif - -#undef ISPRINT -#define ISPRINT(c) (ISASCII (c) && isprint (c)) -#define ISDIGIT(c) (ISASCII (c) && isdigit (c)) -#define ISALNUM(c) (ISASCII (c) && isalnum (c)) -#define ISALPHA(c) (ISASCII (c) && isalpha (c)) -#define ISCNTRL(c) (ISASCII (c) && iscntrl (c)) -#define ISLOWER(c) (ISASCII (c) && islower (c)) -#define ISPUNCT(c) (ISASCII (c) && ispunct (c)) -#define ISSPACE(c) (ISASCII (c) && isspace (c)) -#define ISUPPER(c) (ISASCII (c) && isupper (c)) -#define ISXDIGIT(c) (ISASCII (c) && isxdigit (c)) - -#ifdef _tolower -# define TOLOWER(c) _tolower(c) -#else -# define TOLOWER(c) tolower(c) -#endif - -#ifndef NULL -# define NULL (void *)0 -#endif - -/* We remove any previous definition of `SIGN_EXTEND_CHAR', - since ours (we hope) works properly with all combinations of - machines, compilers, `char' and `unsigned char' argument types. - (Per Bothner suggested the basic approach.) */ -#undef SIGN_EXTEND_CHAR -#if __STDC__ -# define SIGN_EXTEND_CHAR(c) ((signed char) (c)) -#else /* not __STDC__ */ -/* As in Harbison and Steele. */ -# define SIGN_EXTEND_CHAR(c) ((((unsigned char) (c)) ^ 128) - 128) -#endif - -#ifndef emacs -/* How many characters in the character set. */ -# define CHAR_SET_SIZE 256 - -# ifdef SYNTAX_TABLE - -extern char *re_syntax_table; - -# else /* not SYNTAX_TABLE */ - -static char re_syntax_table[CHAR_SET_SIZE]; - -static void init_syntax_once PARAMS ((void)); - -static void -init_syntax_once () -{ - register int c; - static int done = 0; - - if (done) - return; - bzero (re_syntax_table, sizeof re_syntax_table); - - for (c = 0; c < CHAR_SET_SIZE; ++c) - if (ISALNUM (c)) - re_syntax_table[c] = Sword; - - re_syntax_table['_'] = Sword; - - done = 1; -} - -# endif /* not SYNTAX_TABLE */ - -# define SYNTAX(c) re_syntax_table[(unsigned char) (c)] - -#endif /* emacs */ - -/* Should we use malloc or alloca? If REGEX_MALLOC is not defined, we - use `alloca' instead of `malloc'. This is because using malloc in - re_search* or re_match* could cause memory leaks when C-g is used in - Emacs; also, malloc is slower and causes storage fragmentation. On - the other hand, malloc is more portable, and easier to debug. - - Because we sometimes use alloca, some routines have to be macros, - not functions -- `alloca'-allocated space disappears at the end of the - function it is called in. */ - -#ifdef REGEX_MALLOC - -# define REGEX_ALLOCATE malloc -# define REGEX_REALLOCATE(source, osize, nsize) realloc (source, nsize) -# define REGEX_FREE free - -#else /* not REGEX_MALLOC */ - -/* Emacs already defines alloca, sometimes. */ -# ifndef alloca - -/* Make alloca work the best possible way. */ -# ifdef __GNUC__ -# define alloca __builtin_alloca -# else /* not __GNUC__ */ -# if HAVE_ALLOCA_H -# include -# endif /* HAVE_ALLOCA_H */ -# endif /* not __GNUC__ */ - -# endif /* not alloca */ - -# define REGEX_ALLOCATE alloca - -/* Assumes a `char *destination' variable. */ -# define REGEX_REALLOCATE(source, osize, nsize) \ - (destination = (char *) alloca (nsize), \ - memcpy (destination, source, osize)) - -/* No need to do anything to free, after alloca. */ -# define REGEX_FREE(arg) ((void)0) /* Do nothing! But inhibit gcc warning. */ - -#endif /* not REGEX_MALLOC */ - -/* Define how to allocate the failure stack. */ - -#if defined REL_ALLOC && defined REGEX_MALLOC - -# define REGEX_ALLOCATE_STACK(size) \ - r_alloc (&failure_stack_ptr, (size)) -# define REGEX_REALLOCATE_STACK(source, osize, nsize) \ - r_re_alloc (&failure_stack_ptr, (nsize)) -# define REGEX_FREE_STACK(ptr) \ - r_alloc_free (&failure_stack_ptr) - -#else /* not using relocating allocator */ - -# ifdef REGEX_MALLOC - -# define REGEX_ALLOCATE_STACK malloc -# define REGEX_REALLOCATE_STACK(source, osize, nsize) realloc (source, nsize) -# define REGEX_FREE_STACK free - -# else /* not REGEX_MALLOC */ - -# define REGEX_ALLOCATE_STACK alloca - -# define REGEX_REALLOCATE_STACK(source, osize, nsize) \ - REGEX_REALLOCATE (source, osize, nsize) -/* No need to explicitly free anything. */ -# define REGEX_FREE_STACK(arg) - -# endif /* not REGEX_MALLOC */ -#endif /* not using relocating allocator */ - - -/* True if `size1' is non-NULL and PTR is pointing anywhere inside - `string1' or just past its end. This works if PTR is NULL, which is - a good thing. */ -#define FIRST_STRING_P(ptr) \ - (size1 && string1 <= (ptr) && (ptr) <= string1 + size1) - -/* (Re)Allocate N items of type T using malloc, or fail. */ -#define TALLOC(n, t) ((t *) malloc ((n) * sizeof (t))) -#define RETALLOC(addr, n, t) ((addr) = (t *) realloc (addr, (n) * sizeof (t))) -#define RETALLOC_IF(addr, n, t) \ - if (addr) RETALLOC((addr), (n), t); else (addr) = TALLOC ((n), t) -#define REGEX_TALLOC(n, t) ((t *) REGEX_ALLOCATE ((n) * sizeof (t))) - -#define BYTEWIDTH 8 /* In bits. */ - -#define STREQ(s1, s2) ((strcmp (s1, s2) == 0)) - -#undef MAX -#undef MIN -#define MAX(a, b) ((a) > (b) ? (a) : (b)) -#define MIN(a, b) ((a) < (b) ? (a) : (b)) - -typedef char boolean; -#define false 0 -#define true 1 - -static int re_match_2_internal PARAMS ((struct re_pattern_buffer *bufp, - const char *string1, int size1, - const char *string2, int size2, - int pos, - struct re_registers *regs, - int stop)); - -/* These are the command codes that appear in compiled regular - expressions. Some opcodes are followed by argument bytes. A - command code can specify any interpretation whatsoever for its - arguments. Zero bytes may appear in the compiled regular expression. */ - -typedef enum -{ - no_op = 0, - - /* Succeed right away--no more backtracking. */ - succeed, - - /* Followed by one byte giving n, then by n literal bytes. */ - exactn, - -#ifdef MBS_SUPPORT - /* Same as exactn, but contains binary data. */ - exactn_bin, -#endif - - /* Matches any (more or less) character. */ - anychar, - - /* Matches any one char belonging to specified set. First - following byte is number of bitmap bytes. Then come bytes - for a bitmap saying which chars are in. Bits in each byte - are ordered low-bit-first. A character is in the set if its - bit is 1. A character too large to have a bit in the map is - automatically not in the set. */ - /* ifdef MBS_SUPPORT, following element is length of character - classes, length of collating symbols, length of equivalence - classes, length of character ranges, and length of characters. - Next, character class element, collating symbols elements, - equivalence class elements, range elements, and character - elements follow. - See regex_compile function. */ - charset, - - /* Same parameters as charset, but match any character that is - not one of those specified. */ - charset_not, - - /* Start remembering the text that is matched, for storing in a - register. Followed by one byte with the register number, in - the range 0 to one less than the pattern buffer's re_nsub - field. Then followed by one byte with the number of groups - inner to this one. (This last has to be part of the - start_memory only because we need it in the on_failure_jump - of re_match_2.) */ - start_memory, - - /* Stop remembering the text that is matched and store it in a - memory register. Followed by one byte with the register - number, in the range 0 to one less than `re_nsub' in the - pattern buffer, and one byte with the number of inner groups, - just like `start_memory'. (We need the number of inner - groups here because we don't have any easy way of finding the - corresponding start_memory when we're at a stop_memory.) */ - stop_memory, - - /* Match a duplicate of something remembered. Followed by one - byte containing the register number. */ - duplicate, - - /* Fail unless at beginning of line. */ - begline, - - /* Fail unless at end of line. */ - endline, - - /* Succeeds if at beginning of buffer (if emacs) or at beginning - of string to be matched (if not). */ - begbuf, - - /* Analogously, for end of buffer/string. */ - endbuf, - - /* Followed by two byte relative address to which to jump. */ - jump, - - /* Same as jump, but marks the end of an alternative. */ - jump_past_alt, - - /* Followed by two-byte relative address of place to resume at - in case of failure. */ - /* ifdef MBS_SUPPORT, the size of address is 1. */ - on_failure_jump, - - /* Like on_failure_jump, but pushes a placeholder instead of the - current string position when executed. */ - on_failure_keep_string_jump, - - /* Throw away latest failure point and then jump to following - two-byte relative address. */ - /* ifdef MBS_SUPPORT, the size of address is 1. */ - pop_failure_jump, - - /* Change to pop_failure_jump if know won't have to backtrack to - match; otherwise change to jump. This is used to jump - back to the beginning of a repeat. If what follows this jump - clearly won't match what the repeat does, such that we can be - sure that there is no use backtracking out of repetitions - already matched, then we change it to a pop_failure_jump. - Followed by two-byte address. */ - /* ifdef MBS_SUPPORT, the size of address is 1. */ - maybe_pop_jump, - - /* Jump to following two-byte address, and push a dummy failure - point. This failure point will be thrown away if an attempt - is made to use it for a failure. A `+' construct makes this - before the first repeat. Also used as an intermediary kind - of jump when compiling an alternative. */ - /* ifdef MBS_SUPPORT, the size of address is 1. */ - dummy_failure_jump, - - /* Push a dummy failure point and continue. Used at the end of - alternatives. */ - push_dummy_failure, - - /* Followed by two-byte relative address and two-byte number n. - After matching N times, jump to the address upon failure. */ - /* ifdef MBS_SUPPORT, the size of address is 1. */ - succeed_n, - - /* Followed by two-byte relative address, and two-byte number n. - Jump to the address N times, then fail. */ - /* ifdef MBS_SUPPORT, the size of address is 1. */ - jump_n, - - /* Set the following two-byte relative address to the - subsequent two-byte number. The address *includes* the two - bytes of number. */ - /* ifdef MBS_SUPPORT, the size of address is 1. */ - set_number_at, - - wordchar, /* Matches any word-constituent character. */ - notwordchar, /* Matches any char that is not a word-constituent. */ - - wordbeg, /* Succeeds if at word beginning. */ - wordend, /* Succeeds if at word end. */ - - wordbound, /* Succeeds if at a word boundary. */ - notwordbound /* Succeeds if not at a word boundary. */ - -#ifdef emacs - ,before_dot, /* Succeeds if before point. */ - at_dot, /* Succeeds if at point. */ - after_dot, /* Succeeds if after point. */ - - /* Matches any character whose syntax is specified. Followed by - a byte which contains a syntax code, e.g., Sword. */ - syntaxspec, - - /* Matches any character whose syntax is not that specified. */ - notsyntaxspec -#endif /* emacs */ -} re_opcode_t; - -/* Common operations on the compiled pattern. */ - -/* Store NUMBER in two contiguous bytes starting at DESTINATION. */ -/* ifdef MBS_SUPPORT, we store NUMBER in 1 element. */ - -#ifdef MBS_SUPPORT -# define STORE_NUMBER(destination, number) \ - do { \ - *(destination) = (US_CHAR_TYPE)(number); \ - } while (0) -#else -# define STORE_NUMBER(destination, number) \ - do { \ - (destination)[0] = (number) & 0377; \ - (destination)[1] = (number) >> 8; \ - } while (0) -#endif /* MBS_SUPPORT */ - -/* Same as STORE_NUMBER, except increment DESTINATION to - the byte after where the number is stored. Therefore, DESTINATION - must be an lvalue. */ -/* ifdef MBS_SUPPORT, we store NUMBER in 1 element. */ - -#define STORE_NUMBER_AND_INCR(destination, number) \ - do { \ - STORE_NUMBER (destination, number); \ - (destination) += OFFSET_ADDRESS_SIZE; \ - } while (0) - -/* Put into DESTINATION a number stored in two contiguous bytes starting - at SOURCE. */ -/* ifdef MBS_SUPPORT, we store NUMBER in 1 element. */ - -#ifdef MBS_SUPPORT -# define EXTRACT_NUMBER(destination, source) \ - do { \ - (destination) = *(source); \ - } while (0) -#else -# define EXTRACT_NUMBER(destination, source) \ - do { \ - (destination) = *(source) & 0377; \ - (destination) += SIGN_EXTEND_CHAR (*((source) + 1)) << 8; \ - } while (0) -#endif - -#ifdef DEBUG -static void extract_number _RE_ARGS ((int *dest, US_CHAR_TYPE *source)); -static void -extract_number (dest, source) - int *dest; - US_CHAR_TYPE *source; -{ -#ifdef MBS_SUPPORT - *dest = *source; -#else - int temp = SIGN_EXTEND_CHAR (*(source + 1)); - *dest = *source & 0377; - *dest += temp << 8; -#endif -} >>> TRUNCATED FOR MAIL (1000 lines) <<< From owner-p4-projects@FreeBSD.ORG Wed May 11 19:43:04 2005 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 8E87C16A4D1; Wed, 11 May 2005 19:43:04 +0000 (GMT) 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 6866D16A4CE for ; Wed, 11 May 2005 19:43:04 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3F38443D46 for ; Wed, 11 May 2005 19:43:04 +0000 (GMT) (envelope-from sam@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 j4BJh4Ik099342 for ; Wed, 11 May 2005 19:43:04 GMT (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j4BJh33L099339 for perforce@freebsd.org; Wed, 11 May 2005 19:43:03 GMT (envelope-from sam@freebsd.org) Date: Wed, 11 May 2005 19:43:03 GMT Message-Id: <200505111943.j4BJh33L099339@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Subject: PERFORCE change 76841 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 May 2005 19:43:05 -0000 http://perforce.freebsd.org/chv.cgi?CH=76841 Change 76841 by sam@sam_laptop on 2005/05/11 19:42:16 add missing bits Affected files ... .. //depot/projects/vap/sys/modules/wlan_scan_ap/Makefile#1 add .. //depot/projects/vap/sys/modules/wlan_scan_sta/Makefile#1 add Differences ... From owner-p4-projects@FreeBSD.ORG Thu May 12 01:28:54 2005 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id B9E0D16A56F; Thu, 12 May 2005 01:28:46 +0000 (GMT) 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 0226616A569 for ; Thu, 12 May 2005 01:28:41 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id BEA3343D81 for ; Thu, 12 May 2005 01:28:40 +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 j4C1SdHt021178 for ; Thu, 12 May 2005 01:28:40 GMT (envelope-from cognet@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j4BNdNn0013115 for perforce@freebsd.org; Wed, 11 May 2005 23:39:23 GMT (envelope-from cognet@freebsd.org) Date: Wed, 11 May 2005 23:39:23 GMT Message-Id: <200505112339.j4BNdNn0013115@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 Subject: PERFORCE change 76857 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 May 2005 01:28:54 -0000 http://perforce.freebsd.org/chv.cgi?CH=76857 Change 76857 by cognet@cognet on 2005/05/11 22:45:38 Brand ELF binaries for arm. Affected files ... .. //depot/projects/arm/gnu-arm.diff#3 edit Differences ... ==== //depot/projects/arm/gnu-arm.diff#3 (text+ko) ==== From owner-p4-projects@FreeBSD.ORG Thu May 12 04:38:41 2005 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id D2F2316A4D1; Thu, 12 May 2005 04:38:40 +0000 (GMT) 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 A757616A4CE for ; Thu, 12 May 2005 04:38:40 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 862B443D83 for ; Thu, 12 May 2005 04:38:40 +0000 (GMT) (envelope-from marcel@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 j4C4ceRu030813 for ; Thu, 12 May 2005 04:38:40 GMT (envelope-from marcel@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j4C4cepI030810 for perforce@freebsd.org; Thu, 12 May 2005 04:38:40 GMT (envelope-from marcel@freebsd.org) Date: Thu, 12 May 2005 04:38:40 GMT Message-Id: <200505120438.j4C4cepI030810@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to marcel@freebsd.org using -f From: Marcel Moolenaar To: Perforce Change Reviews Subject: PERFORCE change 76865 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 May 2005 04:38:41 -0000 http://perforce.freebsd.org/chv.cgi?CH=76865 Change 76865 by marcel@marcel_nfs on 2005/05/12 04:38:08 Flesh out what's needed for low-level console output. This basically boils down to finding the right definition of the BitBlt operation. Ideally you want the hardware driver to take advantage of any hardware acceleration if possible. In short: o Printing a character is a bitblt operation from host memory to the frame buffer, o Scrolling the screen is a bitblt operation from the frame buffer to the frame buffer, o Clearing a portion of the screen is a (pseudo) bitblt operation where the source is a pixel color and the destination is the frame buffer. Host originated bitmaps come in multiple variants of differing depths. Fonts typically are monochrome, so we need to have the ability to pass a background and foreground color to the bitblt function. Use stdarg to cover these variations. Affected files ... .. //depot/projects/tty/sys/dev/vga/vga.c#10 edit .. //depot/projects/tty/sys/dev/vga/vga.h#6 edit .. //depot/projects/tty/sys/dev/vga/vga_con.c#3 edit .. //depot/projects/tty/sys/dev/vtc/vtc_con.c#3 edit .. //depot/projects/tty/sys/dev/vtc/vtc_con.h#2 edit .. //depot/projects/tty/sys/sys/vtc.h#1 add Differences ... ==== //depot/projects/tty/sys/dev/vga/vga.c#10 (text+ko) ==== @@ -268,7 +268,8 @@ } int -vga_bitblt(struct vga_softc *sc, int x, int y) +vga_vbitblt(struct vga_softc *sc, int op, uintptr_t dst, uintptr_t src, + int width, int height, va_list ap) { return (0); ==== //depot/projects/tty/sys/dev/vga/vga.h#6 (text+ko) ==== @@ -29,6 +29,8 @@ #ifndef _DEV_VGA_VGA_H_ #define _DEV_VGA_VGA_H_ +#include + struct vga_spc { bus_space_tag_t bst; @@ -68,8 +70,9 @@ extern char vga_device_name[]; int vga_attach(device_t); -int vga_bitblt(struct vga_softc *, int, int); +int vga_vbitblt(struct vga_softc *, int, uintptr_t, uintptr_t, int, int, + va_list); int vga_init(struct vga_softc *); int vga_probe(struct vga_softc *); -#endif /* _DEV_VGA_VGA_H_ */ +#endif /* !_DEV_VGA_VGA_H_ */ ==== //depot/projects/tty/sys/dev/vga/vga_con.c#3 (text+ko) ==== @@ -46,7 +46,7 @@ VTC_CONOUT(vga, vga_con_probe, vga_con_init, vga_con_bitblt); static int -vga_con_probe() +vga_con_probe(struct vtc_conout *co) { struct vga_consdata cd; @@ -61,20 +61,30 @@ if (!vga_probe(&vga_console)) return (-1); + co->vtc_con_cookie = &vga_console; + co->vtc_con_width = 640; + co->vtc_con_height = 480; + co->vtc_con_depth = 16; return (0); } static void -vga_con_init() +vga_con_init(struct vtc_conout *co) { + struct vga_softc *sc = co->vtc_con_cookie; - if (vga_init(&vga_console) == 0) - vga_console.vga_console = 1; + if (vga_init(sc) == 0) + sc->vga_console = 1; } static void -vga_con_bitblt(int x, int y) +vga_con_bitblt(struct vtc_conout *co, int op, uintptr_t dst, uintptr_t src, + int width, int height, ...) { + struct vga_softc *sc = co->vtc_con_cookie; + va_list ap; - vga_bitblt(&vga_console, x, y); + va_start(ap, height); + vga_vbitblt(sc, op, dst, src, width, height, ap); + va_end(ap); } ==== //depot/projects/tty/sys/dev/vtc/vtc_con.c#3 (text+ko) ==== @@ -35,6 +35,7 @@ #include #include #include +#include #include @@ -62,7 +63,7 @@ cur_vc = NULL; SET_FOREACH(iter, vtc_conout_set) { vc = *iter; - pri = (vc->vtc_con_probe != NULL) ? vc->vtc_con_probe() : -1; + pri = (vc->vtc_con_probe != NULL) ? vc->vtc_con_probe(vc) : -1; if (pri > cur_pri) { cur_pri = pri; cur_vc = vc; @@ -78,7 +79,7 @@ { struct vtc_conout *vc = cp->cn_arg; - vc->vtc_con_init(); + vc->vtc_con_init(vc); } static void @@ -89,9 +90,34 @@ static void vtc_cnputc(struct consdev *cp, int c) { + static int col = 0, row = 0; + static uint8_t bitmap[] = { 0x82, 0x82, 0x44, 0x44, 0x28, 0x28, 0x10, + 0x10, 0x28, 0x28, 0x44, 0x44, 0x82, 0x82, + 0x00, 0x00, 0x00, 0x00, 0x00 }; struct vtc_conout *vc = cp->cn_arg; - vc->vtc_con_bitblt(0, 0); + switch (c) { + case 0x0a: + col = 0; + row++; + break; + default: + vc->vtc_con_bitblt(vc, BITBLT_H1TOFB, (uintptr_t)bitmap, + vc->vtc_con_width * row * 10 + col * 8, 8, 19, 0, 7); + col++; + break; + } + if (col >= 80) { + col = 0; + row++; + } + if (row >= 24) { + vc->vtc_con_bitblt(vc, BITBLT_FBTOFB, vc->vtc_con_width * 19, + 0, vc->vtc_con_width, 23 * 19); + vc->vtc_con_bitblt(vc, BITBLT_CLRTOFB, 0, 23 * 19, + vc->vtc_con_width, 19); + row = 0; + } } static int ==== //depot/projects/tty/sys/dev/vtc/vtc_con.h#2 (text+ko) ==== @@ -29,15 +29,22 @@ #ifndef _DEV_VTC_CON_H_ #define _DEV_VTC_CON_H_ -typedef void vtc_con_bitblt_f(int, int); -typedef void vtc_con_init_f(void); -typedef int vtc_con_probe_f(void); +struct vtc_conout; + +typedef void vtc_con_bitblt_f(struct vtc_conout *, int, uintptr_t, uintptr_t, + int, int, ...); +typedef void vtc_con_init_f(struct vtc_conout *); +typedef int vtc_con_probe_f(struct vtc_conout *); struct vtc_conout { const char *vtc_con_name; vtc_con_probe_f *vtc_con_probe; vtc_con_init_f *vtc_con_init; vtc_con_bitblt_f *vtc_con_bitblt; + void * vtc_con_cookie; + int vtc_con_width; + int vtc_con_height; + int vtc_con_depth; }; #define VTC_CONOUT(name, probe, init, bitblt) \ @@ -45,7 +52,11 @@ .vtc_con_name = #name, \ .vtc_con_probe = probe, \ .vtc_con_init = init, \ - .vtc_con_bitblt = bitblt \ + .vtc_con_bitblt = bitblt, \ + .vtc_con_cookie = NULL, \ + .vtc_con_width = -1, \ + .vtc_con_height = -1, \ + .vtc_con_depth = -1 \ }; \ DATA_SET(vtc_conout_set, name##_vtc_conout) From owner-p4-projects@FreeBSD.ORG Thu May 12 04:39:43 2005 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id F422616A4D1; Thu, 12 May 2005 04:39:42 +0000 (GMT) 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 A02F516A4CE for ; Thu, 12 May 2005 04:39:42 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 484A943D7F for ; Thu, 12 May 2005 04:39:42 +0000 (GMT) (envelope-from csjp@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 j4C4dgUL030858 for ; Thu, 12 May 2005 04:39:42 GMT (envelope-from csjp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j4C4dfKF030855 for perforce@freebsd.org; Thu, 12 May 2005 04:39:41 GMT (envelope-from csjp@freebsd.org) Date: Thu, 12 May 2005 04:39:41 GMT Message-Id: <200505120439.j4C4dfKF030855@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to csjp@freebsd.org using -f From: "Christian S.J. Peron" To: Perforce Change Reviews Subject: PERFORCE change 76866 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 May 2005 04:39:43 -0000 http://perforce.freebsd.org/chv.cgi?CH=76866 Change 76866 by csjp@csjp_xor on 2005/05/12 04:39:25 Manually specify include path Affected files ... .. //depot/projects/trustedbsd/mac/usr.sbin/getfhash/Makefile#4 edit Differences ... ==== //depot/projects/trustedbsd/mac/usr.sbin/getfhash/Makefile#4 (text+ko) ==== @@ -3,4 +3,6 @@ NO_MAN= WARNS= 6 +CFLAGS+=-I${.CURDIR}/../../sys/ + .include From owner-p4-projects@FreeBSD.ORG Thu May 12 20:26:06 2005 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 042EB16A4D1; Thu, 12 May 2005 20:26:06 +0000 (GMT) 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 B9D3016A4CE for ; Thu, 12 May 2005 20:26:05 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6AA6243D80 for ; Thu, 12 May 2005 20:26:05 +0000 (GMT) (envelope-from trhodes@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 j4CKQ5tA099800 for ; Thu, 12 May 2005 20:26:05 GMT (envelope-from trhodes@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j4CKQ4Da099797 for perforce@freebsd.org; Thu, 12 May 2005 20:26:04 GMT (envelope-from trhodes@freebsd.org) Date: Thu, 12 May 2005 20:26:04 GMT Message-Id: <200505122026.j4CKQ4Da099797@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to trhodes@freebsd.org using -f From: Tom Rhodes To: Perforce Change Reviews Subject: PERFORCE change 76894 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 May 2005 20:26:06 -0000 http://perforce.freebsd.org/chv.cgi?CH=76894 Change 76894 by trhodes@trhodes-x64 on 2005/05/12 20:25:46 Use %zu for arg 3 (size_t). This permits building on both my x86 and AMD64 box. Affected files ... .. //depot/projects/trustedbsd/mac/sbin/setfsmac/setfsmac.c#11 edit Differences ... ==== //depot/projects/trustedbsd/mac/sbin/setfsmac/setfsmac.c#11 (text+ko) ==== @@ -269,7 +269,7 @@ free(line); } fclose(fp); - warnx("%s: read %u specifications", file, spec->nentries); + warnx("%s: read %zu specifications", file, spec->nentries); STAILQ_INSERT_TAIL(&specs->head, spec, link); } From owner-p4-projects@FreeBSD.ORG Fri May 13 01:32:27 2005 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id E075516A4D1; Fri, 13 May 2005 01:32:25 +0000 (GMT) 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 753E216A4CE for ; Fri, 13 May 2005 01:32:25 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 39D2943D60 for ; Fri, 13 May 2005 01:32:25 +0000 (GMT) (envelope-from marcel@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 j4D1WPsH026599 for ; Fri, 13 May 2005 01:32:25 GMT (envelope-from marcel@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j4D1WOGw026596 for perforce@freebsd.org; Fri, 13 May 2005 01:32:24 GMT (envelope-from marcel@freebsd.org) Date: Fri, 13 May 2005 01:32:24 GMT Message-Id: <200505130132.j4D1WOGw026596@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to marcel@freebsd.org using -f From: Marcel Moolenaar To: Perforce Change Reviews Subject: PERFORCE change 76903 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 May 2005 01:32:27 -0000 http://perforce.freebsd.org/chv.cgi?CH=76903 Change 76903 by marcel@marcel_nfs on 2005/05/13 01:32:20 IFC @76902 Affected files ... .. //depot/projects/tty/etc/devd.conf#11 integrate .. //depot/projects/tty/include/unistd.h#6 integrate .. //depot/projects/tty/lib/libc/gen/Makefile.inc#11 integrate .. //depot/projects/tty/lib/libc/uuid/uuid_is_nil.c#4 integrate .. //depot/projects/tty/lib/libz/FREEBSD-upgrade#1 branch .. //depot/projects/tty/lib/libz/adler32.c#3 integrate .. //depot/projects/tty/lib/libz/compress.c#3 integrate .. //depot/projects/tty/lib/libz/crc32.c#3 integrate .. //depot/projects/tty/lib/libz/deflate.c#3 integrate .. //depot/projects/tty/lib/libz/deflate.h#3 integrate .. //depot/projects/tty/lib/libz/example.c#3 integrate .. //depot/projects/tty/lib/libz/infback.c#2 integrate .. //depot/projects/tty/lib/libz/inffast.c#3 integrate .. //depot/projects/tty/lib/libz/inflate.c#3 integrate .. //depot/projects/tty/lib/libz/inftrees.c#3 integrate .. //depot/projects/tty/lib/libz/trees.c#3 integrate .. //depot/projects/tty/lib/libz/uncompr.c#3 integrate .. //depot/projects/tty/lib/libz/zlib.3#4 integrate .. //depot/projects/tty/lib/libz/zutil.c#3 integrate .. //depot/projects/tty/lib/libz/zutil.h#3 integrate .. //depot/projects/tty/libexec/rlogind/rlogind.c#4 integrate .. //depot/projects/tty/libexec/rshd/rshd.c#4 integrate .. //depot/projects/tty/sbin/ipfw/ipfw.8#14 integrate .. //depot/projects/tty/sbin/route/route.c#6 integrate .. //depot/projects/tty/share/man/man4/ng_netflow.4#4 integrate .. //depot/projects/tty/share/man/man4/twe.4#6 integrate .. //depot/projects/tty/share/misc/bsd-family-tree#11 integrate .. //depot/projects/tty/sys/amd64/amd64/mp_machdep.c#7 integrate .. //depot/projects/tty/sys/amd64/include/cpufunc.h#7 integrate .. //depot/projects/tty/sys/amd64/isa/isa.h#4 integrate .. //depot/projects/tty/sys/arm/arm/vm_machdep.c#5 integrate .. //depot/projects/tty/sys/cam/cam_xpt.c#11 integrate .. //depot/projects/tty/sys/conf/options#20 integrate .. //depot/projects/tty/sys/conf/options.i386#14 integrate .. //depot/projects/tty/sys/conf/options.pc98#13 integrate .. //depot/projects/tty/sys/dev/acpica/acpi_ec.c#8 integrate .. //depot/projects/tty/sys/dev/ata/ata-all.h#16 integrate .. //depot/projects/tty/sys/dev/ata/ata-chipset.c#17 integrate .. //depot/projects/tty/sys/dev/ata/ata-lowlevel.c#11 integrate .. //depot/projects/tty/sys/dev/ata/ata-pci.h#14 integrate .. //depot/projects/tty/sys/dev/ata/ata-queue.c#9 integrate .. //depot/projects/tty/sys/dev/isp/isp_freebsd.h#6 integrate .. //depot/projects/tty/sys/dev/isp/isp_inline.h#5 integrate .. //depot/projects/tty/sys/dev/isp/isp_pci.c#8 integrate .. //depot/projects/tty/sys/dev/isp/ispvar.h#6 integrate .. //depot/projects/tty/sys/dev/kbd/kbdtables.h#2 integrate .. //depot/projects/tty/sys/dev/usb/uhub.c#6 integrate .. //depot/projects/tty/sys/dev/usb/umass.c#13 integrate .. //depot/projects/tty/sys/fs/nwfs/nwfs_subr.c#4 integrate .. //depot/projects/tty/sys/fs/udf/udf_vnops.c#13 integrate .. //depot/projects/tty/sys/geom/mirror/g_mirror.c#5 integrate .. //depot/projects/tty/sys/geom/raid3/g_raid3_ctl.c#4 integrate .. //depot/projects/tty/sys/geom/stripe/g_stripe.c#6 integrate .. //depot/projects/tty/sys/i386/i386/mp_machdep.c#16 integrate .. //depot/projects/tty/sys/i386/include/cpufunc.h#6 integrate .. //depot/projects/tty/sys/i386/include/npx.h#4 integrate .. //depot/projects/tty/sys/i386/isa/isa.h#6 integrate .. //depot/projects/tty/sys/i386/isa/npx.c#11 integrate .. //depot/projects/tty/sys/isa/isareg.h#5 integrate .. //depot/projects/tty/sys/kern/sysv_shm.c#12 integrate .. //depot/projects/tty/sys/kern/vfs_export.c#8 integrate .. //depot/projects/tty/sys/kern/vfs_mount.c#14 integrate .. //depot/projects/tty/sys/netgraph/netflow/netflow.c#4 integrate .. //depot/projects/tty/sys/netgraph/netflow/netflow.h#2 integrate .. //depot/projects/tty/sys/netgraph/netflow/ng_netflow.c#4 integrate .. //depot/projects/tty/sys/netgraph/netflow/ng_netflow.h#4 integrate .. //depot/projects/tty/sys/netgraph/ng_nat.c#3 integrate .. //depot/projects/tty/sys/netinet/tcp_input.c#17 integrate .. //depot/projects/tty/sys/netinet/tcp_output.c#10 integrate .. //depot/projects/tty/sys/netinet/tcp_sack.c#4 integrate .. //depot/projects/tty/sys/netinet/tcp_var.h#13 integrate .. //depot/projects/tty/sys/pc98/cbus/cbus.h#2 integrate .. //depot/projects/tty/sys/pc98/cbus/pckbd.c#2 integrate .. //depot/projects/tty/sys/pc98/cbus/pckbdtables.h#1 branch .. //depot/projects/tty/sys/pc98/include/npx.h#2 integrate .. //depot/projects/tty/sys/sys/acl.h#4 integrate .. //depot/projects/tty/sys/vm/vm_fault.c#11 integrate .. //depot/projects/tty/usr.bin/Makefile#15 integrate .. //depot/projects/tty/usr.bin/make/Makefile#7 integrate .. //depot/projects/tty/usr.bin/make/cond.c#7 integrate .. //depot/projects/tty/usr.bin/make/globals.h#4 integrate .. //depot/projects/tty/usr.bin/make/job.c#7 integrate .. //depot/projects/tty/usr.bin/make/job.h#6 integrate .. //depot/projects/tty/usr.bin/make/main.c#12 integrate .. //depot/projects/tty/usr.bin/make/parse.c#9 integrate .. //depot/projects/tty/usr.bin/make/str.c#5 integrate .. //depot/projects/tty/usr.bin/make/suff.c#6 integrate .. //depot/projects/tty/usr.bin/make/var.c#9 integrate .. //depot/projects/tty/usr.bin/make/var.h#6 integrate .. //depot/projects/tty/usr.bin/mkuzip/mkuzip.c#3 integrate .. //depot/projects/tty/usr.bin/rsh/rsh.c#4 integrate .. //depot/projects/tty/usr.bin/what/what.1#4 integrate .. //depot/projects/tty/usr.bin/what/what.c#2 integrate .. //depot/projects/tty/usr.sbin/IPXrouted/main.c#3 integrate .. //depot/projects/tty/usr.sbin/mount_portalfs/activate.c#4 integrate Differences ... ==== //depot/projects/tty/etc/devd.conf#11 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/etc/devd.conf,v 1.22 2005/01/08 06:00:24 brooks Exp $ +# $FreeBSD: src/etc/devd.conf,v 1.23 2005/05/11 10:24:20 brian Exp $ # # Refer to devd.conf(5) and devd(8) man pages for the details on how to # run and configure devd. @@ -60,7 +60,7 @@ # When a USB keyboard arrives, attach it as the console keyboard. attach 100 { device-name "ukbd0"; - action "kbdcontrol -k /dev/ukbd0 < /dev/console"; + action "kbdcontrol -k /dev/ukbd0 < /dev/console && /etc/rc.d/syscons restart"; }; detach 100 { device-name "ukbd0"; ==== //depot/projects/tty/include/unistd.h#6 (text+ko) ==== @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)unistd.h 8.12 (Berkeley) 4/27/95 - * $FreeBSD: src/include/unistd.h,v 1.76 2005/03/22 01:19:17 das Exp $ + * $FreeBSD: src/include/unistd.h,v 1.77 2005/05/11 14:07:25 delphij Exp $ */ #ifndef _UNISTD_H_ @@ -365,6 +365,7 @@ pid_t tcgetpgrp(int); int tcsetpgrp(int, pid_t); char *ttyname(int); +char *ttyname_r(int, char *, size_t); int unlink(const char *); ssize_t write(int, const void *, size_t); ==== //depot/projects/tty/lib/libc/gen/Makefile.inc#11 (text+ko) ==== @@ -1,5 +1,5 @@ # @(#)Makefile.inc 8.6 (Berkeley) 5/4/95 -# $FreeBSD: src/lib/libc/gen/Makefile.inc,v 1.120 2005/03/07 05:01:04 das Exp $ +# $FreeBSD: src/lib/libc/gen/Makefile.inc,v 1.121 2005/05/11 14:07:25 delphij Exp $ # machine-independent gen sources .PATH: ${.CURDIR}/${MACHINE_ARCH}/gen ${.CURDIR}/gen @@ -143,7 +143,7 @@ tcsetattr.3 cfmakeraw.3 tcsetattr.3 cfsetispeed.3 \ tcsetattr.3 cfsetospeed.3 tcsetattr.3 cfsetspeed.3 \ tcsetattr.3 tcgetattr.3 -MLINKS+=ttyname.3 isatty.3 ttyname.3 ttyslot.3 +MLINKS+=ttyname.3 isatty.3 ttyname.3 ttyname_r.3 ttyname.3 ttyslot.3 MLINKS+=tzset.3 tzsetwall.3 MLINKS+=unvis.3 strunvis.3 unvis.3 strunvisx.3 MLINKS+=vis.3 strvis.3 vis.3 strvisx.3 ==== //depot/projects/tty/lib/libc/uuid/uuid_is_nil.c#4 (text+ko) ==== @@ -24,7 +24,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/lib/libc/uuid/uuid_is_nil.c,v 1.3 2005/01/03 02:56:15 marcel Exp $ + * $FreeBSD: src/lib/libc/uuid/uuid_is_nil.c,v 1.4 2005/05/11 13:18:10 delphij Exp $ */ #include @@ -37,7 +37,7 @@ int32_t uuid_is_nil(const uuid_t *u, uint32_t *status) { - uint32_t *p; + const uint32_t *p; if (status) *status = uuid_s_ok; @@ -49,6 +49,6 @@ * Pick the largest type that has equivalent alignment constraints * as an UUID and use it to test if the UUID consists of all zeroes. */ - p = (uint32_t*)u; + p = (const uint32_t*)u; return ((p[0] == 0 && p[1] == 0 && p[2] == 0 && p[3] == 0) ? 1 : 0); } ==== //depot/projects/tty/lib/libz/adler32.c#3 (text+ko) ==== @@ -3,8 +3,7 @@ * For conditions of distribution and use, see copyright notice in zlib.h */ -#include -__FBSDID("$FreeBSD: src/lib/libz/adler32.c,v 1.8 2004/06/30 23:54:46 tjr Exp $"); +/* @(#) $Id$ */ #define ZLIB_INTERNAL #include "zlib.h" ==== //depot/projects/tty/lib/libz/compress.c#3 (text+ko) ==== @@ -3,8 +3,7 @@ * For conditions of distribution and use, see copyright notice in zlib.h */ -#include -__FBSDID("$FreeBSD: src/lib/libz/compress.c,v 1.8 2004/06/30 23:54:46 tjr Exp $"); +/* @(#) $Id$ */ #define ZLIB_INTERNAL #include "zlib.h" ==== //depot/projects/tty/lib/libz/crc32.c#3 (text+ko) ==== @@ -9,8 +9,15 @@ * of two increase in speed on a Power PC G4 (PPC7455) using gcc -O3. */ -#include -__FBSDID("$FreeBSD: src/lib/libz/crc32.c,v 1.8 2004/06/30 23:54:46 tjr Exp $"); +/* @(#) $Id$ */ + +/* + Note on the use of DYNAMIC_CRC_TABLE: there is no mutex or semaphore + protection on the static variables used to control the first-use generation + of the crc tables. Therefore, if you #define DYNAMIC_CRC_TABLE, you should + first call get_crc_table() to initialize the tables before allowing more than + one thread to use crc32(). + */ #ifdef MAKECRCH # include @@ -59,7 +66,7 @@ #ifdef DYNAMIC_CRC_TABLE -local int crc_table_empty = 1; +local volatile int crc_table_empty = 1; local unsigned long FAR crc_table[TBLS][256]; local void make_crc_table OF((void)); #ifdef MAKECRCH @@ -96,38 +103,51 @@ { unsigned long c; int n, k; - unsigned long poly; /* polynomial exclusive-or pattern */ + unsigned long poly; /* polynomial exclusive-or pattern */ /* terms of polynomial defining this crc (except x^32): */ + static volatile int first = 1; /* flag to limit concurrent making */ static const unsigned char p[] = {0,1,2,4,5,7,8,10,11,12,16,22,23,26}; - /* make exclusive-or pattern from polynomial (0xedb88320UL) */ - poly = 0UL; - for (n = 0; n < sizeof(p)/sizeof(unsigned char); n++) - poly |= 1UL << (31 - p[n]); + /* See if another task is already doing this (not thread-safe, but better + than nothing -- significantly reduces duration of vulnerability in + case the advice about DYNAMIC_CRC_TABLE is ignored) */ + if (first) { + first = 0; + + /* make exclusive-or pattern from polynomial (0xedb88320UL) */ + poly = 0UL; + for (n = 0; n < sizeof(p)/sizeof(unsigned char); n++) + poly |= 1UL << (31 - p[n]); - /* generate a crc for every 8-bit value */ - for (n = 0; n < 256; n++) { - c = (unsigned long)n; - for (k = 0; k < 8; k++) - c = c & 1 ? poly ^ (c >> 1) : c >> 1; - crc_table[0][n] = c; - } + /* generate a crc for every 8-bit value */ + for (n = 0; n < 256; n++) { + c = (unsigned long)n; + for (k = 0; k < 8; k++) + c = c & 1 ? poly ^ (c >> 1) : c >> 1; + crc_table[0][n] = c; + } #ifdef BYFOUR - /* generate crc for each value followed by one, two, and three zeros, and - then the byte reversal of those as well as the first table */ - for (n = 0; n < 256; n++) { - c = crc_table[0][n]; - crc_table[4][n] = REV(c); - for (k = 1; k < 4; k++) { - c = crc_table[0][c & 0xff] ^ (c >> 8); - crc_table[k][n] = c; - crc_table[k + 4][n] = REV(c); + /* generate crc for each value followed by one, two, and three zeros, + and then the byte reversal of those as well as the first table */ + for (n = 0; n < 256; n++) { + c = crc_table[0][n]; + crc_table[4][n] = REV(c); + for (k = 1; k < 4; k++) { + c = crc_table[0][c & 0xff] ^ (c >> 8); + crc_table[k][n] = c; + crc_table[k + 4][n] = REV(c); + } } - } #endif /* BYFOUR */ - crc_table_empty = 0; + crc_table_empty = 0; + } + else { /* not first */ + /* wait for the other guy to finish (not efficient, but rare) */ + while (crc_table_empty) + ; + } #ifdef MAKECRCH /* write out CRC tables to crc32.h */ @@ -181,9 +201,10 @@ const unsigned long FAR * ZEXPORT get_crc_table() { #ifdef DYNAMIC_CRC_TABLE - if (crc_table_empty) make_crc_table(); + if (crc_table_empty) + make_crc_table(); #endif /* DYNAMIC_CRC_TABLE */ - return (const unsigned long FAR *)crc_table; + return (const unsigned long FAR *)crc_table; } /* ========================================================================= */ ==== //depot/projects/tty/lib/libz/deflate.c#3 (text+ko) ==== @@ -1,11 +1,8 @@ /* deflate.c -- compress data using the deflation algorithm - * Copyright (C) 1995-2003 Jean-loup Gailly. + * Copyright (C) 1995-2004 Jean-loup Gailly. * For conditions of distribution and use, see copyright notice in zlib.h */ -#include -__FBSDID("$FreeBSD: src/lib/libz/deflate.c,v 1.8 2004/06/30 23:54:46 tjr Exp $"); - /* * ALGORITHM * @@ -50,12 +47,12 @@ * */ -/* @(#) $FreeBSD: src/lib/libz/deflate.c,v 1.8 2004/06/30 23:54:46 tjr Exp $ */ +/* @(#) $Id$ */ #include "deflate.h" const char deflate_copyright[] = - " deflate 1.2.1 Copyright 1995-2003 Jean-loup Gailly "; + " deflate 1.2.2 Copyright 1995-2004 Jean-loup Gailly "; /* If you use the zlib library in a product, an acknowledgment is welcome in the documentation of your product. If for some reason you cannot ==== //depot/projects/tty/lib/libz/deflate.h#3 (text+ko) ==== @@ -8,7 +8,7 @@ subject to change. Applications should only use zlib.h. */ -/* @(#) $FreeBSD: src/lib/libz/deflate.h,v 1.7 2004/06/30 23:54:46 tjr Exp $ */ +/* @(#) $Id$ */ #ifndef DEFLATE_H #define DEFLATE_H @@ -95,7 +95,6 @@ Bytef *pending_out; /* next pending byte to output to the stream */ int pending; /* nb of bytes in the pending buffer */ int wrap; /* bit 0 true for zlib, bit 1 true for gzip */ - Byte data_type; /* UNKNOWN, BINARY or ASCII */ Byte method; /* STORED (for zip only) or DEFLATED */ int last_flush; /* value of flush param for previous deflate call */ ==== //depot/projects/tty/lib/libz/example.c#3 (text+ko) ==== @@ -3,8 +3,7 @@ * For conditions of distribution and use, see copyright notice in zlib.h */ -#include -__FBSDID("$FreeBSD: src/lib/libz/example.c,v 1.8 2004/06/30 23:54:46 tjr Exp $"); +/* @(#) $Id$ */ #include #include "zlib.h" ==== //depot/projects/tty/lib/libz/infback.c#2 (text+ko) ==== @@ -434,8 +434,8 @@ } } - if (state->mode == BAD) - break; + /* handle error breaks in while */ + if (state->mode == BAD) break; /* build code tables */ state->next = state->codes; ==== //depot/projects/tty/lib/libz/inffast.c#3 (text+ko) ==== @@ -1,11 +1,8 @@ /* inffast.c -- fast decoding - * Copyright (C) 1995-2003 Mark Adler + * Copyright (C) 1995-2004 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ -#include -__FBSDID("$FreeBSD: src/lib/libz/inffast.c,v 1.4 2004/06/30 23:54:46 tjr Exp $"); - #include "zutil.h" #include "inftrees.h" #include "inflate.h" @@ -22,7 +19,7 @@ - none No measurable difference: - Pentium III (Anderson) - - 68060 (Nikl) + - M68060 (Nikl) */ #ifdef POSTINC # define OFF 0 ==== //depot/projects/tty/lib/libz/inflate.c#3 (text+ko) ==== @@ -80,9 +80,6 @@ * The history for versions after 1.2.0 are in ChangeLog in zlib distribution. */ -#include -__FBSDID("$FreeBSD: src/lib/libz/inflate.c,v 1.5 2004/08/26 19:37:06 nectar Exp $"); - #include "zutil.h" #include "inftrees.h" #include "inflate.h" @@ -112,6 +109,7 @@ state = (struct inflate_state FAR *)strm->state; strm->total_in = strm->total_out = state->total = 0; strm->msg = Z_NULL; + strm->adler = 1; /* to support ill-conceived Java test suite */ state->mode = HEAD; state->last = 0; state->havedict = 0; @@ -864,8 +862,8 @@ } } - if (state->mode == BAD) - break; + /* handle error breaks in while */ + if (state->mode == BAD) break; /* build code tables */ state->next = state->codes; ==== //depot/projects/tty/lib/libz/inftrees.c#3 (text+ko) ==== @@ -1,18 +1,15 @@ /* inftrees.c -- generate Huffman trees for efficient decoding - * Copyright (C) 1995-2003 Mark Adler + * Copyright (C) 1995-2004 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ -#include -__FBSDID("$FreeBSD: src/lib/libz/inftrees.c,v 1.4 2004/06/30 23:54:46 tjr Exp $"); - #include "zutil.h" #include "inftrees.h" #define MAXBITS 15 const char inflate_copyright[] = - " inflate 1.2.1 Copyright 1995-2003 Mark Adler "; + " inflate 1.2.2 Copyright 1995-2004 Mark Adler "; /* If you use the zlib library in a product, an acknowledgment is welcome in the documentation of your product. If for some reason you cannot @@ -65,7 +62,7 @@ 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0}; static const unsigned short lext[31] = { /* Length codes 257..285 extra */ 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, - 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 76, 66}; + 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 199, 198}; static const unsigned short dbase[32] = { /* Distance codes 0..29 base */ 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, @@ -117,7 +114,15 @@ for (max = MAXBITS; max >= 1; max--) if (count[max] != 0) break; if (root > max) root = max; - if (max == 0) return -1; /* no codes! */ + if (max == 0) { /* no symbols to code at all */ + this.op = (unsigned char)64; /* invalid code marker */ + this.bits = (unsigned char)1; + this.val = (unsigned short)0; + *(*table)++ = this; /* make a table to force an error */ + *(*table)++ = this; + *bits = 1; + return 0; /* no symbols, but wait for decoding to report error */ + } for (min = 1; min <= MAXBITS; min++) if (count[min] != 0) break; if (root < min) root = min; @@ -298,7 +303,6 @@ drop = 0; len = root; next = *table; - curr = root; this.bits = (unsigned char)len; } ==== //depot/projects/tty/lib/libz/trees.c#3 (text+ko) ==== @@ -29,8 +29,7 @@ * Addison-Wesley, 1983. ISBN 0-201-06672-6. */ -#include -__FBSDID("$FreeBSD: src/lib/libz/trees.c,v 1.8 2004/06/30 23:54:46 tjr Exp $"); +/* @(#) $Id$ */ /* #define GEN_TREES_H */ @@ -932,7 +931,7 @@ if (s->level > 0) { /* Check if the file is ascii or binary */ - if (s->data_type == Z_UNKNOWN) set_data_type(s); + if (s->strm->data_type == Z_UNKNOWN) set_data_type(s); /* Construct the literal and distance trees */ build_tree(s, (tree_desc *)(&(s->l_desc))); @@ -1132,7 +1131,7 @@ while (n < 7) bin_freq += s->dyn_ltree[n++].Freq; while (n < 128) ascii_freq += s->dyn_ltree[n++].Freq; while (n < LITERALS) bin_freq += s->dyn_ltree[n++].Freq; - s->data_type = (Byte)(bin_freq > (ascii_freq >> 2) ? Z_BINARY : Z_ASCII); + s->strm->data_type = bin_freq > (ascii_freq >> 2) ? Z_BINARY : Z_ASCII; } /* =========================================================================== ==== //depot/projects/tty/lib/libz/uncompr.c#3 (text+ko) ==== @@ -3,8 +3,7 @@ * For conditions of distribution and use, see copyright notice in zlib.h */ -#include -__FBSDID("$FreeBSD: src/lib/libz/uncompr.c,v 1.8 2004/06/30 23:54:46 tjr Exp $"); +/* @(#) $Id$ */ #define ZLIB_INTERNAL #include "zlib.h" ==== //depot/projects/tty/lib/libz/zlib.3#4 (text+ko) ==== @@ -1,6 +1,4 @@ -.\" $FreeBSD: src/lib/libz/zlib.3,v 1.7 2004/06/30 23:54:46 tjr Exp $ -.\" -.TH ZLIB 3 "17 November 2003" +.TH ZLIB 3 "3 October 2004" .SH NAME zlib \- compression/decompression library .SH SYNOPSIS @@ -135,8 +133,8 @@ Send questions and/or comments to zlib@gzip.org, or (for the Windows DLL version) to Gilles Vollant (info@winimage.com). .SH AUTHORS -Version 1.2.1 -Copyright (C) 1995-2003 Jean-loup Gailly (jloup@gzip.org) +Version 1.2.2 +Copyright (C) 1995-2004 Jean-loup Gailly (jloup@gzip.org) and Mark Adler (madler@alumni.caltech.edu). .LP This software is provided "as-is," ==== //depot/projects/tty/lib/libz/zutil.c#3 (text+ko) ==== @@ -3,8 +3,7 @@ * For conditions of distribution and use, see copyright notice in zlib.h */ -#include -__FBSDID("$FreeBSD: src/lib/libz/zutil.c,v 1.8 2004/06/30 23:54:46 tjr Exp $"); +/* @(#) $Id$ */ #include "zutil.h" ==== //depot/projects/tty/lib/libz/zutil.h#3 (text+ko) ==== @@ -8,7 +8,7 @@ subject to change. Applications should only use zlib.h. */ -/* @(#) $FreeBSD: src/lib/libz/zutil.h,v 1.7 2004/06/30 23:54:46 tjr Exp $ */ +/* @(#) $Id$ */ #ifndef ZUTIL_H #define ZUTIL_H @@ -189,9 +189,14 @@ # define NO_vsnprintf # endif #endif +#ifdef VMS +# define NO_vsnprintf +#endif #ifdef HAVE_STRERROR - extern char *strerror OF((int)); +# ifndef VMS + extern char *strerror OF((int)); +# endif # define zstrerror(errnum) strerror(errnum) #else # define zstrerror(errnum) "" ==== //depot/projects/tty/libexec/rlogind/rlogind.c#4 (text+ko) ==== @@ -50,7 +50,7 @@ #endif /* not lint */ #endif #include -__FBSDID("$FreeBSD: src/libexec/rlogind/rlogind.c,v 1.42 2005/02/14 17:42:57 stefanf Exp $"); +__FBSDID("$FreeBSD: src/libexec/rlogind/rlogind.c,v 1.43 2005/05/11 02:43:04 jmallett Exp $"); /* * remote login server: @@ -496,7 +496,7 @@ (void)chflags(line, 0); (void)chmod(line, 0666); (void)chown(line, 0, 0); - shutdown(netf, 2); + shutdown(netf, SHUT_RDWR); exit(1); } ==== //depot/projects/tty/libexec/rshd/rshd.c#4 (text+ko) ==== @@ -51,7 +51,7 @@ #endif /* not lint */ #include -__FBSDID("$FreeBSD: src/libexec/rshd/rshd.c,v 1.50 2005/03/21 08:01:14 das Exp $"); +__FBSDID("$FreeBSD: src/libexec/rshd/rshd.c,v 1.51 2005/05/11 02:41:39 jmallett Exp $"); /* * remote shell server: @@ -267,7 +267,7 @@ if ((cc = read(STDIN_FILENO, &c, 1)) != 1) { if (cc < 0) syslog(LOG_NOTICE, "read: %m"); - shutdown(0, 1+1); + shutdown(0, SHUT_RDWR); exit(1); } if (c == 0) @@ -442,7 +442,7 @@ errno = 0; cc = read(pv[0], buf, sizeof(buf)); if (cc <= 0) { - shutdown(s, 1+1); + shutdown(s, SHUT_RDWR); FD_CLR(pv[0], &readfrom); } else { (void)write(s, buf, cc); ==== //depot/projects/tty/sbin/ipfw/ipfw.8#14 (text+ko) ==== @@ -1,5 +1,5 @@ .\" -.\" $FreeBSD: src/sbin/ipfw/ipfw.8,v 1.169 2005/05/04 13:14:57 glebius Exp $ +.\" $FreeBSD: src/sbin/ipfw/ipfw.8,v 1.170 2005/05/11 12:58:15 glebius Exp $ .\" .Dd February 22, 2005 .Dt IPFW 8 @@ -735,7 +735,9 @@ sysctl variable. .It Cm ngtee Ar cookie A copy of packet is diverted into netgraph, original -packet continues with next rule. +packet is either accepted or continues with the next rule, depending on +.Em net.inet.ip.fw.one_pass +sysctl variable. See .Xr ng_ipfw 4 for more information on ==== //depot/projects/tty/sbin/route/route.c#6 (text+ko) ==== @@ -38,7 +38,7 @@ static char sccsid[] = "@(#)route.c 8.6 (Berkeley) 4/28/95"; #endif static const char rcsid[] = - "$FreeBSD: src/sbin/route/route.c,v 1.76 2004/06/16 06:29:41 bms Exp $"; + "$FreeBSD: src/sbin/route/route.c,v 1.77 2005/05/11 02:50:41 jmallett Exp $"; #endif /* not lint */ #include @@ -208,7 +208,7 @@ if (uid && !debugonly) { errx(EX_NOPERM, "must be root to alter routing table"); } - shutdown(s, 0); /* Don't want to read back our messages */ + shutdown(s, SHUT_RD); /* Don't want to read back our messages */ if (argc > 1) { argv++; if (argc == 2 && **argv == '-') @@ -577,7 +577,7 @@ } cmd = argv[0]; if (*cmd != 'g') - shutdown(s, 0); /* Don't want to read back our messages */ + shutdown(s, SHUT_RD); /* Don't want to read back our messages */ while (--argc > 0) { if (**(++argv)== '-') { switch (key = keyword(1 + *argv)) { ==== //depot/projects/tty/share/man/man4/ng_netflow.4#4 (text+ko) ==== @@ -22,9 +22,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $FreeBSD: src/share/man/man4/ng_netflow.4,v 1.9 2005/04/08 10:38:12 joel Exp $ +.\" $FreeBSD: src/share/man/man4/ng_netflow.4,v 1.10 2005/05/11 11:53:37 glebius Exp $ .\" -.Dd March 23, 2005 +.Dd May 11, 2005 .Os .Dt NG_NETFLOW 4 .Sh NAME @@ -168,6 +168,9 @@ .Xr flowctl 8 , not directly from .Xr ngctl 8 . +See also +.Sx BUGS +section. .El .Sh ASCII CONTROL MESSAGES Most binary control messages have an @@ -258,6 +261,10 @@ written by .An Roman V. Palagin Aq romanp@unshadow.net . .Sh BUGS +Cache snapshot obtained via +.Dv NGM_NETFLOW_SHOW +command may lack some percentage of entries under severe load. +.Pp The .Nm node type does not fill in AS numbers. ==== //depot/projects/tty/share/man/man4/twe.4#6 (text+ko) ==== @@ -22,7 +22,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/share/man/man4/twe.4,v 1.14 2005/04/20 10:41:09 brueffer Exp $ +.\" $FreeBSD: src/share/man/man4/twe.4,v 1.15 2005/05/12 16:18:58 brueffer Exp $ .\" .Dd August 15, 2004 .Dt TWE 4 @@ -135,7 +135,7 @@ .It twe%d: device_add_child failed .It twe%d: bus_generic_attach returned %d .Pp -Creation of the disk devices failed, either due to communications +Creation of the disk devices failed, either due to communication problems with the adapter or due to resource shortage; attachment of one or more units may have been aborted. .El ==== //depot/projects/tty/share/misc/bsd-family-tree#11 (text+ko) ==== @@ -186,7 +186,8 @@ | | | | OpenBSD 3.6 | | | | NetBSD 2.0 | | | | | | | DragonFly 1.2.0 - | FreeBSD 5.4 | | | | + | | Mac OS X | | | + | FreeBSD 5.4 10.4 | | | | | | | | | | V | | | | | | | | | @@ -420,6 +421,7 @@ NetBSD 2.0 2004-12-09 [NBD] FreeBSD 4.11 2005-01-25 [FBD] DragonFly 1.2.0 2005-04-08 [DFB] +Mac OS X 10.4 2005-04-29 [APL] FreeBSD 5.4 2005-05-09 [FBD] Bibliography @@ -481,4 +483,4 @@ Copyright (c) 1997-2004 Wolfram Schneider URL: http://cvsweb.freebsd.org/src/share/misc/bsd-family-tree -$FreeBSD: src/share/misc/bsd-family-tree,v 1.90 2005/05/10 17:51:18 maxim Exp $ +$FreeBSD: src/share/misc/bsd-family-tree,v 1.91 2005/05/11 11:11:29 maxim Exp $ ==== //depot/projects/tty/sys/amd64/amd64/mp_machdep.c#7 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/amd64/mp_machdep.c,v 1.253 2005/04/30 20:00:58 dwhite Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/mp_machdep.c,v 1.255 2005/05/13 00:57:04 nectar Exp $"); #include "opt_cpu.h" #include "opt_kstack_pages.h" @@ -142,6 +142,9 @@ static void release_aps(void *dummy); static int hlt_logical_cpus; +static u_int hyperthreading_cpus; +static cpumask_t hyperthreading_cpus_mask; +static int hyperthreading_allowed = 1; static struct sysctl_ctx_list logical_cpu_clist; static u_int bootMP_size; @@ -301,6 +304,7 @@ cpu_mp_start(void) { int i; + u_int threads_per_cache, p[4]; /* Initialize the logical ID to APIC ID table. */ for (i = 0; i < MAXCPU; i++) { @@ -340,6 +344,48 @@ if (cpu_feature & CPUID_HTT) logical_cpus = (cpu_procinfo & CPUID_HTT_CORES) >> 16; + /* + * Work out if hyperthreading is *really* enabled. This + * is made really ugly by the fact that processors lie: Dual + * core processors claim to be hyperthreaded even when they're + * not, presumably because they want to be treated the same + * way as HTT with respect to per-cpu software licensing. + * At the time of writing (May 12, 2005) the only hyperthreaded + * cpus are from Intel, and Intel's dual-core processors can be + * identified via the "deterministic cache parameters" cpuid + * calls. + */ + /* + * First determine if this is an Intel processor which claims + * to have hyperthreading support. + */ + if ((cpu_feature & CPUID_HTT) && + (strcmp(cpu_vendor, "GenuineIntel") == 0)) { + /* + * If the "deterministic cache parameters" cpuid calls + * are available, use them. + */ + if (cpu_high >= 4) { + /* Ask the processor about up to 32 caches. */ + for (i = 0; i < 32; i++) { + cpuid_count(4, i, p); + threads_per_cache = ((p[0] & 0x3ffc000) >> 14) + 1; + if (hyperthreading_cpus < threads_per_cache) + hyperthreading_cpus = threads_per_cache; + if ((p[0] & 0x1f) == 0) + break; + } + } + + /* + * If the deterministic cache parameters are not + * available, or if no caches were reported to exist, + * just accept what the HTT flag indicated. + */ + if (hyperthreading_cpus == 0) + hyperthreading_cpus = logical_cpus; + } + set_logical_apic_ids(); } @@ -478,6 +524,11 @@ if (logical_cpus > 1 && PCPU_GET(apic_id) % logical_cpus != 0) logical_cpus_mask |= PCPU_GET(cpumask); + /* Determine if we are a hyperthread. */ + if (hyperthreading_cpus > 1 && + PCPU_GET(apic_id) % hyperthreading_cpus != 0) + hyperthreading_cpus_mask |= PCPU_GET(cpumask); + /* Build our map of 'other' CPUs. */ PCPU_SET(other_cpus, all_cpus & ~PCPU_GET(cpumask)); @@ -1081,6 +1132,9 @@ else hlt_logical_cpus = 0; + if (! hyperthreading_allowed) + mask |= hyperthreading_cpus_mask; + if ((mask & all_cpus) == all_cpus) mask &= ~(1<<0); hlt_cpus_mask = mask; @@ -1105,6 +1159,9 @@ else hlt_cpus_mask &= ~logical_cpus_mask; + if (! hyperthreading_allowed) + hlt_cpus_mask |= hyperthreading_cpus_mask; + if ((hlt_cpus_mask & all_cpus) == all_cpus) hlt_cpus_mask &= ~(1<<0); @@ -1112,6 +1169,34 @@ return (error); } +static int +sysctl_hyperthreading_allowed(SYSCTL_HANDLER_ARGS) +{ + int allowed, error; + + allowed = hyperthreading_allowed; + error = sysctl_handle_int(oidp, &allowed, 0, req); + if (error || !req->newptr) + return (error); + + if (allowed) + hlt_cpus_mask &= ~hyperthreading_cpus_mask; + else + hlt_cpus_mask |= hyperthreading_cpus_mask; + + if (logical_cpus_mask != 0 && + (hlt_cpus_mask & logical_cpus_mask) == logical_cpus_mask) + hlt_logical_cpus = 1; + else + hlt_logical_cpus = 0; + + if ((hlt_cpus_mask & all_cpus) == all_cpus) + hlt_cpus_mask &= ~(1<<0); + + hyperthreading_allowed = allowed; + return (error); +} + static void cpu_hlt_setup(void *dummy __unused) { @@ -1131,6 +1216,22 @@ if (hlt_logical_cpus) hlt_cpus_mask |= logical_cpus_mask; + + /* + * If necessary for security purposes, force + * hyperthreading off, regardless of the value + * of hlt_logical_cpus. + */ + if (hyperthreading_cpus_mask) { + TUNABLE_INT_FETCH("machdep.hyperthreading_allowed", + &hyperthreading_allowed); + SYSCTL_ADD_PROC(&logical_cpu_clist, + SYSCTL_STATIC_CHILDREN(_machdep), OID_AUTO, + "hyperthreading_allowed", CTLTYPE_INT|CTLFLAG_RW, + 0, 0, sysctl_hyperthreading_allowed, "IU", ""); + if (! hyperthreading_allowed) + hlt_cpus_mask |= hyperthreading_cpus_mask; + } } } SYSINIT(cpu_hlt, SI_SUB_SMP, SI_ORDER_ANY, cpu_hlt_setup, NULL); ==== //depot/projects/tty/sys/amd64/include/cpufunc.h#7 (text+ko) ==== @@ -27,7 +27,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/amd64/include/cpufunc.h,v 1.147 2005/03/11 22:16:09 peter Exp $ + * $FreeBSD: src/sys/amd64/include/cpufunc.h,v 1.148 2005/05/13 00:05:55 nectar Exp $ */ /* >>> TRUNCATED FOR MAIL (1000 lines) <<< From owner-p4-projects@FreeBSD.ORG Fri May 13 02:09:11 2005 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 0CB2916A4D1; Fri, 13 May 2005 02:09:10 +0000 (GMT) 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 C832016A4CE for ; Fri, 13 May 2005 02:09:09 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9DBCB43D6E for ; Fri, 13 May 2005 02:09:09 +0000 (GMT) (envelope-from marcel@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 j4D299jp027939 for ; Fri, 13 May 2005 02:09:09 GMT (envelope-from marcel@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j4D299xP027936 for perforce@freebsd.org; Fri, 13 May 2005 02:09:09 GMT (envelope-from marcel@freebsd.org) Date: Fri, 13 May 2005 02:09:09 GMT Message-Id: <200505130209.j4D299xP027936@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to marcel@freebsd.org using -f From: Marcel Moolenaar To: Perforce Change Reviews Subject: PERFORCE change 76904 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 May 2005 02:09:11 -0000 http://perforce.freebsd.org/chv.cgi?CH=76904 Change 76904 by marcel@marcel_nfs on 2005/05/13 02:08:19 Catch up with reality. Use suggested probe() return values. Since vga(4) is the driver you want attached only when no accelerated driver exists, return BUS_PROBE_GENERIC. Affected files ... .. //depot/projects/tty/sys/dev/vga/vga_bus_pci.c#4 edit Differences ... ==== //depot/projects/tty/sys/dev/vga/vga_bus_pci.c#4 (text+ko) ==== @@ -132,7 +132,7 @@ if ((cfg & PCIM_CMD_PORTEN) == 0) return (ENXIO); - return (-1); + return (BUS_PROBE_GENERIC); } DRIVER_MODULE(vga, pci, vga_pci_driver, vga_devclass, 0, 0); From owner-p4-projects@FreeBSD.ORG Fri May 13 02:47:11 2005 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 3D5AF16A4D1; Fri, 13 May 2005 02:47:11 +0000 (GMT) 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 E576E16A4CE for ; Fri, 13 May 2005 02:47:10 +0000 (GMT) Received: from mail26.sea5.speakeasy.net (mail26.sea5.speakeasy.net [69.17.117.28]) by mx1.FreeBSD.org (Postfix) with ESMTP id 942F143D83 for ; Fri, 13 May 2005 02:47:10 +0000 (GMT) (envelope-from jhb@FreeBSD.org) Received: (qmail 17791 invoked from network); 13 May 2005 02:47:10 -0000 Received: from server.baldwin.cx ([216.27.160.63]) (envelope-sender )AES256-SHA encrypted SMTP for ; 13 May 2005 02:47:10 -0000 Received: from [192.168.0.15] (osx.baldwin.cx [192.168.0.15]) (authenticated bits=0) by server.baldwin.cx (8.13.1/8.13.1) with ESMTP id j4D2l4m8069112; Thu, 12 May 2005 22:47:05 -0400 (EDT) (envelope-from jhb@FreeBSD.org) In-Reply-To: <200505081955.j48JtBfi092536@repoman.freebsd.org> References: <200505081955.j48JtBfi092536@repoman.freebsd.org> Mime-Version: 1.0 (Apple Message framework v622) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: <721cb42c97f084506344f17efa84c6a1@FreeBSD.org> Content-Transfer-Encoding: 7bit From: John Baldwin Date: Thu, 12 May 2005 22:47:04 -0400 To: Marcel Moolenaar X-Mailer: Apple Mail (2.622) X-Spam-Status: No, score=-2.8 required=4.2 tests=ALL_TRUSTED autolearn=failed version=3.0.2 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on server.baldwin.cx cc: Perforce Change Reviews Subject: Re: PERFORCE change 76704 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 May 2005 02:47:12 -0000 On May 8, 2005, at 3:55 PM, Marcel Moolenaar wrote: > http://perforce.freebsd.org/chv.cgi?CH=76704 > > Change 76704 by marcel@marcel_nfs on 2005/05/08 19:54:21 > > Wordsmithing after proofreading. Add a reference to R.F. Ferraro's > "Programmer's guide to the galaxy^WEGA, VGA, and Super VGA cards". Ahh, memories. My favorite VGA book is actually some smaller book with a purple cover whose title escapes me at the moment. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org From owner-p4-projects@FreeBSD.ORG Fri May 13 03:05:21 2005 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 5640116A4D1; Fri, 13 May 2005 03:05:20 +0000 (GMT) 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 141C616A4CE for ; Fri, 13 May 2005 03:05:20 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9023C43D8A for ; Fri, 13 May 2005 03:05:18 +0000 (GMT) (envelope-from marcel@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 j4D35IDc030078 for ; Fri, 13 May 2005 03:05:18 GMT (envelope-from marcel@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j4D35I3M030075 for perforce@freebsd.org; Fri, 13 May 2005 03:05:18 GMT (envelope-from marcel@freebsd.org) Date: Fri, 13 May 2005 03:05:18 GMT Message-Id: <200505130305.j4D35I3M030075@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to marcel@freebsd.org using -f From: Marcel Moolenaar To: Perforce Change Reviews Subject: PERFORCE change 76907 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 May 2005 03:05:21 -0000 http://perforce.freebsd.org/chv.cgi?CH=76907 Change 76907 by marcel@marcel_nfs on 2005/05/13 03:04:49 Add a seletal driver for the Intel 830M GMCH. The purpose of this driver is many-fold: o Help to create the right logical infrastructure, o Experimentation with 2D accelerated hardware for BitBlt operations, o Experimentation with multi-head configurations to aid in designing the right infrastructure for assigning keyboards to displays (multiplexing and so on), o Have an accelerated driver to preempt the VGA driver for: + purposes of having the VGA ISA bus front-end called at the end of bus enumeration and making sure this doesn't create a conflict, + implementing the logistics necessary for gmch(4) to take over the console from vga(4), o Gumption builder or project show-stopper. This code only causes gmch(4) to attach. Nothing else is being done yet. Affected files ... .. //depot/projects/tty/sys/conf/files#26 edit .. //depot/projects/tty/sys/dev/gmch/gmch.c#1 add .. //depot/projects/tty/sys/dev/gmch/gmch.h#1 add .. //depot/projects/tty/sys/dev/gmch/gmch_bus_pci.c#1 add Differences ... ==== //depot/projects/tty/sys/conf/files#26 (text+ko) ==== @@ -555,6 +555,8 @@ dev/fxp/if_fxp.c optional fxp dev/gem/if_gem.c optional gem dev/gem/if_gem_pci.c optional gem pci +dev/gmch/gmch.c optional gmch +dev/gmch/gmch_bus_pci.c optional gmch pci dev/harp/if_harp.c optional harp pci dev/hatm/if_hatm.c optional hatm pci dev/hatm/if_hatm_intr.c optional hatm pci From owner-p4-projects@FreeBSD.ORG Fri May 13 20:18:17 2005 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id D943616A4D0; Fri, 13 May 2005 20:18:16 +0000 (GMT) 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 AFD4E16A4D0 for ; Fri, 13 May 2005 20:18:16 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7C05C43D88 for ; Fri, 13 May 2005 20:18:16 +0000 (GMT) (envelope-from marcel@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 j4DKIGKl002761 for ; Fri, 13 May 2005 20:18:16 GMT (envelope-from marcel@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j4DKIGn6002758 for perforce@freebsd.org; Fri, 13 May 2005 20:18:16 GMT (envelope-from marcel@freebsd.org) Date: Fri, 13 May 2005 20:18:16 GMT Message-Id: <200505132018.j4DKIGn6002758@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to marcel@freebsd.org using -f From: Marcel Moolenaar To: Perforce Change Reviews Subject: PERFORCE change 76937 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 May 2005 20:18:17 -0000 http://perforce.freebsd.org/chv.cgi?CH=76937 Change 76937 by marcel@marcel_nfs on 2005/05/13 20:18:05 o Fix a typo. The character height for the single character that we can display is 19 bits. o the BitBlt in vga(4) is implemented far enough that we see a nice line of X characters (the one bitmap we have for now) and see the screen scrolling when we reach the bottom. Don't start at the top of the screen after reaching the bottom. Time to add a real font. There's a 8x16 in syscons(4) that we can probably use without any problems. Affected files ... .. //depot/projects/tty/sys/dev/vtc/vtc_con.c#4 edit Differences ... ==== //depot/projects/tty/sys/dev/vtc/vtc_con.c#4 (text+ko) ==== @@ -103,7 +103,7 @@ break; default: vc->vtc_con_bitblt(vc, BITBLT_H1TOFB, (uintptr_t)bitmap, - vc->vtc_con_width * row * 10 + col * 8, 8, 19, 0, 7); + vc->vtc_con_width * row * 19 + col * 8, 8, 19, 0, 7); col++; break; } @@ -116,7 +116,7 @@ 0, vc->vtc_con_width, 23 * 19); vc->vtc_con_bitblt(vc, BITBLT_CLRTOFB, 0, 23 * 19, vc->vtc_con_width, 19); - row = 0; + row = 23; } } From owner-p4-projects@FreeBSD.ORG Fri May 13 21:12:23 2005 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 8738E16A4D0; Fri, 13 May 2005 21:12:23 +0000 (GMT) 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 417C416A4D1 for ; Fri, 13 May 2005 21:12:23 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2752443D6B for ; Fri, 13 May 2005 21:12:23 +0000 (GMT) (envelope-from marcel@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 j4DLCN3u015981 for ; Fri, 13 May 2005 21:12:23 GMT (envelope-from marcel@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j4DLCN5X015978 for perforce@freebsd.org; Fri, 13 May 2005 21:12:23 GMT (envelope-from marcel@freebsd.org) Date: Fri, 13 May 2005 21:12:23 GMT Message-Id: <200505132112.j4DLCN5X015978@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to marcel@freebsd.org using -f From: Marcel Moolenaar To: Perforce Change Reviews Subject: PERFORCE change 76941 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 May 2005 21:12:24 -0000 http://perforce.freebsd.org/chv.cgi?CH=76941 Change 76941 by marcel@marcel_nfs on 2005/05/13 21:11:45 I reverted the order of the destination and source addresses to be more in line with the BitBlt operation (source first). I forgot it here. Affected files ... .. //depot/projects/tty/sys/dev/vga/vga_con.c#4 edit Differences ... ==== //depot/projects/tty/sys/dev/vga/vga_con.c#4 (text+ko) ==== @@ -78,13 +78,13 @@ } static void -vga_con_bitblt(struct vtc_conout *co, int op, uintptr_t dst, uintptr_t src, +vga_con_bitblt(struct vtc_conout *co, int op, uintptr_t src, uintptr_t dst, int width, int height, ...) { struct vga_softc *sc = co->vtc_con_cookie; va_list ap; va_start(ap, height); - vga_vbitblt(sc, op, dst, src, width, height, ap); + vga_vbitblt(sc, op, src, dst, width, height, ap); va_end(ap); } From owner-p4-projects@FreeBSD.ORG Fri May 13 21:40:59 2005 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 7956716A4D2; Fri, 13 May 2005 21:40:59 +0000 (GMT) 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 4E8AB16A4D0 for ; Fri, 13 May 2005 21:40:59 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 11C1943D53 for ; Fri, 13 May 2005 21:40:59 +0000 (GMT) (envelope-from marcel@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 j4DLewQv017582 for ; Fri, 13 May 2005 21:40:58 GMT (envelope-from marcel@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j4DLewf3017579 for perforce@freebsd.org; Fri, 13 May 2005 21:40:58 GMT (envelope-from marcel@freebsd.org) Date: Fri, 13 May 2005 21:40:58 GMT Message-Id: <200505132140.j4DLewf3017579@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to marcel@freebsd.org using -f From: Marcel Moolenaar To: Perforce Change Reviews Subject: PERFORCE change 76944 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 May 2005 21:41:00 -0000 http://perforce.freebsd.org/chv.cgi?CH=76944 Change 76944 by marcel@marcel_nfs on 2005/05/13 21:40:44 o Remove BITBLT_NOP o Rename BITBLT_CLRTOFB to BITBLT_CTOFB Affected files ... .. //depot/projects/tty/sys/sys/vtc.h#2 edit Differences ... ==== //depot/projects/tty/sys/sys/vtc.h#2 (text+ko) ==== @@ -30,8 +30,7 @@ #define _SYS_VTC_H_ /* BitBlt operations. */ -#define BITBLT_NOP 0x0000 -#define BITBLT_CLRTOFB 0x0001 +#define BITBLT_CTOFB 0x0001 #define BITBLT_H1TOFB 0x0002 #define BITBLT_H4TOFB 0x0003 #define BITBLT_H8TOFB 0x0004 From owner-p4-projects@FreeBSD.ORG Fri May 13 21:46:06 2005 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 012A216A4D1; Fri, 13 May 2005 21:46:06 +0000 (GMT) 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 B9CAF16A4CE for ; Fri, 13 May 2005 21:46:05 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id A6E4843D7C for ; Fri, 13 May 2005 21:46:05 +0000 (GMT) (envelope-from marcel@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 j4DLk5Tr018087 for ; Fri, 13 May 2005 21:46:05 GMT (envelope-from marcel@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j4DLk51N018084 for perforce@freebsd.org; Fri, 13 May 2005 21:46:05 GMT (envelope-from marcel@freebsd.org) Date: Fri, 13 May 2005 21:46:05 GMT Message-Id: <200505132146.j4DLk51N018084@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to marcel@freebsd.org using -f From: Marcel Moolenaar To: Perforce Change Reviews Subject: PERFORCE change 76945 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 May 2005 21:46:06 -0000 http://perforce.freebsd.org/chv.cgi?CH=76945 Change 76945 by marcel@marcel_nfs on 2005/05/13 21:45:57 o Cache vc->vtc_con_width in local variable width. This improves readability and makes sure the compiler knows the value is not changed across function calls. The latter helps optimizations. o s/BITBLT_CLRTOFB/BITBLT_CTOFB/ o Fix clearing the last line (missing width product). Affected files ... .. //depot/projects/tty/sys/dev/vtc/vtc_con.c#5 edit Differences ... ==== //depot/projects/tty/sys/dev/vtc/vtc_con.c#5 (text+ko) ==== @@ -95,6 +95,7 @@ 0x10, 0x28, 0x28, 0x44, 0x44, 0x82, 0x82, 0x00, 0x00, 0x00, 0x00, 0x00 }; struct vtc_conout *vc = cp->cn_arg; + int width = vc->vtc_con_width; switch (c) { case 0x0a: @@ -103,7 +104,7 @@ break; default: vc->vtc_con_bitblt(vc, BITBLT_H1TOFB, (uintptr_t)bitmap, - vc->vtc_con_width * row * 19 + col * 8, 8, 19, 0, 7); + width * row * 19 + col * 8, 8, 19, 0, 7); col++; break; } @@ -112,10 +113,10 @@ row++; } if (row >= 24) { - vc->vtc_con_bitblt(vc, BITBLT_FBTOFB, vc->vtc_con_width * 19, - 0, vc->vtc_con_width, 23 * 19); - vc->vtc_con_bitblt(vc, BITBLT_CLRTOFB, 0, 23 * 19, - vc->vtc_con_width, 19); + vc->vtc_con_bitblt(vc, BITBLT_FBTOFB, width * 19, 0, width, + 23 * 19); + vc->vtc_con_bitblt(vc, BITBLT_CTOFB, 0, width * 23 * 19, width, + 19); row = 23; } } From owner-p4-projects@FreeBSD.ORG Fri May 13 21:52:14 2005 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id E619816A4D1; Fri, 13 May 2005 21:52:13 +0000 (GMT) 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 C25D416A4CE for ; Fri, 13 May 2005 21:52:13 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id A125A43D75 for ; Fri, 13 May 2005 21:52:13 +0000 (GMT) (envelope-from marcel@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 j4DLqDNW019004 for ; Fri, 13 May 2005 21:52:13 GMT (envelope-from marcel@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j4DLqDx9019001 for perforce@freebsd.org; Fri, 13 May 2005 21:52:13 GMT (envelope-from marcel@freebsd.org) Date: Fri, 13 May 2005 21:52:13 GMT Message-Id: <200505132152.j4DLqDx9019001@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to marcel@freebsd.org using -f From: Marcel Moolenaar To: Perforce Change Reviews Subject: PERFORCE change 76946 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 May 2005 21:52:14 -0000 http://perforce.freebsd.org/chv.cgi?CH=76946 Change 76946 by marcel@marcel_nfs on 2005/05/13 21:51:51 Implement BitBlt operations CTOFB, FBTOFB and H1TOFB. Both CTOFB and FBTOFB use write mode 0. H1TOFB uses write mode 3. The implementation is not feature complete. It is assumed for now that the width is always a multiple of 8 bits and that the bit offset is also a multiple of 8. Some VGA magic with masks and rotate registers is needed to handle all possible cases. As long as we're using fonts of width 8, this is not an issue so we're good for now. Affected files ... .. //depot/projects/tty/sys/dev/vga/vga.c#11 edit Differences ... ==== //depot/projects/tty/sys/dev/vga/vga.c#11 (text+ko) ==== @@ -33,6 +33,7 @@ #include #include #include +#include #include #include @@ -186,7 +187,7 @@ REG_WRITE(sc, VGA_GC_ADDRESS, VGA_GC_SET_RESET); REG_WRITE(sc, VGA_GC_DATA, 0); REG_WRITE(sc, VGA_GC_ADDRESS, VGA_GC_ENABLE_SET_RESET); - REG_WRITE(sc, VGA_GC_DATA, 0); + REG_WRITE(sc, VGA_GC_DATA, 0x0f); REG_WRITE(sc, VGA_GC_ADDRESS, VGA_GC_COLOR_COMPARE); REG_WRITE(sc, VGA_GC_DATA, 0); REG_WRITE(sc, VGA_GC_ADDRESS, VGA_GC_DATA_ROTATE); @@ -267,12 +268,133 @@ return (0); } +static __inline int +vga_bitblt_ctofb(struct vga_softc *sc, u_long c, u_long dst, int width, + int height) +{ + int w; + + REG_WRITE(sc, VGA_GC_ADDRESS, VGA_GC_MODE); + REG_WRITE(sc, VGA_GC_DATA, 0); + REG_WRITE(sc, VGA_GC_ADDRESS, VGA_GC_ENABLE_SET_RESET); + REG_WRITE(sc, VGA_GC_DATA, 0x0f); + REG_WRITE(sc, VGA_GC_ADDRESS, VGA_GC_SET_RESET); + REG_WRITE(sc, VGA_GC_DATA, c & 0x0f); + REG_WRITE(sc, VGA_GC_ADDRESS, VGA_GC_DATA_ROTATE); + REG_WRITE(sc, VGA_GC_DATA, 0); + dst >>= 3; + while (height > 0) { + for (w = 0; w < width; w += 8) { + MEM_READ(sc, dst); + MEM_WRITE(sc, dst++, 0); + } + dst += (640 - w) >> 3; + height--; + } + return (0); +} + +static __inline int +vga_bitblt_fbtofb(struct vga_softc *sc, u_long src, u_long dst, int width, + int height) +{ + int w; + + REG_WRITE(sc, VGA_GC_ADDRESS, VGA_GC_MODE); + REG_WRITE(sc, VGA_GC_DATA, 0); + REG_WRITE(sc, VGA_GC_ADDRESS, VGA_GC_ENABLE_SET_RESET); + REG_WRITE(sc, VGA_GC_DATA, 0x0f); + REG_WRITE(sc, VGA_GC_ADDRESS, VGA_GC_SET_RESET); + REG_WRITE(sc, VGA_GC_DATA, 0); + REG_WRITE(sc, VGA_GC_ADDRESS, VGA_GC_DATA_ROTATE); + REG_WRITE(sc, VGA_GC_DATA, VGA_GC_DR_FS_OR); + dst >>= 3; + src >>= 3; + while (height > 0) { + for (w = 0; w < width; w += 8) { + MEM_READ(sc, src++); + MEM_WRITE(sc, dst++, 0); + } + src += (640 - w) >> 3; + dst += (640 - w) >> 3; + height--; + } + return (0); +} + +static __inline int +vga_bitblt_h1tofb(struct vga_softc *sc, uint8_t *src, u_long dst, int width, + int height, int bgclr, int fgclr) +{ + int c, w; + uint8_t b; + + REG_WRITE(sc, VGA_GC_ADDRESS, VGA_GC_MODE); + REG_WRITE(sc, VGA_GC_DATA, 3); + REG_WRITE(sc, VGA_GC_ADDRESS, VGA_GC_ENABLE_SET_RESET); + REG_WRITE(sc, VGA_GC_DATA, 0x0f); + REG_WRITE(sc, VGA_GC_ADDRESS, VGA_GC_SET_RESET); + REG_WRITE(sc, VGA_GC_DATA, fgclr); + REG_WRITE(sc, VGA_GC_ADDRESS, VGA_GC_DATA_ROTATE); + REG_WRITE(sc, VGA_GC_DATA, 0); + c = fgclr; + dst >>= 3; + while (height > 0) { + for (w = 0; w < width; w += 8) { + b = *src++; + if (b != 0) { + if (c != fgclr) { + REG_WRITE(sc, VGA_GC_ADDRESS, + VGA_GC_SET_RESET); + REG_WRITE(sc, VGA_GC_DATA, fgclr); + c = fgclr; + } + MEM_READ(sc, dst); + MEM_WRITE(sc, dst, b); + } + if (b != 0xff) { + if (c != bgclr) { + REG_WRITE(sc, VGA_GC_ADDRESS, + VGA_GC_SET_RESET); + REG_WRITE(sc, VGA_GC_DATA, bgclr); + c = bgclr; + } + MEM_READ(sc, dst); + MEM_WRITE(sc, dst, ~b); + } + dst++; + } + dst += (640 - w) >> 3; + height--; + } + return (0); +} + int -vga_vbitblt(struct vga_softc *sc, int op, uintptr_t dst, uintptr_t src, +vga_vbitblt(struct vga_softc *sc, int op, uintptr_t src, uintptr_t dst, int width, int height, va_list ap) { + int bgclr, fgclr; + int error; - return (0); + switch (op) { + case BITBLT_FBTOFB: + error = vga_bitblt_fbtofb(sc, src, dst, width, height); + break; + case BITBLT_H1TOFB: + bgclr = va_arg(ap, int); + fgclr = va_arg(ap, int); + error = vga_bitblt_h1tofb(sc, (uint8_t *)src, dst, width, + height, bgclr, fgclr); + break; + case BITBLT_CTOFB: + error = vga_bitblt_ctofb(sc, src, dst, width, height); + break; + default: + error = EINVAL; + break; + } + return (error); } int From owner-p4-projects@FreeBSD.ORG Sat May 14 00:33:28 2005 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 6EF4B16A4D1; Sat, 14 May 2005 00:33:28 +0000 (GMT) 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 2C76316A4CE for ; Sat, 14 May 2005 00:33:28 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id ECDDA43D88 for ; Sat, 14 May 2005 00:33:27 +0000 (GMT) (envelope-from wsalamon@computer.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j4E0XR2T027008 for ; Sat, 14 May 2005 00:33:27 GMT (envelope-from wsalamon@computer.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j4E0XROJ027005 for perforce@freebsd.org; Sat, 14 May 2005 00:33:27 GMT (envelope-from wsalamon@computer.org) Date: Sat, 14 May 2005 00:33:27 GMT Message-Id: <200505140033.j4E0XROJ027005@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to wsalamon@computer.org using -f From: Wayne Salamon To: Perforce Change Reviews Subject: PERFORCE change 76947 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 May 2005 00:33:29 -0000 http://perforce.freebsd.org/chv.cgi?CH=76947 Change 76947 by wsalamon@rickenbacker on 2005/05/14 00:33:07 Changes necessary for kernel support. The vnode auditing uses a audit-specific record to contain the audit info to save space. Add the Unix socket tokenizer function. Affected files ... .. //depot/projects/trustedbsd/openbsm/bsm/audit_record.h#10 edit .. //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#14 edit Differences ... ==== //depot/projects/trustedbsd/openbsm/bsm/audit_record.h#10 (text+ko) ==== @@ -211,7 +211,7 @@ struct sockaddr_in6; struct sockaddr_un; #if defined(_KERNEL) || defined(KERNEL) -struct vattr; +struct vnode_au_info; #endif int au_open(void); @@ -219,11 +219,22 @@ int au_close(int d, int keep, short event); int au_close_buffer(int d, short event, u_char *buffer, size_t *buflen); +#if defined(KERNEL) || defined(_KERNEL) +token_t *au_to_file(char *file, struct timeval tm); +#else token_t *au_to_file(char *file); +#endif +#if defined(KERNEL) || defined(_KERNEL) token_t *au_to_header(int rec_size, au_event_t e_type, + au_emod_t e_mod, struct timeval tm); +token_t *au_to_header32(int rec_size, au_event_t e_type, + au_emod_t e_mod, struct timeval tm); +#else +token_t *au_to_header(int rec_size, au_event_t e_type, au_emod_t e_mod); token_t *au_to_header32(int rec_size, au_event_t e_type, au_emod_t e_mod); +#endif token_t *au_to_header64(int rec_size, au_event_t e_type, au_emod_t e_mod); token_t *au_to_me(void); @@ -232,9 +243,9 @@ token_t *au_to_arg32(char n, char *text, u_int32_t v); token_t *au_to_arg64(char n, char *text, u_int64_t v); #if defined(_KERNEL) || defined(KERNEL) -token_t *au_to_attr(struct vattr *attr); -token_t *au_to_attr32(struct vattr *attr); -token_t *au_to_attr64(struct vattr *attr); +token_t *au_to_attr(struct vnode_au_info *vni); +token_t *au_to_attr32(struct vnode_au_info *vni); +token_t *au_to_attr64(struct vnode_au_info *vni); #endif token_t *au_to_data(char unit_print, char unit_type, char unit_count, char *p); ==== //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#14 (text+ko) ==== @@ -36,6 +36,7 @@ #endif /* __APPLE__*/ #include #include +#include #include @@ -144,7 +145,7 @@ return au_to_arg32(n, text, v); } -#if defined(_KERNEL) || defined(_KERNEL) +#if defined(_KERNEL) || defined(KERNEL) /* * token ID 1 byte * file access mode 4 bytes @@ -154,14 +155,14 @@ * node ID 8 bytes * device 4 bytes/8 bytes (32-bit/64-bit) */ -token_t *au_to_attr32(struct vattr *attr) +token_t *au_to_attr32(struct vnode_au_info *vni) { token_t *t; u_char *dptr = NULL; u_int16_t pad0_16 = 0; u_int16_t pad0_32 = 0; - if(attr == NULL) { + if(vni == NULL) { errno = EINVAL; return NULL; } @@ -179,11 +180,11 @@ * as 2 bytes; BSM defines 4 so pad with 0 */ ADD_U_INT16(dptr, pad0_16); - ADD_U_INT16(dptr, attr->va_mode); + ADD_U_INT16(dptr, vni->vn_mode); - ADD_U_INT32(dptr, attr->va_uid); - ADD_U_INT32(dptr, attr->va_gid); - ADD_U_INT32(dptr, attr->va_fsid); + ADD_U_INT32(dptr, vni->vn_uid); + ADD_U_INT32(dptr, vni->vn_gid); + ADD_U_INT32(dptr, vni->vn_fsid); /* * Some systems use 32-bit file ID's, other's use 64-bit file IDs. @@ -191,29 +192,29 @@ * could pick this out at compile-time, it would be better, so as to * avoid the else case below. */ - if (sizeof(attr->va_fileid) == sizeof(uint32_t)) { + if (sizeof(vni->vn_fileid) == sizeof(uint32_t)) { ADD_U_INT32(dptr, pad0_32); - ADD_U_INT32(dptr, attr->va_fileid); - } else if (sizeof(attr->va_fileid) == sizeof(uint64_t)) { - ADD_U_INT64(dptr, attr->va_fileid); + ADD_U_INT32(dptr, vni->vn_fileid); + } else if (sizeof(vni->vn_fileid) == sizeof(uint64_t)) { + ADD_U_INT64(dptr, vni->vn_fileid); } else { ADD_U_INT64(dptr, 0LL); } - ADD_U_INT32(dptr, attr->va_rdev); + ADD_U_INT32(dptr, vni->vn_dev); return t; } -token_t *au_to_attr64(struct vattr *attr) +token_t *au_to_attr64(struct vnode_au_info *vni) { errno = ENOTSUP; return NULL; } -token_t *au_to_attr(struct vattr *attr) +token_t *au_to_attr(struct vnode_au_info *vni) { - return au_to_attr32(attr); + return au_to_attr32(vni); } #endif /* !(defined(_KERNEL) || defined(KERNEL) */ @@ -553,18 +554,24 @@ * file name len 2 bytes * file pathname N bytes + 1 terminating NULL byte */ +#if defined(KERNEL) || defined(_KERNEL) +token_t *au_to_file(char *file, struct timeval tm) +#else token_t *au_to_file(char *file) +#endif { token_t *t; u_char *dptr = NULL; u_int16_t filelen; + u_int32_t timems; +#if !defined(KERNEL) && !defined(_KERNEL) struct timeval tm; struct timezone tzp; - u_int32_t timems; if(gettimeofday(&tm, &tzp) == -1) { return NULL; } +#endif if(file == NULL) { errno = EINVAL; @@ -884,7 +891,34 @@ return NULL; } +/* + * token ID 1 byte + * socket family 2 bytes + * path 104 bytes + */ +token_t *au_to_sock_unix(struct sockaddr_un *so) +{ + token_t *t; + u_char *dptr; + + if(so == NULL) { + return NULL; + } + + GET_TOKEN_AREA(t, dptr, 107); + if(t == NULL) { + return NULL; + } + + ADD_U_CHAR(dptr, AU_SOCK_UNIX_TOKEN); + /* BSM token has two bytes for family */ + ADD_U_CHAR(dptr, 0); + ADD_U_CHAR(dptr, so->sun_family); + ADD_STRING(dptr, so->sun_path, strlen(so->sun_path)); + return t; +} + /* * token ID 1 byte * socket family 2 bytes @@ -1085,6 +1119,7 @@ pid, sid, tid); } +#if !defined(_KERNEL) && !defined(KERNEL) /* * Collects audit information for the current process * and creates a subject token from it @@ -1103,6 +1138,7 @@ &auinfo.ai_termid); } +#endif /* * token ID 1 byte @@ -1207,17 +1243,24 @@ * seconds of time 4 bytes/8 bytes (32-bit/64-bit value) * milliseconds of time 4 bytes/8 bytes (32-bit/64-bit value) */ +#if defined(KERNEL) || defined(_KERNEL) token_t *au_to_header32(int rec_size, au_event_t e_type, au_emod_t e_mod) + struct timeval tm) +#else +token_t *au_to_header32(int rec_size, au_event_t e_type, au_emod_t e_mod) +#endif { token_t *t; u_char *dptr = NULL; + u_int32_t timems; +#if !defined(KERNEL) && !defined(_KERNEL) struct timeval tm; struct timezone tzp; - u_int32_t timems; if(gettimeofday(&tm, &tzp) == -1) { return NULL; } +#endif GET_TOKEN_AREA(t, dptr, 18); if(t == NULL) { From owner-p4-projects@FreeBSD.ORG Sat May 14 07:06:30 2005 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id B6AE716A4D1; Sat, 14 May 2005 07:06:29 +0000 (GMT) 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 85C2716A4CE for ; Sat, 14 May 2005 07:06:29 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 655B543D78 for ; Sat, 14 May 2005 07:06:29 +0000 (GMT) (envelope-from marcel@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 j4E76TND057453 for ; Sat, 14 May 2005 07:06:29 GMT (envelope-from marcel@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j4E76SmV057450 for perforce@freebsd.org; Sat, 14 May 2005 07:06:28 GMT (envelope-from marcel@freebsd.org) Date: Sat, 14 May 2005 07:06:28 GMT Message-Id: <200505140706.j4E76SmV057450@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to marcel@freebsd.org using -f From: Marcel Moolenaar To: Perforce Change Reviews Subject: PERFORCE change 76961 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 May 2005 07:06:31 -0000 http://perforce.freebsd.org/chv.cgi?CH=76961 Change 76961 by marcel@marcel_nfs on 2005/05/14 07:05:31 o Add a 8x16 font and use it. Taken from syscons. o Add an image of beastie when he was 4.4BSD years old. Shown when the VGA is not a console. o Implement BITBLT_H4TOFB. Affected files ... .. //depot/projects/tty/sys/conf/files#27 edit .. //depot/projects/tty/sys/dev/vga/vga.c#12 edit .. //depot/projects/tty/sys/dev/vga/vga_logo.c#1 add .. //depot/projects/tty/sys/dev/vtc/vtc_con.c#6 edit .. //depot/projects/tty/sys/dev/vtc/vtc_font.c#1 add Differences ... ==== //depot/projects/tty/sys/conf/files#27 (text+ko) ==== @@ -919,10 +919,12 @@ dev/vga/vga_bus_isa.c optional vga isa dev/vga/vga_bus_pci.c optional vga pci dev/vga/vga_con.c optional vga +dev/vga/vga_logo.c optional vga dev/vge/if_vge.c optional vge dev/vkbd/vkbd.c optional vkbd dev/vtc/vtc_con.c optional vtc dev/vtc/vtc_core.c optional vtc +dev/vtc/vtc_font.c optional vtc dev/vx/if_vx.c optional vx dev/vx/if_vx_eisa.c optional vx eisa dev/vx/if_vx_pci.c optional vx pci ==== //depot/projects/tty/sys/dev/vga/vga.c#12 (text+ko) ==== @@ -38,6 +38,10 @@ #include #include +extern int vga_logo_height; +extern int vga_logo_width; +extern u_char vga_logo_image[]; + /* Convenience macros. */ #define MEM_READ(sc, ofs) \ bus_space_read_1(sc->vga_fb.bst, sc->vga_fb.bsh, ofs) @@ -280,8 +284,6 @@ REG_WRITE(sc, VGA_GC_DATA, 0x0f); REG_WRITE(sc, VGA_GC_ADDRESS, VGA_GC_SET_RESET); REG_WRITE(sc, VGA_GC_DATA, c & 0x0f); - REG_WRITE(sc, VGA_GC_ADDRESS, VGA_GC_DATA_ROTATE); - REG_WRITE(sc, VGA_GC_DATA, 0); dst >>= 3; while (height > 0) { for (w = 0; w < width; w += 8) { @@ -301,13 +303,11 @@ int w; REG_WRITE(sc, VGA_GC_ADDRESS, VGA_GC_MODE); - REG_WRITE(sc, VGA_GC_DATA, 0); + REG_WRITE(sc, VGA_GC_DATA, 1); REG_WRITE(sc, VGA_GC_ADDRESS, VGA_GC_ENABLE_SET_RESET); REG_WRITE(sc, VGA_GC_DATA, 0x0f); REG_WRITE(sc, VGA_GC_ADDRESS, VGA_GC_SET_RESET); REG_WRITE(sc, VGA_GC_DATA, 0); - REG_WRITE(sc, VGA_GC_ADDRESS, VGA_GC_DATA_ROTATE); - REG_WRITE(sc, VGA_GC_DATA, VGA_GC_DR_FS_OR); dst >>= 3; src >>= 3; while (height > 0) { @@ -335,8 +335,6 @@ REG_WRITE(sc, VGA_GC_DATA, 0x0f); REG_WRITE(sc, VGA_GC_ADDRESS, VGA_GC_SET_RESET); REG_WRITE(sc, VGA_GC_DATA, fgclr); - REG_WRITE(sc, VGA_GC_ADDRESS, VGA_GC_DATA_ROTATE); - REG_WRITE(sc, VGA_GC_DATA, 0); c = fgclr; dst >>= 3; while (height > 0) { @@ -370,6 +368,56 @@ return (0); } +static __inline int +vga_bitblt_h4tofb(struct vga_softc *sc, uint8_t *src, u_long dst, int width, + int height) +{ + u_long dstini; + int rotini, w; + uint8_t mask; + + REG_WRITE(sc, VGA_GC_ADDRESS, VGA_GC_MODE); + REG_WRITE(sc, VGA_GC_DATA, 0); + REG_WRITE(sc, VGA_GC_ADDRESS, VGA_GC_ENABLE_SET_RESET); + REG_WRITE(sc, VGA_GC_DATA, 0x0f); + + rotini = dst & 7; + dstini = dst >> 3; + + while (height > 0) { + dst = dstini; + mask = 1 << (7 - rotini); + for (w = 0; w < width; w += 2) { + REG_WRITE(sc, VGA_GC_ADDRESS, VGA_GC_SET_RESET); + REG_WRITE(sc, VGA_GC_DATA, *src >> 4); + REG_WRITE(sc, VGA_GC_ADDRESS, VGA_GC_BIT_MASK); + REG_WRITE(sc, VGA_GC_DATA, mask); + MEM_READ(sc, dst); + MEM_WRITE(sc, dst, 0); + mask >>= 1; + if (mask == 0) { + dst++; + mask = 0x80; + } + REG_WRITE(sc, VGA_GC_ADDRESS, VGA_GC_SET_RESET); + REG_WRITE(sc, VGA_GC_DATA, *src & 0x0f); + REG_WRITE(sc, VGA_GC_ADDRESS, VGA_GC_BIT_MASK); + REG_WRITE(sc, VGA_GC_DATA, mask); + MEM_READ(sc, dst); + MEM_WRITE(sc, dst, 0); + mask >>= 1; + if (mask == 0) { + dst++; + mask = 0x80; + } + src++; + } + dstini += 80; + height--; + } + return (0); +} + int vga_vbitblt(struct vga_softc *sc, int op, uintptr_t src, uintptr_t dst, int width, int height, va_list ap) @@ -412,7 +460,9 @@ if (error) return (error); - /* TODO -- show beastie logo */ + vga_bitblt_h4tofb(sc, vga_logo_image, + 640 * (480 - vga_logo_height) / 2 + (640 - vga_logo_width) / 2, + vga_logo_width, vga_logo_height); return (0); } ==== //depot/projects/tty/sys/dev/vtc/vtc_con.c#6 (text+ko) ==== @@ -40,6 +40,7 @@ #include extern char vtc_device_name[]; /* XXX Should be in a header file. */ +extern u_char vtc_font_8x16[]; static cn_checkc_t vtc_cncheckc; static cn_getc_t vtc_cngetc; @@ -91,11 +92,9 @@ vtc_cnputc(struct consdev *cp, int c) { static int col = 0, row = 0; - static uint8_t bitmap[] = { 0x82, 0x82, 0x44, 0x44, 0x28, 0x28, 0x10, - 0x10, 0x28, 0x28, 0x44, 0x44, 0x82, 0x82, - 0x00, 0x00, 0x00, 0x00, 0x00 }; struct vtc_conout *vc = cp->cn_arg; int width = vc->vtc_con_width; + u_char *glyph; switch (c) { case 0x0a: @@ -103,8 +102,9 @@ row++; break; default: - vc->vtc_con_bitblt(vc, BITBLT_H1TOFB, (uintptr_t)bitmap, - width * row * 19 + col * 8, 8, 19, 0, 7); + glyph = vtc_font_8x16 + (c * 16); + vc->vtc_con_bitblt(vc, BITBLT_H1TOFB, (uintptr_t)glyph, + width * row * 16 + col * 8, 8, 16, 0, 7); col++; break; } @@ -112,12 +112,12 @@ col = 0; row++; } - if (row >= 24) { - vc->vtc_con_bitblt(vc, BITBLT_FBTOFB, width * 19, 0, width, - 23 * 19); - vc->vtc_con_bitblt(vc, BITBLT_CTOFB, 0, width * 23 * 19, width, - 19); - row = 23; + if (row >= 30) { + vc->vtc_con_bitblt(vc, BITBLT_FBTOFB, width * 16, 0, width, + 29 * 16); + vc->vtc_con_bitblt(vc, BITBLT_CTOFB, 0, width * 29 * 16, width, + 16); + row = 29; } } From owner-p4-projects@FreeBSD.ORG Sat May 14 21:23:15 2005 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 2D63D16A4D1; Sat, 14 May 2005 21:23:15 +0000 (GMT) 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 DE71416A4CE for ; Sat, 14 May 2005 21:23:14 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id C261043D67 for ; Sat, 14 May 2005 21:23:14 +0000 (GMT) (envelope-from marcel@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 j4ELNEKx032659 for ; Sat, 14 May 2005 21:23:14 GMT (envelope-from marcel@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j4ELNEAh032656 for perforce@freebsd.org; Sat, 14 May 2005 21:23:14 GMT (envelope-from marcel@freebsd.org) Date: Sat, 14 May 2005 21:23:14 GMT Message-Id: <200505142123.j4ELNEAh032656@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to marcel@freebsd.org using -f From: Marcel Moolenaar To: Perforce Change Reviews Subject: PERFORCE change 76986 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 May 2005 21:23:16 -0000 http://perforce.freebsd.org/chv.cgi?CH=76986 Change 76986 by marcel@marcel_nfs on 2005/05/14 21:23:02 Flesh-out the low-level console: o Reject characters outside the 7-bit unsigned range. o Process selected control characters. o Diplay glyphs for non-control characters. Trim the font table from the first 32 character ghyphs. Since we only accept 7-bit characters, we can also trim the table at the high end (not done yet). Backspace erases. Affected files ... .. //depot/projects/tty/sys/dev/vtc/vtc_con.c#7 edit .. //depot/projects/tty/sys/dev/vtc/vtc_font.c#2 edit Differences ... ==== //depot/projects/tty/sys/dev/vtc/vtc_con.c#7 (text+ko) ==== @@ -93,21 +93,50 @@ { static int col = 0, row = 0; struct vtc_conout *vc = cp->cn_arg; - int width = vc->vtc_con_width; + int ch, width; u_char *glyph; + /* Sanity check. */ + if (c <= 0 || c >= 0x7f) + return; + + width = vc->vtc_con_width; switch (c) { - case 0x0a: + case 8: /* BS */ + if (col > 0) + col--; + ch = ' '; + break; + case 9: /* HT */ + col = (col + 7) & 7; + if (col >= 80) + col = 79; + ch = 0; + break; + case 10: /* LF */ + case 11: /* VT (processed as LF) */ + case 12: /* FF (processed as LF) */ col = 0; row++; + ch = 0; + break; + case 13: /* CR */ + col = 0; + ch = 0; break; default: - glyph = vtc_font_8x16 + (c * 16); + ch = (c >= ' ') ? c : 0; + break; + } + + if (ch != 0) { + glyph = vtc_font_8x16 + ((ch - ' ') * 16); vc->vtc_con_bitblt(vc, BITBLT_H1TOFB, (uintptr_t)glyph, width * row * 16 + col * 8, 8, 16, 0, 7); - col++; - break; + if (c != 8) + col++; } + if (col >= 80) { col = 0; row++; ==== //depot/projects/tty/sys/dev/vtc/vtc_font.c#2 (text+ko) ==== @@ -27,31 +27,14 @@ #include __FBSDID("$FreeBSD$"); -unsigned char vtc_font_8x16[16*256] = { -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,126,129,165,129,129,189,153,129,129, -126,0,0,0,0,0,0,126,255,219,255,255,195,231,255,255,126,0,0,0,0,0,0,0,0, -108,254,254,254,254,124,56,16,0,0,0,0,0,0,0,0,16,56,124,254,124,56,16,0, -0,0,0,0,0,0,0,24,60,60,231,231,231,24,24,60,0,0,0,0,0,0,0,24,60,126,255, -255,126,24,24,60,0,0,0,0,0,0,0,0,0,0,24,60,60,24,0,0,0,0,0,0,255,255,255, -255,255,255,231,195,195,231,255,255,255,255,255,255,0,0,0,0,0,60,102,66, -66,102,60,0,0,0,0,0,255,255,255,255,255,195,153,189,189,153,195,255,255, -255,255,255,0,0,30,14,26,50,120,204,204,204,204,120,0,0,0,0,0,0,60,102, -102,102,102,60,24,126,24,24,0,0,0,0,0,0,63,51,63,48,48,48,48,112,240,224, -0,0,0,0,0,0,127,99,127,99,99,99,99,103,231,230,192,0,0,0,0,0,0,24,24,219, -60,231,60,219,24,24,0,0,0,0,0,128,192,224,240,248,254,248,240,224,192,128, -0,0,0,0,0,2,6,14,30,62,254,62,30,14,6,2,0,0,0,0,0,0,24,60,126,24,24,24, -126,60,24,0,0,0,0,0,0,0,102,102,102,102,102,102,102,0,102,102,0,0,0,0,0, -0,127,219,219,219,123,27,27,27,27,27,0,0,0,0,0,124,198,96,56,108,198,198, -108,56,12,198,124,0,0,0,0,0,0,0,0,0,0,0,254,254,254,254,0,0,0,0,0,0,24, -60,126,24,24,24,126,60,24,126,0,0,0,0,0,0,24,60,126,24,24,24,24,24,24,24, -0,0,0,0,0,0,24,24,24,24,24,24,24,126,60,24,0,0,0,0,0,0,0,0,0,24,12,254, -12,24,0,0,0,0,0,0,0,0,0,0,0,48,96,254,96,48,0,0,0,0,0,0,0,0,0,0,0,0,192, -192,192,254,0,0,0,0,0,0,0,0,0,0,0,40,108,254,108,40,0,0,0,0,0,0,0,0,0,0, -16,56,56,124,124,254,254,0,0,0,0,0,0,0,0,0,254,254,124,124,56,56,16,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,60,60,60,24,24,24,0,24,24, -0,0,0,0,0,102,102,102,36,0,0,0,0,0,0,0,0,0,0,0,0,0,0,108,108,254,108,108, -108,254,108,108,0,0,0,0,24,24,124,198,194,192,124,6,6,134,198,124,24,24, -0,0,0,0,0,0,194,198,12,24,48,96,198,134,0,0,0,0,0,0,56,108,108,56,118,220, +unsigned char vtc_font_8x16[16 * (256 - 32)] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,24,60,60,60,24,24,24,0,24,24,0,0,0,0, +0,102,102,102,36,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,108,108,254,108,108,108,254,108,108,0,0,0,0, +24,24,124,198,194,192,124,6,6,134,198,124,24,24,0,0, + +0,0,0,0,194,198,12,24,48,96,198,134,0,0,0,0,0,0,56,108,108,56,118,220, 204,204,204,118,0,0,0,0,0,48,48,48,96,0,0,0,0,0,0,0,0,0,0,0,0,0,12,24,48, 48,48,48,48,48,24,12,0,0,0,0,0,0,48,24,12,12,12,12,12,12,24,48,0,0,0,0, 0,0,0,0,0,102,60,255,60,102,0,0,0,0,0,0,0,0,0,0,0,24,24,126,24,24,0,0,0, From owner-p4-projects@FreeBSD.ORG Sat May 14 22:07:08 2005 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 45BE816A4D1; Sat, 14 May 2005 22:07:08 +0000 (GMT) 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 1B1E316A4CE for ; Sat, 14 May 2005 22:07:08 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id E1A7243D73 for ; Sat, 14 May 2005 22:07:07 +0000 (GMT) (envelope-from marcel@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 j4EM77TF034364 for ; Sat, 14 May 2005 22:07:07 GMT (envelope-from marcel@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j4EM77ol034361 for perforce@freebsd.org; Sat, 14 May 2005 22:07:07 GMT (envelope-from marcel@freebsd.org) Date: Sat, 14 May 2005 22:07:07 GMT Message-Id: <200505142207.j4EM77ol034361@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to marcel@freebsd.org using -f From: Marcel Moolenaar To: Perforce Change Reviews Subject: PERFORCE change 76987 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 May 2005 22:07:09 -0000 http://perforce.freebsd.org/chv.cgi?CH=76987 Change 76987 by marcel@marcel_nfs on 2005/05/14 22:06:20 Reorganize the code. The relation between vtc(4) and hardware drivers is intimate enough that the hardware drivers can or should be moved underneath the vtc directory. Move vga_logo.c to vtc_logo.c Affected files ... .. //depot/projects/tty/sys/dev/gmch/gmch.c#2 delete .. //depot/projects/tty/sys/dev/gmch/gmch.h#2 delete .. //depot/projects/tty/sys/dev/gmch/gmch_bus_pci.c#2 delete .. //depot/projects/tty/sys/dev/vga/vga.c#13 delete .. //depot/projects/tty/sys/dev/vga/vga.h#7 delete .. //depot/projects/tty/sys/dev/vga/vga_bus_isa.c#3 delete .. //depot/projects/tty/sys/dev/vga/vga_bus_pci.c#5 delete .. //depot/projects/tty/sys/dev/vga/vga_con.c#5 delete .. //depot/projects/tty/sys/dev/vga/vga_cpu_alpha.c#5 delete .. //depot/projects/tty/sys/dev/vga/vga_cpu_amd64.c#5 delete .. //depot/projects/tty/sys/dev/vga/vga_cpu_i386.c#6 delete .. //depot/projects/tty/sys/dev/vga/vga_cpu_ia64.c#5 delete .. //depot/projects/tty/sys/dev/vga/vga_cpu_sparc64.c#4 delete .. //depot/projects/tty/sys/dev/vga/vga_logo.c#2 delete .. //depot/projects/tty/sys/dev/vtc/hw/gmch/gmch.c#1 branch .. //depot/projects/tty/sys/dev/vtc/hw/gmch/gmch.h#1 branch .. //depot/projects/tty/sys/dev/vtc/hw/gmch/gmch_bus_pci.c#1 branch .. //depot/projects/tty/sys/dev/vtc/hw/vga/vga.c#1 branch .. //depot/projects/tty/sys/dev/vtc/hw/vga/vga.h#1 branch .. //depot/projects/tty/sys/dev/vtc/hw/vga/vga_bus_isa.c#1 branch .. //depot/projects/tty/sys/dev/vtc/hw/vga/vga_bus_pci.c#1 branch .. //depot/projects/tty/sys/dev/vtc/hw/vga/vga_con.c#1 branch .. //depot/projects/tty/sys/dev/vtc/hw/vga/vga_cpu_alpha.c#1 branch .. //depot/projects/tty/sys/dev/vtc/hw/vga/vga_cpu_amd64.c#1 branch .. //depot/projects/tty/sys/dev/vtc/hw/vga/vga_cpu_i386.c#1 branch .. //depot/projects/tty/sys/dev/vtc/hw/vga/vga_cpu_ia64.c#1 branch .. //depot/projects/tty/sys/dev/vtc/hw/vga/vga_cpu_sparc64.c#1 branch .. //depot/projects/tty/sys/dev/vtc/vtc.h#1 branch .. //depot/projects/tty/sys/dev/vtc/vtc_logo.c#1 branch Differences ... From owner-p4-projects@FreeBSD.ORG Sat May 14 22:08:10 2005 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id F072D16A4D1; Sat, 14 May 2005 22:08:09 +0000 (GMT) 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 CC47B16A4CE for ; Sat, 14 May 2005 22:08:09 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id A1F1743D54 for ; Sat, 14 May 2005 22:08:09 +0000 (GMT) (envelope-from marcel@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 j4EM8943034387 for ; Sat, 14 May 2005 22:08:09 GMT (envelope-from marcel@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j4EM89b2034384 for perforce@freebsd.org; Sat, 14 May 2005 22:08:09 GMT (envelope-from marcel@freebsd.org) Date: Sat, 14 May 2005 22:08:09 GMT Message-Id: <200505142208.j4EM89b2034384@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to marcel@freebsd.org using -f From: Marcel Moolenaar To: Perforce Change Reviews Subject: PERFORCE change 76988 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 May 2005 22:08:10 -0000 http://perforce.freebsd.org/chv.cgi?CH=76988 Change 76988 by marcel@marcel_nfs on 2005/05/14 22:07:48 Forgot to delete in the previous commit... Affected files ... .. //depot/projects/tty/sys/sys/vtc.h#3 delete Differences ... From owner-p4-projects@FreeBSD.ORG Sat May 14 23:53:17 2005 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 856B116A4D1; Sat, 14 May 2005 23:53:17 +0000 (GMT) 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 2B07E16A4CE for ; Sat, 14 May 2005 23:53:17 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id F0DFB43D39 for ; Sat, 14 May 2005 23:53:16 +0000 (GMT) (envelope-from marcel@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 j4ENrGlS040347 for ; Sat, 14 May 2005 23:53:16 GMT (envelope-from marcel@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j4ENrGHH040344 for perforce@freebsd.org; Sat, 14 May 2005 23:53:16 GMT (envelope-from marcel@freebsd.org) Date: Sat, 14 May 2005 23:53:16 GMT Message-Id: <200505142353.j4ENrGHH040344@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to marcel@freebsd.org using -f From: Marcel Moolenaar To: Perforce Change Reviews Subject: PERFORCE change 76991 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 May 2005 23:53:18 -0000 http://perforce.freebsd.org/chv.cgi?CH=76991 Change 76991 by marcel@marcel_nfs on 2005/05/14 23:52:17 Update file contents to reflect reorganization. Minor tweaks here and there while I'm in the vicinity. Affected files ... .. //depot/projects/tty/sys/conf/files#28 edit .. //depot/projects/tty/sys/conf/files.alpha#13 edit .. //depot/projects/tty/sys/conf/files.amd64#16 edit .. //depot/projects/tty/sys/conf/files.i386#20 edit .. //depot/projects/tty/sys/conf/files.ia64#16 edit .. //depot/projects/tty/sys/conf/files.sparc64#13 edit .. //depot/projects/tty/sys/dev/vtc/hw/gmch/gmch.c#2 edit .. //depot/projects/tty/sys/dev/vtc/hw/gmch/gmch.h#2 edit .. //depot/projects/tty/sys/dev/vtc/hw/gmch/gmch_bus_pci.c#2 edit .. //depot/projects/tty/sys/dev/vtc/hw/vga/vga.c#2 edit .. //depot/projects/tty/sys/dev/vtc/hw/vga/vga.h#2 edit .. //depot/projects/tty/sys/dev/vtc/hw/vga/vga_bus_isa.c#2 edit .. //depot/projects/tty/sys/dev/vtc/hw/vga/vga_bus_pci.c#2 edit .. //depot/projects/tty/sys/dev/vtc/hw/vga/vga_con.c#2 edit .. //depot/projects/tty/sys/dev/vtc/hw/vga/vga_cpu_alpha.c#2 edit .. //depot/projects/tty/sys/dev/vtc/hw/vga/vga_cpu_amd64.c#2 edit .. //depot/projects/tty/sys/dev/vtc/hw/vga/vga_cpu_i386.c#2 edit .. //depot/projects/tty/sys/dev/vtc/hw/vga/vga_cpu_ia64.c#2 edit .. //depot/projects/tty/sys/dev/vtc/hw/vga/vga_cpu_sparc64.c#2 edit .. //depot/projects/tty/sys/dev/vtc/vtc.h#2 edit .. //depot/projects/tty/sys/dev/vtc/vtc_con.c#8 edit .. //depot/projects/tty/sys/dev/vtc/vtc_core.c#4 edit .. //depot/projects/tty/sys/dev/vtc/vtc_font.c#3 edit .. //depot/projects/tty/sys/dev/vtc/vtc_logo.c#2 edit Differences ... ==== //depot/projects/tty/sys/conf/files#28 (text+ko) ==== @@ -555,8 +555,6 @@ dev/fxp/if_fxp.c optional fxp dev/gem/if_gem.c optional gem dev/gem/if_gem_pci.c optional gem pci -dev/gmch/gmch.c optional gmch -dev/gmch/gmch_bus_pci.c optional gmch pci dev/harp/if_harp.c optional harp pci dev/hatm/if_hatm.c optional hatm pci dev/hatm/if_hatm_intr.c optional hatm pci @@ -915,16 +913,18 @@ dev/utopia/idtphy.c optional utopia dev/utopia/suni.c optional utopia dev/utopia/utopia.c optional utopia -dev/vga/vga.c optional vga -dev/vga/vga_bus_isa.c optional vga isa -dev/vga/vga_bus_pci.c optional vga pci -dev/vga/vga_con.c optional vga -dev/vga/vga_logo.c optional vga dev/vge/if_vge.c optional vge dev/vkbd/vkbd.c optional vkbd dev/vtc/vtc_con.c optional vtc dev/vtc/vtc_core.c optional vtc dev/vtc/vtc_font.c optional vtc +dev/vtc/vtc_logo.c optional vtc +dev/vtc/hw/gmch/gmch.c optional gmch vtc +dev/vtc/hw/gmch/gmch_bus_pci.c optional gmch vtc pci +dev/vtc/hw/vga/vga.c optional vga vtc +dev/vtc/hw/vga/vga_bus_isa.c optional vga vtc isa +dev/vtc/hw/vga/vga_bus_pci.c optional vga vtc pci +dev/vtc/hw/vga/vga_con.c optional vga vtc dev/vx/if_vx.c optional vx dev/vx/if_vx_eisa.c optional vx eisa dev/vx/if_vx_pci.c optional vx pci ==== //depot/projects/tty/sys/conf/files.alpha#13 (text+ko) ==== @@ -178,7 +178,7 @@ dev/sio/sio.c optional sio dev/sio/sio_isa.c optional sio isa dev/uart/uart_cpu_alpha.c optional uart -dev/vga/vga_cpu_alpha.c optional vga +dev/vtc/hw/vga/vga_cpu_alpha.c optional vga vtc geom/geom_bsd.c standard geom/geom_bsd_enc.c standard isa/atkbd_isa.c optional atkbd ==== //depot/projects/tty/sys/conf/files.amd64#16 (text+ko) ==== @@ -148,7 +148,7 @@ dev/sio/sio.c optional sio dev/sio/sio_isa.c optional sio isa dev/uart/uart_cpu_amd64.c optional uart -dev/vga/vga_cpu_amd64.c optional vga +dev/vtc/hw/vga/vga_cpu_amd64.c optional vga vtc geom/geom_bsd.c standard geom/geom_bsd_enc.c standard geom/geom_mbr.c standard ==== //depot/projects/tty/sys/conf/files.i386#20 (text+ko) ==== @@ -196,7 +196,7 @@ dev/sio/sio_isa.c optional sio isa dev/sr/if_sr_isa.c optional sr isa dev/uart/uart_cpu_i386.c optional uart -dev/vga/vga_cpu_i386.c optional vga +dev/vtc/hw/vga/vga_cpu_i386.c optional vga vtc geom/geom_bsd.c standard geom/geom_bsd_enc.c standard geom/geom_mbr.c standard ==== //depot/projects/tty/sys/conf/files.ia64#16 (text+ko) ==== @@ -44,7 +44,7 @@ dev/kbd/kbd.c optional ukbd dev/ppc/ppc.c optional ppc isa dev/uart/uart_cpu_ia64.c optional uart -dev/vga/vga_cpu_ia64.c optional vga +dev/vtc/hw/vga/vga_cpu_ia64.c optional vga vtc geom/geom_bsd.c standard geom/geom_bsd_enc.c standard geom/geom_gpt.c standard ==== //depot/projects/tty/sys/conf/files.sparc64#13 (text+ko) ==== @@ -24,7 +24,7 @@ dev/sound/sbus/cs4231.c optional snd_audiocs sbus dev/uart/uart_cpu_sparc64.c optional uart #dev/uart/uart_kbd_sun.c optional uart sc -dev/vga/vga_cpu_sparc64.c optional vga +dev/vtc/hw/vga/vga_cpu_sparc64.c optional vga vtc geom/geom_bsd.c standard geom/geom_bsd_enc.c standard geom/geom_sunlabel.c standard ==== //depot/projects/tty/sys/dev/vtc/hw/gmch/gmch.c#2 (text+ko) ==== @@ -34,15 +34,25 @@ #include #include -#include +#include devclass_t gmch_devclass; char gmch_device_name[] = "gmch"; int +gmch_attach(device_t dev) +{ + struct gmch_softc *sc; + + sc = device_get_softc(dev); + sc->gmch_dev = dev; + return (0); +} + +int gmch_vbitblt(struct gmch_softc *sc, int op, uintptr_t dst, uintptr_t src, int width, int height, va_list ap) { - return (0); + return (ENXIO); } ==== //depot/projects/tty/sys/dev/vtc/hw/gmch/gmch.h#2 (text+ko) ==== @@ -26,8 +26,8 @@ * $FreeBSD$ */ -#ifndef _DEV_GMCH_GMCH_H_ -#define _DEV_GMCH_GMCH_H_ +#ifndef _DEV_VTC_HW_GMCH_H_ +#define _DEV_VTC_HW_GMCH_H_ #include @@ -40,7 +40,8 @@ extern devclass_t gmch_devclass; extern char gmch_device_name[]; +int gmch_attach(device_t); int gmch_vbitblt(struct gmch_softc *, int, uintptr_t, uintptr_t, int, int, va_list); -#endif /* !_DEV_GMCH_GMCH_H_ */ +#endif /* !_DEV_VTC_HW_GMCH_H_ */ ==== //depot/projects/tty/sys/dev/vtc/hw/gmch/gmch_bus_pci.c#2 (text+ko) ==== @@ -39,7 +39,7 @@ #include #include -#include +#include #define PCI_VENDOR_INTEL 0x8086 #define PCI_DEVICE_I830M 0x3577 @@ -64,7 +64,7 @@ gmch_pci_attach(device_t dev) { - return (0); + return (gmch_attach(dev)); } static int ==== //depot/projects/tty/sys/dev/vtc/hw/vga/vga.c#2 (text+ko) ==== @@ -33,14 +33,10 @@ #include #include #include -#include #include -#include - -extern int vga_logo_height; -extern int vga_logo_width; -extern u_char vga_logo_image[]; +#include +#include /* Convenience macros. */ #define MEM_READ(sc, ofs) \ @@ -460,9 +456,9 @@ if (error) return (error); - vga_bitblt_h4tofb(sc, vga_logo_image, - 640 * (480 - vga_logo_height) / 2 + (640 - vga_logo_width) / 2, - vga_logo_width, vga_logo_height); + vga_bitblt_h4tofb(sc, vtc_logo4_image, + 640 * (480 - vtc_logo4_height) / 2 + (640 - vtc_logo4_width) / 2, + vtc_logo4_width, vtc_logo4_height); return (0); } ==== //depot/projects/tty/sys/dev/vtc/hw/vga/vga.h#2 (text+ko) ==== @@ -26,8 +26,8 @@ * $FreeBSD$ */ -#ifndef _DEV_VGA_VGA_H_ -#define _DEV_VGA_VGA_H_ +#ifndef _DEV_VTC_HW_VGA_H_ +#define _DEV_VTC_HW_VGA_H_ #include @@ -75,4 +75,4 @@ int vga_init(struct vga_softc *); int vga_probe(struct vga_softc *); -#endif /* !_DEV_VGA_VGA_H_ */ +#endif /* !_DEV_VTC_HW_VGA_H_ */ ==== //depot/projects/tty/sys/dev/vtc/hw/vga/vga_bus_isa.c#2 (text+ko) ==== @@ -40,7 +40,7 @@ #include #include -#include +#include static int vga_isa_attach(device_t); static int vga_isa_probe(device_t); ==== //depot/projects/tty/sys/dev/vtc/hw/vga/vga_bus_pci.c#2 (text+ko) ==== @@ -40,7 +40,7 @@ #include #include -#include +#include static int vga_pci_attach(device_t dev); static int vga_pci_probe(device_t dev); ==== //depot/projects/tty/sys/dev/vtc/hw/vga/vga_con.c#2 (text+ko) ==== @@ -36,7 +36,8 @@ #include #include -#include +#include + #include static vtc_con_bitblt_f vga_con_bitblt; ==== //depot/projects/tty/sys/dev/vtc/hw/vga/vga_cpu_alpha.c#2 (text+ko) ==== @@ -33,7 +33,7 @@ #include #include -#include +#include int vga_get_console(struct vga_consdata *cd) ==== //depot/projects/tty/sys/dev/vtc/hw/vga/vga_cpu_amd64.c#2 (text+ko) ==== @@ -39,7 +39,7 @@ #include #include -#include +#include int vga_get_console(struct vga_consdata *cd) ==== //depot/projects/tty/sys/dev/vtc/hw/vga/vga_cpu_i386.c#2 (text+ko) ==== @@ -39,7 +39,7 @@ #include #include -#include +#include int vga_get_console(struct vga_consdata *cd) ==== //depot/projects/tty/sys/dev/vtc/hw/vga/vga_cpu_ia64.c#2 (text+ko) ==== @@ -33,7 +33,7 @@ #include #include -#include +#include int vga_get_console(struct vga_consdata *cd) ==== //depot/projects/tty/sys/dev/vtc/hw/vga/vga_cpu_sparc64.c#2 (text+ko) ==== @@ -37,7 +37,7 @@ #include #include -#include +#include int vga_get_console(struct vga_consdata *cd) ==== //depot/projects/tty/sys/dev/vtc/vtc.h#2 (text+ko) ==== @@ -26,8 +26,8 @@ * $FreeBSD$ */ -#ifndef _SYS_VTC_H_ -#define _SYS_VTC_H_ +#ifndef _DEV_VTC_H_ +#define _DEV_VTC_H_ /* BitBlt operations. */ #define BITBLT_CTOFB 0x0001 @@ -39,4 +39,15 @@ #define BITBLT_H32TOFB 0x0007 #define BITBLT_FBTOFB 0x0008 -#endif /* !_SYS_VTC_H_ */ +/* Beastie logos. */ +extern int vtc_logo4_width; +extern int vtc_logo4_height; +extern unsigned char vtc_logo4_image[]; + +/* Built-in fonts. */ +extern unsigned char vtc_font_8x16[]; + +/* Miscellaneous. */ +extern char vtc_device_name[]; + +#endif /* !_DEV_VTC_H_ */ ==== //depot/projects/tty/sys/dev/vtc/vtc_con.c#8 (text+ko) ==== @@ -35,13 +35,10 @@ #include #include #include -#include +#include #include -extern char vtc_device_name[]; /* XXX Should be in a header file. */ -extern u_char vtc_font_8x16[]; - static cn_checkc_t vtc_cncheckc; static cn_getc_t vtc_cngetc; static cn_init_t vtc_cninit; @@ -49,6 +46,9 @@ static cn_putc_t vtc_cnputc; static cn_term_t vtc_cnterm; +static int cncol = 0; +static int cnrow = 0; + CONS_DRIVER(vtc, vtc_cnprobe, vtc_cninit, vtc_cnterm, vtc_cngetc, vtc_cncheckc, vtc_cnputc, NULL); @@ -91,7 +91,6 @@ static void vtc_cnputc(struct consdev *cp, int c) { - static int col = 0, row = 0; struct vtc_conout *vc = cp->cn_arg; int ch, width; u_char *glyph; @@ -103,25 +102,25 @@ width = vc->vtc_con_width; switch (c) { case 8: /* BS */ - if (col > 0) - col--; + if (cncol > 0) + cncol--; ch = ' '; break; case 9: /* HT */ - col = (col + 7) & 7; - if (col >= 80) - col = 79; + cncol = (cncol + 7) & 7; + if (cncol >= 80) + cncol = 79; ch = 0; break; case 10: /* LF */ case 11: /* VT (processed as LF) */ case 12: /* FF (processed as LF) */ - col = 0; - row++; + cncol = 0; + cnrow++; ch = 0; break; case 13: /* CR */ - col = 0; + cncol = 0; ch = 0; break; default: @@ -132,21 +131,21 @@ if (ch != 0) { glyph = vtc_font_8x16 + ((ch - ' ') * 16); vc->vtc_con_bitblt(vc, BITBLT_H1TOFB, (uintptr_t)glyph, - width * row * 16 + col * 8, 8, 16, 0, 7); + width * cnrow * 16 + cncol * 8, 8, 16, 0, 7); if (c != 8) - col++; + cncol++; } - if (col >= 80) { - col = 0; - row++; + if (cncol >= 80) { + cncol = 0; + cnrow++; } - if (row >= 30) { + if (cnrow >= 30) { vc->vtc_con_bitblt(vc, BITBLT_FBTOFB, width * 16, 0, width, 29 * 16); vc->vtc_con_bitblt(vc, BITBLT_CTOFB, 0, width * 29 * 16, width, 16); - row = 29; + cnrow = 29; } } ==== //depot/projects/tty/sys/dev/vtc/vtc_core.c#4 (text+ko) ==== @@ -33,6 +33,8 @@ #include #include +#include + char vtc_device_name[] = "vtc"; static int ==== //depot/projects/tty/sys/dev/vtc/vtc_font.c#3 (text+ko) ==== @@ -27,6 +27,8 @@ #include __FBSDID("$FreeBSD$"); +#include + unsigned char vtc_font_8x16[16 * (256 - 32)] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,24,60,60,60,24,24,24,0,24,24,0,0,0,0, ==== //depot/projects/tty/sys/dev/vtc/vtc_logo.c#2 (text+ko) ==== @@ -27,6 +27,8 @@ #include __FBSDID("$FreeBSD$"); +#include + #define __ 0 #define BR 4 #define BW 15 @@ -37,9 +39,14 @@ #define WR 244 #define WW 255 -int vga_logo_width = 232; -int vga_logo_height = 138; -unsigned char vga_logo_image[] = { +int vtc_logo4_width = 232; +int vtc_logo4_height = 140; +unsigned char vtc_logo4_image[] = { +__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__, +__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__, +__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__, +__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__, + __,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__, __,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__, RR,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__, @@ -729,4 +736,9 @@ __,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,RR,RR,RB,__,__,__,__, __,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__, __,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__, + +__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__, +__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__, +__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__, +__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__, };