From owner-p4-projects@FreeBSD.ORG Sun Apr 6 03:09:11 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id D3A8237B404; Sun, 6 Apr 2003 03:09:10 -0700 (PDT) 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 8FEB637B401 for ; Sun, 6 Apr 2003 03:09:09 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1951A43F85 for ; Sun, 6 Apr 2003 03:09:09 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h36A980U005685 for ; Sun, 6 Apr 2003 03:09:08 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h36A980O005682 for perforce@freebsd.org; Sun, 6 Apr 2003 03:09:08 -0700 (PDT) Date: Sun, 6 Apr 2003 03:09:08 -0700 (PDT) Message-Id: <200304061009.h36A980O005682@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28311 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, 06 Apr 2003 10:09:12 -0000 http://perforce.freebsd.org/chv.cgi?CH=28311 Change 28311 by peter@peter_overcee on 2003/04/06 03:08:19 Quick and dirty hack working towards starting the kernel with long mode enabled and running at the virtual address. Not quite finished yet - the trampoline isn't quite connected yet. Affected files ... .. //depot/projects/hammer/sys/boot/i386/libi386/Makefile#4 edit .. //depot/projects/hammer/sys/boot/i386/libi386/elf64_freebsd.c#3 edit .. //depot/projects/hammer/sys/boot/i386/libi386/x86_64_tramp.S#1 add Differences ... ==== //depot/projects/hammer/sys/boot/i386/libi386/Makefile#4 (text+ko) ==== @@ -7,7 +7,7 @@ biospci.c bootinfo.c comconsole.c devicename.c elf32_freebsd.c \ elf64_freebsd.c gatea20.c \ i386_copy.c i386_module.c nullconsole.c pxe.c pxetramp.s \ - time.c vidconsole.c + time.c vidconsole.c x86_64_tramp.S CFLAGS+= -ffreestanding BOOT_COMCONSOLE_PORT?= 0x3f8 ==== //depot/projects/hammer/sys/boot/i386/libi386/elf64_freebsd.c#3 (text+ko) ==== @@ -43,6 +43,16 @@ struct file_format x86_64_elf = { elf64_loadfile, elf64_exec }; +typedef u_int64_t p4_entry_t; +typedef u_int64_t p3_entry_t; +typedef u_int64_t p2_entry_t; +extern p4_entry_t PT4[]; +extern p3_entry_t PT3[]; +extern p2_entry_t PT2[]; + +u_int32_t entry_hi; +u_int32_t entry_lo; + /* * There is an a.out kernel and one or more a.out modules loaded. * We wish to start executing the kernel image, so make such @@ -57,6 +67,7 @@ int boothowto, err, bootdev; struct bootinfo *bi; vm_offset_t ssym, esym; + int i; if ((md = file_findmetadata(fp, MODINFOMD_ELFHDR)) == NULL) return(EFTYPE); /* XXX actually EFUCKUP */ @@ -77,10 +88,32 @@ bi->bi_symtab = ssym; /* XXX this is only the primary kernel symtab */ bi->bi_esymtab = esym; +printf("initializing trampoline, __base=%#x\n", __base); +#define PG_V 0x001 +#define PG_RW 0x002 +#define PG_U 0x004 +#define PG_PS 0x080 + bzero(PT4, PAGE_SIZE); + bzero(PT3, PAGE_SIZE); + bzero(PT2, PAGE_SIZE); -#ifdef DEBUG + /* single PML4 entry */ + PT4[0] = (p4_entry_t)&PT3[0]; + PT4[0] |= PG_V | PG_RW | PG_U; + + /* four PDP entries, 1G each */ + for (i = 0; i < 4; i++) { + PT3[i] = (p3_entry_t)&PT2[i * 512]; + PT3[i] |= PG_V | PG_RW | PG_U; + } + + /* 2048 PG_PS (2MB) page mappings */ + for (i = 0; i < 2048; i++) { + PT2[i] = i * (2 * 1024 * 1024); + PT2[i] |= PG_V | PG_RW | PG_PS | PG_U; + } + printf("Start @ 0x%lx ...\n", entry); -#endif dev_cleanup(); __exec((void *)entry, boothowto, bootdev, 0, 0, 0, bootinfop, modulep, bi->bi_kernend); From owner-p4-projects@FreeBSD.ORG Sun Apr 6 11:37:49 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 2EA8C37B404; Sun, 6 Apr 2003 11:37:49 -0700 (PDT) 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 C3ED637B401 for ; Sun, 6 Apr 2003 11:37:48 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6676843F75 for ; Sun, 6 Apr 2003 11:37:48 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h36Ibm0U058617 for ; Sun, 6 Apr 2003 11:37:48 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h36IblQ2058614 for perforce@freebsd.org; Sun, 6 Apr 2003 11:37:47 -0700 (PDT) Date: Sun, 6 Apr 2003 11:37:47 -0700 (PDT) Message-Id: <200304061837.h36IblQ2058614@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28345 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, 06 Apr 2003 18:37:50 -0000 http://perforce.freebsd.org/chv.cgi?CH=28345 Change 28345 by peter@peter_overcee on 2003/04/06 11:36:54 connect up the x86-64 trampoline to elf64_freebsd Affected files ... .. //depot/projects/hammer/sys/boot/i386/libi386/elf64_freebsd.c#4 edit Differences ... ==== //depot/projects/hammer/sys/boot/i386/libi386/elf64_freebsd.c#4 (text+ko) ==== @@ -53,6 +53,8 @@ u_int32_t entry_hi; u_int32_t entry_lo; +extern x86_64_tramp(); + /* * There is an a.out kernel and one or more a.out modules loaded. * We wish to start executing the kernel image, so make such @@ -98,12 +100,12 @@ bzero(PT2, PAGE_SIZE); /* single PML4 entry */ - PT4[0] = (p4_entry_t)&PT3[0]; + PT4[0] = (p4_entry_t)(uintptr_t)&PT3[0]; PT4[0] |= PG_V | PG_RW | PG_U; /* four PDP entries, 1G each */ for (i = 0; i < 4; i++) { - PT3[i] = (p3_entry_t)&PT2[i * 512]; + PT3[i] = (p3_entry_t)(uintptr_t)&PT2[i * 512]; PT3[i] |= PG_V | PG_RW | PG_U; } @@ -113,10 +115,12 @@ PT2[i] |= PG_V | PG_RW | PG_PS | PG_U; } - printf("Start @ 0x%lx ...\n", entry); + printf("entry_hi: %#x \n", entry_hi); + printf("entry_lo: %#x \n", entry_lo); + printf("Start @ %#llx ...\n", entry); dev_cleanup(); - __exec((void *)entry, boothowto, bootdev, 0, 0, 0, bootinfop, modulep, bi->bi_kernend); + __exec((void *)x86_64_tramp, boothowto, bootdev, 0, 0, 0, bootinfop, modulep, bi->bi_kernend); panic("exec returned"); } From owner-p4-projects@FreeBSD.ORG Sun Apr 6 12:03:22 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id DF2DA37B404; Sun, 6 Apr 2003 12:03:21 -0700 (PDT) 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 7BB0B37B401 for ; Sun, 6 Apr 2003 12:03:21 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 90B1343F75 for ; Sun, 6 Apr 2003 12:03:20 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h36J3K0U061411 for ; Sun, 6 Apr 2003 12:03:20 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h36J3Kla061408 for perforce@freebsd.org; Sun, 6 Apr 2003 12:03:20 -0700 (PDT) Date: Sun, 6 Apr 2003 12:03:20 -0700 (PDT) Message-Id: <200304061903.h36J3Kla061408@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28347 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, 06 Apr 2003 19:03:23 -0000 http://perforce.freebsd.org/chv.cgi?CH=28347 Change 28347 by peter@peter_overcee on 2003/04/06 12:02:44 IFC @28346 Affected files ... .. //depot/projects/hammer/share/termcap/termcap.src#5 integrate .. //depot/projects/hammer/sys/boot/common/bootstrap.h#4 integrate .. //depot/projects/hammer/sys/dev/usb/usbdevs#5 integrate .. //depot/projects/hammer/sys/dev/usb/usbdevs.h#5 integrate .. //depot/projects/hammer/sys/dev/usb/usbdevs_data.h#5 integrate .. //depot/projects/hammer/sys/dev/usb/uvisor.c#4 integrate .. //depot/projects/hammer/sys/i386/i386/mp_clock.c#3 integrate .. //depot/projects/hammer/sys/ia64/ia64/exception.s#6 integrate .. //depot/projects/hammer/sys/sparc64/include/cpufunc.h#3 integrate .. //depot/projects/hammer/sys/sparc64/include/md_var.h#3 integrate .. //depot/projects/hammer/sys/sparc64/include/pmap.h#8 integrate .. //depot/projects/hammer/sys/sparc64/sparc64/machdep.c#10 integrate .. //depot/projects/hammer/sys/sparc64/sparc64/pmap.c#10 integrate .. //depot/projects/hammer/tools/regression/lib/libc/stdio/test-printfloat.c#2 integrate .. //depot/projects/hammer/usr.bin/tip/libacu/courier.c#2 integrate .. //depot/projects/hammer/usr.bin/tip/libacu/df.c#2 integrate .. //depot/projects/hammer/usr.bin/tip/libacu/hayes.c#2 integrate .. //depot/projects/hammer/usr.bin/tip/libacu/t3000.c#2 integrate .. //depot/projects/hammer/usr.bin/tip/tip/cmds.c#2 integrate .. //depot/projects/hammer/usr.bin/tip/tip/cmdtab.c#2 integrate .. //depot/projects/hammer/usr.bin/tip/tip/tip.c#2 integrate .. //depot/projects/hammer/usr.bin/tip/tip/tip.h#2 integrate .. //depot/projects/hammer/usr.bin/tip/tip/value.c#2 integrate Differences ... ==== //depot/projects/hammer/share/termcap/termcap.src#5 (text+ko) ==== @@ -30,7 +30,7 @@ # SUCH DAMAGE. # # @(#)termcap.src 8.2 (Berkeley) 11/17/93 -# $FreeBSD: src/share/termcap/termcap.src,v 1.134 2003/01/09 19:52:01 trhodes Exp $ +# $FreeBSD: src/share/termcap/termcap.src,v 1.135 2003/04/06 11:47:24 hosokawa Exp $ # Termcap source file # John Kunze, Berkeley @@ -4461,15 +4461,15 @@ :xn@:op=\E[39;49m:Km=\E[M:tc=linux: # Multilingual Sysinstall (kon2 console) # HOSOKAWA, Tatsumi (hosokawa@FreeBSD.org) -kons25jx|kon3jx|jkons3jx|kons24-jis1983-j:\ +kons25x|kons25-euc:\ :ac=q\207x\214m\205v\212j\202t\210n\206u\211l\204w\213k\203y\053z\053f\336~\245a\043h\043`^D.v-\136I^U0\215:\ :ve=\E[25h:vi=\E[25l:\ :k1=\E[M:k2=\E[N:k3=\E[O:k4=\E[P:k5=\E[Q:k6=\E[R:k7=\E[S:k8=\E[T:\ :k9=\E[U:k;=\E[V:F1=\E[W:F2=\E[X:K2=\E[E:\ :kN=\E[G:kP=\E[I:\ :tc=linux: -kons25jx-m|kon3jx-m|jkons3jx-mono|kons24-jis1983-j-mono:\ - :pa@:Co@:Sf@:Sb@:op@:us=\E[4m:ue=\E[m:md@:mh@:tc=kons25jx: +kons25x-m|kons25-euc-mono:\ + :pa@:Co@:Sf@:Sb@:op@:us=\E[4m:ue=\E[m:md@:mh@:tc=kons25x: # Termcap for Top Gun Telnet and SSH on the Palm Pilot. # http://www.ai/~iang/TGssh/ ==== //depot/projects/hammer/sys/boot/common/bootstrap.h#4 (text+ko) ==== @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/boot/common/bootstrap.h,v 1.36 2002/03/10 22:33:04 sobomax Exp $ + * $FreeBSD: src/sys/boot/common/bootstrap.h,v 1.37 2003/04/06 06:28:08 peter Exp $ */ #include ==== //depot/projects/hammer/sys/dev/usb/usbdevs#5 (text+ko) ==== @@ -1,4 +1,4 @@ -$FreeBSD: src/sys/dev/usb/usbdevs,v 1.115 2003/03/11 01:41:33 njl Exp $ +$FreeBSD: src/sys/dev/usb/usbdevs,v 1.116 2003/04/06 17:32:12 scottl Exp $ /* * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc. @@ -468,6 +468,7 @@ product BELKIN2 F5U002 0x0002 F5U002 Parallel printer adapter product BELKIN USB2LAN 0x0121 USB to LAN Converter product BELKIN F5U103 0x0103 F5U103 Serial adapter +product BELKIN F5U109 0x0109 F5U109 Serial adapter product BELKIN F5U120 0x1203 F5U120-PC Hub /* Billionton products */ @@ -1044,6 +1045,7 @@ product SONY MSC 0x0032 MSC memory stick slot product SONY CLIE_40 0x0066 Sony Clie v4.0 product SONY CLIE_41 0x009a Sony Clie v4.1 +product SONY CLIE_50 0x00da Sony Clie v5.0 /* STMicroelectronics products */ product STMICRO COMMUNICATOR 0x7554 USB Communicator ==== //depot/projects/hammer/sys/dev/usb/usbdevs.h#5 (text+ko) ==== @@ -1,10 +1,10 @@ -/* $FreeBSD: src/sys/dev/usb/usbdevs.h,v 1.124 2003/03/11 01:41:33 njl Exp $ */ +/* $FreeBSD: src/sys/dev/usb/usbdevs.h,v 1.125 2003/04/06 17:32:39 scottl Exp $ */ /* * THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. * * generated from: - * FreeBSD: src/sys/dev/usb/usbdevs,v 1.114 2003/02/13 12:55:17 sanpei Exp + * FreeBSD: src/sys/dev/usb/usbdevs,v 1.116 2003/04/06 17:32:12 scottl Exp */ /* @@ -475,6 +475,7 @@ #define USB_PRODUCT_BELKIN2_F5U002 0x0002 /* F5U002 Parallel printer adapter */ #define USB_PRODUCT_BELKIN_USB2LAN 0x0121 /* USB to LAN Converter */ #define USB_PRODUCT_BELKIN_F5U103 0x0103 /* F5U103 Serial adapter */ +#define USB_PRODUCT_BELKIN_F5U109 0x0109 /* F5U109 Serial adapter */ #define USB_PRODUCT_BELKIN_F5U120 0x1203 /* F5U120-PC Hub */ /* Billionton products */ @@ -1051,6 +1052,7 @@ #define USB_PRODUCT_SONY_MSC 0x0032 /* MSC memory stick slot */ #define USB_PRODUCT_SONY_CLIE_40 0x0066 /* Sony Clie v4.0 */ #define USB_PRODUCT_SONY_CLIE_41 0x009a /* Sony Clie v4.1 */ +#define USB_PRODUCT_SONY_CLIE_50 0x00da /* Sony Clie v5.0 */ /* STMicroelectronics products */ #define USB_PRODUCT_STMICRO_COMMUNICATOR 0x7554 /* USB Communicator */ ==== //depot/projects/hammer/sys/dev/usb/usbdevs_data.h#5 (text+ko) ==== @@ -1,10 +1,10 @@ -/* $FreeBSD: src/sys/dev/usb/usbdevs_data.h,v 1.124 2003/03/11 01:41:33 njl Exp $ */ +/* $FreeBSD: src/sys/dev/usb/usbdevs_data.h,v 1.125 2003/04/06 17:34:08 scottl Exp $ */ /* * THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. * * generated from: - * FreeBSD: src/sys/dev/usb/usbdevs,v 1.114 2003/02/13 12:55:17 sanpei Exp + * FreeBSD: src/sys/dev/usb/usbdevs,v 1.116 2003/04/06 17:32:12 scottl Exp */ /* @@ -448,6 +448,12 @@ "F5U103 Serial adapter", }, { + USB_VENDOR_BELKIN, USB_PRODUCT_BELKIN_F5U109, + 0, + "Belkin Components", + "F5U109 Serial adapter", + }, + { USB_VENDOR_BELKIN, USB_PRODUCT_BELKIN_F5U120, 0, "Belkin Components", @@ -2506,6 +2512,12 @@ "Sony Clie v4.1", }, { + USB_VENDOR_SONY, USB_PRODUCT_SONY_CLIE_50, + 0, + "Sony", + "Sony Clie v5.0", + }, + { USB_VENDOR_STMICRO, USB_PRODUCT_STMICRO_COMMUNICATOR, 0, "STMicroelectronics", ==== //depot/projects/hammer/sys/dev/usb/uvisor.c#4 (text+ko) ==== @@ -1,5 +1,5 @@ /* $NetBSD: uvisor.c,v 1.9 2001/01/23 14:04:14 augustss Exp $ */ -/* $FreeBSD: src/sys/dev/usb/uvisor.c,v 1.11 2003/03/09 11:14:34 akiyama Exp $ */ +/* $FreeBSD: src/sys/dev/usb/uvisor.c,v 1.12 2003/04/06 17:34:50 scottl Exp $ */ /* This version of uvisor is heavily based upon the version in NetBSD * but is missing the following patches: @@ -202,6 +202,7 @@ {{ USB_VENDOR_PALM, USB_PRODUCT_PALM_M125 }, PALM4 }, {{ USB_VENDOR_SONY, USB_PRODUCT_SONY_CLIE_40 }, PALM4 }, {{ USB_VENDOR_SONY, USB_PRODUCT_SONY_CLIE_41 }, 0 }, + {{ USB_VENDOR_SONY, USB_PRODUCT_SONY_CLIE_50 }, 0 }, /* {{ USB_VENDOR_SONY, USB_PRODUCT_SONY_CLIE_25 }, PALM4 },*/ }; #define uvisor_lookup(v, p) ((const struct uvisor_type *)usb_lookup(uvisor_devs, v, p)) ==== //depot/projects/hammer/sys/i386/i386/mp_clock.c#3 (text+ko) ==== @@ -29,7 +29,7 @@ * not protected against the fact that the bits can be wrong in two * directions. If we only cared about monosity two reads would be enough. * - * $FreeBSD: src/sys/i386/i386/mp_clock.c,v 1.11 2002/11/13 17:50:59 mux Exp $ + * $FreeBSD: src/sys/i386/i386/mp_clock.c,v 1.12 2003/04/06 18:42:22 des Exp $ * */ @@ -101,12 +101,11 @@ switch (pci_get_devid(dev)) { case 0x71138086: d = pci_read_config(dev, 0x4, 2); - if (!(d & 1)) - return 0; /* IO space not mapped */ - d = pci_read_config(dev, 0x40, 4); - piix_timecounter_address = (d & 0xffc0) + 8; - piix_timecounter.tc_frequency = piix_freq; - tc_init(&piix_timecounter); + if (d & 1) + return (0); + printf("PIIX I/O space not mapped\n"); + return (ENXIO); + default: return (ENXIO); }; return (ENXIO); @@ -115,8 +114,13 @@ static int piix_attach (device_t dev) { - - return 0; + u_int32_t d; + + d = pci_read_config(dev, 0x40, 4); + piix_timecounter_address = (d & 0xffc0) + 8; + piix_timecounter.tc_frequency = piix_freq; + tc_init(&piix_timecounter); + return (0); } static device_method_t piix_methods[] = { ==== //depot/projects/hammer/sys/ia64/ia64/exception.s#6 (text+ko) ==== @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/ia64/ia64/exception.s,v 1.39 2003/02/17 10:21:32 julian Exp $ + * $FreeBSD: src/sys/ia64/ia64/exception.s,v 1.40 2003/04/06 05:55:36 marcel Exp $ */ #include @@ -336,9 +336,9 @@ (p1) br.cond.sptk.few 2f // if not, read next in chain ;; ld8 r21=[r20] // read pte - mov r22=PTE_D + mov r22=PTE_D|PTE_A ;; - or r21=r22,r21 // set dirty bit + or r21=r22,r21 // set dirty & access bit ;; st8 [r20]=r21 // store back ;; ==== //depot/projects/hammer/sys/sparc64/include/cpufunc.h#3 (text+ko) ==== @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/sparc64/include/cpufunc.h,v 1.15 2003/04/03 18:43:40 jake Exp $ + * $FreeBSD: src/sys/sparc64/include/cpufunc.h,v 1.16 2003/04/06 17:05:26 jake Exp $ */ #ifndef _MACHINE_CPUFUNC_H_ @@ -196,9 +196,6 @@ void ascopyto(caddr_t src, u_long dasi, vm_offset_t dst, size_t len); void aszero(u_long asi, vm_offset_t dst, size_t len); -void spitfire_block_copy(void *src, void *dst, size_t len); -void spitfire_block_zero(void *dst, size_t len); - /* * Ultrasparc II doesn't implement popc in hardware. Suck. */ ==== //depot/projects/hammer/sys/sparc64/include/md_var.h#3 (text+ko) ==== @@ -27,12 +27,15 @@ * SUCH DAMAGE. * * from: FreeBSD: src/sys/i386/include/md_var.h,v 1.40 2001/07/12 - * $FreeBSD: src/sys/sparc64/include/md_var.h,v 1.12 2002/08/30 04:04:37 peter Exp $ + * $FreeBSD: src/sys/sparc64/include/md_var.h,v 1.13 2003/04/06 17:05:26 jake Exp $ */ #ifndef _MACHINE_MD_VAR_H_ #define _MACHINE_MD_VAR_H_ +typedef void cpu_block_copy_t(const void *src, void *dst, size_t len); +typedef void cpu_block_zero_t(void *dst, size_t len); + extern char tl0_base[]; extern char _end[]; @@ -41,10 +44,6 @@ extern vm_offset_t kstack0; extern vm_offset_t kstack0_phys; -struct dbreg; -struct fpreg; -struct thread; -struct reg; struct pcpu; void cpu_halt(void); @@ -54,4 +53,10 @@ int is_physical_memory(vm_offset_t addr); void swi_vm(void *v); +cpu_block_copy_t spitfire_block_copy; +cpu_block_zero_t spitfire_block_zero; + +extern cpu_block_copy_t *cpu_block_copy; +extern cpu_block_zero_t *cpu_block_zero; + #endif /* !_MACHINE_MD_VAR_H_ */ ==== //depot/projects/hammer/sys/sparc64/include/pmap.h#8 (text+ko) ==== @@ -37,7 +37,7 @@ * from: hp300: @(#)pmap.h 7.2 (Berkeley) 12/16/90 * from: @(#)pmap.h 7.4 (Berkeley) 5/12/91 * from: FreeBSD: src/sys/i386/include/pmap.h,v 1.70 2000/11/30 - * $FreeBSD: src/sys/sparc64/include/pmap.h,v 1.33 2003/03/19 06:55:37 jake Exp $ + * $FreeBSD: src/sys/sparc64/include/pmap.h,v 1.34 2003/04/06 18:17:31 jake Exp $ */ #ifndef _MACHINE_PMAP_H_ @@ -117,7 +117,7 @@ #define PMAP_STATS_VAR(name) \ static long name; \ - SYSCTL_LONG(_debug_pmap_stats, OID_AUTO, name, CTLFLAG_RD, \ + SYSCTL_LONG(_debug_pmap_stats, OID_AUTO, name, CTLFLAG_RW, \ &name, 0, "") #define PMAP_STATS_INC(var) \ ==== //depot/projects/hammer/sys/sparc64/sparc64/machdep.c#10 (text+ko) ==== @@ -37,7 +37,7 @@ * * from: @(#)machdep.c 7.4 (Berkeley) 6/3/91 * from: FreeBSD: src/sys/i386/i386/machdep.c,v 1.477 2001/08/27 - * $FreeBSD: src/sys/sparc64/sparc64/machdep.c,v 1.85 2003/04/03 18:28:03 jake Exp $ + * $FreeBSD: src/sys/sparc64/sparc64/machdep.c,v 1.86 2003/04/06 17:05:26 jake Exp $ */ #include "opt_compat.h" @@ -132,6 +132,11 @@ char sparc64_model[32]; +static int cpu_use_vis = 1; + +cpu_block_copy_t *cpu_block_copy; +cpu_block_zero_t *cpu_block_zero; + static timecounter_get_t tick_get_timecount; void sparc64_init(caddr_t mdp, u_long o1, u_long o2, u_long o3, ofw_vec_t *vec); @@ -280,6 +285,15 @@ cache_init(child); + getenv_int("machdep.use_vis", &cpu_use_vis); + if (cpu_use_vis) { + cpu_block_copy = spitfire_block_copy; + cpu_block_zero = spitfire_block_zero; + } else { + cpu_block_copy = bcopy; + cpu_block_zero = bzero; + } + #ifdef DDB kdb_init(); #endif ==== //depot/projects/hammer/sys/sparc64/sparc64/pmap.c#10 (text+ko) ==== @@ -39,7 +39,7 @@ * SUCH DAMAGE. * * from: @(#)pmap.c 7.7 (Berkeley) 5/12/91 - * $FreeBSD: src/sys/sparc64/sparc64/pmap.c,v 1.104 2003/03/31 19:56:55 jake Exp $ + * $FreeBSD: src/sys/sparc64/sparc64/pmap.c,v 1.107 2003/04/06 18:18:17 jake Exp $ */ /* @@ -200,7 +200,6 @@ PMAP_STATS_VAR(pmap_ncache_remove_cc); PMAP_STATS_VAR(pmap_ncache_remove_coc); PMAP_STATS_VAR(pmap_ncache_remove_nc); -PMAP_STATS_VAR(pmap_niflush); PMAP_STATS_VAR(pmap_nzero_page); PMAP_STATS_VAR(pmap_nzero_page_c); PMAP_STATS_VAR(pmap_nzero_page_oc); @@ -892,6 +891,8 @@ tp = tsb_kvtotte(va); CTR3(KTR_PMAP, "pmap_kremove: va=%#lx tp=%p data=%#lx", va, tp, tp->tte_data); + if ((tp->tte_data & TD_V) == 0) + return; m = PHYS_TO_VM_PAGE(TTE_GET_PA(tp)); TAILQ_REMOVE(&m->md.tte_list, tp, tte_link); pmap_cache_remove(m, va); @@ -1497,7 +1498,6 @@ */ if ((prot & VM_PROT_EXECUTE) != 0) { if ((data & TD_EXEC) == 0) { - PMAP_STATS_INC(pmap_niflush); icache_page_inval(pa); } tp->tte_data |= TD_EXEC; @@ -1534,7 +1534,6 @@ data |= TD_SW; if (prot & VM_PROT_EXECUTE) { data |= TD_EXEC; - PMAP_STATS_INC(pmap_niflush); icache_page_inval(pa); } @@ -1643,14 +1642,14 @@ } else if (m->md.color == DCACHE_COLOR(pa)) { PMAP_STATS_INC(pmap_nzero_page_c); va = TLB_PHYS_TO_DIRECT(pa); - bzero((void *)va, PAGE_SIZE); + cpu_block_zero((void *)va, PAGE_SIZE); } else { PMAP_STATS_INC(pmap_nzero_page_oc); va = pmap_temp_map_1 + (m->md.color * PAGE_SIZE); tp = tsb_kvtotte(va); tp->tte_data = TD_V | TD_8K | TD_PA(pa) | TD_CP | TD_CV | TD_W; tp->tte_vpn = TV_VPN(va, TS_8K); - bzero((void *)va, PAGE_SIZE); + cpu_block_zero((void *)va, PAGE_SIZE); tlb_page_demap(kernel_pmap, va); } } @@ -1702,14 +1701,14 @@ } else if (m->md.color == DCACHE_COLOR(pa)) { PMAP_STATS_INC(pmap_nzero_page_idle_c); va = TLB_PHYS_TO_DIRECT(pa); - bzero((void *)va, PAGE_SIZE); + cpu_block_zero((void *)va, PAGE_SIZE); } else { PMAP_STATS_INC(pmap_nzero_page_idle_oc); va = pmap_idle_map + (m->md.color * PAGE_SIZE); tp = tsb_kvtotte(va); tp->tte_data = TD_V | TD_8K | TD_PA(pa) | TD_CP | TD_CV | TD_W; tp->tte_vpn = TV_VPN(va, TS_8K); - bzero((void *)va, PAGE_SIZE); + cpu_block_zero((void *)va, PAGE_SIZE); tlb_page_demap(kernel_pmap, va); } } @@ -1738,7 +1737,7 @@ PMAP_STATS_INC(pmap_ncopy_page_c); vdst = TLB_PHYS_TO_DIRECT(pdst); vsrc = TLB_PHYS_TO_DIRECT(psrc); - bcopy((void *)vsrc, (void *)vdst, PAGE_SIZE); + cpu_block_copy((void *)vsrc, (void *)vdst, PAGE_SIZE); } else if (msrc->md.color == -1) { if (mdst->md.color == DCACHE_COLOR(pdst)) { PMAP_STATS_INC(pmap_ncopy_page_dc); @@ -1785,7 +1784,7 @@ tp->tte_data = TD_V | TD_8K | TD_PA(psrc) | TD_CP | TD_CV | TD_W; tp->tte_vpn = TV_VPN(vsrc, TS_8K); - bcopy((void *)vsrc, (void *)vdst, PAGE_SIZE); + cpu_block_copy((void *)vsrc, (void *)vdst, PAGE_SIZE); tlb_page_demap(kernel_pmap, vdst); tlb_page_demap(kernel_pmap, vsrc); } ==== //depot/projects/hammer/tools/regression/lib/libc/stdio/test-printfloat.c#2 (text+ko) ==== @@ -29,7 +29,7 @@ */ #include -__FBSDID("$FreeBSD: src/tools/regression/lib/libc/stdio/test-printfloat.c,v 1.1 2003/04/05 22:13:01 das Exp $"); +__FBSDID("$FreeBSD: src/tools/regression/lib/libc/stdio/test-printfloat.c,v 1.2 2003/04/06 08:02:20 tjr Exp $"); #include #include @@ -133,6 +133,9 @@ testfmt("314159", "%g", 3.14159e5); testfmt("314159.", "%#g", 3.14159e5); + testfmt(" 0.0", "%4.1f", 0.0); + testfmt(" 100", "%4.0f", 100.0); + printf("PASS printfloat\n"); return (0); ==== //depot/projects/hammer/usr.bin/tip/libacu/courier.c#2 (text+ko) ==== @@ -35,7 +35,7 @@ */ #include -__FBSDID("$FreeBSD: src/usr.bin/tip/libacu/courier.c,v 1.5 2002/03/22 01:42:34 imp Exp $"); +__FBSDID("$FreeBSD: src/usr.bin/tip/libacu/courier.c,v 1.6 2003/04/06 08:30:25 imp Exp $"); #ifndef lint #if 0 @@ -60,6 +60,7 @@ static jmp_buf timeoutbuf, intbuf; static int coursync(), cour_connect(), cour_swallow(); void cour_nap(); +static void cour_write(int fd, char *cp, int n); void cour_disconnect(void); ==== //depot/projects/hammer/usr.bin/tip/libacu/df.c#2 (text+ko) ==== @@ -35,7 +35,7 @@ */ #include -__FBSDID("$FreeBSD: src/usr.bin/tip/libacu/df.c,v 1.2 2001/12/20 14:25:46 markm Exp $"); +__FBSDID("$FreeBSD: src/usr.bin/tip/libacu/df.c,v 1.3 2003/04/06 08:30:25 imp Exp $"); #ifndef lint #if 0 @@ -52,6 +52,7 @@ static jmp_buf Sjbuf; static void timeout(); +static void df_disconnect(void); int df02_dialer(num, acu) @@ -123,8 +124,8 @@ return (c == 'A'); } -void -df_disconnect() +static void +df_disconnect(void) { write(FD, "\001", 1); sleep(1); ==== //depot/projects/hammer/usr.bin/tip/libacu/hayes.c#2 (text+ko) ==== @@ -35,7 +35,7 @@ */ #include -__FBSDID("$FreeBSD: src/usr.bin/tip/libacu/hayes.c,v 1.3 2001/12/20 14:25:46 markm Exp $"); +__FBSDID("$FreeBSD: src/usr.bin/tip/libacu/hayes.c,v 1.4 2003/04/06 08:30:25 imp Exp $"); #ifndef lint #if 0 @@ -74,6 +74,8 @@ #define min(a,b) ((a < b) ? a : b) +static void error_rep(char c); +static void goodbye(void); static void sigALRM(); static int timeout = 0; static jmp_buf timeoutbuf; @@ -252,8 +254,8 @@ /* * set modem back to normal verbose status codes. */ -void -goodbye() +static void +goodbye(void) { int len; char c; ==== //depot/projects/hammer/usr.bin/tip/libacu/t3000.c#2 (text+ko) ==== @@ -35,7 +35,7 @@ */ #include -__FBSDID("$FreeBSD: src/usr.bin/tip/libacu/t3000.c,v 1.4 2001/12/20 14:25:46 markm Exp $"); +__FBSDID("$FreeBSD: src/usr.bin/tip/libacu/t3000.c,v 1.5 2003/04/06 08:30:25 imp Exp $"); #ifndef lint #if 0 @@ -61,6 +61,7 @@ static jmp_buf timeoutbuf, intbuf; static int t3000_sync(), t3000_connect(), t3000_swallow(); static void t3000_nap(); +static int t3000_write(int fd, char *cp, int n); int t3000_dialer(num, acu) ==== //depot/projects/hammer/usr.bin/tip/tip/cmds.c#2 (text+ko) ==== @@ -35,7 +35,7 @@ */ #include -__FBSDID("$FreeBSD: src/usr.bin/tip/tip/cmds.c,v 1.15 2001/12/20 14:25:46 markm Exp $"); +__FBSDID("$FreeBSD: src/usr.bin/tip/tip/cmds.c,v 1.16 2003/04/06 08:30:25 imp Exp $"); #ifndef lint #if 0 @@ -95,6 +95,7 @@ return; } transfer(buf, sfd, value(EOFREAD)); + return; } /* @@ -202,7 +203,7 @@ * send remote input to local process via pipe */ void -pipefile() +pipefile(char c) { int cpid, pdes[2]; char buf[256]; @@ -473,7 +474,7 @@ * Identical to consh() except for where stdout goes. */ void -pipeout(c) +pipeout(char c) { char buf[256]; int cpid, status, p; @@ -525,7 +526,7 @@ * 2 <-> local tty out */ void -consh(c) +consh(char c) { char buf[256]; int cpid, status, p; @@ -575,7 +576,7 @@ * Escape to local shell */ void -shell() +shell(char c) { int shpid, status; char *cp; @@ -633,7 +634,7 @@ * local portion of tip */ void -chdirectory() +chdirectory(char c) { char dirname[PATH_MAX]; char *cp = dirname; @@ -665,7 +666,7 @@ } void -finish() +finish(char c) { char *dismsg; @@ -745,7 +746,7 @@ } void -variable() +variable(char c) { char buf[256]; @@ -789,7 +790,7 @@ } void -listvariables() +listvariables(char c) { value_t *p; char *buf; @@ -853,7 +854,7 @@ * Send a break. */ void -genbrk() +genbrk(char c) { ioctl(FD, TIOCSBRK, NULL); ==== //depot/projects/hammer/usr.bin/tip/tip/cmdtab.c#2 (text+ko) ==== @@ -35,7 +35,7 @@ */ #include -__FBSDID("$FreeBSD: src/usr.bin/tip/tip/cmdtab.c,v 1.4 2001/12/20 14:25:46 markm Exp $"); +__FBSDID("$FreeBSD: src/usr.bin/tip/tip/cmdtab.c,v 1.5 2003/04/06 08:30:25 imp Exp $"); #ifndef lint #if 0 @@ -46,10 +46,6 @@ #include "tip.h" -extern int shell(), getfl(), sendfile(), chdirectory(); -extern int finish(), help(), pipefile(), pipeout(), consh(), variable(); -extern int cu_take(), cu_put(), dollar(), genbrk(), suspend(), listvariables(); - esctable_t etable[] = { { '!', NORM, "shell", shell }, { '<', NORM, "receive file from remote host", getfl }, ==== //depot/projects/hammer/usr.bin/tip/tip/tip.c#2 (text+ko) ==== @@ -35,7 +35,7 @@ */ #include -__FBSDID("$FreeBSD: src/usr.bin/tip/tip/tip.c,v 1.15 2001/12/20 14:25:46 markm Exp $"); +__FBSDID("$FreeBSD: src/usr.bin/tip/tip/tip.c,v 1.16 2003/04/06 08:30:25 imp Exp $"); #ifndef lint static char copyright[] = @@ -81,6 +81,7 @@ char *system = NOSTR; int i; char *p; + const char *p2; char sbuf[12]; gid = getgid(); @@ -198,8 +199,8 @@ */ if (HW) ttysetup(i); - if ((p = connect())) { - printf("\07%s\n[EOT]\n", p); + if ((p2 = connect())) { + printf("\07%s\n[EOT]\n", p2); daemon_uid(); (void)uu_unlock(uucplock); exit(1); ==== //depot/projects/hammer/usr.bin/tip/tip/tip.h#2 (text+ko) ==== @@ -1,6 +1,6 @@ /* $OpenBSD: tip.h,v 1.11 2001/09/09 19:30:49 millert Exp $ */ /* $NetBSD: tip.h,v 1.7 1997/04/20 00:02:46 mellon Exp $ */ -/* $FreeBSD: src/usr.bin/tip/tip/tip.h,v 1.8 2002/03/22 01:42:35 imp Exp $ */ +/* $FreeBSD: src/usr.bin/tip/tip/tip.h,v 1.9 2003/04/06 08:30:25 imp Exp $ */ /* * Copyright (c) 1989, 1993 @@ -173,7 +173,7 @@ char e_char; /* char to match on */ char e_flags; /* experimental, priviledged */ const char *e_help; /* help string */ - int (*e_func)(char); /* command */ + void (*e_func)(char); /* command */ } esctable_t; @@ -330,3 +330,8 @@ int v831_dialer(char *, char *); void v831_disconnect(void); void v831_abort(void); + +void shell(char c), getfl(char c), sendfile(char c), chdirectory(char c); +void finish(char c), help(char c), pipefile(char c), pipeout(char c); +void consh(char c), variable(char c), cu_take(char c), cu_put(char c); +void dollar(char c), genbrk(char c), suspend(char c), listvariables(char c); ==== //depot/projects/hammer/usr.bin/tip/tip/value.c#2 (text+ko) ==== @@ -35,7 +35,7 @@ */ #include -__FBSDID("$FreeBSD: src/usr.bin/tip/tip/value.c,v 1.7 2001/12/20 14:25:46 markm Exp $"); +__FBSDID("$FreeBSD: src/usr.bin/tip/tip/value.c,v 1.8 2003/04/06 08:30:25 imp Exp $"); #ifndef lint #if 0 @@ -218,7 +218,7 @@ value_t *p; { char *cp; - extern char *interp(), *ctrl(); + extern char *interp(); if (col > 0 && col < MIDDLE) while (col++ < MIDDLE) From owner-p4-projects@FreeBSD.ORG Sun Apr 6 12:10:31 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id BF2DF37B404; Sun, 6 Apr 2003 12:10:30 -0700 (PDT) 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 715E137B401 for ; Sun, 6 Apr 2003 12:10:30 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 058C843FAF for ; Sun, 6 Apr 2003 12:10:30 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h36JAT0U061765 for ; Sun, 6 Apr 2003 12:10:29 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h36JATtG061759 for perforce@freebsd.org; Sun, 6 Apr 2003 12:10:29 -0700 (PDT) Date: Sun, 6 Apr 2003 12:10:29 -0700 (PDT) Message-Id: <200304061910.h36JATtG061759@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28348 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, 06 Apr 2003 19:10:32 -0000 http://perforce.freebsd.org/chv.cgi?CH=28348 Change 28348 by peter@peter_overcee on 2003/04/06 12:09:50 kill R() with extreme prejudice. Now we'll start up at the correct virtual address. Affected files ... .. //depot/projects/hammer/sys/x86_64/x86_64/locore.s#26 edit Differences ... ==== //depot/projects/hammer/sys/x86_64/x86_64/locore.s#26 (text+ko) ==== @@ -71,13 +71,11 @@ * */ -#define R(foo) ((foo)-KERNBASE) - #define ALLOCPAGES(foo) \ - movl R(physfree), %esi ; \ + movl physfree, %esi ; \ movl $((foo)*PAGE_SIZE), %eax ; \ addl %esi, %eax ; \ - movl %eax, R(physfree) ; \ + movl %eax, physfree ; \ movl %esi, %edi ; \ movl $((foo)*PAGE_SIZE),%ecx ; \ xorl %eax,%eax ; \ @@ -112,7 +110,7 @@ #define fillkptphys(prot) \ movl %eax, %ebx ; \ shrl $PAGE_SHIFT, %ebx ; \ - fillkpt(R(KPTphys), prot) + fillkpt(KPTphys, prot) #define PING(a) \ movb $(a),%al; \ @@ -131,7 +129,7 @@ movw $0x1234,0x472 /* Get onto a stack that we can trust and set up a real frame. */ -# movl $R(HIDENAME(tmpstk)),%esp +# movl $HIDENAME(tmpstk),%esp pushl %ebp movl %esp, %ebp @@ -174,7 +172,7 @@ PING('e'); /* Point to the PML4 */ - movl R(IdlePML4), %eax + movl IdlePML4, %eax movl %eax,%cr3 /* load ptd addr into mmu */ PING('r'); @@ -251,9 +249,9 @@ */ movl 32(%ebp),%eax /* modulep */ - movl %eax,R(modulep) + movl %eax,modulep movl 36(%ebp),%eax /* kernend */ - movl %eax,R(KERNend) + movl %eax,KERNend ret @@ -267,17 +265,17 @@ xorl %eax,%eax cpuid # cpuid 0 - movl %eax,R(cpu_high) # highest capability - movl %ebx,R(cpu_vendor) # store vendor string - movl %edx,R(cpu_vendor+4) - movl %ecx,R(cpu_vendor+8) - movb $0,R(cpu_vendor+12) + movl %eax,cpu_high # highest capability + movl %ebx,cpu_vendor # store vendor string + movl %edx,cpu_vendor+4 + movl %ecx,cpu_vendor+8 + movb $0,cpu_vendor+12 movl $1,%eax cpuid # cpuid 1 - movl %eax,R(cpu_id) # store cpu_id - movl %ebx,R(cpu_procinfo) # store cpu_procinfo - movl %edx,R(cpu_feature) # store cpu_feature + movl %eax,cpu_id # store cpu_id + movl %ebx,cpu_procinfo # store cpu_procinfo + movl %edx,cpu_feature # store cpu_feature ret @@ -290,70 +288,70 @@ create_pagetables: /* We are told where the end of the kernel space is. */ - movl R(KERNend),%esi /* get end of kernel */ - movl %esi,R(physfree) /* next free page is at end of kernel */ + movl KERNend, %esi /* get end of kernel */ + movl %esi, physfree /* next free page is at end of kernel */ /* Allocate Kernel Page Tables */ ALLOCPAGES(NKPT) - movl %esi,R(KPTphys) + movl %esi, KPTphys /* Allocate Page Table Directory */ ALLOCPAGES(1) - movl %esi,R(IdlePML4) + movl %esi, IdlePML4 ALLOCPAGES(1) - movl %esi,R(IdlePDP) + movl %esi, IdlePDP ALLOCPAGES(NPGPTD) - movl %esi,R(IdlePTD) + movl %esi, IdlePTD /* Allocate UPAGES */ ALLOCPAGES(UAREA_PAGES) - movl %esi,R(p0upa) + movl %esi, p0upa addl $KERNBASE, %esi - movl %esi, R(proc0uarea) + movl %esi, proc0uarea ALLOCPAGES(KSTACK_PAGES) - movl %esi,R(p0kpa) + movl %esi, p0kpa addl $KERNBASE, %esi - movl %esi, R(proc0kstack) + movl %esi, proc0kstack /* Map read-only from zero to the end of the kernel text section */ xorl %eax, %eax xorl %edx,%edx - movl $R(etext),%ecx + movl $etext,%ecx addl $PAGE_MASK,%ecx shrl $PAGE_SHIFT,%ecx fillkptphys(%edx) /* Map read-write, data, bss and symbols */ - movl $R(etext),%eax + movl $etext, %eax addl $PAGE_MASK, %eax andl $~PAGE_MASK, %eax movl $PG_RW,%edx - movl R(KERNend),%ecx + movl KERNend, %ecx subl %eax,%ecx shrl $PAGE_SHIFT,%ecx fillkptphys(%edx) /* Map page directory. */ - movl R(IdlePML4), %eax + movl IdlePML4, %eax movl $1, %ecx fillkptphys($PG_RW) - movl R(IdlePDP), %eax + movl IdlePDP, %eax movl $1, %ecx fillkptphys($PG_RW) - movl R(IdlePTD), %eax + movl IdlePTD, %eax movl $NPGPTD, %ecx fillkptphys($PG_RW) /* Map proc0's UPAGES in the physical way ... */ - movl R(p0upa), %eax + movl p0upa, %eax movl $(UAREA_PAGES), %ecx fillkptphys($PG_RW) /* Map proc0's KSTACK in the physical way ... */ - movl R(p0kpa), %eax + movl p0kpa, %eax movl $(KSTACK_PAGES), %ecx fillkptphys($PG_RW) @@ -363,32 +361,32 @@ fillkptphys($PG_RW) /* install a pde for temporary double map of bottom of VA */ - movl R(KPTphys), %eax + movl KPTphys, %eax xorl %ebx, %ebx movl $NKPT, %ecx - fillkpt(R(IdlePTD), $PG_RW) + fillkpt(IdlePTD, $PG_RW) /* install pde's for pt's */ - movl R(KPTphys), %eax + movl KPTphys, %eax movl $KPTDI, %ebx movl $NKPT, %ecx - fillkpt(R(IdlePTD), $PG_RW) + fillkpt(IdlePTD, $PG_RW) /* install a pde recursively mapping page directory as a page table */ - movl R(IdlePTD), %eax + movl IdlePTD, %eax movl $PTDPTDI, %ebx movl $NPGPTD,%ecx - fillkpt(R(IdlePTD), $PG_RW) + fillkpt(IdlePTD, $PG_RW) - movl R(IdlePTD), %eax + movl IdlePTD, %eax xorl %ebx, %ebx movl $NPGPTD, %ecx - fillkpt(R(IdlePDP), $0x0) + fillkpt(IdlePDP, $0x0) - movl R(IdlePDP), %eax + movl IdlePDP, %eax xorl %ebx, %ebx movl $1, %ecx - fillkpt(R(IdlePML4), $0x0) + fillkpt(IdlePML4, $0x0) ret @@ -428,7 +426,7 @@ /* Region descriptor for the gdt above */ gdt_rd: .word (gdt_end - gdt) - .word R(gdt) + .word gdt #endif .bss From owner-p4-projects@FreeBSD.ORG Sun Apr 6 12:21:45 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 1ACBF37B404; Sun, 6 Apr 2003 12:21:45 -0700 (PDT) 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 ADB3137B401 for ; Sun, 6 Apr 2003 12:21:44 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4090443FA3 for ; Sun, 6 Apr 2003 12:21:44 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h36JLi0U062707 for ; Sun, 6 Apr 2003 12:21:44 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h36JLhFc062704 for perforce@freebsd.org; Sun, 6 Apr 2003 12:21:43 -0700 (PDT) Date: Sun, 6 Apr 2003 12:21:43 -0700 (PDT) Message-Id: <200304061921.h36JLhFc062704@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28349 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, 06 Apr 2003 19:21:46 -0000 http://perforce.freebsd.org/chv.cgi?CH=28349 Change 28349 by peter@peter_overcee on 2003/04/06 12:20:50 strip out some OBE stuff. partial 64 bit conversion. Affected files ... .. //depot/projects/hammer/sys/x86_64/x86_64/locore.s#27 edit Differences ... ==== //depot/projects/hammer/sys/x86_64/x86_64/locore.s#27 (text+ko) ==== @@ -72,13 +72,13 @@ */ #define ALLOCPAGES(foo) \ - movl physfree, %esi ; \ - movl $((foo)*PAGE_SIZE), %eax ; \ - addl %esi, %eax ; \ - movl %eax, physfree ; \ - movl %esi, %edi ; \ - movl $((foo)*PAGE_SIZE),%ecx ; \ - xorl %eax,%eax ; \ + movq physfree, %rsi ; \ + movq $((foo)*PAGE_SIZE), %rax ; \ + addq %rsi, %rax ; \ + movq %rax, physfree ; \ + movq %rsi, %rdi ; \ + movq $((foo)*PAGE_SIZE), %rcx ; \ + xorq %rax, %rax ; \ cld ; \ rep ; \ stosb @@ -122,28 +122,19 @@ * This is where the bootblocks start us, set the ball rolling... * */ - .code32 NON_GPROF_ENTRY(btext) /* Tell the bios to warmboot next time */ movw $0x1234,0x472 /* Get onto a stack that we can trust and set up a real frame. */ -# movl $HIDENAME(tmpstk),%esp - pushl %ebp - movl %esp, %ebp + movq $HIDENAME(tmpstk),%rsp + pushq %rbp + movq %rsp, %rbp /* Don't trust what the BIOS gives for eflags. */ - pushl $PSL_KERNEL - popfl - -/* - * Don't trust what the BIOS gives for %fs and %gs. Trust the bootstrap - * to set %cs, %ds, %es and %ss. - */ - mov %ds, %ax - mov %ax, %fs - mov %ax, %gs + pushq $PSL_KERNEL + popfq call init_serial @@ -165,58 +156,24 @@ call create_pagetables PING('h'); -/* Enable PAE mode (prerequisite for long mode) */ - movl %cr4, %eax - orl $CR4_PAE, %eax - movl %eax, %cr4 - PING('e'); -/* Point to the PML4 */ - movl IdlePML4, %eax - movl %eax,%cr3 /* load ptd addr into mmu */ - PING('r'); -/* Enable long mode */ - movl $MSR_EFER, %ecx - rdmsr - orl $EFER_LME, %eax - wrmsr -/* - * At this point, we are in 32 bit "compatability" mode, where - * EFER.LMA = 1, CS.L = 0, CS.D = 0, CR0.PE = 1. - */ - PING('e'); -/* Now enable paging */ - movl %cr0,%eax /* get control word */ - orl $CR0_PG, %eax /* enable paging */ - movl %eax,%cr0 /* and let's page NOW! */ - -/* - * Now, we're running with paging turned on, but still running with V==P - * in low memory. We are still using the bootblock gdt/idt. Switch to - * a gdt that we control so that we can flip on the 'L' bit in %cs. - */ PING('0') - pushl $paging /* prepare for jump to virtual address */ - ret - -/* now running relocated at KERNBASE where the system is linked to run */ -/* XXX not yet, we have to set the segment 'long' bit first! */ paging: PING('1') /* set up bootstrap stack */ - movl proc0kstack,%eax /* location of in-kernel stack */ + movq proc0kstack,%rax /* location of in-kernel stack */ /* bootstrap stack end location */ - leal (KSTACK_PAGES*PAGE_SIZE-PCB_SIZE)(%eax),%esp + leaq (KSTACK_PAGES*PAGE_SIZE-PCB_SIZE)(%rax),%rsp - xorl %ebp,%ebp /* mark end of frames */ + xorq %rbp,%rbp /* mark end of frames */ - movl IdlePML4,%esi - movl %esi,(KSTACK_PAGES*PAGE_SIZE-PCB_SIZE+PCB_CR3)(%eax) + movq IdlePML4,%rsi + movq %rsi,(KSTACK_PAGES*PAGE_SIZE-PCB_SIZE+PCB_CR3)(%rax) - pushl physfree /* value of first for init386(first) */ + pushq physfree /* value of first for init386(first) */ call init386 /* wire 386 chip for unix operation */ /* @@ -224,11 +181,11 @@ * that backtraces in ddb don't underrun the stack. Traps for * inaccessible memory are more fatal than usual this early. */ - addl $4,%esp + addq $8,%rsp call mi_startup /* autoconfiguration, mountroot etc */ /* NOTREACHED */ - addl $0,%esp /* for db_numargs() again */ + addq $0,%rsp /* for db_numargs() again */ 0: hlt jmp 0b @@ -248,10 +205,10 @@ * and old boot code can load new kernels. */ - movl 32(%ebp),%eax /* modulep */ - movl %eax,modulep - movl 36(%ebp),%eax /* kernend */ - movl %eax,KERNend + movq 32(%rbp),%rax /* modulep */ + movq %rax,modulep + movq 36(%rbp),%rax /* kernend */ + movq %rax,KERNend ret @@ -390,45 +347,7 @@ ret -/**********************************************************************/ -/* - * We need to switch to a new gdt in order to get from compatability - * mode to full 64 bit mode. These are 'long mode descriptors', not - * the old legacy mode descriptors. The contents are mostly ignored, - * except for the key flags fields. - */ - .data - .p2align 4 -gdt: /* offset = 0x0 */ - .word 0x0 /* null descriptor (required) */ - .word 0x0 - .byte 0x0 - .byte 0x0 - .byte 0x0 - .byte 0x0 - -kernelcode: /* offset = 0x8 */ - .word 0xffff /* segment limit 0..15 */ - .word 0x0000 /* segment base 0..15 */ - .byte 0x0 /* segment base 16..23 */ - .byte 0x9f /* flags; Type; P=1,DPL=0,C=1 */ - .byte 0xaf /* flags; Limit; D=0,L=1 */ - .byte 0x0 /* segment base 24..32 */ - -kerneldata: /* offset = 0x10 */ - .word 0xffff /* segment limit 0..15 */ - .word 0x0000 /* segment base 0..15 */ - .byte 0x0 /* segment base 16..23 */ - .byte 0x93 /* flags; Type; P=1 */ - .byte 0xcf /* flags; Limit; */ - .byte 0x0 /* segment base 24..32 */ -gdt_end: - -/* Region descriptor for the gdt above */ -gdt_rd: .word (gdt_end - gdt) - .word gdt #endif - .bss ALIGN_DATA /* just to be sure */ .globl HIDENAME(tmpstk) @@ -446,7 +365,6 @@ #define COMCONSOLE 0x3f8 #define CONSPEED 9600 - .code32 .text /* * void serial_putc(int ch); @@ -464,7 +382,7 @@ testb $0x20, %al je 1b # TX buffer not empty - movb 4(%esp), %al + movb 8(%rsp), %al subl $5, %edx # TX output reg outb %al, %dx # send this one From owner-p4-projects@FreeBSD.ORG Sun Apr 6 12:29:56 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 8A0CA37B404; Sun, 6 Apr 2003 12:29:55 -0700 (PDT) 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 2ADCF37B401 for ; Sun, 6 Apr 2003 12:29:55 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id B4E3343F93 for ; Sun, 6 Apr 2003 12:29:54 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h36JTs0U063054 for ; Sun, 6 Apr 2003 12:29:54 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h36JTsNU063050 for perforce@freebsd.org; Sun, 6 Apr 2003 12:29:54 -0700 (PDT) Date: Sun, 6 Apr 2003 12:29:54 -0700 (PDT) Message-Id: <200304061929.h36JTsNU063050@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28350 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, 06 Apr 2003 19:29:56 -0000 http://perforce.freebsd.org/chv.cgi?CH=28350 Change 28350 by peter@peter_overcee on 2003/04/06 12:29:34 set this correctly now Affected files ... .. //depot/projects/hammer/sys/conf/ldscript.x86_64#3 edit Differences ... ==== //depot/projects/hammer/sys/conf/ldscript.x86_64#3 (text+ko) ==== @@ -6,7 +6,7 @@ SECTIONS { /* Read-only sections, merged into text segment: */ - . = 0x400000 + SIZEOF_HEADERS; + . = kernbase + 0x00100000 + SIZEOF_HEADERS; .interp : { *(.interp) } .hash : { *(.hash) } .dynsym : { *(.dynsym) } From owner-p4-projects@FreeBSD.ORG Sun Apr 6 12:44:15 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 0C31737B405; Sun, 6 Apr 2003 12:44:15 -0700 (PDT) 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 9F36C37B401 for ; Sun, 6 Apr 2003 12:44:14 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 10E5E43FCB for ; Sun, 6 Apr 2003 12:44:14 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h36JiD0U064314 for ; Sun, 6 Apr 2003 12:44:13 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h36JiDLi064311 for perforce@freebsd.org; Sun, 6 Apr 2003 12:44:13 -0700 (PDT) Date: Sun, 6 Apr 2003 12:44:13 -0700 (PDT) Message-Id: <200304061944.h36JiDLi064311@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28353 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, 06 Apr 2003 19:44:16 -0000 http://perforce.freebsd.org/chv.cgi?CH=28353 Change 28353 by peter@peter_overcee on 2003/04/06 12:43:52 HACK ALERT! Affected files ... .. //depot/projects/hammer/sys/boot/common/load_elf.c#7 edit Differences ... ==== //depot/projects/hammer/sys/boot/common/load_elf.c#7 (text+ko) ==== @@ -41,6 +41,12 @@ #define COPYOUT(s,d,l) archsw.arch_copyout((vm_offset_t)(s), d, l) +#if defined(__i386__) && __ELF_WORD_SIZE == 64 +#undef ELF_TARG_CLASS +#undef ELF_TARG_MACH +#define ELF_TARG_CLASS ELFCLASS64 +#define ELF_TARG_MACH EM_X86_64 +#endif typedef struct elf_file { Elf_Phdr *ph; From owner-p4-projects@FreeBSD.ORG Sun Apr 6 14:00:57 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id DCCBB37B401; Sun, 6 Apr 2003 14:00:56 -0700 (PDT) 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 7833037B404 for ; Sun, 6 Apr 2003 14:00:56 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id C5F8343FD7 for ; Sun, 6 Apr 2003 14:00:51 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h36L0p0U075818 for ; Sun, 6 Apr 2003 14:00:51 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h36L0oBK075812 for perforce@freebsd.org; Sun, 6 Apr 2003 14:00:50 -0700 (PDT) Date: Sun, 6 Apr 2003 14:00:50 -0700 (PDT) Message-Id: <200304062100.h36L0oBK075812@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28356 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, 06 Apr 2003 21:00:57 -0000 http://perforce.freebsd.org/chv.cgi?CH=28356 Change 28356 by peter@peter_overcee on 2003/04/06 13:59:50 argh. I hate this VTOP stuff. fix some other silly bogons. actually set the entry points. Affected files ... .. //depot/projects/hammer/sys/boot/i386/libi386/elf64_freebsd.c#5 edit Differences ... ==== //depot/projects/hammer/sys/boot/i386/libi386/elf64_freebsd.c#5 (text+ko) ==== @@ -65,7 +65,7 @@ { struct file_metadata *md; Elf_Ehdr *ehdr; - vm_offset_t entry, bootinfop, modulep; + vm_offset_t bootinfop, modulep; int boothowto, err, bootdev; struct bootinfo *bi; vm_offset_t ssym, esym; @@ -77,7 +77,6 @@ if ((err = bi_load(fp->f_args, &boothowto, &bootdev, &bootinfop, &modulep)) != 0) return(err); - entry = ehdr->e_entry & 0xffffff; ssym = esym = 0; if ((md = file_findmetadata(fp, MODINFOMD_SSYM)) != NULL) @@ -100,12 +99,12 @@ bzero(PT2, PAGE_SIZE); /* single PML4 entry */ - PT4[0] = (p4_entry_t)(uintptr_t)&PT3[0]; + PT4[0] = (p4_entry_t)VTOP((uintptr_t)&PT3[0]); PT4[0] |= PG_V | PG_RW | PG_U; /* four PDP entries, 1G each */ for (i = 0; i < 4; i++) { - PT3[i] = (p3_entry_t)(uintptr_t)&PT2[i * 512]; + PT3[i] = (p3_entry_t)VTOP((uintptr_t)&PT2[i * 512]); PT3[i] |= PG_V | PG_RW | PG_U; } @@ -115,12 +114,14 @@ PT2[i] |= PG_V | PG_RW | PG_PS | PG_U; } + entry_lo = ehdr->e_entry & 0xffffffff; + entry_hi = (ehdr->e_entry >> 32) & 0xffffffff; printf("entry_hi: %#x \n", entry_hi); printf("entry_lo: %#x \n", entry_lo); - printf("Start @ %#llx ...\n", entry); + printf("Start @ %#llx ...\n", ehdr->e_entry); dev_cleanup(); - __exec((void *)x86_64_tramp, boothowto, bootdev, 0, 0, 0, bootinfop, modulep, bi->bi_kernend); + __exec((void *)VTOP(x86_64_tramp), boothowto, bootdev, 0, 0, 0, bootinfop, modulep, bi->bi_kernend); panic("exec returned"); } From owner-p4-projects@FreeBSD.ORG Sun Apr 6 16:41:15 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 4EB1537B404; Sun, 6 Apr 2003 16:41:15 -0700 (PDT) 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 06A5E37B401 for ; Sun, 6 Apr 2003 16:41:15 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id A06BC43F3F for ; Sun, 6 Apr 2003 16:41:14 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h36NfE0U091034 for ; Sun, 6 Apr 2003 16:41:14 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h36NfEvM091031 for perforce@freebsd.org; Sun, 6 Apr 2003 16:41:14 -0700 (PDT) Date: Sun, 6 Apr 2003 16:41:14 -0700 (PDT) Message-Id: <200304062341.h36NfEvM091031@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28370 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, 06 Apr 2003 23:41:16 -0000 http://perforce.freebsd.org/chv.cgi?CH=28370 Change 28370 by peter@peter_overcee on 2003/04/06 16:41:10 set the direct mappings correctly. 1GB at physical address zero, and 1GB at KERNBASE (hardcoded for now). Remove debug printfs. Affected files ... .. //depot/projects/hammer/sys/boot/i386/libi386/elf64_freebsd.c#6 edit Differences ... ==== //depot/projects/hammer/sys/boot/i386/libi386/elf64_freebsd.c#6 (text+ko) ==== @@ -89,7 +89,6 @@ bi->bi_symtab = ssym; /* XXX this is only the primary kernel symtab */ bi->bi_esymtab = esym; -printf("initializing trampoline, __base=%#x\n", __base); #define PG_V 0x001 #define PG_RW 0x002 #define PG_U 0x004 @@ -102,23 +101,25 @@ PT4[0] = (p4_entry_t)VTOP((uintptr_t)&PT3[0]); PT4[0] |= PG_V | PG_RW | PG_U; - /* four PDP entries, 1G each */ - for (i = 0; i < 4; i++) { - PT3[i] = (p3_entry_t)VTOP((uintptr_t)&PT2[i * 512]); - PT3[i] |= PG_V | PG_RW | PG_U; - } + /* Direct map 1GB at address zero */ + PT3[0] = (p3_entry_t)VTOP((uintptr_t)&PT2[0]); + PT3[0] |= PG_V | PG_RW | PG_U; + + /* Direct map 1GB at KERNBASE (hardcoded for now) */ + PT3[1] = (p3_entry_t)VTOP((uintptr_t)&PT2[0]); + PT3[1] |= PG_V | PG_RW | PG_U; - /* 2048 PG_PS (2MB) page mappings */ - for (i = 0; i < 2048; i++) { + /* 512 PG_PS (2MB) page mappings for 1GB of direct mapping */ + for (i = 0; i < 512; i++) { PT2[i] = i * (2 * 1024 * 1024); PT2[i] |= PG_V | PG_RW | PG_PS | PG_U; } entry_lo = ehdr->e_entry & 0xffffffff; entry_hi = (ehdr->e_entry >> 32) & 0xffffffff; - printf("entry_hi: %#x \n", entry_hi); - printf("entry_lo: %#x \n", entry_lo); +#ifdef DEBUG printf("Start @ %#llx ...\n", ehdr->e_entry); +#endif dev_cleanup(); __exec((void *)VTOP(x86_64_tramp), boothowto, bootdev, 0, 0, 0, bootinfop, modulep, bi->bi_kernend); From owner-p4-projects@FreeBSD.ORG Sun Apr 6 16:43:19 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 8721837B40C; Sun, 6 Apr 2003 16:43:18 -0700 (PDT) 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 242D337B413 for ; Sun, 6 Apr 2003 16:43:18 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id BC40B43FA3 for ; Sun, 6 Apr 2003 16:43:17 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h36NhH0U091123 for ; Sun, 6 Apr 2003 16:43:17 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h36NhHQ2091120 for perforce@freebsd.org; Sun, 6 Apr 2003 16:43:17 -0700 (PDT) Date: Sun, 6 Apr 2003 16:43:17 -0700 (PDT) Message-Id: <200304062343.h36NhHQ2091120@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28371 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, 06 Apr 2003 23:43:20 -0000 http://perforce.freebsd.org/chv.cgi?CH=28371 Change 28371 by peter@peter_overcee on 2003/04/06 16:43:17 Make this actually work. Compensate for BTX having %cs/%ds at 0xa000. Hardcoded for now. This is run after BTX has shut down. Affected files ... .. //depot/projects/hammer/sys/boot/i386/libi386/x86_64_tramp.S#2 edit Differences ... ==== //depot/projects/hammer/sys/boot/i386/libi386/x86_64_tramp.S#2 (text+ko) ==== @@ -1,7 +1,13 @@ #define MSR_EFER 0xc0000080 #define EFER_LME 0x00000100 #define CR4_PAE 0x00000020 +#define CR4_PSE 0x00000010 #define CR0_PG 0x80000000 + +/* GRRR. Deal with BTX that links us for a non-zero location */ +#define VPBASE 0xa000 +#define VTOP(x) ((x) + VPBASE) + .data .p2align 12,0x40 @@ -14,11 +20,11 @@ .space 0x1000 .globl PT2 PT2: - .space 0x4000 + .space 0x1000 gdtdesc: .word gdtend - gdt - .long gdt # low + .long VTOP(gdt) # low .long 0 # high gdt: @@ -30,17 +36,12 @@ .long 0x00008000 gdtend: - -farjmp: - .long longmode - .word 0x8 # segment 1 is %cs - .text .code32 .globl x86_64_tramp x86_64_tramp: - /* Interrupts disabled */ + /* Be sure that interrupts are disabled */ cli /* Turn on EFER.LME */ @@ -51,32 +52,30 @@ /* Turn on PAE */ movl %cr4, %eax - orl $CR4_PAE, %eax + orl $(CR4_PAE | CR4_PSE), %eax movl %eax, %cr4 /* Set %cr3 for PT4 */ - movl $PT4, %eax + movl $VTOP(PT4), %eax movl %eax, %cr3 /* Turn on paging (implicitly sets EFER.LMA) */ movl %cr0, %eax orl $CR0_PG, %eax movl %eax, %cr0 - jmp 1f -1: /* Now we're in compatability mode. set %cs for long mode */ - movl $gdtdesc, %eax - movl $farjmp, %edx - movl entry_hi, %ebx - movl entry_lo, %ecx + movl $VTOP(gdtdesc), %eax + movl VTOP(entry_hi), %esi + movl VTOP(entry_lo), %edi lgdt (%eax) - ljmp *(%edx) + ljmp $0x8, $VTOP(longmode) .code64 longmode: /* We're still running V=P, jump to entry point */ - movl %ebx, %eax + movl %esi, %eax salq $32, %rax - movl %ecx, %eax - jmp *%rax + movl %edi, %eax + pushq %rax + ret From owner-p4-projects@FreeBSD.ORG Sun Apr 6 16:45:22 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 48FDE37B404; Sun, 6 Apr 2003 16:45:22 -0700 (PDT) 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 B8CB737B401 for ; Sun, 6 Apr 2003 16:45:21 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6326543F85 for ; Sun, 6 Apr 2003 16:45:21 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h36NjL0U091280 for ; Sun, 6 Apr 2003 16:45:21 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h36NjK6b091277 for perforce@freebsd.org; Sun, 6 Apr 2003 16:45:20 -0700 (PDT) Date: Sun, 6 Apr 2003 16:45:20 -0700 (PDT) Message-Id: <200304062345.h36NjK6b091277@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28373 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, 06 Apr 2003 23:45:23 -0000 http://perforce.freebsd.org/chv.cgi?CH=28373 Change 28373 by peter@peter_overcee on 2003/04/06 16:45:14 Call serial_putc correctly. doh! We now print something from the kernel, in 64 bit mode, running at the compiled KERNBASE instead of having to compensate for the evil relocation stuff: OK load /boot/kernel64 /boot/kernel64 text=0x138ac0 data=0x367f0+0x15360 syms=[0x4+0x28e00+0x4+0x1ce1]- OK unset acpi_load OK boot Hello, World! Affected files ... .. //depot/projects/hammer/sys/x86_64/x86_64/locore.s#28 edit Differences ... ==== //depot/projects/hammer/sys/x86_64/x86_64/locore.s#28 (text+ko) ==== @@ -113,7 +113,7 @@ fillkpt(KPTphys, prot) #define PING(a) \ - movb $(a),%al; \ + movb $(a),%bl; \ call serial_putc .text @@ -143,6 +143,13 @@ PING('l'); PING('l'); PING('o'); + PING(','); + PING(' '); + PING('W'); + PING('o'); + PING('r'); + PING('l'); + PING('d'); PING('!'); PING('\r'); PING('\n'); @@ -382,8 +389,7 @@ testb $0x20, %al je 1b # TX buffer not empty - movb 8(%rsp), %al - + movb %bl, %al subl $5, %edx # TX output reg outb %al, %dx # send this one From owner-p4-projects@FreeBSD.ORG Sun Apr 6 18:38:42 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id CA97B37B405; Sun, 6 Apr 2003 18:38:41 -0700 (PDT) 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 62DAE37B401 for ; Sun, 6 Apr 2003 18:38:41 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id C5BD843FB1 for ; Sun, 6 Apr 2003 18:38:40 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h371ce0U007168 for ; Sun, 6 Apr 2003 18:38:40 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h371ceOw007165 for perforce@freebsd.org; Sun, 6 Apr 2003 18:38:40 -0700 (PDT) Date: Sun, 6 Apr 2003 18:38:40 -0700 (PDT) Message-Id: <200304070138.h371ceOw007165@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28377 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, 07 Apr 2003 01:38:43 -0000 http://perforce.freebsd.org/chv.cgi?CH=28377 Change 28377 by peter@peter_overcee on 2003/04/06 18:38:03 beep during the !^@#$!^@# countdown so I stop missing it Affected files ... .. //depot/projects/hammer/sys/boot/common/boot.c#2 edit Differences ... ==== //depot/projects/hammer/sys/boot/common/boot.c#2 (text+ko) ==== @@ -190,7 +190,7 @@ when = otime + timeout; /* when to boot */ yes = 0; - printf("%s\n", (prompt == NULL) ? "Hit [Enter] to boot immediately, or any other key for command prompt." : prompt); + printf("%s\n", (prompt == NULL) ? "Hit [Enter] to boot immediately, or any other key for command prompt." : prompt); for (;;) { if (ischar()) { @@ -206,7 +206,7 @@ } if (ntime != otime) { - printf("\rBooting [%s] in %d second%s... ", + printf("\rBooting [%s] in %d second%s... ", kernelname, (int)(when - ntime), (when-ntime)==1?"":"s"); otime = ntime; From owner-p4-projects@FreeBSD.ORG Sun Apr 6 18:39:44 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id F37D537B401; Sun, 6 Apr 2003 18:39:43 -0700 (PDT) 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 93B7637B404 for ; Sun, 6 Apr 2003 18:39:43 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2913D43F93 for ; Sun, 6 Apr 2003 18:39:43 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h371dh0U007255 for ; Sun, 6 Apr 2003 18:39:43 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h371dgGx007248 for perforce@freebsd.org; Sun, 6 Apr 2003 18:39:42 -0700 (PDT) Date: Sun, 6 Apr 2003 18:39:42 -0700 (PDT) Message-Id: <200304070139.h371dgGx007248@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28381 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, 07 Apr 2003 01:39:45 -0000 http://perforce.freebsd.org/chv.cgi?CH=28381 Change 28381 by peter@peter_overcee on 2003/04/06 18:38:44 add a helper function, serial_puts(char *string), for easy calling from asm. Affected files ... .. //depot/projects/hammer/sys/x86_64/x86_64/machdep.c#40 edit Differences ... ==== //depot/projects/hammer/sys/x86_64/x86_64/machdep.c#40 (text+ko) ==== @@ -1656,3 +1656,16 @@ } return 0; } + +extern void serial_putc(int); +void serial_puts(char *); + +void +serial_puts(char *s) +{ + while (*s) { + if (*s == '\n') + serial_putc('\r'); + serial_putc(*s++); + } +} From owner-p4-projects@FreeBSD.ORG Sun Apr 6 18:40:46 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id E58BB37B404; Sun, 6 Apr 2003 18:40:45 -0700 (PDT) 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 9CFFC37B401 for ; Sun, 6 Apr 2003 18:40:45 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 473D843FBF for ; Sun, 6 Apr 2003 18:40:45 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h371ej0U007652 for ; Sun, 6 Apr 2003 18:40:45 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h371eiQu007645 for perforce@freebsd.org; Sun, 6 Apr 2003 18:40:44 -0700 (PDT) Date: Sun, 6 Apr 2003 18:40:44 -0700 (PDT) Message-Id: <200304070140.h371eiQu007645@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28382 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, 07 Apr 2003 01:40:46 -0000 http://perforce.freebsd.org/chv.cgi?CH=28382 Change 28382 by peter@peter_overcee on 2003/04/06 18:40:06 Somebody once said, "printf is all you need for kernel debugging". So. Step 1: get printf working. Affected files ... .. //depot/projects/hammer/sys/kern/tty_cons.c#4 edit Differences ... ==== //depot/projects/hammer/sys/kern/tty_cons.c#4 (text+ko) ==== @@ -116,8 +116,10 @@ static int openflag; /* how /dev/console was opened */ static int cn_is_open; static u_char console_pausing; /* pause after each line during probe */ +#if 0 static char *console_pausestr= ""; +#endif void cndebug(char *); @@ -537,9 +539,15 @@ return (-1); } +extern void serial_putc(int); void cnputc(int c) { +#if 1 + if (c == '\n') + serial_putc('\r'); + serial_putc(c); +#else struct cn_device *cnd; struct consdev *cn; char *cp; @@ -566,6 +574,7 @@ cnputc(' '); cnputc('\r'); } +#endif } void From owner-p4-projects@FreeBSD.ORG Sun Apr 6 18:41:49 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id A252637B404; Sun, 6 Apr 2003 18:41:48 -0700 (PDT) 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 411FF37B401 for ; Sun, 6 Apr 2003 18:41:48 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7F7B443F85 for ; Sun, 6 Apr 2003 18:41:47 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h371fl0U007780 for ; Sun, 6 Apr 2003 18:41:47 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h371fkPZ007777 for perforce@freebsd.org; Sun, 6 Apr 2003 18:41:46 -0700 (PDT) Date: Sun, 6 Apr 2003 18:41:46 -0700 (PDT) Message-Id: <200304070141.h371fkPZ007777@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28383 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, 07 Apr 2003 01:41:49 -0000 http://perforce.freebsd.org/chv.cgi?CH=28383 Change 28383 by peter@peter_overcee on 2003/04/06 18:41:33 Strip out create_pagetables with the intention of doing it in machdep.c. Test the console hacks. Call printf (varargs, ugh) to check it. Affected files ... .. //depot/projects/hammer/sys/x86_64/x86_64/locore.s#29 edit Differences ... ==== //depot/projects/hammer/sys/x86_64/x86_64/locore.s#29 (text+ko) ==== @@ -71,68 +71,22 @@ * */ -#define ALLOCPAGES(foo) \ - movq physfree, %rsi ; \ - movq $((foo)*PAGE_SIZE), %rax ; \ - addq %rsi, %rax ; \ - movq %rax, physfree ; \ - movq %rsi, %rdi ; \ - movq $((foo)*PAGE_SIZE), %rcx ; \ - xorq %rax, %rax ; \ - cld ; \ - rep ; \ - stosb - -/* - * fillkpt - * eax = page frame address - * ebx = index into page table - * ecx = how many pages to map - * base = base address of page dir/table - * prot = protection bits - */ -#define fillkpt(base, prot) \ - shll $PTESHIFT,%ebx ; \ - addl base,%ebx ; \ - orl $PG_V,%eax ; \ - orl prot,%eax ; \ -1: movl %eax,(%ebx) ; \ - addl $PAGE_SIZE,%eax ; /* increment physical address */ \ - addl $PTESIZE,%ebx ; /* next pte */ \ - loop 1b - -/* - * fillkptphys(prot) - * eax = physical address - * ecx = how many pages to map - * prot = protection bits - */ -#define fillkptphys(prot) \ - movl %eax, %ebx ; \ - shrl $PAGE_SHIFT, %ebx ; \ - fillkpt(KPTphys, prot) - #define PING(a) \ - movb $(a),%bl; \ + movq $(a),%rdi; \ call serial_putc .text /********************************************************************** * - * This is where the bootblocks start us, set the ball rolling... + * This is where the loader trampoline start us, set the ball rolling... * */ NON_GPROF_ENTRY(btext) -/* Tell the bios to warmboot next time */ + /* Tell the bios to warmboot next time */ movw $0x1234,0x472 -/* Get onto a stack that we can trust and set up a real frame. */ - movq $HIDENAME(tmpstk),%rsp - pushq %rbp - movq %rsp, %rbp - -/* Don't trust what the BIOS gives for eflags. */ + /* Don't trust what the loader gives for rflags. */ pushq $PSL_KERNEL popfq @@ -153,22 +107,41 @@ PING('!'); PING('\r'); PING('\n'); + + movq $str, %rdi + call serial_puts + + movq $prf, %rdi + movl $0x12ab34ef, %esi + xorl %eax, %eax + call printf + + /* Find the metadata pointers before we lose them */ + movq 32(%rbp),%rax /* modulep */ + movq %rax,modulep + movq 36(%rbp),%rax /* kernend */ + movq %rax,KERNend + + /* Get onto a stack that we can trust and set up a real frame. */ + movq $HIDENAME(tmpstk),%rsp + pushq %rbp + movq %rsp, %rbp + hlt + +str: + .asciz "this is a string\n" +prf: + .asciz "This is a number: %#x\n" #if 0 - call recover_metadata PING('i'); call identify_cpu PING('T'); - call create_pagetables - PING('h'); PING('e'); PING('r'); PING('e'); - PING('0') -paging: - PING('1') /* set up bootstrap stack */ movq proc0kstack,%rax /* location of in-kernel stack */ @@ -196,30 +169,7 @@ 0: hlt jmp 0b -/********************************************************************** - * - * Recover the metadata passed to us from the boot program - * - */ -recover_metadata: - /* - * New uniform boot code: - * (*btext)(howto, bootdev, 0, 0, 0, &bootinfo, modulep, kernend) - * [return address != 0, and can be returned to] - * - * There may seem to be a lot of wasted arguments in here, but - * that is so the newer boot code can still load very old kernels - * and old boot code can load new kernels. - */ - - movq 32(%rbp),%rax /* modulep */ - movq %rax,modulep - movq 36(%rbp),%rax /* kernend */ - movq %rax,KERNend - - ret - /********************************************************************** * * Identify the CPU and initialize anything special about it @@ -241,120 +191,11 @@ movl %ebx,cpu_procinfo # store cpu_procinfo movl %edx,cpu_feature # store cpu_feature ret +#endif -/********************************************************************** - * - * Create the first page directory and its page tables. - * - */ - -create_pagetables: - -/* We are told where the end of the kernel space is. */ - movl KERNend, %esi /* get end of kernel */ - movl %esi, physfree /* next free page is at end of kernel */ - -/* Allocate Kernel Page Tables */ - ALLOCPAGES(NKPT) - movl %esi, KPTphys - -/* Allocate Page Table Directory */ - ALLOCPAGES(1) - movl %esi, IdlePML4 - ALLOCPAGES(1) - movl %esi, IdlePDP - ALLOCPAGES(NPGPTD) - movl %esi, IdlePTD - -/* Allocate UPAGES */ - ALLOCPAGES(UAREA_PAGES) - movl %esi, p0upa - addl $KERNBASE, %esi - movl %esi, proc0uarea - - ALLOCPAGES(KSTACK_PAGES) - movl %esi, p0kpa - addl $KERNBASE, %esi - movl %esi, proc0kstack - -/* Map read-only from zero to the end of the kernel text section */ - xorl %eax, %eax - xorl %edx,%edx - movl $etext,%ecx - addl $PAGE_MASK,%ecx - shrl $PAGE_SHIFT,%ecx - fillkptphys(%edx) - -/* Map read-write, data, bss and symbols */ - movl $etext, %eax - addl $PAGE_MASK, %eax - andl $~PAGE_MASK, %eax - movl $PG_RW,%edx - movl KERNend, %ecx - subl %eax,%ecx - shrl $PAGE_SHIFT,%ecx - fillkptphys(%edx) - -/* Map page directory. */ - movl IdlePML4, %eax - movl $1, %ecx - fillkptphys($PG_RW) +/***********************************************************************/ - movl IdlePDP, %eax - movl $1, %ecx - fillkptphys($PG_RW) - - movl IdlePTD, %eax - movl $NPGPTD, %ecx - fillkptphys($PG_RW) - -/* Map proc0's UPAGES in the physical way ... */ - movl p0upa, %eax - movl $(UAREA_PAGES), %ecx - fillkptphys($PG_RW) - -/* Map proc0's KSTACK in the physical way ... */ - movl p0kpa, %eax - movl $(KSTACK_PAGES), %ecx - fillkptphys($PG_RW) - -/* Map ISA hole */ - movl $ISA_HOLE_START, %eax - movl $ISA_HOLE_LENGTH>>PAGE_SHIFT, %ecx - fillkptphys($PG_RW) - -/* install a pde for temporary double map of bottom of VA */ - movl KPTphys, %eax - xorl %ebx, %ebx - movl $NKPT, %ecx - fillkpt(IdlePTD, $PG_RW) - -/* install pde's for pt's */ - movl KPTphys, %eax - movl $KPTDI, %ebx - movl $NKPT, %ecx - fillkpt(IdlePTD, $PG_RW) - -/* install a pde recursively mapping page directory as a page table */ - movl IdlePTD, %eax - movl $PTDPTDI, %ebx - movl $NPGPTD,%ecx - fillkpt(IdlePTD, $PG_RW) - - movl IdlePTD, %eax - xorl %ebx, %ebx - movl $NPGPTD, %ecx - fillkpt(IdlePDP, $0x0) - - movl IdlePDP, %eax - xorl %ebx, %ebx - movl $1, %ecx - fillkpt(IdlePML4, $0x0) - - ret - -#endif .bss ALIGN_DATA /* just to be sure */ .globl HIDENAME(tmpstk) @@ -389,7 +230,7 @@ testb $0x20, %al je 1b # TX buffer not empty - movb %bl, %al + movq %rdi, %rax subl $5, %edx # TX output reg outb %al, %dx # send this one @@ -397,45 +238,6 @@ ret /* - * int serial_getc(void); - * Read a character from port COMCONSOLE. - */ - .globl serial_getc - .type serial_getc@function -serial_getc: - mov $COMCONSOLE + 5, %edx # line status reg -1: - inb %dx, %al - testb $0x01, %al - je 1b # no rx char available - - xorl %eax, %eax - subl $5, %edx # rx buffer reg - inb %dx, %al # fetch (first) character - - andb $0x7F, %al # remove any parity bits we get - cmpb $0x7F, %al # make DEL... - jne 2f - movb $0x08, %al # look like BS -2: - ret - -/* - * int serial_ischar(void); - * If there is a character in the input buffer of port COMCONSOLE, - * return nonzero; otherwise return 0. - */ - - .globl serial_ischar - .type serial_ischar@function -serial_ischar: - xorl %eax, %eax - movl $COMCONSOLE + 5, %edx # line status reg - inb %dx, %al - andb $0x01, %al # rx char available? - ret - -/* * void init_serial(void); * Initialize port COMCONSOLE to speed CONSPEED, line settings 8N1. */ From owner-p4-projects@FreeBSD.ORG Sun Apr 6 18:47:56 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 4EE0437B404; Sun, 6 Apr 2003 18:47:56 -0700 (PDT) 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 E332237B401 for ; Sun, 6 Apr 2003 18:47:55 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8F6C443FAF for ; Sun, 6 Apr 2003 18:47:55 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h371lt0U008047 for ; Sun, 6 Apr 2003 18:47:55 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h371ltA3008044 for perforce@freebsd.org; Sun, 6 Apr 2003 18:47:55 -0700 (PDT) Date: Sun, 6 Apr 2003 18:47:55 -0700 (PDT) Message-Id: <200304070147.h371ltA3008044@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28384 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, 07 Apr 2003 01:47:57 -0000 http://perforce.freebsd.org/chv.cgi?CH=28384 Change 28384 by peter@peter_overcee on 2003/04/06 18:46:56 use serial_puts for the Hello, World! instead of PING Affected files ... .. //depot/projects/hammer/sys/x86_64/x86_64/locore.s#30 edit Differences ... ==== //depot/projects/hammer/sys/x86_64/x86_64/locore.s#30 (text+ko) ==== @@ -65,16 +65,6 @@ .globl kernbase .set kernbase,KERNBASE -/********************************************************************** - * - * Some handy macros - * - */ - -#define PING(a) \ - movq $(a),%rdi; \ - call serial_putc - .text /********************************************************************** * @@ -92,22 +82,6 @@ call init_serial - PING('H'); - PING('e'); - PING('l'); - PING('l'); - PING('o'); - PING(','); - PING(' '); - PING('W'); - PING('o'); - PING('r'); - PING('l'); - PING('d'); - PING('!'); - PING('\r'); - PING('\n'); - movq $str, %rdi call serial_puts @@ -130,7 +104,7 @@ hlt str: - .asciz "this is a string\n" + .asciz "Hello, World!\n" prf: .asciz "This is a number: %#x\n" #if 0 From owner-p4-projects@FreeBSD.ORG Sun Apr 6 19:23:40 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id E551637B404; Sun, 6 Apr 2003 19:23:39 -0700 (PDT) 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 7745137B401 for ; Sun, 6 Apr 2003 19:23:39 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 240D643FAF for ; Sun, 6 Apr 2003 19:23:39 -0700 (PDT) (envelope-from jmallett@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h372Nc0U011503 for ; Sun, 6 Apr 2003 19:23:38 -0700 (PDT) (envelope-from jmallett@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h372NcZ9011500 for perforce@freebsd.org; Sun, 6 Apr 2003 19:23:38 -0700 (PDT) Date: Sun, 6 Apr 2003 19:23:38 -0700 (PDT) Message-Id: <200304070223.h372NcZ9011500@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jmallett@freebsd.org using -f From: Juli Mallett To: Perforce Change Reviews Subject: PERFORCE change 28385 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, 07 Apr 2003 02:23:40 -0000 http://perforce.freebsd.org/chv.cgi?CH=28385 Change 28385 by jmallett@jmallett_dalek on 2003/04/06 19:23:16 Rename locore.s to locore.S for consistency. Affected files ... .. //depot/projects/mips/sys/conf/files.mips#12 edit .. //depot/projects/mips/sys/mips/mips/locore.S#1 add .. //depot/projects/mips/sys/mips/mips/locore.s#4 delete Differences ... ==== //depot/projects/mips/sys/conf/files.mips#12 (text+ko) ==== @@ -12,7 +12,7 @@ # This stanza is MIPS MD files. mips/mips/critical.c standard mips/mips/elf_machdep.c standard -mips/mips/locore.s standard no-obj +mips/mips/locore.S standard no-obj mips/mips/machdep.c standard mips/mips/pmap.c standard mips/mips/sig_machdep.c standard From owner-p4-projects@FreeBSD.ORG Sun Apr 6 19:48:17 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 8B6C837B414; Sun, 6 Apr 2003 19:48:16 -0700 (PDT) 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 C64E237B49A for ; Sun, 6 Apr 2003 19:48:11 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id A2A0743FA3 for ; Sun, 6 Apr 2003 19:48:10 -0700 (PDT) (envelope-from jmallett@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h372mA0U012980 for ; Sun, 6 Apr 2003 19:48:10 -0700 (PDT) (envelope-from jmallett@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h372m9h1012977 for perforce@freebsd.org; Sun, 6 Apr 2003 19:48:09 -0700 (PDT) Date: Sun, 6 Apr 2003 19:48:09 -0700 (PDT) Message-Id: <200304070248.h372m9h1012977@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jmallett@freebsd.org using -f From: Juli Mallett To: Perforce Change Reviews Subject: PERFORCE change 28387 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, 07 Apr 2003 02:48:18 -0000 http://perforce.freebsd.org/chv.cgi?CH=28387 Change 28387 by jmallett@jmallett_dalek on 2003/04/06 19:48:08 IFC. Affected files ... .. //depot/projects/mips/Makefile.inc1#14 integrate .. //depot/projects/mips/contrib/gdtoa/gdtoaimp.h#3 integrate .. //depot/projects/mips/contrib/ipfilter/man/ipmon.8#3 integrate .. //depot/projects/mips/gnu/usr.bin/binutils/ld/Makefile#2 integrate .. //depot/projects/mips/gnu/usr.bin/binutils/libiberty/Makefile#4 integrate .. //depot/projects/mips/kerberos5/lib/libasn1/Makefile#3 integrate .. //depot/projects/mips/kerberos5/lib/libhdb/Makefile#3 integrate .. //depot/projects/mips/lib/libc/alpha/_fpmath.h#3 integrate .. //depot/projects/mips/lib/libc/gdtoa/Makefile.inc#2 integrate .. //depot/projects/mips/lib/libc/gdtoa/_ldtoa.c#1 branch .. //depot/projects/mips/lib/libc/i386/_fpmath.h#2 integrate .. //depot/projects/mips/lib/libc/ia64/_fpmath.h#3 integrate .. //depot/projects/mips/lib/libc/powerpc/_fpmath.h#2 integrate .. //depot/projects/mips/lib/libc/sparc64/_fpmath.h#2 integrate .. //depot/projects/mips/lib/libc/stdio/floatio.h#2 integrate .. //depot/projects/mips/lib/libc/stdio/vfprintf.c#5 integrate .. //depot/projects/mips/lib/libc/stdio/vfwprintf.c#5 integrate .. //depot/projects/mips/lib/libncurses/Makefile#4 integrate .. //depot/projects/mips/lib/libstand/printf.c#2 integrate .. //depot/projects/mips/lib/libusbhid/libusbhid.h#2 integrate .. //depot/projects/mips/lib/libusbhid/parse.c#2 integrate .. //depot/projects/mips/lib/libusbhid/usage.c#2 integrate .. //depot/projects/mips/share/man/man4/Makefile#13 integrate .. //depot/projects/mips/share/man/man4/man4.i386/Makefile#3 integrate .. //depot/projects/mips/share/man/man4/man4.i386/smapi.4#1 branch .. //depot/projects/mips/share/man/man4/wlan.4#1 branch .. //depot/projects/mips/share/mk/bsd.sys.mk#4 integrate .. //depot/projects/mips/share/termcap/termcap.src#3 integrate .. //depot/projects/mips/sys/boot/common/bootstrap.h#2 integrate .. //depot/projects/mips/sys/cam/cam_periph.c#6 integrate .. //depot/projects/mips/sys/dev/fxp/if_fxp.c#10 integrate .. //depot/projects/mips/sys/dev/fxp/if_fxpreg.h#4 integrate .. //depot/projects/mips/sys/dev/usb/usbdevs#9 integrate .. //depot/projects/mips/sys/dev/usb/usbdevs.h#8 integrate .. //depot/projects/mips/sys/dev/usb/usbdevs_data.h#8 integrate .. //depot/projects/mips/sys/dev/usb/uvisor.c#5 integrate .. //depot/projects/mips/sys/i386/i386/mp_clock.c#3 integrate .. //depot/projects/mips/sys/i386/i386/swtch.s#4 integrate .. //depot/projects/mips/sys/i386/isa/mca_machdep.c#3 delete .. //depot/projects/mips/sys/i386/isa/mca_machdep.h#2 delete .. //depot/projects/mips/sys/ia64/ia64/exception.s#6 integrate .. //depot/projects/mips/sys/ia64/ia64/locore.s#4 integrate .. //depot/projects/mips/sys/ia64/ia64/sscdisk.c#8 integrate .. //depot/projects/mips/sys/kern/kern_physio.c#5 integrate .. //depot/projects/mips/sys/kern/link_elf.c#7 integrate .. //depot/projects/mips/sys/kern/vfs_aio.c#10 integrate .. //depot/projects/mips/sys/kern/vfs_bio.c#14 integrate .. //depot/projects/mips/sys/pci/if_xl.c#10 integrate .. //depot/projects/mips/sys/sparc64/include/cpufunc.h#3 integrate .. //depot/projects/mips/sys/sparc64/include/md_var.h#2 integrate .. //depot/projects/mips/sys/sparc64/include/pmap.h#6 integrate .. //depot/projects/mips/sys/sparc64/sparc64/machdep.c#9 integrate .. //depot/projects/mips/sys/sparc64/sparc64/pmap.c#10 integrate .. //depot/projects/mips/sys/ufs/ffs/ffs_rawread.c#2 integrate .. //depot/projects/mips/sys/vm/vm_pager.c#3 integrate .. //depot/projects/mips/tools/build/Makefile#1 branch .. //depot/projects/mips/tools/build/Makefile.boot#1 branch .. //depot/projects/mips/tools/build/dummy.c#1 branch .. //depot/projects/mips/tools/build/endian.h#1 branch .. //depot/projects/mips/tools/build/langinfo.h#1 branch .. //depot/projects/mips/tools/build/progname.c#1 branch .. //depot/projects/mips/tools/regression/lib/libc/stdio/Makefile#2 integrate .. //depot/projects/mips/tools/regression/lib/libc/stdio/test-printfloat.c#1 branch .. //depot/projects/mips/usr.bin/tip/libacu/courier.c#2 integrate .. //depot/projects/mips/usr.bin/tip/libacu/df.c#2 integrate .. //depot/projects/mips/usr.bin/tip/libacu/hayes.c#2 integrate .. //depot/projects/mips/usr.bin/tip/libacu/t3000.c#2 integrate .. //depot/projects/mips/usr.bin/tip/tip/cmds.c#2 integrate .. //depot/projects/mips/usr.bin/tip/tip/cmdtab.c#2 integrate .. //depot/projects/mips/usr.bin/tip/tip/tip.c#2 integrate .. //depot/projects/mips/usr.bin/tip/tip/tip.h#2 integrate .. //depot/projects/mips/usr.bin/tip/tip/value.c#2 integrate .. //depot/projects/mips/usr.bin/xargs/xargs.c#7 integrate .. //depot/projects/mips/usr.bin/xinstall/Makefile#3 integrate .. //depot/projects/mips/usr.sbin/rtadvd/config.c#4 integrate .. //depot/projects/mips/usr.sbin/wicontrol/wicontrol.8#6 integrate .. //depot/projects/mips/usr.sbin/wicontrol/wicontrol.c#5 integrate Differences ... ==== //depot/projects/mips/Makefile.inc1#14 (text+ko) ==== @@ -1,5 +1,5 @@ # -# $FreeBSD: src/Makefile.inc1,v 1.331 2003/04/04 22:46:08 imp Exp $ +# $FreeBSD: src/Makefile.inc1,v 1.339 2003/04/07 00:01:33 ru Exp $ # # Make command line options: # -DMAKE_KERBEROS5 to build Kerberos5 @@ -159,15 +159,19 @@ # # Building a world goes through the following stages # -# 1. bootstrap-tool stage [BMAKE] +# 1. legacy stage [BMAKE] +# This stage is responsible for creating compatibility +# shims that are needed by the bootstrap-tools, +# build-tools and cross-tools stages. +# 1. bootstrap-tools stage [BMAKE] # This stage is responsible for creating programs that # are needed for backward compatibility reasons. They # are not built as cross-tools. -# 2. build-tool stage [TMAKE] +# 2. build-tools stage [TMAKE] # This stage is responsible for creating the object # tree and building any tools that are needed during # the build process. -# 3. cross-tool stage [XMAKE] +# 3. cross-tools stage [XMAKE] # This stage is responsible for creating any tools that # are needed for cross-builds. A cross-compiler is one # of them. @@ -186,23 +190,24 @@ GROFF_FONT_PATH=${WORLDTMP}/usr/share/groff_font \ GROFF_TMAC_PATH=${WORLDTMP}/usr/share/tmac -# bootstrap-tool stage -BMAKEENV= MAKEOBJDIRPREFIX=${WORLDTMP} \ - DESTDIR= \ - INSTALL="sh ${.CURDIR}/tools/install.sh" -BMAKE= ${BMAKEENV} ${MAKE} -f Makefile.inc1 \ +# bootstrap-tools stage +BMAKEENV= DESTDIR= \ + INSTALL="sh ${.CURDIR}/tools/install.sh" \ + __MAKE_CONF=${.CURDIR}/tools/build/Makefile.boot \ + OLD_MAKE_CONF=${__MAKE_CONF} \ + WORLDTMP=${WORLDTMP} +BMAKE= MAKEOBJDIRPREFIX=${WORLDTMP} \ + ${BMAKEENV} ${MAKE} -f Makefile.inc1 \ BOOTSTRAPPING=${OSRELDATE} \ -DNOHTML -DNOINFO -DNOMAN -DNOPIC -DNOPROFILE -DNOSHARED \ -DNO_CPU_CFLAGS -DNO_WARNS -# build-tool stage -TMAKEENV= MAKEOBJDIRPREFIX=${OBJTREE} \ - DESTDIR= \ - INSTALL="sh ${.CURDIR}/tools/install.sh" -TMAKE= ${TMAKEENV} ${MAKE} -f Makefile.inc1 \ +# build-tools stage +TMAKE= MAKEOBJDIRPREFIX=${OBJTREE} \ + ${BMAKEENV} ${MAKE} -f Makefile.inc1 \ BOOTSTRAPPING=${OSRELDATE} -DNO_CPU_CFLAGS -DNO_WARNS -# cross-tool stage +# cross-tools stage XMAKE= TOOLS_PREFIX=${WORLDTMP} ${BMAKE} -DNO_FORTRAN -DNO_GDB # world stage @@ -264,6 +269,7 @@ .if !defined(NOCLEAN) rm -rf ${WORLDTMP} .else + rm -rf ${WORLDTMP}/legacy/usr/include # XXX - These two can depend on any header file. rm -f ${OBJTREE}${.CURDIR}/usr.bin/kdump/ioctl.c rm -f ${OBJTREE}${.CURDIR}/usr.bin/truss/ioctl.c @@ -275,6 +281,15 @@ mkdir -p ${WORLDTMP}/usr/include/${_dir} .endfor ln -sf ${.CURDIR}/sys ${WORLDTMP} +.for _dir in lib include/sys + mkdir -p ${WORLDTMP}/legacy/usr/${_dir} +.endfor +_legacy: + @echo + @echo "--------------------------------------------------------------" + @echo ">>> stage 1: legacy release compatibility shims" + @echo "--------------------------------------------------------------" + cd ${.CURDIR}; ${BMAKE} legacy _bootstrap-tools: @echo @echo "--------------------------------------------------------------" @@ -335,7 +350,7 @@ WMAKE_TGTS= .if !defined(SUBDIR_OVERRIDE) -WMAKE_TGTS+= _worldtmp _bootstrap-tools +WMAKE_TGTS+= _worldtmp _legacy _bootstrap-tools .endif WMAKE_TGTS+= _cleanobj _obj _build-tools .if !defined(SUBDIR_OVERRIDE) @@ -607,6 +622,19 @@ # # +# legacy: Build compatibility shims for the next three targets +# +legacy: +.for _tool in tools/build + @${ECHODIR} "===> ${_tool}"; \ + cd ${.CURDIR}/${_tool}; \ + ${MAKE} DIRPRFX=${_tool}/ obj; \ + ${MAKE} DIRPRFX=${_tool}/ depend; \ + ${MAKE} DIRPRFX=${_tool}/ all; \ + ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy install +.endfor + +# # bootstrap-tools: Build tools needed for compatibility # .if exists(${.CURDIR}/games) && !defined(NOGAMES) ==== //depot/projects/mips/contrib/gdtoa/gdtoaimp.h#3 (text+ko) ==== @@ -26,7 +26,7 @@ ****************************************************************/ -/* $FreeBSD: src/contrib/gdtoa/gdtoaimp.h,v 1.3 2003/03/19 20:25:45 das Exp $ */ +/* $FreeBSD: src/contrib/gdtoa/gdtoaimp.h,v 1.4 2003/04/05 22:09:26 das Exp $ */ /* This is a variation on dtoa.c that converts arbitary binary floating-point formats to and from decimal notation. It uses @@ -600,6 +600,8 @@ extern Bigint *diff ANSI((Bigint*, Bigint*)); extern char *dtoa ANSI((double d, int mode, int ndigits, int *decpt, int *sign, char **rve)); + extern char *gdtoa ANSI((FPI *fpi, int be, ULong *bits, int *kindp, + int mode, int ndigits, int *decpt, char **rve)); extern char *g__fmt ANSI((char*, char*, char*, int, ULong)); extern int gethex ANSI((CONST char**, FPI*, Long*, Bigint**, int)); extern void hexdig_init_D2A(Void); ==== //depot/projects/mips/contrib/ipfilter/man/ipmon.8#3 (text+ko) ==== @@ -1,4 +1,4 @@ -.\" $FreeBSD: src/contrib/ipfilter/man/ipmon.8,v 1.12 2003/02/15 06:32:48 darrenr Exp $ +.\" $FreeBSD: src/contrib/ipfilter/man/ipmon.8,v 1.13 2003/04/05 21:12:58 darrenr Exp $ .TH ipmon 8 .SH NAME ipmon \- monitors /dev/ipl for logged packets @@ -126,7 +126,7 @@ .B \-s Packet information read in will be sent through syslogd rather than saved to a file. The default facility when compiled and installed is -\fBlocal0\fP. The following levels are used: +\fBsecurity\fP. The following levels are used: .IP .B LOG_INFO \- packets logged using the "log" keyword as the action rather ==== //depot/projects/mips/gnu/usr.bin/binutils/ld/Makefile#2 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/gnu/usr.bin/binutils/ld/Makefile,v 1.23 2002/07/29 09:40:08 ru Exp $ +# $FreeBSD: src/gnu/usr.bin/binutils/ld/Makefile,v 1.24 2003/04/05 20:30:29 imp Exp $ .include "../Makefile.inc0" @@ -10,20 +10,12 @@ ldgram.y ldlang.c ldlex.l ldmain.c ldmisc.c \ ldver.c ldwrite.c lexsup.c mri.c -.if defined(BOOTSTRAPPING) && !exists(/usr/include/elf-hints.h) -SRCS+= elf-hints.h -CLEANFILES+= elf-hints.h - -elf-hints.h: - ln -sf ${.CURDIR}/../../../../include/${.TARGET} . -.endif - WARNS= 1 CFLAGS+= -DSCRIPTDIR=\"${TOOLS_PREFIX}/usr/libdata\" CFLAGS+= -DBFD_VERSION_STRING=\"${VERSION}\" CFLAGS+= -I${SRCDIR}/ld -I${SRCDIR}/bfd NOSHARED?= yes -DPADD= ${RELTOP}/libbfd/libbfd.a +DPADD+= ${RELTOP}/libbfd/libbfd.a DPADD+= ${RELTOP}/libiberty/libiberty.a LDADD= ${DPADD} CLEANDIRS+= ldscripts ==== //depot/projects/mips/gnu/usr.bin/binutils/libiberty/Makefile#4 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/gnu/usr.bin/binutils/libiberty/Makefile,v 1.17 2002/11/13 13:49:29 ru Exp $ +# $FreeBSD: src/gnu/usr.bin/binutils/libiberty/Makefile,v 1.18 2003/04/05 20:30:29 imp Exp $ .include "../Makefile.inc0" @@ -10,12 +10,7 @@ hex.c floatformat.c hashtab.c lbasename.c make-temp-file.c \ objalloc.c obstack.c safe-ctype.c xatexit.c xexit.c xmalloc.c \ xstrdup.c xstrerror.c -.if defined(BOOTSTRAPPING) && \ - ( ${BOOTSTRAPPING} < 440000 || \ - ( ${BOOTSTRAPPING} >= 500000 && ${BOOTSTRAPPING} < 500022 )) -SRCS+= basename.c -.endif -WARNS?= 1 +WARNS= 1 CFLAGS+= -DHAVE_CONFIG_H INTERNALLIB= true ==== //depot/projects/mips/kerberos5/lib/libasn1/Makefile#3 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/kerberos5/lib/libasn1/Makefile,v 1.17 2002/11/13 13:49:29 ru Exp $ +# $FreeBSD: src/kerberos5/lib/libasn1/Makefile,v 1.18 2003/04/05 20:30:29 imp Exp $ LIB= asn1 CFLAGS+=-I${KRB5DIR}/include \ @@ -104,13 +104,7 @@ print_version.o \ get_window_size.c \ strupr.c - ${CC} ${CFLAGS} ${.OODATE} -o ${.TARGET} - -.if defined(BOOTSTRAPPING) && \ - ( ${BOOTSTRAPPING} < 440001 || \ - ( ${BOOTSTRAPPING} >= 500000 && ${BOOTSTRAPPING} < 500023 )) -asn1_compile: getprogname.c setprogname.c -.endif + ${CC} ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${.OODATE} ${LDADD} parse.o: parse.c roken.h ==== //depot/projects/mips/kerberos5/lib/libhdb/Makefile#3 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/kerberos5/lib/libhdb/Makefile,v 1.10 2002/11/13 13:49:29 ru Exp $ +# $FreeBSD: src/kerberos5/lib/libhdb/Makefile,v 1.11 2003/04/05 20:30:29 imp Exp $ LIB= hdb CFLAGS+=-I${KRB5DIR}/include \ @@ -59,13 +59,7 @@ gen_encode.c gen_decode.c gen_free.c gen_length.c \ gen_copy.c gen_glue.c getarg.c warnerr.c print_version.o \ get_window_size.c strupr.c - ${CC} ${CFLAGS} ${.OODATE} -o ${.TARGET} - -.if defined(BOOTSTRAPPING) && \ - ( ${BOOTSTRAPPING} < 440001 || \ - ( ${BOOTSTRAPPING} >= 500000 && ${BOOTSTRAPPING} < 500023 )) -asn1_compile: getprogname.c setprogname.c -.endif + ${CC} ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${.OODATE} ${LDADD} parse.o: parse.c ==== //depot/projects/mips/lib/libc/alpha/_fpmath.h#3 (text+ko) ==== @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/lib/libc/alpha/_fpmath.h,v 1.2 2003/02/11 15:19:31 des Exp $ + * $FreeBSD: src/lib/libc/alpha/_fpmath.h,v 1.3 2003/04/05 22:10:13 das Exp $ */ union IEEEl2bits { @@ -37,3 +37,9 @@ }; #define mask_nbit_l(u) ((void)0) +#define LDBL_IMPLICIT_NBIT + +#define LDBL_TO_ARRAY32(u, a) do { \ + (a)[0] = (uint32_t)(u).bits.manl; \ + (a)[1] = (uint32_t)(u).bits.manh; \ +} while(0) ==== //depot/projects/mips/lib/libc/gdtoa/Makefile.inc#2 (text+ko) ==== @@ -1,9 +1,9 @@ -# $FreeBSD: src/lib/libc/gdtoa/Makefile.inc,v 1.2 2003/03/13 18:55:14 obrien Exp $ +# $FreeBSD: src/lib/libc/gdtoa/Makefile.inc,v 1.3 2003/04/05 22:10:13 das Exp $ # netlib gdtoa sources .PATH: ${.CURDIR}/gdtoa -MISRCS+=glue.c +MISRCS+=_ldtoa.c glue.c GDTOASRCS=dmisc.c dtoa.c gdtoa.c gethex.c gmisc.c \ hd_init.c hexnan.c misc.c smisc.c \ strtoIg.c strtod.c strtodg.c strtof.c strtord.c sum.c ulp.c ==== //depot/projects/mips/lib/libc/i386/_fpmath.h#2 (text+ko) ==== @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/lib/libc/i386/_fpmath.h,v 1.1 2003/02/08 20:37:52 mike Exp $ + * $FreeBSD: src/lib/libc/i386/_fpmath.h,v 1.2 2003/04/05 22:10:13 das Exp $ */ union IEEEl2bits { @@ -38,3 +38,8 @@ }; #define mask_nbit_l(u) ((u).bits.manh &= 0x7fffffff) + +#define LDBL_TO_ARRAY32(u, a) do { \ + (a)[0] = (uint32_t)(u).bits.manl; \ + (a)[1] = (uint32_t)(u).bits.manh; \ +} while(0) ==== //depot/projects/mips/lib/libc/ia64/_fpmath.h#3 (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/ia64/_fpmath.h,v 1.2 2003/02/26 16:04:34 mike Exp $ + * $FreeBSD: src/lib/libc/ia64/_fpmath.h,v 1.3 2003/04/05 22:10:13 das Exp $ */ #include @@ -53,3 +53,8 @@ #else /* _BIG_ENDIAN */ #define mask_nbit_l(u) ((u).bits.manh &= 0xffffff7f) #endif + +#define LDBL_TO_ARRAY32(u, a) do { \ + (a)[0] = (uint32_t)(u).bits.manl; \ + (a)[1] = (uint32_t)(u).bits.manh; \ +} while(0) ==== //depot/projects/mips/lib/libc/powerpc/_fpmath.h#2 (text+ko) ==== @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/lib/libc/powerpc/_fpmath.h,v 1.1 2003/02/08 20:37:53 mike Exp $ + * $FreeBSD: src/lib/libc/powerpc/_fpmath.h,v 1.2 2003/04/05 22:10:13 das Exp $ */ union IEEEl2bits { @@ -38,3 +38,11 @@ /* XXX does powerpc have a normalization bit? */ #define mask_nbit_l(u) ((void)0) +#define LDBL_IMPLICIT_NBIT + +#define LDBL_TO_ARRAY32(u, a) do { \ + (a)[0] = (uint32_t)(u).bits.manl; \ + (a)[1] = (uint32_t)((u).bits.manl >> 32); \ + (a)[2] = (uint32_t)(u).bits.manh; \ + (a)[3] = (uint32_t)((u).bits.manh >> 32); \ +} while(0) ==== //depot/projects/mips/lib/libc/sparc64/_fpmath.h#2 (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/sparc64/_fpmath.h,v 1.1 2003/02/08 20:37:54 mike Exp $ + * $FreeBSD: src/lib/libc/sparc64/_fpmath.h,v 1.2 2003/04/05 22:10:13 das Exp $ */ union IEEEl2bits { @@ -38,3 +38,11 @@ }; #define mask_nbit_l(u) ((void)0) +#define LDBL_IMPLICIT_NBIT + +#define LDBL_TO_ARRAY32(u, a) do { \ + (a)[0] = (uint32_t)(u).bits.manl; \ + (a)[1] = (uint32_t)((u).bits.manl >> 32); \ + (a)[2] = (uint32_t)(u).bits.manh; \ + (a)[3] = (uint32_t)((u).bits.manh >> 32); \ +} while(0) ==== //depot/projects/mips/lib/libc/stdio/floatio.h#2 (text+ko) ==== @@ -34,14 +34,23 @@ * SUCH DAMAGE. * * @(#)floatio.h 8.1 (Berkeley) 6/4/93 - * $FreeBSD: src/lib/libc/stdio/floatio.h,v 1.2 2002/03/22 23:42:01 obrien Exp $ + * $FreeBSD: src/lib/libc/stdio/floatio.h,v 1.4 2003/04/05 22:11:42 das Exp $ */ /* * Floating point scanf/printf (input/output) definitions. */ -/* 11-bit exponent (VAX G floating point) is 308 decimal digits */ -#define MAXEXP 308 -/* 128 bit fraction takes up 39 decimal digits; max reasonable precision */ -#define MAXFRACT 39 +/* + * MAXEXPDIG is the maximum number of decimal digits needed to store a + * floating point exponent in the largest supported format. It should + * be ceil(log10(LDBL_MAX_10_EXP)) or, if hexadecimal floating point + * conversions are supported, ceil(log10(LDBL_MAX_EXP)). But since it + * is presently never greater than 5 in practice, we fudge it. + */ +#define MAXEXPDIG 6 +#if LDBL_MAX_EXP > 999999 +#error "floating point buffers too small" +#endif + +char *__ldtoa(long double *, int, int, int *, int *, char **); ==== //depot/projects/mips/lib/libc/stdio/vfprintf.c#5 (text+ko) ==== @@ -38,7 +38,7 @@ static char sccsid[] = "@(#)vfprintf.c 8.1 (Berkeley) 6/4/93"; #endif /* LIBC_SCCS and not lint */ #include -__FBSDID("$FreeBSD: src/lib/libc/stdio/vfprintf.c,v 1.52 2003/03/14 04:48:09 das Exp $"); +__FBSDID("$FreeBSD: src/lib/libc/stdio/vfprintf.c,v 1.56 2003/04/07 01:07:48 das Exp $"); /* * Actual printf innards. @@ -111,9 +111,9 @@ static int __sprint(FILE *, struct __suio *); static int __sbprintf(FILE *, const char *, va_list) __printflike(2, 0); -static char *__ujtoa(uintmax_t, char *, int, int, char *, int, char, +static char *__ujtoa(uintmax_t, char *, int, int, const char *, int, char, const char *); -static char *__ultoa(u_long, char *, int, int, char *, int, char, +static char *__ultoa(u_long, char *, int, int, const char *, int, char, const char *); static char *__wcsconv(wchar_t *, int); static void __find_arguments(const char *, va_list, union arg **); @@ -185,7 +185,7 @@ * use the given digits. */ static char * -__ultoa(u_long val, char *endp, int base, int octzero, char *xdigs, +__ultoa(u_long val, char *endp, int base, int octzero, const char *xdigs, int needgrp, char thousep, const char *grp) { char *cp = endp; @@ -262,7 +262,7 @@ /* Identical to __ultoa, but for intmax_t. */ static char * -__ujtoa(uintmax_t val, char *endp, int base, int octzero, char *xdigs, +__ujtoa(uintmax_t val, char *endp, int base, int octzero, const char *xdigs, int needgrp, char thousep, const char *grp) { char *cp = endp; @@ -407,23 +407,29 @@ } #ifdef FLOATING_POINT + +#define dtoa __dtoa +#define freedtoa __freedtoa + +#include #include #include "floatio.h" +#include "gdtoa.h" -#define BUF ((MAXEXP*2)+MAXFRACT+1) /* + decimal point */ #define DEFPREC 6 -extern char *__dtoa(double, int, int, int *, int *, char **); -extern void __freedtoa(char *s); - -static char *cvt(double, int, int, char *, int *, int, int *); static int exponent(char *, int, int); -#else /* no FLOATING_POINT */ +#endif /* FLOATING_POINT */ -#define BUF 136 - -#endif /* FLOATING_POINT */ +/* + * The size of the buffer we use as scratch space for integer + * conversions, among other things. Technically, we would need the + * most space for base 10 conversions with thousands' grouping + * characters between each pair of digits. 100 bytes is a + * conservative overestimate even for a 128-bit uintmax_t. + */ +#define BUF 100 #define STATIC_ARG_TBL_SIZE 8 /* Size of static argument table. */ @@ -431,7 +437,6 @@ * Flags used during conversion. */ #define ALT 0x001 /* alternate form */ -#define HEXPREFIX 0x002 /* add 0x or 0X prefix */ #define LADJUST 0x004 /* left adjustment */ #define LONGDBL 0x008 /* long double */ #define LONGINT 0x010 /* long integer */ @@ -460,19 +465,41 @@ int flags; /* flags as above */ int ret; /* return value accumulator */ int width; /* width from format (%8d), or 0 */ - int prec; /* precision from format (%.3d), or -1 */ + int prec; /* precision from format; <0 for N/A */ char sign; /* sign prefix (' ', '+', '-', or \0) */ char thousands_sep; /* locale specific thousands separator */ const char *grouping; /* locale specific numeric grouping rules */ #ifdef FLOATING_POINT + /* + * We can decompose the printed representation of floating + * point numbers into several parts, some of which may be empty: + * + * [+|-| ] [0x|0X] MMM . NNN [e|E|p|P] [+|-] ZZ + * A B ---C--- D E F + * + * A: 'sign' holds this value if present; '\0' otherwise + * B: ox[1] holds the 'x' or 'X'; '\0' if not hexadecimal + * C: cp points to the string MMMNNN. Leading and trailing + * zeros are not in the string and must be added. + * D: expchar holds this character; '\0' if no exponent, e.g. %f + * F: at least two digits for decimal, at least one digit for hex + */ char *decimal_point; /* locale specific decimal point */ - char softsign; /* temporary negative sign for floats */ - double _double; /* double precision arguments %[eEfgG] */ + int signflag; /* true if float is negative */ + union { /* floating point arguments %[aAeEfFgG] */ + double dbl; + long double ldbl; + } fparg; int expt; /* integer value of exponent */ + char expchar; /* exponent character: [eEpP\0] */ + char *dtoaend; /* pointer to end of converted digits */ int expsize; /* character count for expstr */ - int ndig; /* actual number of digits returned by cvt */ - char expstr[7]; /* buffer for exponent string */ + int lead; /* sig figs before decimal or group sep */ + int ndig; /* actual number of digits returned by dtoa */ + char expstr[MAXEXPDIG+2]; /* buffer for exponent string: e+ZZZ */ char *dtoaresult; /* buffer allocated by dtoa */ + int nseps; /* number of group separators with ' */ + int nrepeats; /* number of repeats of the last group */ #endif u_long ulval; /* integer arguments %[diouxX] */ uintmax_t ujval; /* %j, %ll, %q, %t, %z integers */ @@ -481,12 +508,12 @@ int realsz; /* field size expanded by dprec, sign, etc */ int size; /* size of converted field or string */ int prsize; /* max size of printed field */ - char *xdigs; /* digits for [xX] conversion */ + const char *xdigs; /* digits for %[xX] conversion */ #define NIOV 8 struct __suio uio; /* output information: summary */ struct __siov iov[NIOV];/* ... and individual io vectors */ - char buf[BUF]; /* space for %c, %[diouxX], %[eEfFgG] */ - char ox[2]; /* space for 0x hex-prefix */ + char buf[BUF]; /* buffer with space for digits of uintmax_t */ + char ox[2]; /* space for 0x; ox[1] is either x, X, or \0 */ union arg *argtable; /* args, built due to positional arg */ union arg statargtable [STATIC_ARG_TBL_SIZE]; int nextarg; /* 1-based argument index */ @@ -504,6 +531,9 @@ static char zeroes[PADSIZE] = {'0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0'}; + static const char xdigs_lower[16] = "0123456789abcdef"; + static const char xdigs_upper[16] = "0123456789ABCDEF"; + /* * BEWARE, these `goto error' on error, and PAD uses `n'. */ @@ -527,6 +557,14 @@ PRINT(with, n); \ } \ } +#define PRINTANDPAD(p, ep, len, with) do { \ + n2 = (ep) - (p); \ + if (n2 > (len)) \ + n2 = (len); \ + if (n2 > 0) \ + PRINT((p), n2); \ + PAD((len) - (n2 > 0 ? n2 : 0), (with)); \ +} while(0) #define FLUSH() { \ if (uio.uio_resid && __sprint(fp, &uio)) \ goto error; \ @@ -643,6 +681,7 @@ width = 0; prec = -1; sign = '\0'; + ox[1] = '\0'; rflag: ch = *fmt++; reswitch: switch (ch) { @@ -683,16 +722,14 @@ goto rflag; case '.': if ((ch = *fmt++) == '*') { - GETASTER (n); - prec = n < 0 ? -1 : n; + GETASTER (prec); goto rflag; } - n = 0; + prec = 0; while (is_digit(ch)) { - n = 10 * n + to_digit(ch); + prec = 10 * prec + to_digit(ch); ch = *fmt++; } - prec = n < 0 ? -1 : n; goto reswitch; case '0': /*- @@ -797,86 +834,122 @@ #ifdef HEXFLOAT case 'a': case 'A': + if (ch == 'a') { + ox[1] = 'x'; + xdigs = xdigs_lower; + expchar = 'p'; + } else { + ox[1] = 'X'; + xdigs = xdigs_upper; + expchar = 'P'; + } + /* + * XXX We don't actually have a conversion + * XXX routine for this yet. + */ + if (flags & LONGDBL) { + fparg.ldbl = (double)GETARG(long double); + dtoaresult = cp = + __hldtoa(fparg.ldbl, xdigs, prec, + &expt, &signflag, &dtoaend); + } else { + fparg.dbl = GETARG(double); + dtoaresult = cp = + __hdtoa(fparg.dbl, xdigs, prec, + &expt, &signflag, &dtoaend); + } + goto fp_begin; #endif case 'e': case 'E': - /*- - * Grouping apply to %i, %d, %u, %f, %F, %g, %G - * conversion specifiers only. For other conversions - * behavior is undefined. - * -- POSIX - */ - flags &= ~GROUPING; - /*FALLTHROUGH*/ + expchar = ch; + if (prec < 0) /* account for digit before decpt */ + prec = DEFPREC + 1; + else + prec++; + goto fp_begin; case 'f': case 'F': + expchar = '\0'; goto fp_begin; case 'g': case 'G': + expchar = ch - ('g' - 'e'); if (prec == 0) prec = 1; -fp_begin: if (prec == -1) +fp_begin: + if (prec < 0) prec = DEFPREC; - if (flags & LONGDBL) - /* XXX this loses precision. */ - _double = (double)GETARG(long double); - else - _double = GETARG(double); - /* do this before tricky precision changes */ - if (isinf(_double)) { - if (_double < 0) - sign = '-'; - if (isupper(ch)) - cp = "INF"; - else - cp = "inf"; - size = 3; - break; + if (dtoaresult != NULL) + freedtoa(dtoaresult); + if (flags & LONGDBL) { + fparg.ldbl = GETARG(long double); + dtoaresult = cp = + __ldtoa(&fparg.ldbl, expchar ? 2 : 3, prec, + &expt, &signflag, &dtoaend); + } else { + fparg.dbl = GETARG(double); + dtoaresult = cp = + dtoa(fparg.dbl, expchar ? 2 : 3, prec, + &expt, &signflag, &dtoaend); + if (expt == 9999) + expt = INT_MAX; } - if (isnan(_double)) { - if (isupper(ch)) - cp = "NAN"; - else - cp = "nan"; + if (signflag) + sign = '-'; + if (expt == INT_MAX) { /* inf or nan */ + if (*cp == 'N') { + cp = (ch >= 'a') ? "nan" : "NAN"; + sign = '\0'; + } else + cp = (ch >= 'a') ? "inf" : "INF"; size = 3; break; } flags |= FPT; - if (dtoaresult != NULL) { - __freedtoa(dtoaresult); - dtoaresult = NULL; - } - dtoaresult = cp = cvt(_double, prec, flags, &softsign, - &expt, ch, &ndig); + ndig = dtoaend - cp; if (ch == 'g' || ch == 'G') { - if (expt <= -4 || expt > prec) - ch = (ch == 'g') ? 'e' : 'E'; - else - ch = 'g'; + if (expt > -4 && expt <= prec) { + /* Make %[gG] smell like %[fF] */ + expchar = '\0'; + if (flags & ALT) + prec -= expt; + else + prec = ndig - expt; + if (prec < 0) + prec = 0; + } } - if (ch == 'e' || ch == 'E') { - --expt; - expsize = exponent(expstr, expt, ch); - size = expsize + ndig; - if (ndig > 1 || flags & ALT) + if (expchar) { + expsize = exponent(expstr, expt - 1, expchar); + size = expsize + prec; + if (prec > 1 || flags & ALT) ++size; - } else if (ch == 'f' || ch == 'F') { + } else { if (expt > 0) { size = expt; if (prec || flags & ALT) size += prec + 1; } else /* "0.X" */ size = prec + 2; - } else if (expt >= ndig) { /* fixed g fmt */ - size = expt; - if (flags & ALT) - ++size; - } else - size = ndig + (expt > 0 ? - 1 : 2 - expt); - - if (softsign) - sign = '-'; + if (grouping && expt > 0) { + /* space for thousands' grouping */ + nseps = nrepeats = 0; + lead = expt; + while (*grouping != CHAR_MAX) { + if (lead <= *grouping) + break; + lead -= *grouping; + if (*(grouping+1)) { + nseps++; + grouping++; + } else + nrepeats++; + } + size += nseps + nrepeats; + } else + lead = expt; + } break; #endif /* FLOATING_POINT */ case 'n': @@ -922,9 +995,9 @@ */ ujval = (uintmax_t)(uintptr_t)GETARG(void *); base = 16; - xdigs = "0123456789abcdef"; - flags = flags | INTMAXT | HEXPREFIX; - ch = 'x'; + xdigs = xdigs_lower; + flags = flags | INTMAXT; + ox[1] = 'x'; goto nosign; case 'S': flags |= LONGINT; @@ -976,10 +1049,10 @@ base = 10; goto nosign; case 'X': - xdigs = "0123456789ABCDEF"; + xdigs = xdigs_upper; goto hex; case 'x': - xdigs = "0123456789abcdef"; + xdigs = xdigs_lower; hex: if (flags & INTMAX_SIZE) ujval = UJARG(); @@ -989,7 +1062,7 @@ /* leading 0x/X only if non-zero */ if (flags & ALT && (flags & INTMAX_SIZE ? ujval != 0 : ulval != 0)) - flags |= HEXPREFIX; + ox[1] = ch; flags &= ~GROUPING; /* unsigned conversions */ @@ -1022,6 +1095,8 @@ grouping); } size = buf + BUF - cp; + if (size > BUF) /* should never happen */ + abort(); break; default: /* "%?" prints ?, unless ? is NUL */ if (ch == '\0') @@ -1051,7 +1126,7 @@ realsz = dprec > size ? dprec : size; if (sign) realsz++; - else if (flags & HEXPREFIX) + else if (ox[1]) realsz += 2; prsize = width > realsz ? width : realsz; @@ -1067,9 +1142,8 @@ /* prefix */ if (sign) { PRINT(&sign, 1); - } else if (flags & HEXPREFIX) { + } else if (ox[1]) { /* ox[1] is either x, X, or \0 */ ox[0] = '0'; - ox[1] = ch; PRINT(ox, 2); } @@ -1085,40 +1159,45 @@ if ((flags & FPT) == 0) { PRINT(cp, size); } else { /* glue together f_p fragments */ - if (ch >= 'f') { /* 'f' or 'g' */ - if (_double == 0) { - /* kludge for __dtoa irregularity */ - PRINT("0", 1); - if (expt < ndig || (flags & ALT) != 0) { - PRINT(decimal_point, 1); - PAD(ndig - 1, zeroes); - } - } else if (expt <= 0) { - PRINT("0", 1); - PRINT(decimal_point, 1); + if (!expchar) { /* %[fF] or sufficiently short %[gG] */ + if (expt <= 0) { + buf[0] = '0'; + buf[1] = *decimal_point; + PRINT(buf, 2); PAD(-expt, zeroes); - PRINT(cp, ndig); - } else if (expt >= ndig) { - PRINT(cp, ndig); - PAD(expt - ndig, zeroes); - if (flags & ALT) - PRINT(decimal_point, 1); + /* already handled initial 0's */ + prec += expt; } else { - PRINT(cp, expt); - cp += expt; - PRINT(decimal_point, 1); - PRINT(cp, ndig-expt); + PRINTANDPAD(cp, dtoaend, lead, zeroes); + cp += lead; + if (grouping) { + while (nseps>0 || nrepeats>0) { + if (nrepeats > 0) + nrepeats--; + else { + grouping--; + nseps--; + } + PRINT(&thousands_sep, + 1); >>> TRUNCATED FOR MAIL (1000 lines) <<< From owner-p4-projects@FreeBSD.ORG Sun Apr 6 20:14:46 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id A04B837B404; Sun, 6 Apr 2003 20:14:45 -0700 (PDT) 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 3F67437B401 for ; Sun, 6 Apr 2003 20:14:45 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id D8C5543F3F for ; Sun, 6 Apr 2003 20:14:44 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h373Ei0U015833 for ; Sun, 6 Apr 2003 20:14:44 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h373Eien015830 for perforce@freebsd.org; Sun, 6 Apr 2003 20:14:44 -0700 (PDT) Date: Sun, 6 Apr 2003 20:14:44 -0700 (PDT) Message-Id: <200304070314.h373Eien015830@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28390 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, 07 Apr 2003 03:14:46 -0000 http://perforce.freebsd.org/chv.cgi?CH=28390 Change 28390 by peter@peter_overcee on 2003/04/06 20:14:28 delete bootinfo. print modulep and kernend for good luck at this point. Affected files ... .. //depot/projects/hammer/sys/boot/i386/libi386/elf64_freebsd.c#7 edit Differences ... ==== //depot/projects/hammer/sys/boot/i386/libi386/elf64_freebsd.c#7 (text+ko) ==== @@ -65,10 +65,8 @@ { struct file_metadata *md; Elf_Ehdr *ehdr; - vm_offset_t bootinfop, modulep; + vm_offset_t bootinfop, modulep, kernend; int boothowto, err, bootdev; - struct bootinfo *bi; - vm_offset_t ssym, esym; int i; if ((md = file_findmetadata(fp, MODINFOMD_ELFHDR)) == NULL) @@ -78,16 +76,10 @@ if ((err = bi_load(fp->f_args, &boothowto, &bootdev, &bootinfop, &modulep)) != 0) return(err); - ssym = esym = 0; - if ((md = file_findmetadata(fp, MODINFOMD_SSYM)) != NULL) - ssym = *((vm_offset_t *)&(md->md_data)); - if ((md = file_findmetadata(fp, MODINFOMD_ESYM)) != NULL) - esym = *((vm_offset_t *)&(md->md_data)); - if (ssym == 0 || esym == 0) - ssym = esym = 0; /* sanity */ - bi = (struct bootinfo *)PTOV(bootinfop); - bi->bi_symtab = ssym; /* XXX this is only the primary kernel symtab */ - bi->bi_esymtab = esym; + kernend = 0; + md = file_findmetadata(fp, MODINFOMD_KERNEND); + if (md != NULL) + kernend = *((vm_offset_t *)&(md->md_data)); #define PG_V 0x001 #define PG_RW 0x002 @@ -117,12 +109,14 @@ entry_lo = ehdr->e_entry & 0xffffffff; entry_hi = (ehdr->e_entry >> 32) & 0xffffffff; + printf("modulep: 0x%x\n", modulep); + printf("kernend: 0x%x\n", kernend); #ifdef DEBUG printf("Start @ %#llx ...\n", ehdr->e_entry); #endif dev_cleanup(); - __exec((void *)VTOP(x86_64_tramp), boothowto, bootdev, 0, 0, 0, bootinfop, modulep, bi->bi_kernend); + __exec((void *)VTOP(x86_64_tramp), modulep, kernend); panic("exec returned"); } From owner-p4-projects@FreeBSD.ORG Sun Apr 6 20:16:49 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 2D88B37B404; Sun, 6 Apr 2003 20:16:49 -0700 (PDT) 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 BF51037B401 for ; Sun, 6 Apr 2003 20:16:48 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3A70843F3F for ; Sun, 6 Apr 2003 20:16:48 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h373Gm0U015943 for ; Sun, 6 Apr 2003 20:16:48 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h373GlIx015940 for perforce@freebsd.org; Sun, 6 Apr 2003 20:16:47 -0700 (PDT) Date: Sun, 6 Apr 2003 20:16:47 -0700 (PDT) Message-Id: <200304070316.h373GlIx015940@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28391 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, 07 Apr 2003 03:16:50 -0000 http://perforce.freebsd.org/chv.cgi?CH=28391 Change 28391 by peter@peter_overcee on 2003/04/06 20:15:58 Correct the types if IdleP*. They're physical addresses, not pointers. fix bzero (doh!) tidy up locore rename init386() to hammer_time() start replacing the create_pagetables code from old locore Affected files ... .. //depot/projects/hammer/sys/x86_64/include/pmap.h#14 edit .. //depot/projects/hammer/sys/x86_64/x86_64/locore.s#31 edit .. //depot/projects/hammer/sys/x86_64/x86_64/machdep.c#41 edit .. //depot/projects/hammer/sys/x86_64/x86_64/pmap.c#16 edit Differences ... ==== //depot/projects/hammer/sys/x86_64/include/pmap.h#14 (text+ko) ==== @@ -155,9 +155,9 @@ extern pd_entry_t PTD[]; extern pd_entry_t PTDpde[]; -extern pml4_entry_t *IdlePML4; /* physical address of "Idle" state directory */ -extern pdp_entry_t *IdlePDP; /* physical address of "Idle" state directory */ -extern pd_entry_t *IdlePTD; /* physical address of "Idle" state directory */ +extern u_int64_t IdlePML4; /* physical address of "Idle" state directory */ +extern u_int64_t IdlePDP; /* physical address of "Idle" state directory */ +extern u_int64_t IdlePTD; /* physical address of "Idle" state directory */ #endif #ifdef _KERNEL ==== //depot/projects/hammer/sys/x86_64/x86_64/locore.s#31 (text+ko) ==== @@ -70,6 +70,12 @@ * * This is where the loader trampoline start us, set the ball rolling... * + * We are called with the stack looking like this: + * 0(%rsp) = 32 bit return address + * 4(%rsp) = 32 bit modulep + * 8(%rsp) = 32 bit kernend + * + * We are already in long mode, on a 64 bit %cs and running at KERNBASE. */ NON_GPROF_ENTRY(btext) @@ -82,41 +88,22 @@ call init_serial - movq $str, %rdi - call serial_puts - - movq $prf, %rdi - movl $0x12ab34ef, %esi - xorl %eax, %eax - call printf - /* Find the metadata pointers before we lose them */ - movq 32(%rbp),%rax /* modulep */ + movq %rsp, %rbp + xorq %rax, %rax + movl 4(%rbp),%eax /* modulep */ movq %rax,modulep - movq 36(%rbp),%rax /* kernend */ - movq %rax,KERNend + movl 8(%rbp),%eax /* kernend */ + movq %rax,physfree /* Get onto a stack that we can trust and set up a real frame. */ - movq $HIDENAME(tmpstk),%rsp + movq $bootstack,%rsp pushq %rbp movq %rsp, %rbp - hlt - -str: - .asciz "Hello, World!\n" -prf: - .asciz "This is a number: %#x\n" #if 0 - PING('i'); call identify_cpu - PING('T'); - PING('h'); - PING('e'); - PING('r'); - PING('e'); - /* set up bootstrap stack */ movq proc0kstack,%rax /* location of in-kernel stack */ /* bootstrap stack end location */ @@ -126,24 +113,15 @@ movq IdlePML4,%rsi movq %rsi,(KSTACK_PAGES*PAGE_SIZE-PCB_SIZE+PCB_CR3)(%rax) +#endif - pushq physfree /* value of first for init386(first) */ - call init386 /* wire 386 chip for unix operation */ - - /* - * Clean up the stack in a way that db_numargs() understands, so - * that backtraces in ddb don't underrun the stack. Traps for - * inaccessible memory are more fatal than usual this early. - */ - addq $8,%rsp - + call hammer_time /* set up cpu for unix operation */ call mi_startup /* autoconfiguration, mountroot etc */ - /* NOTREACHED */ - addq $0,%rsp /* for db_numargs() again */ 0: hlt jmp 0b +#if 0 /********************************************************************** * * Identify the CPU and initialize anything special about it @@ -170,28 +148,11 @@ /***********************************************************************/ - .bss - ALIGN_DATA /* just to be sure */ - .globl HIDENAME(tmpstk) - .space 0x1000 /* space for tmpstk - temporary stack */ -HIDENAME(tmpstk): -#if 0 -physfree: .space 4 /* phys addr of next free page */ -KPTphys: .space 4 /* phys addr of kernel page tables */ -p0upa: .space 4 /* phys addr of proc0's UAREA */ -p0kpa: .space 4 /* phys addr of proc0's STACK */ -#endif - #define COMBRD(x) (1843200 / (16*(x))) #define COMCONSOLE 0x3f8 #define CONSPEED 9600 - .text -/* - * void serial_putc(int ch); - * Write character `ch' to port COMCONSOLE. - */ .globl serial_putc .type serial_putc@function serial_putc: @@ -211,11 +172,6 @@ 2: ret -/* - * void init_serial(void); - * Initialize port COMCONSOLE to speed CONSPEED, line settings 8N1. - */ - .globl init_serial .type init_serial@function init_serial: @@ -252,3 +208,8 @@ jne 1b # more ret + + .bss + ALIGN_DATA /* just to be sure */ + .space 0x1000 /* space for bootstack - temporary stack */ +bootstack: ==== //depot/projects/hammer/sys/x86_64/x86_64/machdep.c#41 (text+ko) ==== @@ -110,7 +110,7 @@ #include #include -extern void init386(int first); +extern void hammer_time(void); #if 0 extern void dblfault_handler(void); #endif @@ -134,11 +134,11 @@ int _udatasel, _ucodesel; u_int atdevbase; -/* These are written in 32 bit mode */ -u_int32_t modulep; /* phys addr of metadata table */ -pd_entry_t *IdlePTD; /* phys addr of kernel PTD */ -pdp_entry_t *IdlePDP; /* phys addr of kernel level 3 */ -pml4_entry_t *IdlePML4; /* phys addr of kernel level 4 */ +u_int64_t modulep; /* phys addr of metadata table */ +u_int64_t physfree; /* first free page after kernel */ +u_int64_t IdlePTD; /* phys addr of kernel PTD */ +u_int64_t IdlePDP; /* phys addr of kernel level 3 */ +u_int64_t IdlePML4; /* phys addr of kernel level 4 */ struct user *proc0uarea; /* address of proc 0 uarea space */ vm_offset_t proc0kstack; /* address of proc 0 kstack space */ @@ -736,7 +736,7 @@ * XXX first should be vm_paddr_t. */ static void -getmemsize(int first) +getmemsize(u_int64_t first) { int i, physmap_idx, pa_indx; u_int basemem, extmem; @@ -747,6 +747,7 @@ bzero(physmap, sizeof(physmap)); basemem = 0; + smap = 0; /* * map page 1 R/W into the kernel page table so we can use it @@ -1030,15 +1031,47 @@ avail_end = phys_avail[pa_indx]; } +static u_int64_t +allocpages(int n) +{ + u_int64_t ret; + + ret = physfree; + bzero((void *)ret, n * PAGE_SIZE); + physfree += n * PAGE_SIZE; + return (ret); +} + void -init386(first) - int first; +hammer_time(void) { caddr_t kmdp; int gsel_tss, off, x; struct region_descriptor r_gdt, r_idt; struct pcpu *pc; + u_int64_t p0kpa; + u_int64_t p0upa; + u_int64_t KPTphys; + u_int64_t first; + + first = physfree; +printf("made it to hammer_time! first = 0x%x\n", first); + KPTphys = allocpages(NKPT); + printf("KPTphys = 0x%lx\n", KPTphys); + IdlePML4 = allocpages(1); + printf("IdlePML4 = 0x%lx\n", IdlePML4); + IdlePDP = allocpages(1); + printf("IdlePDP = 0x%lx\n", IdlePDP); + IdlePTD = allocpages(NPGPTD); + printf("IdlePTD = 0x%lx\n", IdlePTD); + p0upa = allocpages(UAREA_PAGES); + printf("p0upa = 0x%lx\n", p0upa); + p0kpa = allocpages(KSTACK_PAGES); + printf("p0kpa = 0x%lx\n", p0kpa); + +for(;;); + proc0.p_uarea = proc0uarea; thread0.td_kstack = proc0kstack; thread0.td_pcb = (struct pcb *) @@ -1192,9 +1225,9 @@ dblfault_tss.tss_ss = dblfault_tss.tss_ss0 = dblfault_tss.tss_ss1 = dblfault_tss.tss_ss2 = GSEL(GDATA_SEL, SEL_KPL); #ifdef PAE - dblfault_tss.tss_cr3 = (int)IdlePDPT; + dblfault_tss.tss_cr3 = IdlePDPT; #else - dblfault_tss.tss_cr3 = (int)IdlePTD; + dblfault_tss.tss_cr3 = IdlePTD; #endif dblfault_tss.tss_eip = (int)dblfault_handler; dblfault_tss.tss_rflags = PSL_KERNEL; @@ -1216,7 +1249,7 @@ /* setup proc 0's pcb */ thread0.td_pcb->pcb_flags = 0; /* XXXKSE */ - thread0.td_pcb->pcb_cr3 = (long)IdlePML4; + thread0.td_pcb->pcb_cr3 = IdlePML4; thread0.td_frame = &proc0_tf; } @@ -1629,7 +1662,7 @@ size_t i; cbuf = (char *)buf; - for (i = len - 1; i >= 0; i--) + for (i = 0; i < len; i++) cbuf[i] = 0; } ==== //depot/projects/hammer/sys/x86_64/x86_64/pmap.c#16 (text+ko) ==== @@ -185,7 +185,6 @@ static int nkpt; vm_offset_t kernel_vm_end; -u_int32_t KERNend; /* Written in 32 bit mode */ static uma_zone_t pdpzone; static uma_zone_t pml4zone; @@ -301,9 +300,9 @@ /* * Initialize the kernel pmap (which is statically allocated). */ - kernel_pmap->pm_pdir = (pd_entry_t *) (KERNBASE + (u_long)IdlePTD); - kernel_pmap->pm_pdp = (pdp_entry_t *) (KERNBASE + (u_long)IdlePDP); - kernel_pmap->pm_pml4 = (pdp_entry_t *) (KERNBASE + (u_long)IdlePML4); + kernel_pmap->pm_pdir = (pd_entry_t *) (KERNBASE + IdlePTD); + kernel_pmap->pm_pdp = (pdp_entry_t *) (KERNBASE + IdlePDP); + kernel_pmap->pm_pml4 = (pdp_entry_t *) (KERNBASE + IdlePML4); kernel_pmap->pm_active = -1; /* don't allow deactivation */ TAILQ_INIT(&kernel_pmap->pm_pvlist); LIST_INIT(&allpmaps); @@ -1012,9 +1011,9 @@ struct pmap *pmap; { - pmap->pm_pdir = (pd_entry_t *)(KERNBASE + (vm_offset_t)IdlePTD); - pmap->pm_pdp = (pdp_entry_t *)(KERNBASE + (vm_offset_t)IdlePDP); - pmap->pm_pml4 = (pml4_entry_t *)(KERNBASE + (vm_offset_t)IdlePML4); + pmap->pm_pdir = (pd_entry_t *)(KERNBASE + IdlePTD); + pmap->pm_pdp = (pdp_entry_t *)(KERNBASE + IdlePDP); + pmap->pm_pml4 = (pml4_entry_t *)(KERNBASE + IdlePML4); pmap->pm_active = 0; TAILQ_INIT(&pmap->pm_pvlist); bzero(&pmap->pm_stats, sizeof pmap->pm_stats); From owner-p4-projects@FreeBSD.ORG Sun Apr 6 20:58:43 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id D330837B404; Sun, 6 Apr 2003 20:58:42 -0700 (PDT) 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 72BC537B401 for ; Sun, 6 Apr 2003 20:58:42 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id F366743FB1 for ; Sun, 6 Apr 2003 20:58:41 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h373wf0U023843 for ; Sun, 6 Apr 2003 20:58:41 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h373wfpU023840 for perforce@freebsd.org; Sun, 6 Apr 2003 20:58:41 -0700 (PDT) Date: Sun, 6 Apr 2003 20:58:41 -0700 (PDT) Message-Id: <200304070358.h373wfpU023840@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28396 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, 07 Apr 2003 03:58:43 -0000 http://perforce.freebsd.org/chv.cgi?CH=28396 Change 28396 by peter@peter_overcee on 2003/04/06 20:57:50 this is a bit gross, but is a replacement for create_pagetables from locore.s. I want to do this differently but this is a useful checkpoint. Affected files ... .. //depot/projects/hammer/sys/x86_64/x86_64/machdep.c#42 edit Differences ... ==== //depot/projects/hammer/sys/x86_64/x86_64/machdep.c#42 (text+ko) ==== @@ -1042,21 +1042,15 @@ return (ret); } -void -hammer_time(void) +static void +create_pagetables(void) { - caddr_t kmdp; - int gsel_tss, off, x; - struct region_descriptor r_gdt, r_idt; - struct pcpu *pc; u_int64_t p0kpa; u_int64_t p0upa; u_int64_t KPTphys; - u_int64_t first; + int i; - first = physfree; -printf("made it to hammer_time! first = 0x%x\n", first); - + /* Allocate pages */ KPTphys = allocpages(NKPT); printf("KPTphys = 0x%lx\n", KPTphys); IdlePML4 = allocpages(1); @@ -1070,6 +1064,63 @@ p0kpa = allocpages(KSTACK_PAGES); printf("p0kpa = 0x%lx\n", p0kpa); + /* Fill in the underlying page table pages */ + /* Read-only from zero to physfree */ + /* XXX not actually used, underneath 2M pages */ + for (i = 0; (i << PAGE_SHIFT) < physfree; i++) { + ((pt_entry_t *)KPTphys)[i] = i << PAGE_SHIFT; + ((pt_entry_t *)KPTphys)[i] |= PG_RW; + } + + /* Map from zero to end of allocations under 2M pages */ + for (i = 0; (i << PDRSHIFT) < physfree; i++) { + ((pd_entry_t *)IdlePTD)[i] = i << PDRSHIFT; + ((pd_entry_t *)IdlePTD)[i] |= PG_RW | PG_V | PG_PS; + } + + /* Now map the page tables at their location within PTmap */ + for (i = 0; i < NKPT; i++) { + ((pd_entry_t *)IdlePTD)[i + KPTDI] = KPTphys + (i << PAGE_SHIFT); + ((pd_entry_t *)IdlePTD)[i + KPTDI] |= PG_RW | PG_V; + } + + /* Now map the PTD at the top of the PTmap (ie: PTD[]) */ + for (i = 0; i < NPGPTD; i++) { + ((pd_entry_t *)IdlePTD)[i + PTDPTDI] = IdlePTD + (i << PAGE_SHIFT); + ((pd_entry_t *)IdlePTD)[i + PTDPTDI] |= PG_RW | PG_V; + } + + /* And connect up the PTD to the PDP */ + /* XXX index 1 == 1GB, where the KERNBASE is for now */ + ((pdp_entry_t *)IdlePDP)[1] = IdlePTD; + ((pdp_entry_t *)IdlePDP)[1] |= PG_RW | PG_V; + + /* And connect up the PDP to the PML4 */ + ((pdp_entry_t *)IdlePML4)[0] = IdlePDP; + ((pdp_entry_t *)IdlePML4)[0] |= PG_RW | PG_V | PG_U; +} + +void +hammer_time(void) +{ + caddr_t kmdp; + int gsel_tss, off, x; + struct region_descriptor r_gdt, r_idt; + struct pcpu *pc; + u_int64_t first; + + first = physfree; +printf("It is hammer_time!\n"); +printf("first = 0x%lx\n", first); + + create_pagetables(); + +printf("got to the end; activating page tables...\n"); + + load_cr3(IdlePML4); + +printf("it worked!\n"); +printf("yippee!\n"); for(;;); proc0.p_uarea = proc0uarea; From owner-p4-projects@FreeBSD.ORG Sun Apr 6 21:15:05 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id B655F37B404; Sun, 6 Apr 2003 21:15:04 -0700 (PDT) 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 5617537B401 for ; Sun, 6 Apr 2003 21:15:04 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id E1BF843FA3 for ; Sun, 6 Apr 2003 21:15:03 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h374F30U025983 for ; Sun, 6 Apr 2003 21:15:03 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h374F3Zp025980 for perforce@freebsd.org; Sun, 6 Apr 2003 21:15:03 -0700 (PDT) Date: Sun, 6 Apr 2003 21:15:03 -0700 (PDT) Message-Id: <200304070415.h374F3Zp025980@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28399 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, 07 Apr 2003 04:15:05 -0000 http://perforce.freebsd.org/chv.cgi?CH=28399 Change 28399 by peter@peter_overcee on 2003/04/06 21:14:16 store the metadata for SSYM/ESYM in native pointer format. ie: 32 bit for elf32, 64 for elf64. Affected files ... .. //depot/projects/hammer/sys/boot/common/load_elf.c#8 edit Differences ... ==== //depot/projects/hammer/sys/boot/common/load_elf.c#8 (text+ko) ==== @@ -244,7 +244,7 @@ size_t resid, chunk; ssize_t result; vm_offset_t dest; - vm_offset_t ssym, esym; + Elf_Addr ssym, esym; Elf_Dyn *dp; Elf_Addr adp; int ndp; From owner-p4-projects@FreeBSD.ORG Sun Apr 6 21:32:28 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 6A70137B404; Sun, 6 Apr 2003 21:32:27 -0700 (PDT) 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 123CE37B401 for ; Sun, 6 Apr 2003 21:32:27 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id DBA2743F3F for ; Sun, 6 Apr 2003 21:32:25 -0700 (PDT) (envelope-from marcel@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h374WP0U027143 for ; Sun, 6 Apr 2003 21:32:25 -0700 (PDT) (envelope-from marcel@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h374WO7o027139 for perforce@freebsd.org; Sun, 6 Apr 2003 21:32:24 -0700 (PDT) Date: Sun, 6 Apr 2003 21:32:24 -0700 (PDT) Message-Id: <200304070432.h374WO7o027139@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 28400 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, 07 Apr 2003 04:32:28 -0000 http://perforce.freebsd.org/chv.cgi?CH=28400 Change 28400 by marcel@marcel_pluto1 on 2003/04/06 21:31:42 IFC @28398 Affected files ... .. //depot/projects/ia64/Makefile.inc1#53 integrate .. //depot/projects/ia64/contrib/gdtoa/gdtoaimp.h#3 integrate .. //depot/projects/ia64/contrib/ipfilter/Makefile#4 integrate .. //depot/projects/ia64/contrib/ipfilter/man/ipmon.8#6 integrate .. //depot/projects/ia64/gnu/usr.bin/binutils/ld/Makefile#6 integrate .. //depot/projects/ia64/gnu/usr.bin/binutils/libiberty/Makefile#6 integrate .. //depot/projects/ia64/kerberos5/lib/libasn1/Makefile#7 integrate .. //depot/projects/ia64/kerberos5/lib/libhdb/Makefile#7 integrate .. //depot/projects/ia64/lib/libc/alpha/_fpmath.h#3 integrate .. //depot/projects/ia64/lib/libc/gdtoa/Makefile.inc#2 integrate .. //depot/projects/ia64/lib/libc/gdtoa/_ldtoa.c#1 branch .. //depot/projects/ia64/lib/libc/i386/_fpmath.h#2 integrate .. //depot/projects/ia64/lib/libc/i386/string/Makefile.inc#3 integrate .. //depot/projects/ia64/lib/libc/i386/string/wcschr.S#1 branch .. //depot/projects/ia64/lib/libc/ia64/_fpmath.h#3 integrate .. //depot/projects/ia64/lib/libc/powerpc/_fpmath.h#2 integrate .. //depot/projects/ia64/lib/libc/sparc64/_fpmath.h#2 integrate .. //depot/projects/ia64/lib/libc/stdio/floatio.h#3 integrate .. //depot/projects/ia64/lib/libc/stdio/vfprintf.c#15 integrate .. //depot/projects/ia64/lib/libc/stdio/vfwprintf.c#4 integrate .. //depot/projects/ia64/lib/libc/stdlib/Makefile.inc#12 integrate .. //depot/projects/ia64/lib/libc/stdtime/strptime.c#8 integrate .. //depot/projects/ia64/lib/libncurses/Makefile#12 integrate .. //depot/projects/ia64/lib/libstand/printf.c#4 integrate .. //depot/projects/ia64/lib/libusbhid/libusbhid.h#2 integrate .. //depot/projects/ia64/lib/libusbhid/parse.c#2 integrate .. //depot/projects/ia64/lib/libusbhid/usage.c#2 integrate .. //depot/projects/ia64/release/picobsd/tinyware/simple_httpd/simple_httpd.c#4 integrate .. //depot/projects/ia64/sbin/ipmon/Makefile#4 integrate .. //depot/projects/ia64/share/man/man4/Makefile#39 integrate .. //depot/projects/ia64/share/man/man4/man4.i386/Makefile#7 integrate .. //depot/projects/ia64/share/man/man4/man4.i386/smapi.4#1 branch .. //depot/projects/ia64/share/man/man4/wi.4#18 integrate .. //depot/projects/ia64/share/man/man4/wlan.4#1 branch .. //depot/projects/ia64/share/mk/bsd.sys.mk#11 integrate .. //depot/projects/ia64/share/termcap/termcap.src#14 integrate .. //depot/projects/ia64/share/timedef/it_IT.ISO8859-1.src#2 integrate .. //depot/projects/ia64/sys/boot/common/bootstrap.h#5 integrate .. //depot/projects/ia64/sys/cam/cam_periph.c#9 integrate .. //depot/projects/ia64/sys/conf/options.i386#14 integrate .. //depot/projects/ia64/sys/dev/ed/if_ed.c#11 integrate .. //depot/projects/ia64/sys/dev/fxp/if_fxp.c#23 integrate .. //depot/projects/ia64/sys/dev/fxp/if_fxpreg.h#4 integrate .. //depot/projects/ia64/sys/dev/usb/usbdevs#29 integrate .. //depot/projects/ia64/sys/dev/usb/usbdevs.h#28 integrate .. //depot/projects/ia64/sys/dev/usb/usbdevs_data.h#28 integrate .. //depot/projects/ia64/sys/dev/usb/uvisor.c#5 integrate .. //depot/projects/ia64/sys/i386/conf/NOTES#36 integrate .. //depot/projects/ia64/sys/i386/i386/mp_clock.c#5 integrate .. //depot/projects/ia64/sys/i386/i386/swtch.s#9 integrate .. //depot/projects/ia64/sys/i386/i386/tsc.c#3 integrate .. //depot/projects/ia64/sys/i386/isa/mca_machdep.c#4 delete .. //depot/projects/ia64/sys/i386/isa/mca_machdep.h#2 delete .. //depot/projects/ia64/sys/i386/isa/vesa.c#7 integrate .. //depot/projects/ia64/sys/ia64/ia64/exception.s#19 integrate .. //depot/projects/ia64/sys/ia64/ia64/locore.s#13 integrate .. //depot/projects/ia64/sys/ia64/ia64/sscdisk.c#13 integrate .. //depot/projects/ia64/sys/kern/kern_physio.c#8 integrate .. //depot/projects/ia64/sys/kern/link_elf.c#17 integrate .. //depot/projects/ia64/sys/kern/vfs_aio.c#30 integrate .. //depot/projects/ia64/sys/kern/vfs_bio.c#46 integrate .. //depot/projects/ia64/sys/pci/if_xl.c#26 integrate .. //depot/projects/ia64/sys/sparc64/include/cpufunc.h#8 integrate .. //depot/projects/ia64/sys/sparc64/include/md_var.h#5 integrate .. //depot/projects/ia64/sys/sparc64/include/pmap.h#16 integrate .. //depot/projects/ia64/sys/sparc64/sparc64/machdep.c#32 integrate .. //depot/projects/ia64/sys/sparc64/sparc64/pmap.c#34 integrate .. //depot/projects/ia64/sys/ufs/ffs/ffs_rawread.c#2 integrate .. //depot/projects/ia64/sys/vm/vm_pager.c#10 integrate .. //depot/projects/ia64/tools/build/Makefile#1 branch .. //depot/projects/ia64/tools/build/Makefile.boot#1 branch .. //depot/projects/ia64/tools/build/dummy.c#1 branch .. //depot/projects/ia64/tools/build/endian.h#1 branch .. //depot/projects/ia64/tools/build/langinfo.h#1 branch .. //depot/projects/ia64/tools/build/progname.c#1 branch .. //depot/projects/ia64/tools/regression/lib/libc/stdio/Makefile#2 integrate .. //depot/projects/ia64/tools/regression/lib/libc/stdio/test-printfloat.c#1 branch .. //depot/projects/ia64/usr.bin/tip/libacu/courier.c#4 integrate .. //depot/projects/ia64/usr.bin/tip/libacu/df.c#3 integrate .. //depot/projects/ia64/usr.bin/tip/libacu/hayes.c#3 integrate .. //depot/projects/ia64/usr.bin/tip/libacu/t3000.c#3 integrate .. //depot/projects/ia64/usr.bin/tip/tip/cmds.c#3 integrate .. //depot/projects/ia64/usr.bin/tip/tip/cmdtab.c#3 integrate .. //depot/projects/ia64/usr.bin/tip/tip/tip.c#3 integrate .. //depot/projects/ia64/usr.bin/tip/tip/tip.h#4 integrate .. //depot/projects/ia64/usr.bin/tip/tip/value.c#3 integrate .. //depot/projects/ia64/usr.bin/xargs/xargs.c#23 integrate .. //depot/projects/ia64/usr.bin/xinstall/Makefile#5 integrate .. //depot/projects/ia64/usr.sbin/ppp/ncpaddr.c#7 integrate .. //depot/projects/ia64/usr.sbin/rtadvd/config.c#6 integrate .. //depot/projects/ia64/usr.sbin/wicontrol/wicontrol.8#11 integrate .. //depot/projects/ia64/usr.sbin/wicontrol/wicontrol.c#11 integrate Differences ... ==== //depot/projects/ia64/Makefile.inc1#53 (text+ko) ==== @@ -1,5 +1,5 @@ # -# $FreeBSD: src/Makefile.inc1,v 1.330 2003/04/01 11:39:04 ru Exp $ +# $FreeBSD: src/Makefile.inc1,v 1.339 2003/04/07 00:01:33 ru Exp $ # # Make command line options: # -DMAKE_KERBEROS5 to build Kerberos5 @@ -159,15 +159,19 @@ # # Building a world goes through the following stages # -# 1. bootstrap-tool stage [BMAKE] +# 1. legacy stage [BMAKE] +# This stage is responsible for creating compatibility +# shims that are needed by the bootstrap-tools, +# build-tools and cross-tools stages. +# 1. bootstrap-tools stage [BMAKE] # This stage is responsible for creating programs that # are needed for backward compatibility reasons. They # are not built as cross-tools. -# 2. build-tool stage [TMAKE] +# 2. build-tools stage [TMAKE] # This stage is responsible for creating the object # tree and building any tools that are needed during # the build process. -# 3. cross-tool stage [XMAKE] +# 3. cross-tools stage [XMAKE] # This stage is responsible for creating any tools that # are needed for cross-builds. A cross-compiler is one # of them. @@ -186,23 +190,24 @@ GROFF_FONT_PATH=${WORLDTMP}/usr/share/groff_font \ GROFF_TMAC_PATH=${WORLDTMP}/usr/share/tmac -# bootstrap-tool stage -BMAKEENV= MAKEOBJDIRPREFIX=${WORLDTMP} \ - DESTDIR= \ - INSTALL="sh ${.CURDIR}/tools/install.sh" -BMAKE= ${BMAKEENV} ${MAKE} -f Makefile.inc1 \ +# bootstrap-tools stage +BMAKEENV= DESTDIR= \ + INSTALL="sh ${.CURDIR}/tools/install.sh" \ + __MAKE_CONF=${.CURDIR}/tools/build/Makefile.boot \ + OLD_MAKE_CONF=${__MAKE_CONF} \ + WORLDTMP=${WORLDTMP} +BMAKE= MAKEOBJDIRPREFIX=${WORLDTMP} \ + ${BMAKEENV} ${MAKE} -f Makefile.inc1 \ BOOTSTRAPPING=${OSRELDATE} \ -DNOHTML -DNOINFO -DNOMAN -DNOPIC -DNOPROFILE -DNOSHARED \ -DNO_CPU_CFLAGS -DNO_WARNS -# build-tool stage -TMAKEENV= MAKEOBJDIRPREFIX=${OBJTREE} \ - DESTDIR= \ - INSTALL="sh ${.CURDIR}/tools/install.sh" -TMAKE= ${TMAKEENV} ${MAKE} -f Makefile.inc1 \ +# build-tools stage +TMAKE= MAKEOBJDIRPREFIX=${OBJTREE} \ + ${BMAKEENV} ${MAKE} -f Makefile.inc1 \ BOOTSTRAPPING=${OSRELDATE} -DNO_CPU_CFLAGS -DNO_WARNS -# cross-tool stage +# cross-tools stage XMAKE= TOOLS_PREFIX=${WORLDTMP} ${BMAKE} -DNO_FORTRAN -DNO_GDB # world stage @@ -264,6 +269,7 @@ .if !defined(NOCLEAN) rm -rf ${WORLDTMP} .else + rm -rf ${WORLDTMP}/legacy/usr/include # XXX - These two can depend on any header file. rm -f ${OBJTREE}${.CURDIR}/usr.bin/kdump/ioctl.c rm -f ${OBJTREE}${.CURDIR}/usr.bin/truss/ioctl.c @@ -275,6 +281,15 @@ mkdir -p ${WORLDTMP}/usr/include/${_dir} .endfor ln -sf ${.CURDIR}/sys ${WORLDTMP} +.for _dir in lib include/sys + mkdir -p ${WORLDTMP}/legacy/usr/${_dir} +.endfor +_legacy: + @echo + @echo "--------------------------------------------------------------" + @echo ">>> stage 1: legacy release compatibility shims" + @echo "--------------------------------------------------------------" + cd ${.CURDIR}; ${BMAKE} legacy _bootstrap-tools: @echo @echo "--------------------------------------------------------------" @@ -335,7 +350,7 @@ WMAKE_TGTS= .if !defined(SUBDIR_OVERRIDE) -WMAKE_TGTS+= _worldtmp _bootstrap-tools +WMAKE_TGTS+= _worldtmp _legacy _bootstrap-tools .endif WMAKE_TGTS+= _cleanobj _obj _build-tools .if !defined(SUBDIR_OVERRIDE) @@ -603,6 +618,19 @@ # # +# legacy: Build compatibility shims for the next three targets +# +legacy: +.for _tool in tools/build + @${ECHODIR} "===> ${_tool}"; \ + cd ${.CURDIR}/${_tool}; \ + ${MAKE} DIRPRFX=${_tool}/ obj; \ + ${MAKE} DIRPRFX=${_tool}/ depend; \ + ${MAKE} DIRPRFX=${_tool}/ all; \ + ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy install +.endfor + +# # bootstrap-tools: Build tools needed for compatibility # .if exists(${.CURDIR}/games) && !defined(NOGAMES) @@ -615,7 +643,7 @@ usr.bin/xargs usr.bin/xinstall \ usr.sbin/config usr.sbin/kbdcontrol \ gnu/usr.bin/gperf gnu/usr.bin/groff gnu/usr.bin/texinfo - ${ECHODIR} "===> ${_tool}"; \ + @${ECHODIR} "===> ${_tool}"; \ cd ${.CURDIR}/${_tool}; \ ${MAKE} DIRPRFX=${_tool}/ obj; \ ${MAKE} DIRPRFX=${_tool}/ depend; \ @@ -648,7 +676,7 @@ .for _tool in bin/csh bin/sh gnu/usr.bin/cc/cc_tools ${_fortran} \ ${_libkrb5} lib/libncurses ${_share} \ ${_aicasm} usr.bin/awk usr.bin/file usr.sbin/sysinstall - ${ECHODIR} "===> ${_tool}"; \ + @${ECHODIR} "===> ${_tool}"; \ cd ${.CURDIR}/${_tool}; \ ${MAKE} DIRPRFX=${_tool}/ obj; \ ${MAKE} DIRPRFX=${_tool}/ build-tools @@ -682,7 +710,7 @@ .for _tool in ${_btxld} ${_elf2aout} ${_elf2exe} \ gnu/usr.bin/binutils ${_crunchide} \ gnu/usr.bin/cc ${_xlint} ${_kgzip} - ${ECHODIR} "===> ${_tool}"; \ + @${ECHODIR} "===> ${_tool}"; \ cd ${.CURDIR}/${_tool}; \ ${MAKE} DIRPRFX=${_tool}/ obj; \ ${MAKE} DIRPRFX=${_tool}/ depend; \ @@ -764,7 +792,7 @@ .for _lib in ${_startup_libs} ${_prebuild_libs:Nlib/libpam} ${_generic_libs} ${_lib}__L: .PHONY .if exists(${.CURDIR}/${_lib}) - ${ECHODIR} "===> ${_lib}"; \ + @${ECHODIR} "===> ${_lib}"; \ cd ${.CURDIR}/${_lib}; \ ${MAKE} DIRPRFX=${_lib}/ depend; \ ${MAKE} DIRPRFX=${_lib}/ all; \ @@ -776,7 +804,7 @@ # static PAM library, and dynamic PAM library before dynamic PAM # modules. lib/libpam__L: .PHONY - ${ECHODIR} "===> lib/libpam"; \ + @${ECHODIR} "===> lib/libpam"; \ cd ${.CURDIR}/lib/libpam; \ ${MAKE} DIRPRFX=lib/libpam/ depend; \ ${MAKE} DIRPRFX=lib/libpam/ -D_NO_LIBPAM_SO_YET all; \ ==== //depot/projects/ia64/contrib/gdtoa/gdtoaimp.h#3 (text+ko) ==== @@ -26,7 +26,7 @@ ****************************************************************/ -/* $FreeBSD: src/contrib/gdtoa/gdtoaimp.h,v 1.3 2003/03/19 20:25:45 das Exp $ */ +/* $FreeBSD: src/contrib/gdtoa/gdtoaimp.h,v 1.4 2003/04/05 22:09:26 das Exp $ */ /* This is a variation on dtoa.c that converts arbitary binary floating-point formats to and from decimal notation. It uses @@ -600,6 +600,8 @@ extern Bigint *diff ANSI((Bigint*, Bigint*)); extern char *dtoa ANSI((double d, int mode, int ndigits, int *decpt, int *sign, char **rve)); + extern char *gdtoa ANSI((FPI *fpi, int be, ULong *bits, int *kindp, + int mode, int ndigits, int *decpt, char **rve)); extern char *g__fmt ANSI((char*, char*, char*, int, ULong)); extern int gethex ANSI((CONST char**, FPI*, Long*, Bigint**, int)); extern void hexdig_init_D2A(Void); ==== //depot/projects/ia64/contrib/ipfilter/Makefile#4 (text+ko) ==== @@ -3,6 +3,7 @@ # # See the IPFILTER.LICENCE file for details on licencing. # +# $FreeBSD: src/contrib/ipfilter/Makefile,v 1.2 2003/04/05 09:25:19 darrenr Exp $ # $Id: Makefile,v 2.11.2.15 2002/12/02 04:22:56 darrenr Exp $ # BINDEST=/usr/local/bin @@ -29,7 +30,7 @@ # # The facility you wish to log messages from ipmon to syslogd with. # -LOGFAC=-DLOGFAC=LOG_LOCAL0 +LOGFAC=-DLOGFAC=LOG_SECURITY # # Uncomment the next 3 lines if you want to view the state table a la top(1) ==== //depot/projects/ia64/contrib/ipfilter/man/ipmon.8#6 (text+ko) ==== @@ -1,4 +1,4 @@ -.\" $FreeBSD: src/contrib/ipfilter/man/ipmon.8,v 1.12 2003/02/15 06:32:48 darrenr Exp $ +.\" $FreeBSD: src/contrib/ipfilter/man/ipmon.8,v 1.13 2003/04/05 21:12:58 darrenr Exp $ .TH ipmon 8 .SH NAME ipmon \- monitors /dev/ipl for logged packets @@ -126,7 +126,7 @@ .B \-s Packet information read in will be sent through syslogd rather than saved to a file. The default facility when compiled and installed is -\fBlocal0\fP. The following levels are used: +\fBsecurity\fP. The following levels are used: .IP .B LOG_INFO \- packets logged using the "log" keyword as the action rather ==== //depot/projects/ia64/gnu/usr.bin/binutils/ld/Makefile#6 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/gnu/usr.bin/binutils/ld/Makefile,v 1.23 2002/07/29 09:40:08 ru Exp $ +# $FreeBSD: src/gnu/usr.bin/binutils/ld/Makefile,v 1.24 2003/04/05 20:30:29 imp Exp $ .include "../Makefile.inc0" @@ -10,20 +10,12 @@ ldgram.y ldlang.c ldlex.l ldmain.c ldmisc.c \ ldver.c ldwrite.c lexsup.c mri.c -.if defined(BOOTSTRAPPING) && !exists(/usr/include/elf-hints.h) -SRCS+= elf-hints.h -CLEANFILES+= elf-hints.h - -elf-hints.h: - ln -sf ${.CURDIR}/../../../../include/${.TARGET} . -.endif - WARNS= 1 CFLAGS+= -DSCRIPTDIR=\"${TOOLS_PREFIX}/usr/libdata\" CFLAGS+= -DBFD_VERSION_STRING=\"${VERSION}\" CFLAGS+= -I${SRCDIR}/ld -I${SRCDIR}/bfd NOSHARED?= yes -DPADD= ${RELTOP}/libbfd/libbfd.a +DPADD+= ${RELTOP}/libbfd/libbfd.a DPADD+= ${RELTOP}/libiberty/libiberty.a LDADD= ${DPADD} CLEANDIRS+= ldscripts ==== //depot/projects/ia64/gnu/usr.bin/binutils/libiberty/Makefile#6 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/gnu/usr.bin/binutils/libiberty/Makefile,v 1.17 2002/11/13 13:49:29 ru Exp $ +# $FreeBSD: src/gnu/usr.bin/binutils/libiberty/Makefile,v 1.18 2003/04/05 20:30:29 imp Exp $ .include "../Makefile.inc0" @@ -10,11 +10,6 @@ hex.c floatformat.c hashtab.c lbasename.c make-temp-file.c \ objalloc.c obstack.c safe-ctype.c xatexit.c xexit.c xmalloc.c \ xstrdup.c xstrerror.c -.if defined(BOOTSTRAPPING) && \ - ( ${BOOTSTRAPPING} < 440000 || \ - ( ${BOOTSTRAPPING} >= 500000 && ${BOOTSTRAPPING} < 500022 )) -SRCS+= basename.c -.endif WARNS= 1 CFLAGS+= -DHAVE_CONFIG_H INTERNALLIB= true ==== //depot/projects/ia64/kerberos5/lib/libasn1/Makefile#7 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/kerberos5/lib/libasn1/Makefile,v 1.17 2002/11/13 13:49:29 ru Exp $ +# $FreeBSD: src/kerberos5/lib/libasn1/Makefile,v 1.18 2003/04/05 20:30:29 imp Exp $ LIB= asn1 CFLAGS+=-I${KRB5DIR}/include \ @@ -104,13 +104,7 @@ print_version.o \ get_window_size.c \ strupr.c - ${CC} ${CFLAGS} ${.OODATE} -o ${.TARGET} - -.if defined(BOOTSTRAPPING) && \ - ( ${BOOTSTRAPPING} < 440001 || \ - ( ${BOOTSTRAPPING} >= 500000 && ${BOOTSTRAPPING} < 500023 )) -asn1_compile: getprogname.c setprogname.c -.endif + ${CC} ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${.OODATE} ${LDADD} parse.o: parse.c roken.h ==== //depot/projects/ia64/kerberos5/lib/libhdb/Makefile#7 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/kerberos5/lib/libhdb/Makefile,v 1.10 2002/11/13 13:49:29 ru Exp $ +# $FreeBSD: src/kerberos5/lib/libhdb/Makefile,v 1.11 2003/04/05 20:30:29 imp Exp $ LIB= hdb CFLAGS+=-I${KRB5DIR}/include \ @@ -59,13 +59,7 @@ gen_encode.c gen_decode.c gen_free.c gen_length.c \ gen_copy.c gen_glue.c getarg.c warnerr.c print_version.o \ get_window_size.c strupr.c - ${CC} ${CFLAGS} ${.OODATE} -o ${.TARGET} - -.if defined(BOOTSTRAPPING) && \ - ( ${BOOTSTRAPPING} < 440001 || \ - ( ${BOOTSTRAPPING} >= 500000 && ${BOOTSTRAPPING} < 500023 )) -asn1_compile: getprogname.c setprogname.c -.endif + ${CC} ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${.OODATE} ${LDADD} parse.o: parse.c ==== //depot/projects/ia64/lib/libc/alpha/_fpmath.h#3 (text+ko) ==== @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/lib/libc/alpha/_fpmath.h,v 1.2 2003/02/11 15:19:31 des Exp $ + * $FreeBSD: src/lib/libc/alpha/_fpmath.h,v 1.3 2003/04/05 22:10:13 das Exp $ */ union IEEEl2bits { @@ -37,3 +37,9 @@ }; #define mask_nbit_l(u) ((void)0) +#define LDBL_IMPLICIT_NBIT + +#define LDBL_TO_ARRAY32(u, a) do { \ + (a)[0] = (uint32_t)(u).bits.manl; \ + (a)[1] = (uint32_t)(u).bits.manh; \ +} while(0) ==== //depot/projects/ia64/lib/libc/gdtoa/Makefile.inc#2 (text+ko) ==== @@ -1,9 +1,9 @@ -# $FreeBSD: src/lib/libc/gdtoa/Makefile.inc,v 1.2 2003/03/13 18:55:14 obrien Exp $ +# $FreeBSD: src/lib/libc/gdtoa/Makefile.inc,v 1.3 2003/04/05 22:10:13 das Exp $ # netlib gdtoa sources .PATH: ${.CURDIR}/gdtoa -MISRCS+=glue.c +MISRCS+=_ldtoa.c glue.c GDTOASRCS=dmisc.c dtoa.c gdtoa.c gethex.c gmisc.c \ hd_init.c hexnan.c misc.c smisc.c \ strtoIg.c strtod.c strtodg.c strtof.c strtord.c sum.c ulp.c ==== //depot/projects/ia64/lib/libc/i386/_fpmath.h#2 (text+ko) ==== @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/lib/libc/i386/_fpmath.h,v 1.1 2003/02/08 20:37:52 mike Exp $ + * $FreeBSD: src/lib/libc/i386/_fpmath.h,v 1.2 2003/04/05 22:10:13 das Exp $ */ union IEEEl2bits { @@ -38,3 +38,8 @@ }; #define mask_nbit_l(u) ((u).bits.manh &= 0x7fffffff) + +#define LDBL_TO_ARRAY32(u, a) do { \ + (a)[0] = (uint32_t)(u).bits.manl; \ + (a)[1] = (uint32_t)(u).bits.manh; \ +} while(0) ==== //depot/projects/ia64/lib/libc/i386/string/Makefile.inc#3 (text+ko) ==== @@ -1,6 +1,7 @@ # @(#)Makefile.inc 8.1 (Berkeley) 6/4/93 -# $FreeBSD: src/lib/libc/i386/string/Makefile.inc,v 1.12 2003/03/14 11:01:12 tjr Exp $ +# $FreeBSD: src/lib/libc/i386/string/Makefile.inc,v 1.13 2003/04/05 04:17:05 tjr Exp $ MDSRCS+=bcmp.S bcopy.S bzero.S ffs.S index.S memchr.S memcmp.S memcpy.S \ memmove.S memset.S rindex.S strcat.S strchr.S strcmp.S strcpy.S \ - strlen.S strncmp.S strrchr.S swab.S wcscmp.S wcslen.S wmemchr.S + strlen.S strncmp.S strrchr.S swab.S wcschr.S wcscmp.S wcslen.S \ + wmemchr.S ==== //depot/projects/ia64/lib/libc/ia64/_fpmath.h#3 (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/ia64/_fpmath.h,v 1.2 2003/02/26 16:04:34 mike Exp $ + * $FreeBSD: src/lib/libc/ia64/_fpmath.h,v 1.3 2003/04/05 22:10:13 das Exp $ */ #include @@ -53,3 +53,8 @@ #else /* _BIG_ENDIAN */ #define mask_nbit_l(u) ((u).bits.manh &= 0xffffff7f) #endif + +#define LDBL_TO_ARRAY32(u, a) do { \ + (a)[0] = (uint32_t)(u).bits.manl; \ + (a)[1] = (uint32_t)(u).bits.manh; \ +} while(0) ==== //depot/projects/ia64/lib/libc/powerpc/_fpmath.h#2 (text+ko) ==== @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/lib/libc/powerpc/_fpmath.h,v 1.1 2003/02/08 20:37:53 mike Exp $ + * $FreeBSD: src/lib/libc/powerpc/_fpmath.h,v 1.2 2003/04/05 22:10:13 das Exp $ */ union IEEEl2bits { @@ -38,3 +38,11 @@ /* XXX does powerpc have a normalization bit? */ #define mask_nbit_l(u) ((void)0) +#define LDBL_IMPLICIT_NBIT + +#define LDBL_TO_ARRAY32(u, a) do { \ + (a)[0] = (uint32_t)(u).bits.manl; \ + (a)[1] = (uint32_t)((u).bits.manl >> 32); \ + (a)[2] = (uint32_t)(u).bits.manh; \ + (a)[3] = (uint32_t)((u).bits.manh >> 32); \ +} while(0) ==== //depot/projects/ia64/lib/libc/sparc64/_fpmath.h#2 (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/sparc64/_fpmath.h,v 1.1 2003/02/08 20:37:54 mike Exp $ + * $FreeBSD: src/lib/libc/sparc64/_fpmath.h,v 1.2 2003/04/05 22:10:13 das Exp $ */ union IEEEl2bits { @@ -38,3 +38,11 @@ }; #define mask_nbit_l(u) ((void)0) +#define LDBL_IMPLICIT_NBIT + +#define LDBL_TO_ARRAY32(u, a) do { \ + (a)[0] = (uint32_t)(u).bits.manl; \ + (a)[1] = (uint32_t)((u).bits.manl >> 32); \ + (a)[2] = (uint32_t)(u).bits.manh; \ + (a)[3] = (uint32_t)((u).bits.manh >> 32); \ +} while(0) ==== //depot/projects/ia64/lib/libc/stdio/floatio.h#3 (text+ko) ==== @@ -34,14 +34,23 @@ * SUCH DAMAGE. * * @(#)floatio.h 8.1 (Berkeley) 6/4/93 - * $FreeBSD: src/lib/libc/stdio/floatio.h,v 1.2 2002/03/22 23:42:01 obrien Exp $ + * $FreeBSD: src/lib/libc/stdio/floatio.h,v 1.4 2003/04/05 22:11:42 das Exp $ */ /* * Floating point scanf/printf (input/output) definitions. */ -/* 11-bit exponent (VAX G floating point) is 308 decimal digits */ -#define MAXEXP 308 -/* 128 bit fraction takes up 39 decimal digits; max reasonable precision */ -#define MAXFRACT 39 +/* + * MAXEXPDIG is the maximum number of decimal digits needed to store a + * floating point exponent in the largest supported format. It should + * be ceil(log10(LDBL_MAX_10_EXP)) or, if hexadecimal floating point + * conversions are supported, ceil(log10(LDBL_MAX_EXP)). But since it + * is presently never greater than 5 in practice, we fudge it. + */ +#define MAXEXPDIG 6 +#if LDBL_MAX_EXP > 999999 +#error "floating point buffers too small" +#endif + +char *__ldtoa(long double *, int, int, int *, int *, char **); ==== //depot/projects/ia64/lib/libc/stdio/vfprintf.c#15 (text+ko) ==== @@ -38,7 +38,7 @@ static char sccsid[] = "@(#)vfprintf.c 8.1 (Berkeley) 6/4/93"; #endif /* LIBC_SCCS and not lint */ #include -__FBSDID("$FreeBSD: src/lib/libc/stdio/vfprintf.c,v 1.52 2003/03/14 04:48:09 das Exp $"); +__FBSDID("$FreeBSD: src/lib/libc/stdio/vfprintf.c,v 1.57 2003/04/07 03:17:39 ache Exp $"); /* * Actual printf innards. @@ -111,9 +111,9 @@ static int __sprint(FILE *, struct __suio *); static int __sbprintf(FILE *, const char *, va_list) __printflike(2, 0); -static char *__ujtoa(uintmax_t, char *, int, int, char *, int, char, +static char *__ujtoa(uintmax_t, char *, int, int, const char *, int, char, const char *); -static char *__ultoa(u_long, char *, int, int, char *, int, char, +static char *__ultoa(u_long, char *, int, int, const char *, int, char, const char *); static char *__wcsconv(wchar_t *, int); static void __find_arguments(const char *, va_list, union arg **); @@ -185,7 +185,7 @@ * use the given digits. */ static char * -__ultoa(u_long val, char *endp, int base, int octzero, char *xdigs, +__ultoa(u_long val, char *endp, int base, int octzero, const char *xdigs, int needgrp, char thousep, const char *grp) { char *cp = endp; @@ -262,7 +262,7 @@ /* Identical to __ultoa, but for intmax_t. */ static char * -__ujtoa(uintmax_t val, char *endp, int base, int octzero, char *xdigs, +__ujtoa(uintmax_t val, char *endp, int base, int octzero, const char *xdigs, int needgrp, char thousep, const char *grp) { char *cp = endp; @@ -384,9 +384,11 @@ break; mbp += clen; } + if (clen == (size_t)-1) { + free(convbuf); + return (NULL); + } *mbp = '\0'; - if (clen == (size_t)-1) - return (NULL); return (convbuf); } @@ -407,23 +409,29 @@ } #ifdef FLOATING_POINT + +#define dtoa __dtoa +#define freedtoa __freedtoa + +#include #include #include "floatio.h" +#include "gdtoa.h" -#define BUF ((MAXEXP*2)+MAXFRACT+1) /* + decimal point */ #define DEFPREC 6 -extern char *__dtoa(double, int, int, int *, int *, char **); -extern void __freedtoa(char *s); - -static char *cvt(double, int, int, char *, int *, int, int *); static int exponent(char *, int, int); -#else /* no FLOATING_POINT */ +#endif /* FLOATING_POINT */ -#define BUF 136 - -#endif /* FLOATING_POINT */ +/* + * The size of the buffer we use as scratch space for integer + * conversions, among other things. Technically, we would need the + * most space for base 10 conversions with thousands' grouping + * characters between each pair of digits. 100 bytes is a + * conservative overestimate even for a 128-bit uintmax_t. + */ +#define BUF 100 #define STATIC_ARG_TBL_SIZE 8 /* Size of static argument table. */ @@ -431,7 +439,6 @@ * Flags used during conversion. */ #define ALT 0x001 /* alternate form */ -#define HEXPREFIX 0x002 /* add 0x or 0X prefix */ #define LADJUST 0x004 /* left adjustment */ #define LONGDBL 0x008 /* long double */ #define LONGINT 0x010 /* long integer */ @@ -460,19 +467,41 @@ int flags; /* flags as above */ int ret; /* return value accumulator */ int width; /* width from format (%8d), or 0 */ - int prec; /* precision from format (%.3d), or -1 */ + int prec; /* precision from format; <0 for N/A */ char sign; /* sign prefix (' ', '+', '-', or \0) */ char thousands_sep; /* locale specific thousands separator */ const char *grouping; /* locale specific numeric grouping rules */ #ifdef FLOATING_POINT + /* + * We can decompose the printed representation of floating + * point numbers into several parts, some of which may be empty: + * + * [+|-| ] [0x|0X] MMM . NNN [e|E|p|P] [+|-] ZZ + * A B ---C--- D E F + * + * A: 'sign' holds this value if present; '\0' otherwise + * B: ox[1] holds the 'x' or 'X'; '\0' if not hexadecimal + * C: cp points to the string MMMNNN. Leading and trailing + * zeros are not in the string and must be added. + * D: expchar holds this character; '\0' if no exponent, e.g. %f + * F: at least two digits for decimal, at least one digit for hex + */ char *decimal_point; /* locale specific decimal point */ - char softsign; /* temporary negative sign for floats */ - double _double; /* double precision arguments %[eEfgG] */ + int signflag; /* true if float is negative */ + union { /* floating point arguments %[aAeEfFgG] */ + double dbl; + long double ldbl; + } fparg; int expt; /* integer value of exponent */ + char expchar; /* exponent character: [eEpP\0] */ + char *dtoaend; /* pointer to end of converted digits */ int expsize; /* character count for expstr */ - int ndig; /* actual number of digits returned by cvt */ - char expstr[7]; /* buffer for exponent string */ + int lead; /* sig figs before decimal or group sep */ + int ndig; /* actual number of digits returned by dtoa */ + char expstr[MAXEXPDIG+2]; /* buffer for exponent string: e+ZZZ */ char *dtoaresult; /* buffer allocated by dtoa */ + int nseps; /* number of group separators with ' */ + int nrepeats; /* number of repeats of the last group */ #endif u_long ulval; /* integer arguments %[diouxX] */ uintmax_t ujval; /* %j, %ll, %q, %t, %z integers */ @@ -481,12 +510,12 @@ int realsz; /* field size expanded by dprec, sign, etc */ int size; /* size of converted field or string */ int prsize; /* max size of printed field */ - char *xdigs; /* digits for [xX] conversion */ + const char *xdigs; /* digits for %[xX] conversion */ #define NIOV 8 struct __suio uio; /* output information: summary */ struct __siov iov[NIOV];/* ... and individual io vectors */ - char buf[BUF]; /* space for %c, %[diouxX], %[eEfFgG] */ - char ox[2]; /* space for 0x hex-prefix */ + char buf[BUF]; /* buffer with space for digits of uintmax_t */ + char ox[2]; /* space for 0x; ox[1] is either x, X, or \0 */ union arg *argtable; /* args, built due to positional arg */ union arg statargtable [STATIC_ARG_TBL_SIZE]; int nextarg; /* 1-based argument index */ @@ -504,6 +533,9 @@ static char zeroes[PADSIZE] = {'0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0'}; + static const char xdigs_lower[16] = "0123456789abcdef"; + static const char xdigs_upper[16] = "0123456789ABCDEF"; + /* * BEWARE, these `goto error' on error, and PAD uses `n'. */ @@ -527,6 +559,14 @@ PRINT(with, n); \ } \ } +#define PRINTANDPAD(p, ep, len, with) do { \ + n2 = (ep) - (p); \ + if (n2 > (len)) \ + n2 = (len); \ + if (n2 > 0) \ + PRINT((p), n2); \ + PAD((len) - (n2 > 0 ? n2 : 0), (with)); \ +} while(0) #define FLUSH() { \ if (uio.uio_resid && __sprint(fp, &uio)) \ goto error; \ @@ -643,6 +683,7 @@ width = 0; prec = -1; sign = '\0'; + ox[1] = '\0'; rflag: ch = *fmt++; reswitch: switch (ch) { @@ -683,16 +724,14 @@ goto rflag; case '.': if ((ch = *fmt++) == '*') { - GETASTER (n); - prec = n < 0 ? -1 : n; + GETASTER (prec); goto rflag; } - n = 0; + prec = 0; while (is_digit(ch)) { - n = 10 * n + to_digit(ch); + prec = 10 * prec + to_digit(ch); ch = *fmt++; } - prec = n < 0 ? -1 : n; goto reswitch; case '0': /*- @@ -797,86 +836,122 @@ #ifdef HEXFLOAT case 'a': case 'A': + if (ch == 'a') { + ox[1] = 'x'; + xdigs = xdigs_lower; + expchar = 'p'; + } else { + ox[1] = 'X'; + xdigs = xdigs_upper; + expchar = 'P'; + } + /* + * XXX We don't actually have a conversion + * XXX routine for this yet. + */ + if (flags & LONGDBL) { + fparg.ldbl = (double)GETARG(long double); + dtoaresult = cp = + __hldtoa(fparg.ldbl, xdigs, prec, + &expt, &signflag, &dtoaend); + } else { + fparg.dbl = GETARG(double); + dtoaresult = cp = + __hdtoa(fparg.dbl, xdigs, prec, + &expt, &signflag, &dtoaend); + } + goto fp_begin; #endif case 'e': case 'E': - /*- - * Grouping apply to %i, %d, %u, %f, %F, %g, %G - * conversion specifiers only. For other conversions - * behavior is undefined. - * -- POSIX - */ - flags &= ~GROUPING; - /*FALLTHROUGH*/ + expchar = ch; + if (prec < 0) /* account for digit before decpt */ + prec = DEFPREC + 1; + else + prec++; + goto fp_begin; case 'f': case 'F': + expchar = '\0'; goto fp_begin; case 'g': case 'G': + expchar = ch - ('g' - 'e'); if (prec == 0) prec = 1; -fp_begin: if (prec == -1) +fp_begin: + if (prec < 0) prec = DEFPREC; - if (flags & LONGDBL) - /* XXX this loses precision. */ - _double = (double)GETARG(long double); - else - _double = GETARG(double); - /* do this before tricky precision changes */ - if (isinf(_double)) { - if (_double < 0) - sign = '-'; - if (isupper(ch)) - cp = "INF"; - else - cp = "inf"; - size = 3; - break; + if (dtoaresult != NULL) + freedtoa(dtoaresult); + if (flags & LONGDBL) { + fparg.ldbl = GETARG(long double); + dtoaresult = cp = + __ldtoa(&fparg.ldbl, expchar ? 2 : 3, prec, + &expt, &signflag, &dtoaend); + } else { + fparg.dbl = GETARG(double); + dtoaresult = cp = + dtoa(fparg.dbl, expchar ? 2 : 3, prec, + &expt, &signflag, &dtoaend); + if (expt == 9999) + expt = INT_MAX; } - if (isnan(_double)) { - if (isupper(ch)) - cp = "NAN"; - else - cp = "nan"; + if (signflag) + sign = '-'; + if (expt == INT_MAX) { /* inf or nan */ + if (*cp == 'N') { + cp = (ch >= 'a') ? "nan" : "NAN"; + sign = '\0'; + } else + cp = (ch >= 'a') ? "inf" : "INF"; size = 3; break; } flags |= FPT; - if (dtoaresult != NULL) { - __freedtoa(dtoaresult); - dtoaresult = NULL; - } - dtoaresult = cp = cvt(_double, prec, flags, &softsign, - &expt, ch, &ndig); + ndig = dtoaend - cp; if (ch == 'g' || ch == 'G') { - if (expt <= -4 || expt > prec) - ch = (ch == 'g') ? 'e' : 'E'; - else - ch = 'g'; + if (expt > -4 && expt <= prec) { + /* Make %[gG] smell like %[fF] */ + expchar = '\0'; + if (flags & ALT) + prec -= expt; + else + prec = ndig - expt; + if (prec < 0) + prec = 0; + } } - if (ch == 'e' || ch == 'E') { - --expt; - expsize = exponent(expstr, expt, ch); - size = expsize + ndig; - if (ndig > 1 || flags & ALT) + if (expchar) { + expsize = exponent(expstr, expt - 1, expchar); + size = expsize + prec; + if (prec > 1 || flags & ALT) ++size; - } else if (ch == 'f' || ch == 'F') { + } else { if (expt > 0) { size = expt; if (prec || flags & ALT) size += prec + 1; } else /* "0.X" */ size = prec + 2; - } else if (expt >= ndig) { /* fixed g fmt */ - size = expt; - if (flags & ALT) - ++size; - } else - size = ndig + (expt > 0 ? - 1 : 2 - expt); - - if (softsign) - sign = '-'; + if (grouping && expt > 0) { + /* space for thousands' grouping */ + nseps = nrepeats = 0; + lead = expt; + while (*grouping != CHAR_MAX) { + if (lead <= *grouping) + break; + lead -= *grouping; + if (*(grouping+1)) { + nseps++; + grouping++; + } else + nrepeats++; + } + size += nseps + nrepeats; + } else + lead = expt; + } break; #endif /* FLOATING_POINT */ case 'n': @@ -922,9 +997,9 @@ */ ujval = (uintmax_t)(uintptr_t)GETARG(void *); base = 16; - xdigs = "0123456789abcdef"; >>> TRUNCATED FOR MAIL (1000 lines) <<< From owner-p4-projects@FreeBSD.ORG Sun Apr 6 21:33:30 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 0480F37B404; Sun, 6 Apr 2003 21:33:30 -0700 (PDT) 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 936D937B401 for ; Sun, 6 Apr 2003 21:33:29 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 602D743FA3 for ; Sun, 6 Apr 2003 21:33:28 -0700 (PDT) (envelope-from marcel@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h374XS0U027983 for ; Sun, 6 Apr 2003 21:33:28 -0700 (PDT) (envelope-from marcel@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h374XRGj027978 for perforce@freebsd.org; Sun, 6 Apr 2003 21:33:27 -0700 (PDT) Date: Sun, 6 Apr 2003 21:33:27 -0700 (PDT) Message-Id: <200304070433.h374XRGj027978@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 28401 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, 07 Apr 2003 04:33:31 -0000 http://perforce.freebsd.org/chv.cgi?CH=28401 Change 28401 by marcel@marcel_pluto1 on 2003/04/06 21:33:21 IFia64 Affected files ... .. //depot/projects/ia64_epc/Makefile.inc1#7 integrate .. //depot/projects/ia64_epc/contrib/gcc/ifcvt.c#3 integrate .. //depot/projects/ia64_epc/contrib/gdtoa/gdtoaimp.h#2 integrate .. //depot/projects/ia64_epc/contrib/ipfilter/Makefile#3 integrate .. //depot/projects/ia64_epc/contrib/ipfilter/man/ipmon.8#3 integrate .. //depot/projects/ia64_epc/gnu/usr.bin/binutils/ld/Makefile#2 integrate .. //depot/projects/ia64_epc/gnu/usr.bin/binutils/libiberty/Makefile#2 integrate .. //depot/projects/ia64_epc/kerberos5/lib/libasn1/Makefile#2 integrate .. //depot/projects/ia64_epc/kerberos5/lib/libhdb/Makefile#2 integrate .. //depot/projects/ia64_epc/lib/libc/alpha/_fpmath.h#3 integrate .. //depot/projects/ia64_epc/lib/libc/gdtoa/Makefile.inc#2 integrate .. //depot/projects/ia64_epc/lib/libc/gdtoa/_ldtoa.c#1 branch .. //depot/projects/ia64_epc/lib/libc/i386/_fpmath.h#2 integrate .. //depot/projects/ia64_epc/lib/libc/i386/string/Makefile.inc#3 integrate .. //depot/projects/ia64_epc/lib/libc/i386/string/wcschr.S#1 branch .. //depot/projects/ia64_epc/lib/libc/ia64/_fpmath.h#3 integrate .. //depot/projects/ia64_epc/lib/libc/powerpc/_fpmath.h#2 integrate .. //depot/projects/ia64_epc/lib/libc/sparc64/_fpmath.h#2 integrate .. //depot/projects/ia64_epc/lib/libc/stdio/floatio.h#2 integrate .. //depot/projects/ia64_epc/lib/libc/stdio/vfprintf.c#3 integrate .. //depot/projects/ia64_epc/lib/libc/stdio/vfwprintf.c#3 integrate .. //depot/projects/ia64_epc/lib/libc/stdlib/Makefile.inc#3 integrate .. //depot/projects/ia64_epc/lib/libc/stdtime/strptime.c#5 integrate .. //depot/projects/ia64_epc/lib/libncurses/Makefile#3 integrate .. //depot/projects/ia64_epc/lib/libstand/printf.c#2 integrate .. //depot/projects/ia64_epc/lib/libusbhid/libusbhid.h#2 integrate .. //depot/projects/ia64_epc/lib/libusbhid/parse.c#2 integrate .. //depot/projects/ia64_epc/lib/libusbhid/usage.c#2 integrate .. //depot/projects/ia64_epc/release/picobsd/tinyware/simple_httpd/simple_httpd.c#3 integrate .. //depot/projects/ia64_epc/sbin/ipmon/Makefile#2 integrate .. //depot/projects/ia64_epc/share/man/man4/Makefile#5 integrate .. //depot/projects/ia64_epc/share/man/man4/man4.i386/Makefile#3 integrate .. //depot/projects/ia64_epc/share/man/man4/man4.i386/smapi.4#1 branch .. //depot/projects/ia64_epc/share/man/man4/wi.4#5 integrate .. //depot/projects/ia64_epc/share/man/man4/wlan.4#1 branch .. //depot/projects/ia64_epc/share/mk/bsd.sys.mk#3 integrate .. //depot/projects/ia64_epc/share/termcap/termcap.src#2 integrate .. //depot/projects/ia64_epc/share/timedef/it_IT.ISO8859-1.src#2 integrate .. //depot/projects/ia64_epc/sys/boot/common/bootstrap.h#2 integrate .. //depot/projects/ia64_epc/sys/cam/cam_periph.c#4 integrate .. //depot/projects/ia64_epc/sys/conf/options.i386#4 integrate .. //depot/projects/ia64_epc/sys/dev/ed/if_ed.c#4 integrate .. //depot/projects/ia64_epc/sys/dev/fxp/if_fxp.c#6 integrate .. //depot/projects/ia64_epc/sys/dev/fxp/if_fxpreg.h#4 integrate .. //depot/projects/ia64_epc/sys/dev/usb/usbdevs#4 integrate .. //depot/projects/ia64_epc/sys/dev/usb/usbdevs.h#4 integrate .. //depot/projects/ia64_epc/sys/dev/usb/usbdevs_data.h#4 integrate .. //depot/projects/ia64_epc/sys/dev/usb/uvisor.c#4 integrate .. //depot/projects/ia64_epc/sys/i386/conf/NOTES#7 integrate .. //depot/projects/ia64_epc/sys/i386/i386/mp_clock.c#2 integrate .. //depot/projects/ia64_epc/sys/i386/i386/swtch.s#3 integrate .. //depot/projects/ia64_epc/sys/i386/i386/tsc.c#3 integrate .. //depot/projects/ia64_epc/sys/i386/isa/mca_machdep.c#3 delete .. //depot/projects/ia64_epc/sys/i386/isa/mca_machdep.h#2 delete .. //depot/projects/ia64_epc/sys/i386/isa/vesa.c#3 integrate .. //depot/projects/ia64_epc/sys/ia64/ia64/exception.s#5 integrate .. //depot/projects/ia64_epc/sys/ia64/ia64/locore.s#4 integrate .. //depot/projects/ia64_epc/sys/ia64/ia64/sscdisk.c#6 integrate .. //depot/projects/ia64_epc/sys/ia64/ia64/trap.c#6 integrate .. //depot/projects/ia64_epc/sys/kern/kern_physio.c#3 integrate .. //depot/projects/ia64_epc/sys/kern/link_elf.c#3 integrate .. //depot/projects/ia64_epc/sys/kern/vfs_aio.c#4 integrate .. //depot/projects/ia64_epc/sys/kern/vfs_bio.c#6 integrate .. //depot/projects/ia64_epc/sys/pci/if_xl.c#6 integrate .. //depot/projects/ia64_epc/sys/sparc64/include/cpufunc.h#3 integrate .. //depot/projects/ia64_epc/sys/sparc64/include/md_var.h#2 integrate .. //depot/projects/ia64_epc/sys/sparc64/include/pmap.h#3 integrate .. //depot/projects/ia64_epc/sys/sparc64/sparc64/machdep.c#4 integrate .. //depot/projects/ia64_epc/sys/sparc64/sparc64/pmap.c#5 integrate .. //depot/projects/ia64_epc/sys/ufs/ffs/ffs_rawread.c#2 integrate .. //depot/projects/ia64_epc/sys/vm/vm_pager.c#3 integrate .. //depot/projects/ia64_epc/tools/build/Makefile#1 branch .. //depot/projects/ia64_epc/tools/build/Makefile.boot#1 branch .. //depot/projects/ia64_epc/tools/build/dummy.c#1 branch .. //depot/projects/ia64_epc/tools/build/endian.h#1 branch .. //depot/projects/ia64_epc/tools/build/langinfo.h#1 branch .. //depot/projects/ia64_epc/tools/build/progname.c#1 branch .. //depot/projects/ia64_epc/tools/regression/lib/libc/stdio/Makefile#2 integrate .. //depot/projects/ia64_epc/tools/regression/lib/libc/stdio/test-printfloat.c#1 branch .. //depot/projects/ia64_epc/usr.bin/tip/libacu/courier.c#2 integrate .. //depot/projects/ia64_epc/usr.bin/tip/libacu/df.c#2 integrate .. //depot/projects/ia64_epc/usr.bin/tip/libacu/hayes.c#2 integrate .. //depot/projects/ia64_epc/usr.bin/tip/libacu/t3000.c#2 integrate .. //depot/projects/ia64_epc/usr.bin/tip/tip/cmds.c#2 integrate .. //depot/projects/ia64_epc/usr.bin/tip/tip/cmdtab.c#2 integrate .. //depot/projects/ia64_epc/usr.bin/tip/tip/tip.c#2 integrate .. //depot/projects/ia64_epc/usr.bin/tip/tip/tip.h#2 integrate .. //depot/projects/ia64_epc/usr.bin/tip/tip/value.c#2 integrate .. //depot/projects/ia64_epc/usr.bin/xargs/xargs.c#4 integrate .. //depot/projects/ia64_epc/usr.bin/xinstall/Makefile#2 integrate .. //depot/projects/ia64_epc/usr.sbin/ppp/ncpaddr.c#3 integrate .. //depot/projects/ia64_epc/usr.sbin/rtadvd/config.c#3 integrate .. //depot/projects/ia64_epc/usr.sbin/wicontrol/wicontrol.8#3 integrate .. //depot/projects/ia64_epc/usr.sbin/wicontrol/wicontrol.c#3 integrate Differences ... ==== //depot/projects/ia64_epc/Makefile.inc1#7 (text+ko) ==== @@ -1,5 +1,5 @@ # -# $FreeBSD: src/Makefile.inc1,v 1.330 2003/04/01 11:39:04 ru Exp $ +# $FreeBSD: src/Makefile.inc1,v 1.339 2003/04/07 00:01:33 ru Exp $ # # Make command line options: # -DMAKE_KERBEROS5 to build Kerberos5 @@ -159,15 +159,19 @@ # # Building a world goes through the following stages # -# 1. bootstrap-tool stage [BMAKE] +# 1. legacy stage [BMAKE] +# This stage is responsible for creating compatibility +# shims that are needed by the bootstrap-tools, +# build-tools and cross-tools stages. +# 1. bootstrap-tools stage [BMAKE] # This stage is responsible for creating programs that # are needed for backward compatibility reasons. They # are not built as cross-tools. -# 2. build-tool stage [TMAKE] +# 2. build-tools stage [TMAKE] # This stage is responsible for creating the object # tree and building any tools that are needed during # the build process. -# 3. cross-tool stage [XMAKE] +# 3. cross-tools stage [XMAKE] # This stage is responsible for creating any tools that # are needed for cross-builds. A cross-compiler is one # of them. @@ -186,23 +190,24 @@ GROFF_FONT_PATH=${WORLDTMP}/usr/share/groff_font \ GROFF_TMAC_PATH=${WORLDTMP}/usr/share/tmac -# bootstrap-tool stage -BMAKEENV= MAKEOBJDIRPREFIX=${WORLDTMP} \ - DESTDIR= \ - INSTALL="sh ${.CURDIR}/tools/install.sh" -BMAKE= ${BMAKEENV} ${MAKE} -f Makefile.inc1 \ +# bootstrap-tools stage +BMAKEENV= DESTDIR= \ + INSTALL="sh ${.CURDIR}/tools/install.sh" \ + __MAKE_CONF=${.CURDIR}/tools/build/Makefile.boot \ + OLD_MAKE_CONF=${__MAKE_CONF} \ + WORLDTMP=${WORLDTMP} +BMAKE= MAKEOBJDIRPREFIX=${WORLDTMP} \ + ${BMAKEENV} ${MAKE} -f Makefile.inc1 \ BOOTSTRAPPING=${OSRELDATE} \ -DNOHTML -DNOINFO -DNOMAN -DNOPIC -DNOPROFILE -DNOSHARED \ -DNO_CPU_CFLAGS -DNO_WARNS -# build-tool stage -TMAKEENV= MAKEOBJDIRPREFIX=${OBJTREE} \ - DESTDIR= \ - INSTALL="sh ${.CURDIR}/tools/install.sh" -TMAKE= ${TMAKEENV} ${MAKE} -f Makefile.inc1 \ +# build-tools stage +TMAKE= MAKEOBJDIRPREFIX=${OBJTREE} \ + ${BMAKEENV} ${MAKE} -f Makefile.inc1 \ BOOTSTRAPPING=${OSRELDATE} -DNO_CPU_CFLAGS -DNO_WARNS -# cross-tool stage +# cross-tools stage XMAKE= TOOLS_PREFIX=${WORLDTMP} ${BMAKE} -DNO_FORTRAN -DNO_GDB # world stage @@ -264,6 +269,7 @@ .if !defined(NOCLEAN) rm -rf ${WORLDTMP} .else + rm -rf ${WORLDTMP}/legacy/usr/include # XXX - These two can depend on any header file. rm -f ${OBJTREE}${.CURDIR}/usr.bin/kdump/ioctl.c rm -f ${OBJTREE}${.CURDIR}/usr.bin/truss/ioctl.c @@ -275,6 +281,15 @@ mkdir -p ${WORLDTMP}/usr/include/${_dir} .endfor ln -sf ${.CURDIR}/sys ${WORLDTMP} +.for _dir in lib include/sys + mkdir -p ${WORLDTMP}/legacy/usr/${_dir} +.endfor +_legacy: + @echo + @echo "--------------------------------------------------------------" + @echo ">>> stage 1: legacy release compatibility shims" + @echo "--------------------------------------------------------------" + cd ${.CURDIR}; ${BMAKE} legacy _bootstrap-tools: @echo @echo "--------------------------------------------------------------" @@ -335,7 +350,7 @@ WMAKE_TGTS= .if !defined(SUBDIR_OVERRIDE) -WMAKE_TGTS+= _worldtmp _bootstrap-tools +WMAKE_TGTS+= _worldtmp _legacy _bootstrap-tools .endif WMAKE_TGTS+= _cleanobj _obj _build-tools .if !defined(SUBDIR_OVERRIDE) @@ -603,6 +618,19 @@ # # +# legacy: Build compatibility shims for the next three targets +# +legacy: +.for _tool in tools/build + @${ECHODIR} "===> ${_tool}"; \ + cd ${.CURDIR}/${_tool}; \ + ${MAKE} DIRPRFX=${_tool}/ obj; \ + ${MAKE} DIRPRFX=${_tool}/ depend; \ + ${MAKE} DIRPRFX=${_tool}/ all; \ + ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy install +.endfor + +# # bootstrap-tools: Build tools needed for compatibility # .if exists(${.CURDIR}/games) && !defined(NOGAMES) @@ -615,7 +643,7 @@ usr.bin/xargs usr.bin/xinstall \ usr.sbin/config usr.sbin/kbdcontrol \ gnu/usr.bin/gperf gnu/usr.bin/groff gnu/usr.bin/texinfo - ${ECHODIR} "===> ${_tool}"; \ + @${ECHODIR} "===> ${_tool}"; \ cd ${.CURDIR}/${_tool}; \ ${MAKE} DIRPRFX=${_tool}/ obj; \ ${MAKE} DIRPRFX=${_tool}/ depend; \ @@ -648,7 +676,7 @@ .for _tool in bin/csh bin/sh gnu/usr.bin/cc/cc_tools ${_fortran} \ ${_libkrb5} lib/libncurses ${_share} \ ${_aicasm} usr.bin/awk usr.bin/file usr.sbin/sysinstall - ${ECHODIR} "===> ${_tool}"; \ + @${ECHODIR} "===> ${_tool}"; \ cd ${.CURDIR}/${_tool}; \ ${MAKE} DIRPRFX=${_tool}/ obj; \ ${MAKE} DIRPRFX=${_tool}/ build-tools @@ -682,7 +710,7 @@ .for _tool in ${_btxld} ${_elf2aout} ${_elf2exe} \ gnu/usr.bin/binutils ${_crunchide} \ gnu/usr.bin/cc ${_xlint} ${_kgzip} - ${ECHODIR} "===> ${_tool}"; \ + @${ECHODIR} "===> ${_tool}"; \ cd ${.CURDIR}/${_tool}; \ ${MAKE} DIRPRFX=${_tool}/ obj; \ ${MAKE} DIRPRFX=${_tool}/ depend; \ @@ -764,7 +792,7 @@ .for _lib in ${_startup_libs} ${_prebuild_libs:Nlib/libpam} ${_generic_libs} ${_lib}__L: .PHONY .if exists(${.CURDIR}/${_lib}) - ${ECHODIR} "===> ${_lib}"; \ + @${ECHODIR} "===> ${_lib}"; \ cd ${.CURDIR}/${_lib}; \ ${MAKE} DIRPRFX=${_lib}/ depend; \ ${MAKE} DIRPRFX=${_lib}/ all; \ @@ -776,7 +804,7 @@ # static PAM library, and dynamic PAM library before dynamic PAM # modules. lib/libpam__L: .PHONY - ${ECHODIR} "===> lib/libpam"; \ + @${ECHODIR} "===> lib/libpam"; \ cd ${.CURDIR}/lib/libpam; \ ${MAKE} DIRPRFX=lib/libpam/ depend; \ ${MAKE} DIRPRFX=lib/libpam/ -D_NO_LIBPAM_SO_YET all; \ ==== //depot/projects/ia64_epc/contrib/gcc/ifcvt.c#3 (text+ko) ==== @@ -1934,10 +1934,9 @@ is more than one remaining edge, it must come from elsewhere. There may be zero incoming edges if the THEN block didn't actually join back up (as with a call to abort). */ - else if ((join_bb->pred == NULL || join_bb->pred->pred_next == NULL) - && join_bb != EXIT_BLOCK_PTR - && (NEXT_INSN(combo_bb->end) == join_bb->head - || GET_CODE(NEXT_INSN(combo_bb->end)) != CODE_LABEL)) + else if ((join_bb->pred == NULL + || join_bb->pred->pred_next == NULL) + && join_bb != EXIT_BLOCK_PTR) { /* We can merge the JOIN. */ if (life_data_ok) @@ -2046,7 +2045,8 @@ /* The THEN block of an IF-THEN combo must have zero or one successors. */ if (then_succ != NULL_EDGE && (then_succ->succ_next != NULL_EDGE - || (then_succ->flags & EDGE_COMPLEX))) + || (then_succ->flags & EDGE_COMPLEX) + || (flow2_completed && tablejump_p (then_bb->end)))) return FALSE; /* If the THEN block has no successors, conditional execution can still @@ -2093,7 +2093,8 @@ && then_succ->dest == else_succ->dest && else_bb->pred->pred_next == NULL_EDGE && else_succ->succ_next == NULL_EDGE - && ! (else_succ->flags & EDGE_COMPLEX)) + && ! (else_succ->flags & EDGE_COMPLEX) + && ! (flow2_completed && tablejump_p (else_bb->end))) join_bb = else_succ->dest; /* Otherwise it is not an IF-THEN or IF-THEN-ELSE combination. */ ==== //depot/projects/ia64_epc/contrib/gdtoa/gdtoaimp.h#2 (text+ko) ==== @@ -26,7 +26,7 @@ ****************************************************************/ -/* $FreeBSD: src/contrib/gdtoa/gdtoaimp.h,v 1.3 2003/03/19 20:25:45 das Exp $ */ +/* $FreeBSD: src/contrib/gdtoa/gdtoaimp.h,v 1.4 2003/04/05 22:09:26 das Exp $ */ /* This is a variation on dtoa.c that converts arbitary binary floating-point formats to and from decimal notation. It uses @@ -600,6 +600,8 @@ extern Bigint *diff ANSI((Bigint*, Bigint*)); extern char *dtoa ANSI((double d, int mode, int ndigits, int *decpt, int *sign, char **rve)); + extern char *gdtoa ANSI((FPI *fpi, int be, ULong *bits, int *kindp, + int mode, int ndigits, int *decpt, char **rve)); extern char *g__fmt ANSI((char*, char*, char*, int, ULong)); extern int gethex ANSI((CONST char**, FPI*, Long*, Bigint**, int)); extern void hexdig_init_D2A(Void); ==== //depot/projects/ia64_epc/contrib/ipfilter/Makefile#3 (text+ko) ==== @@ -3,6 +3,7 @@ # # See the IPFILTER.LICENCE file for details on licencing. # +# $FreeBSD: src/contrib/ipfilter/Makefile,v 1.2 2003/04/05 09:25:19 darrenr Exp $ # $Id: Makefile,v 2.11.2.15 2002/12/02 04:22:56 darrenr Exp $ # BINDEST=/usr/local/bin @@ -29,7 +30,7 @@ # # The facility you wish to log messages from ipmon to syslogd with. # -LOGFAC=-DLOGFAC=LOG_LOCAL0 +LOGFAC=-DLOGFAC=LOG_SECURITY # # Uncomment the next 3 lines if you want to view the state table a la top(1) ==== //depot/projects/ia64_epc/contrib/ipfilter/man/ipmon.8#3 (text+ko) ==== @@ -1,4 +1,4 @@ -.\" $FreeBSD: src/contrib/ipfilter/man/ipmon.8,v 1.12 2003/02/15 06:32:48 darrenr Exp $ +.\" $FreeBSD: src/contrib/ipfilter/man/ipmon.8,v 1.13 2003/04/05 21:12:58 darrenr Exp $ .TH ipmon 8 .SH NAME ipmon \- monitors /dev/ipl for logged packets @@ -126,7 +126,7 @@ .B \-s Packet information read in will be sent through syslogd rather than saved to a file. The default facility when compiled and installed is -\fBlocal0\fP. The following levels are used: +\fBsecurity\fP. The following levels are used: .IP .B LOG_INFO \- packets logged using the "log" keyword as the action rather ==== //depot/projects/ia64_epc/gnu/usr.bin/binutils/ld/Makefile#2 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/gnu/usr.bin/binutils/ld/Makefile,v 1.23 2002/07/29 09:40:08 ru Exp $ +# $FreeBSD: src/gnu/usr.bin/binutils/ld/Makefile,v 1.24 2003/04/05 20:30:29 imp Exp $ .include "../Makefile.inc0" @@ -10,20 +10,12 @@ ldgram.y ldlang.c ldlex.l ldmain.c ldmisc.c \ ldver.c ldwrite.c lexsup.c mri.c -.if defined(BOOTSTRAPPING) && !exists(/usr/include/elf-hints.h) -SRCS+= elf-hints.h -CLEANFILES+= elf-hints.h - -elf-hints.h: - ln -sf ${.CURDIR}/../../../../include/${.TARGET} . -.endif - WARNS= 1 CFLAGS+= -DSCRIPTDIR=\"${TOOLS_PREFIX}/usr/libdata\" CFLAGS+= -DBFD_VERSION_STRING=\"${VERSION}\" CFLAGS+= -I${SRCDIR}/ld -I${SRCDIR}/bfd NOSHARED?= yes -DPADD= ${RELTOP}/libbfd/libbfd.a +DPADD+= ${RELTOP}/libbfd/libbfd.a DPADD+= ${RELTOP}/libiberty/libiberty.a LDADD= ${DPADD} CLEANDIRS+= ldscripts ==== //depot/projects/ia64_epc/gnu/usr.bin/binutils/libiberty/Makefile#2 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/gnu/usr.bin/binutils/libiberty/Makefile,v 1.17 2002/11/13 13:49:29 ru Exp $ +# $FreeBSD: src/gnu/usr.bin/binutils/libiberty/Makefile,v 1.18 2003/04/05 20:30:29 imp Exp $ .include "../Makefile.inc0" @@ -10,11 +10,6 @@ hex.c floatformat.c hashtab.c lbasename.c make-temp-file.c \ objalloc.c obstack.c safe-ctype.c xatexit.c xexit.c xmalloc.c \ xstrdup.c xstrerror.c -.if defined(BOOTSTRAPPING) && \ - ( ${BOOTSTRAPPING} < 440000 || \ - ( ${BOOTSTRAPPING} >= 500000 && ${BOOTSTRAPPING} < 500022 )) -SRCS+= basename.c -.endif WARNS= 1 CFLAGS+= -DHAVE_CONFIG_H INTERNALLIB= true ==== //depot/projects/ia64_epc/kerberos5/lib/libasn1/Makefile#2 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/kerberos5/lib/libasn1/Makefile,v 1.17 2002/11/13 13:49:29 ru Exp $ +# $FreeBSD: src/kerberos5/lib/libasn1/Makefile,v 1.18 2003/04/05 20:30:29 imp Exp $ LIB= asn1 CFLAGS+=-I${KRB5DIR}/include \ @@ -104,13 +104,7 @@ print_version.o \ get_window_size.c \ strupr.c - ${CC} ${CFLAGS} ${.OODATE} -o ${.TARGET} - -.if defined(BOOTSTRAPPING) && \ - ( ${BOOTSTRAPPING} < 440001 || \ - ( ${BOOTSTRAPPING} >= 500000 && ${BOOTSTRAPPING} < 500023 )) -asn1_compile: getprogname.c setprogname.c -.endif + ${CC} ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${.OODATE} ${LDADD} parse.o: parse.c roken.h ==== //depot/projects/ia64_epc/kerberos5/lib/libhdb/Makefile#2 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/kerberos5/lib/libhdb/Makefile,v 1.10 2002/11/13 13:49:29 ru Exp $ +# $FreeBSD: src/kerberos5/lib/libhdb/Makefile,v 1.11 2003/04/05 20:30:29 imp Exp $ LIB= hdb CFLAGS+=-I${KRB5DIR}/include \ @@ -59,13 +59,7 @@ gen_encode.c gen_decode.c gen_free.c gen_length.c \ gen_copy.c gen_glue.c getarg.c warnerr.c print_version.o \ get_window_size.c strupr.c - ${CC} ${CFLAGS} ${.OODATE} -o ${.TARGET} - -.if defined(BOOTSTRAPPING) && \ - ( ${BOOTSTRAPPING} < 440001 || \ - ( ${BOOTSTRAPPING} >= 500000 && ${BOOTSTRAPPING} < 500023 )) -asn1_compile: getprogname.c setprogname.c -.endif + ${CC} ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${.OODATE} ${LDADD} parse.o: parse.c ==== //depot/projects/ia64_epc/lib/libc/alpha/_fpmath.h#3 (text+ko) ==== @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/lib/libc/alpha/_fpmath.h,v 1.2 2003/02/11 15:19:31 des Exp $ + * $FreeBSD: src/lib/libc/alpha/_fpmath.h,v 1.3 2003/04/05 22:10:13 das Exp $ */ union IEEEl2bits { @@ -37,3 +37,9 @@ }; #define mask_nbit_l(u) ((void)0) +#define LDBL_IMPLICIT_NBIT + +#define LDBL_TO_ARRAY32(u, a) do { \ + (a)[0] = (uint32_t)(u).bits.manl; \ + (a)[1] = (uint32_t)(u).bits.manh; \ +} while(0) ==== //depot/projects/ia64_epc/lib/libc/gdtoa/Makefile.inc#2 (text+ko) ==== @@ -1,9 +1,9 @@ -# $FreeBSD: src/lib/libc/gdtoa/Makefile.inc,v 1.2 2003/03/13 18:55:14 obrien Exp $ +# $FreeBSD: src/lib/libc/gdtoa/Makefile.inc,v 1.3 2003/04/05 22:10:13 das Exp $ # netlib gdtoa sources .PATH: ${.CURDIR}/gdtoa -MISRCS+=glue.c +MISRCS+=_ldtoa.c glue.c GDTOASRCS=dmisc.c dtoa.c gdtoa.c gethex.c gmisc.c \ hd_init.c hexnan.c misc.c smisc.c \ strtoIg.c strtod.c strtodg.c strtof.c strtord.c sum.c ulp.c ==== //depot/projects/ia64_epc/lib/libc/i386/_fpmath.h#2 (text+ko) ==== @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/lib/libc/i386/_fpmath.h,v 1.1 2003/02/08 20:37:52 mike Exp $ + * $FreeBSD: src/lib/libc/i386/_fpmath.h,v 1.2 2003/04/05 22:10:13 das Exp $ */ union IEEEl2bits { @@ -38,3 +38,8 @@ }; #define mask_nbit_l(u) ((u).bits.manh &= 0x7fffffff) + +#define LDBL_TO_ARRAY32(u, a) do { \ + (a)[0] = (uint32_t)(u).bits.manl; \ + (a)[1] = (uint32_t)(u).bits.manh; \ +} while(0) ==== //depot/projects/ia64_epc/lib/libc/i386/string/Makefile.inc#3 (text+ko) ==== @@ -1,6 +1,7 @@ # @(#)Makefile.inc 8.1 (Berkeley) 6/4/93 -# $FreeBSD: src/lib/libc/i386/string/Makefile.inc,v 1.12 2003/03/14 11:01:12 tjr Exp $ +# $FreeBSD: src/lib/libc/i386/string/Makefile.inc,v 1.13 2003/04/05 04:17:05 tjr Exp $ MDSRCS+=bcmp.S bcopy.S bzero.S ffs.S index.S memchr.S memcmp.S memcpy.S \ memmove.S memset.S rindex.S strcat.S strchr.S strcmp.S strcpy.S \ - strlen.S strncmp.S strrchr.S swab.S wcscmp.S wcslen.S wmemchr.S + strlen.S strncmp.S strrchr.S swab.S wcschr.S wcscmp.S wcslen.S \ + wmemchr.S ==== //depot/projects/ia64_epc/lib/libc/ia64/_fpmath.h#3 (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/ia64/_fpmath.h,v 1.2 2003/02/26 16:04:34 mike Exp $ + * $FreeBSD: src/lib/libc/ia64/_fpmath.h,v 1.3 2003/04/05 22:10:13 das Exp $ */ #include @@ -53,3 +53,8 @@ #else /* _BIG_ENDIAN */ #define mask_nbit_l(u) ((u).bits.manh &= 0xffffff7f) #endif + +#define LDBL_TO_ARRAY32(u, a) do { \ + (a)[0] = (uint32_t)(u).bits.manl; \ + (a)[1] = (uint32_t)(u).bits.manh; \ +} while(0) ==== //depot/projects/ia64_epc/lib/libc/powerpc/_fpmath.h#2 (text+ko) ==== @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/lib/libc/powerpc/_fpmath.h,v 1.1 2003/02/08 20:37:53 mike Exp $ + * $FreeBSD: src/lib/libc/powerpc/_fpmath.h,v 1.2 2003/04/05 22:10:13 das Exp $ */ union IEEEl2bits { @@ -38,3 +38,11 @@ /* XXX does powerpc have a normalization bit? */ #define mask_nbit_l(u) ((void)0) +#define LDBL_IMPLICIT_NBIT + +#define LDBL_TO_ARRAY32(u, a) do { \ + (a)[0] = (uint32_t)(u).bits.manl; \ + (a)[1] = (uint32_t)((u).bits.manl >> 32); \ + (a)[2] = (uint32_t)(u).bits.manh; \ + (a)[3] = (uint32_t)((u).bits.manh >> 32); \ +} while(0) ==== //depot/projects/ia64_epc/lib/libc/sparc64/_fpmath.h#2 (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/sparc64/_fpmath.h,v 1.1 2003/02/08 20:37:54 mike Exp $ + * $FreeBSD: src/lib/libc/sparc64/_fpmath.h,v 1.2 2003/04/05 22:10:13 das Exp $ */ union IEEEl2bits { @@ -38,3 +38,11 @@ }; #define mask_nbit_l(u) ((void)0) +#define LDBL_IMPLICIT_NBIT + +#define LDBL_TO_ARRAY32(u, a) do { \ + (a)[0] = (uint32_t)(u).bits.manl; \ + (a)[1] = (uint32_t)((u).bits.manl >> 32); \ + (a)[2] = (uint32_t)(u).bits.manh; \ + (a)[3] = (uint32_t)((u).bits.manh >> 32); \ +} while(0) ==== //depot/projects/ia64_epc/lib/libc/stdio/floatio.h#2 (text+ko) ==== @@ -34,14 +34,23 @@ * SUCH DAMAGE. * * @(#)floatio.h 8.1 (Berkeley) 6/4/93 - * $FreeBSD: src/lib/libc/stdio/floatio.h,v 1.2 2002/03/22 23:42:01 obrien Exp $ + * $FreeBSD: src/lib/libc/stdio/floatio.h,v 1.4 2003/04/05 22:11:42 das Exp $ */ /* * Floating point scanf/printf (input/output) definitions. */ -/* 11-bit exponent (VAX G floating point) is 308 decimal digits */ -#define MAXEXP 308 -/* 128 bit fraction takes up 39 decimal digits; max reasonable precision */ -#define MAXFRACT 39 +/* + * MAXEXPDIG is the maximum number of decimal digits needed to store a + * floating point exponent in the largest supported format. It should + * be ceil(log10(LDBL_MAX_10_EXP)) or, if hexadecimal floating point + * conversions are supported, ceil(log10(LDBL_MAX_EXP)). But since it + * is presently never greater than 5 in practice, we fudge it. + */ +#define MAXEXPDIG 6 +#if LDBL_MAX_EXP > 999999 +#error "floating point buffers too small" +#endif + +char *__ldtoa(long double *, int, int, int *, int *, char **); ==== //depot/projects/ia64_epc/lib/libc/stdio/vfprintf.c#3 (text+ko) ==== @@ -38,7 +38,7 @@ static char sccsid[] = "@(#)vfprintf.c 8.1 (Berkeley) 6/4/93"; #endif /* LIBC_SCCS and not lint */ #include -__FBSDID("$FreeBSD: src/lib/libc/stdio/vfprintf.c,v 1.52 2003/03/14 04:48:09 das Exp $"); +__FBSDID("$FreeBSD: src/lib/libc/stdio/vfprintf.c,v 1.57 2003/04/07 03:17:39 ache Exp $"); /* * Actual printf innards. @@ -111,9 +111,9 @@ static int __sprint(FILE *, struct __suio *); static int __sbprintf(FILE *, const char *, va_list) __printflike(2, 0); -static char *__ujtoa(uintmax_t, char *, int, int, char *, int, char, +static char *__ujtoa(uintmax_t, char *, int, int, const char *, int, char, const char *); -static char *__ultoa(u_long, char *, int, int, char *, int, char, +static char *__ultoa(u_long, char *, int, int, const char *, int, char, const char *); static char *__wcsconv(wchar_t *, int); static void __find_arguments(const char *, va_list, union arg **); @@ -185,7 +185,7 @@ * use the given digits. */ static char * -__ultoa(u_long val, char *endp, int base, int octzero, char *xdigs, +__ultoa(u_long val, char *endp, int base, int octzero, const char *xdigs, int needgrp, char thousep, const char *grp) { char *cp = endp; @@ -262,7 +262,7 @@ /* Identical to __ultoa, but for intmax_t. */ static char * -__ujtoa(uintmax_t val, char *endp, int base, int octzero, char *xdigs, +__ujtoa(uintmax_t val, char *endp, int base, int octzero, const char *xdigs, int needgrp, char thousep, const char *grp) { char *cp = endp; @@ -384,9 +384,11 @@ break; mbp += clen; } + if (clen == (size_t)-1) { + free(convbuf); + return (NULL); + } *mbp = '\0'; - if (clen == (size_t)-1) - return (NULL); return (convbuf); } @@ -407,23 +409,29 @@ } #ifdef FLOATING_POINT + +#define dtoa __dtoa +#define freedtoa __freedtoa + +#include #include #include "floatio.h" +#include "gdtoa.h" -#define BUF ((MAXEXP*2)+MAXFRACT+1) /* + decimal point */ #define DEFPREC 6 -extern char *__dtoa(double, int, int, int *, int *, char **); -extern void __freedtoa(char *s); - -static char *cvt(double, int, int, char *, int *, int, int *); static int exponent(char *, int, int); -#else /* no FLOATING_POINT */ +#endif /* FLOATING_POINT */ -#define BUF 136 - -#endif /* FLOATING_POINT */ +/* + * The size of the buffer we use as scratch space for integer + * conversions, among other things. Technically, we would need the + * most space for base 10 conversions with thousands' grouping + * characters between each pair of digits. 100 bytes is a + * conservative overestimate even for a 128-bit uintmax_t. + */ +#define BUF 100 #define STATIC_ARG_TBL_SIZE 8 /* Size of static argument table. */ @@ -431,7 +439,6 @@ * Flags used during conversion. */ #define ALT 0x001 /* alternate form */ -#define HEXPREFIX 0x002 /* add 0x or 0X prefix */ #define LADJUST 0x004 /* left adjustment */ #define LONGDBL 0x008 /* long double */ #define LONGINT 0x010 /* long integer */ @@ -460,19 +467,41 @@ int flags; /* flags as above */ int ret; /* return value accumulator */ int width; /* width from format (%8d), or 0 */ - int prec; /* precision from format (%.3d), or -1 */ + int prec; /* precision from format; <0 for N/A */ char sign; /* sign prefix (' ', '+', '-', or \0) */ char thousands_sep; /* locale specific thousands separator */ const char *grouping; /* locale specific numeric grouping rules */ #ifdef FLOATING_POINT + /* + * We can decompose the printed representation of floating + * point numbers into several parts, some of which may be empty: + * + * [+|-| ] [0x|0X] MMM . NNN [e|E|p|P] [+|-] ZZ + * A B ---C--- D E F + * + * A: 'sign' holds this value if present; '\0' otherwise + * B: ox[1] holds the 'x' or 'X'; '\0' if not hexadecimal + * C: cp points to the string MMMNNN. Leading and trailing + * zeros are not in the string and must be added. + * D: expchar holds this character; '\0' if no exponent, e.g. %f + * F: at least two digits for decimal, at least one digit for hex + */ char *decimal_point; /* locale specific decimal point */ - char softsign; /* temporary negative sign for floats */ - double _double; /* double precision arguments %[eEfgG] */ + int signflag; /* true if float is negative */ + union { /* floating point arguments %[aAeEfFgG] */ + double dbl; + long double ldbl; + } fparg; int expt; /* integer value of exponent */ + char expchar; /* exponent character: [eEpP\0] */ + char *dtoaend; /* pointer to end of converted digits */ int expsize; /* character count for expstr */ - int ndig; /* actual number of digits returned by cvt */ - char expstr[7]; /* buffer for exponent string */ + int lead; /* sig figs before decimal or group sep */ + int ndig; /* actual number of digits returned by dtoa */ + char expstr[MAXEXPDIG+2]; /* buffer for exponent string: e+ZZZ */ char *dtoaresult; /* buffer allocated by dtoa */ + int nseps; /* number of group separators with ' */ + int nrepeats; /* number of repeats of the last group */ #endif u_long ulval; /* integer arguments %[diouxX] */ uintmax_t ujval; /* %j, %ll, %q, %t, %z integers */ @@ -481,12 +510,12 @@ int realsz; /* field size expanded by dprec, sign, etc */ int size; /* size of converted field or string */ int prsize; /* max size of printed field */ - char *xdigs; /* digits for [xX] conversion */ + const char *xdigs; /* digits for %[xX] conversion */ #define NIOV 8 struct __suio uio; /* output information: summary */ struct __siov iov[NIOV];/* ... and individual io vectors */ - char buf[BUF]; /* space for %c, %[diouxX], %[eEfFgG] */ - char ox[2]; /* space for 0x hex-prefix */ + char buf[BUF]; /* buffer with space for digits of uintmax_t */ + char ox[2]; /* space for 0x; ox[1] is either x, X, or \0 */ union arg *argtable; /* args, built due to positional arg */ union arg statargtable [STATIC_ARG_TBL_SIZE]; int nextarg; /* 1-based argument index */ @@ -504,6 +533,9 @@ static char zeroes[PADSIZE] = {'0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0'}; + static const char xdigs_lower[16] = "0123456789abcdef"; + static const char xdigs_upper[16] = "0123456789ABCDEF"; + /* * BEWARE, these `goto error' on error, and PAD uses `n'. */ @@ -527,6 +559,14 @@ PRINT(with, n); \ } \ } +#define PRINTANDPAD(p, ep, len, with) do { \ + n2 = (ep) - (p); \ + if (n2 > (len)) \ + n2 = (len); \ + if (n2 > 0) \ + PRINT((p), n2); \ + PAD((len) - (n2 > 0 ? n2 : 0), (with)); \ +} while(0) #define FLUSH() { \ if (uio.uio_resid && __sprint(fp, &uio)) \ goto error; \ @@ -643,6 +683,7 @@ width = 0; prec = -1; sign = '\0'; + ox[1] = '\0'; rflag: ch = *fmt++; reswitch: switch (ch) { @@ -683,16 +724,14 @@ goto rflag; case '.': if ((ch = *fmt++) == '*') { - GETASTER (n); - prec = n < 0 ? -1 : n; + GETASTER (prec); goto rflag; } - n = 0; + prec = 0; while (is_digit(ch)) { - n = 10 * n + to_digit(ch); + prec = 10 * prec + to_digit(ch); ch = *fmt++; } - prec = n < 0 ? -1 : n; goto reswitch; case '0': /*- @@ -797,86 +836,122 @@ #ifdef HEXFLOAT case 'a': case 'A': + if (ch == 'a') { + ox[1] = 'x'; + xdigs = xdigs_lower; + expchar = 'p'; + } else { + ox[1] = 'X'; + xdigs = xdigs_upper; + expchar = 'P'; + } + /* + * XXX We don't actually have a conversion + * XXX routine for this yet. + */ + if (flags & LONGDBL) { + fparg.ldbl = (double)GETARG(long double); + dtoaresult = cp = + __hldtoa(fparg.ldbl, xdigs, prec, + &expt, &signflag, &dtoaend); + } else { + fparg.dbl = GETARG(double); + dtoaresult = cp = + __hdtoa(fparg.dbl, xdigs, prec, + &expt, &signflag, &dtoaend); + } + goto fp_begin; #endif case 'e': case 'E': - /*- - * Grouping apply to %i, %d, %u, %f, %F, %g, %G - * conversion specifiers only. For other conversions - * behavior is undefined. - * -- POSIX - */ - flags &= ~GROUPING; - /*FALLTHROUGH*/ + expchar = ch; + if (prec < 0) /* account for digit before decpt */ + prec = DEFPREC + 1; + else + prec++; + goto fp_begin; case 'f': case 'F': + expchar = '\0'; goto fp_begin; case 'g': case 'G': + expchar = ch - ('g' - 'e'); if (prec == 0) prec = 1; -fp_begin: if (prec == -1) +fp_begin: + if (prec < 0) prec = DEFPREC; - if (flags & LONGDBL) - /* XXX this loses precision. */ - _double = (double)GETARG(long double); - else - _double = GETARG(double); - /* do this before tricky precision changes */ - if (isinf(_double)) { - if (_double < 0) - sign = '-'; - if (isupper(ch)) - cp = "INF"; - else - cp = "inf"; - size = 3; - break; + if (dtoaresult != NULL) + freedtoa(dtoaresult); + if (flags & LONGDBL) { + fparg.ldbl = GETARG(long double); + dtoaresult = cp = + __ldtoa(&fparg.ldbl, expchar ? 2 : 3, prec, + &expt, &signflag, &dtoaend); + } else { + fparg.dbl = GETARG(double); + dtoaresult = cp = + dtoa(fparg.dbl, expchar ? 2 : 3, prec, + &expt, &signflag, &dtoaend); + if (expt == 9999) + expt = INT_MAX; } - if (isnan(_double)) { - if (isupper(ch)) - cp = "NAN"; - else - cp = "nan"; + if (signflag) + sign = '-'; + if (expt == INT_MAX) { /* inf or nan */ + if (*cp == 'N') { + cp = (ch >= 'a') ? "nan" : "NAN"; + sign = '\0'; + } else + cp = (ch >= 'a') ? "inf" : "INF"; size = 3; break; } flags |= FPT; - if (dtoaresult != NULL) { - __freedtoa(dtoaresult); - dtoaresult = NULL; - } - dtoaresult = cp = cvt(_double, prec, flags, &softsign, - &expt, ch, &ndig); + ndig = dtoaend - cp; if (ch == 'g' || ch == 'G') { - if (expt <= -4 || expt > prec) - ch = (ch == 'g') ? 'e' : 'E'; - else - ch = 'g'; + if (expt > -4 && expt <= prec) { + /* Make %[gG] smell like %[fF] */ + expchar = '\0'; + if (flags & ALT) + prec -= expt; + else + prec = ndig - expt; + if (prec < 0) + prec = 0; + } } - if (ch == 'e' || ch == 'E') { - --expt; - expsize = exponent(expstr, expt, ch); - size = expsize + ndig; - if (ndig > 1 || flags & ALT) + if (expchar) { + expsize = exponent(expstr, expt - 1, expchar); + size = expsize + prec; + if (prec > 1 || flags & ALT) ++size; - } else if (ch == 'f' || ch == 'F') { + } else { if (expt > 0) { size = expt; if (prec || flags & ALT) >>> TRUNCATED FOR MAIL (1000 lines) <<< From owner-p4-projects@FreeBSD.ORG Sun Apr 6 22:13:18 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id B005F37B404; Sun, 6 Apr 2003 22:13:17 -0700 (PDT) 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 4DA5937B401 for ; Sun, 6 Apr 2003 22:13:17 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id D9C3543F75 for ; Sun, 6 Apr 2003 22:13:16 -0700 (PDT) (envelope-from marcel@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h375DG0U032046 for ; Sun, 6 Apr 2003 22:13:16 -0700 (PDT) (envelope-from marcel@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h375DGnl032039 for perforce@freebsd.org; Sun, 6 Apr 2003 22:13:16 -0700 (PDT) Date: Sun, 6 Apr 2003 22:13:16 -0700 (PDT) Message-Id: <200304070513.h375DGnl032039@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 28402 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, 07 Apr 2003 05:13:18 -0000 http://perforce.freebsd.org/chv.cgi?CH=28402 Change 28402 by marcel@marcel_nfs on 2003/04/06 22:12:30 Convert a MP related cpu_throw() to the new order. Affected files ... .. //depot/projects/ia64_epc/sys/ia64/ia64/mp_machdep.c#3 edit Differences ... ==== //depot/projects/ia64_epc/sys/ia64/ia64/mp_machdep.c#3 (text+ko) ==== @@ -124,8 +124,8 @@ ia64_set_itm(ia64_get_itc() + itm_reload); ia64_set_itv(CLOCK_VECTOR); ia64_set_tpr(0); - cpu_throw(); - panic("ia64_ap_startup: cpu_throw() returned"); + cpu_throw(NULL, choosethread()); + /* NOTREACHED */ } int From owner-p4-projects@FreeBSD.ORG Sun Apr 6 22:36:47 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 6098937B401; Sun, 6 Apr 2003 22:36:47 -0700 (PDT) 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 CD56637B404 for ; Sun, 6 Apr 2003 22:36:46 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id CEE1143FA3 for ; Sun, 6 Apr 2003 22:36:45 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h375aj0U033734 for ; Sun, 6 Apr 2003 22:36:45 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h375ajls033731 for perforce@freebsd.org; Sun, 6 Apr 2003 22:36:45 -0700 (PDT) Date: Sun, 6 Apr 2003 22:36:45 -0700 (PDT) Message-Id: <200304070536.h375ajls033731@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28404 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, 07 Apr 2003 05:36:48 -0000 http://perforce.freebsd.org/chv.cgi?CH=28404 Change 28404 by peter@peter_overcee on 2003/04/06 22:36:33 fix the module metadata. argh. Rounding by sizeof(long) is great fun when your loader and kernel disagree on the size of long (and the kernel does it in MI code). Affected files ... .. //depot/projects/hammer/sys/boot/i386/libi386/Makefile#5 edit .. //depot/projects/hammer/sys/boot/i386/libi386/bootinfo.c#5 edit .. //depot/projects/hammer/sys/boot/i386/libi386/bootinfo32.c#1 add .. //depot/projects/hammer/sys/boot/i386/libi386/bootinfo64.c#1 add .. //depot/projects/hammer/sys/boot/i386/libi386/elf32_freebsd.c#2 edit .. //depot/projects/hammer/sys/boot/i386/libi386/elf64_freebsd.c#8 edit .. //depot/projects/hammer/sys/boot/i386/libi386/libi386.h#3 edit Differences ... ==== //depot/projects/hammer/sys/boot/i386/libi386/Makefile#5 (text+ko) ==== @@ -4,7 +4,8 @@ INTERNALLIB= true SRCS= biosacpi.c bioscd.c biosdisk.c biosmem.c biospnp.c \ - biospci.c bootinfo.c comconsole.c devicename.c elf32_freebsd.c \ + biospci.c bootinfo.c bootinfo32.c bootinfo64.c \ + comconsole.c devicename.c elf32_freebsd.c \ elf64_freebsd.c gatea20.c \ i386_copy.c i386_module.c nullconsole.c pxe.c pxetramp.s \ time.c vidconsole.c x86_64_tramp.S ==== //depot/projects/hammer/sys/boot/i386/libi386/bootinfo.c#5 (text+ko) ==== @@ -30,13 +30,10 @@ #include #include #include -#include #include "bootstrap.h" #include "libi386.h" #include "btxv86.h" -static struct bootinfo bi; - /* * Return a 'boothowto' value corresponding to the kernel arguments in * (kargs) and any relevant environment variables. @@ -58,8 +55,6 @@ {NULL, 0} }; -vm_offset_t bi_copymodules(vm_offset_t addr); - int bi_getboothowto(char *kargs) { @@ -159,225 +154,3 @@ addr++; return(addr); } - -/* - * Copy module-related data into the load area, where it can be - * used as a directory for loaded modules. - * - * Module data is presented in a self-describing format. Each datum - * is preceded by a 32-bit identifier and a 32-bit size field. - * - * Currently, the following data are saved: - * - * MOD_NAME (variable) module name (string) - * MOD_TYPE (variable) module type (string) - * MOD_ARGS (variable) module parameters (string) - * MOD_ADDR sizeof(vm_offset_t) module load address - * MOD_SIZE sizeof(size_t) module size - * MOD_METADATA (variable) type-specific metadata - */ -#define COPY32(v, a, c) { \ - u_int32_t x = (v); \ - if (c) \ - i386_copyin(&x, a, sizeof(x)); \ - a += sizeof(x); \ -} - -#define MOD_STR(t, a, s, c) { \ - COPY32(t, a, c); \ - COPY32(strlen(s) + 1, a, c); \ - if (c) \ - i386_copyin(s, a, strlen(s) + 1); \ - a += roundup(strlen(s) + 1, sizeof(u_long));\ -} - -#define MOD_NAME(a, s, c) MOD_STR(MODINFO_NAME, a, s, c) -#define MOD_TYPE(a, s, c) MOD_STR(MODINFO_TYPE, a, s, c) -#define MOD_ARGS(a, s, c) MOD_STR(MODINFO_ARGS, a, s, c) - -#define MOD_VAR(t, a, s, c) { \ - COPY32(t, a, c); \ - COPY32(sizeof(s), a, c); \ - if (c) \ - i386_copyin(&s, a, sizeof(s)); \ - a += roundup(sizeof(s), sizeof(u_long)); \ -} - -#define MOD_ADDR(a, s, c) MOD_VAR(MODINFO_ADDR, a, s, c) -#define MOD_SIZE(a, s, c) MOD_VAR(MODINFO_SIZE, a, s, c) - -#define MOD_METADATA(a, mm, c) { \ - COPY32(MODINFO_METADATA | mm->md_type, a, c); \ - COPY32(mm->md_size, a, c); \ - if (c) \ - i386_copyin(mm->md_data, a, mm->md_size); \ - a += roundup(mm->md_size, sizeof(u_long));\ -} - -#define MOD_END(a, c) { \ - COPY32(MODINFO_END, a, c); \ - COPY32(0, a, c); \ -} - -vm_offset_t -bi_copymodules(vm_offset_t addr) -{ - struct preloaded_file *fp; - struct file_metadata *md; - int c; - - c = addr != 0; - /* start with the first module on the list, should be the kernel */ - for (fp = file_findfile(NULL, NULL); fp != NULL; fp = fp->f_next) { - - MOD_NAME(addr, fp->f_name, c); /* this field must come first */ - MOD_TYPE(addr, fp->f_type, c); - if (fp->f_args) - MOD_ARGS(addr, fp->f_args, c); - MOD_ADDR(addr, fp->f_addr, c); - MOD_SIZE(addr, fp->f_size, c); - for (md = fp->f_metadata; md != NULL; md = md->md_next) - if (!(md->md_type & MODINFOMD_NOCOPY)) - MOD_METADATA(addr, md, c); - } - MOD_END(addr, c); - return(addr); -} - -/* - * Load the information expected by an i386 kernel. - * - * - The 'boothowto' argument is constructed - * - The 'bootdev' argument is constructed - * - The 'bootinfo' struct is constructed, and copied into the kernel space. - * - The kernel environment is copied into kernel space. - * - Module metadata are formatted and placed in kernel space. - */ -int -bi_load(char *args, int *howtop, int *bootdevp, vm_offset_t *bip, vm_offset_t *modulep) -{ - struct preloaded_file *xp, *kfp; - struct i386_devdesc *rootdev; - struct file_metadata *md; - vm_offset_t addr; - vm_offset_t kernend; - vm_offset_t envp; - vm_offset_t size; - char *rootdevname; - int bootdevnr, i, howto; - char *kernelname; - const char *kernelpath; - - howto = bi_getboothowto(args); - - /* - * Allow the environment variable 'rootdev' to override the supplied device - * This should perhaps go to MI code and/or have $rootdev tested/set by - * MI code before launching the kernel. - */ - rootdevname = getenv("rootdev"); - i386_getdev((void **)(&rootdev), rootdevname, NULL); - if (rootdev == NULL) { /* bad $rootdev/$currdev */ - printf("can't determine root device\n"); - return(EINVAL); - } - - /* Try reading the /etc/fstab file to select the root device */ - getrootmount(i386_fmtdev((void *)rootdev)); - - /* Do legacy rootdev guessing */ - - /* XXX - use a default bootdev of 0. Is this ok??? */ - bootdevnr = 0; - - switch(rootdev->d_type) { - case DEVT_CD: - /* Pass in BIOS device number. */ - bi.bi_bios_dev = bc_unit2bios(rootdev->d_kind.bioscd.unit); - bootdevnr = bc_getdev(rootdev); - break; - - case DEVT_DISK: - /* pass in the BIOS device number of the current disk */ - bi.bi_bios_dev = bd_unit2bios(rootdev->d_kind.biosdisk.unit); - bootdevnr = bd_getdev(rootdev); - break; - - case DEVT_NET: - break; - - default: - printf("WARNING - don't know how to boot from device type %d\n", rootdev->d_type); - } - if (bootdevnr == -1) { - printf("root device %s invalid\n", i386_fmtdev(rootdev)); - return (EINVAL); - } - free(rootdev); - - /* find the last module in the chain */ - addr = 0; - for (xp = file_findfile(NULL, NULL); xp != NULL; xp = xp->f_next) { - if (addr < (xp->f_addr + xp->f_size)) - addr = xp->f_addr + xp->f_size; - } - /* pad to a page boundary */ - addr = roundup(addr, PAGE_SIZE); - - /* copy our environment */ - envp = addr; - addr = bi_copyenv(addr); - - /* pad to a page boundary */ - addr = roundup(addr, PAGE_SIZE); - - kfp = file_findfile(NULL, "elf64 kernel"); - if (kfp == NULL) - kfp = file_findfile(NULL, "elf32 kernel"); - if (kfp == NULL) - panic("can't find kernel file"); - kernend = 0; /* fill it in later */ - file_addmetadata(kfp, MODINFOMD_HOWTO, sizeof howto, &howto); - file_addmetadata(kfp, MODINFOMD_ENVP, sizeof envp, &envp); - file_addmetadata(kfp, MODINFOMD_KERNEND, sizeof kernend, &kernend); -#ifdef MODINFOMD_SMAP - file_addmetadata(kfp, MODINFOMD_SMAP, smapsize, smap); -#endif - - /* Figure out the size and location of the metadata */ - *modulep = addr; - size = bi_copymodules(0); - kernend = roundup(addr + size, PAGE_SIZE); - - /* patch MODINFOMD_KERNEND */ - md = file_findmetadata(kfp, MODINFOMD_KERNEND); - bcopy(&kernend, md->md_data, sizeof kernend); - - /* copy module list and metadata */ - (void)bi_copymodules(addr); - - /* legacy bootinfo structure */ - kernelname = getenv("kernelname"); - i386_getdev(NULL, kernelname, &kernelpath); - bi.bi_version = BOOTINFO_VERSION; - bi.bi_kernelname = 0; /* XXX char * -> kernel name */ - bi.bi_nfs_diskless = 0; /* struct nfs_diskless * */ - bi.bi_n_bios_used = 0; /* XXX would have to hook biosdisk driver for these */ - for (i = 0; i < N_BIOS_GEOM; i++) - bi.bi_bios_geom[i] = bd_getbigeom(i); - bi.bi_size = sizeof(bi); - bi.bi_memsizes_valid = 1; - bi.bi_basemem = bios_basemem / 1024; - bi.bi_extmem = bios_extmem / 1024; - bi.bi_envp = envp; - bi.bi_modulep = *modulep; - bi.bi_kernend = kernend; - bi.bi_kernelname = VTOP(kernelpath); - - /* legacy boot arguments */ - *howtop = howto | RB_BOOTINFO; - *bootdevp = bootdevnr; - *bip = VTOP(&bi); - - return(0); -} ==== //depot/projects/hammer/sys/boot/i386/libi386/elf32_freebsd.c#2 (text+ko) ==== @@ -52,37 +52,24 @@ { struct file_metadata *md; Elf_Ehdr *ehdr; - vm_offset_t entry, bootinfop, modulep; + vm_offset_t entry, bootinfop, modulep, kernend; int boothowto, err, bootdev; - struct bootinfo *bi; - vm_offset_t ssym, esym; if ((md = file_findmetadata(fp, MODINFOMD_ELFHDR)) == NULL) return(EFTYPE); /* XXX actually EFUCKUP */ ehdr = (Elf_Ehdr *)&(md->md_data); - if ((err = bi_load(fp->f_args, &boothowto, &bootdev, &bootinfop, &modulep)) != 0) + err = bi_load32(fp->f_args, &boothowto, &bootdev, &bootinfop, &modulep, &kernend); + if (err != 0) return(err); entry = ehdr->e_entry & 0xffffff; - ssym = esym = 0; - if ((md = file_findmetadata(fp, MODINFOMD_SSYM)) != NULL) - ssym = *((vm_offset_t *)&(md->md_data)); - if ((md = file_findmetadata(fp, MODINFOMD_ESYM)) != NULL) - esym = *((vm_offset_t *)&(md->md_data)); - if (ssym == 0 || esym == 0) - ssym = esym = 0; /* sanity */ - bi = (struct bootinfo *)PTOV(bootinfop); - bi->bi_symtab = ssym; /* XXX this is only the primary kernel symtab */ - bi->bi_esymtab = esym; - - #ifdef DEBUG printf("Start @ 0x%lx ...\n", entry); #endif dev_cleanup(); - __exec((void *)entry, boothowto, bootdev, 0, 0, 0, bootinfop, modulep, bi->bi_kernend); + __exec((void *)entry, boothowto, bootdev, 0, 0, 0, bootinfop, modulep, kernend); panic("exec returned"); } ==== //depot/projects/hammer/sys/boot/i386/libi386/elf64_freebsd.c#8 (text+ko) ==== @@ -65,22 +65,18 @@ { struct file_metadata *md; Elf_Ehdr *ehdr; - vm_offset_t bootinfop, modulep, kernend; - int boothowto, err, bootdev; + vm_offset_t modulep, kernend; + int err; int i; if ((md = file_findmetadata(fp, MODINFOMD_ELFHDR)) == NULL) return(EFTYPE); /* XXX actually EFUCKUP */ ehdr = (Elf_Ehdr *)&(md->md_data); - if ((err = bi_load(fp->f_args, &boothowto, &bootdev, &bootinfop, &modulep)) != 0) + err = bi_load64(fp->f_args, &modulep, &kernend); + if (err != 0) return(err); - kernend = 0; - md = file_findmetadata(fp, MODINFOMD_KERNEND); - if (md != NULL) - kernend = *((vm_offset_t *)&(md->md_data)); - #define PG_V 0x001 #define PG_RW 0x002 #define PG_U 0x004 ==== //depot/projects/hammer/sys/boot/i386/libi386/libi386.h#3 (text+ko) ==== @@ -97,7 +97,8 @@ int bi_getboothowto(char *kargs); vm_offset_t bi_copyenv(vm_offset_t addr); -int bi_load(char *args, int *howtop, int *bootdevp, vm_offset_t *bip, - vm_offset_t *modulep); +int bi_load32(char *args, int *howtop, int *bootdevp, vm_offset_t *bip, + vm_offset_t *modulep, vm_offset_t *kernend); +int bi_load64(char *args, vm_offset_t *modulep, vm_offset_t *kernend); void pxe_enable(void *pxeinfo); From owner-p4-projects@FreeBSD.ORG Sun Apr 6 23:04:24 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 472C837B404; Sun, 6 Apr 2003 23:04:24 -0700 (PDT) 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 DB52F37B401 for ; Sun, 6 Apr 2003 23:04:23 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 71E2443F75 for ; Sun, 6 Apr 2003 23:04:23 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h3764N0U036746 for ; Sun, 6 Apr 2003 23:04:23 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h3764MYO036743 for perforce@freebsd.org; Sun, 6 Apr 2003 23:04:22 -0700 (PDT) Date: Sun, 6 Apr 2003 23:04:22 -0700 (PDT) Message-Id: <200304070604.h3764MYO036743@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28410 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, 07 Apr 2003 06:04:25 -0000 http://perforce.freebsd.org/chv.cgi?CH=28410 Change 28410 by peter@peter_overcee on 2003/04/06 23:03:58 more long/int64 nastiness. MI code expects envp to be a pointer. Affected files ... .. //depot/projects/hammer/sys/boot/i386/libi386/bootinfo64.c#2 edit Differences ... ==== //depot/projects/hammer/sys/boot/i386/libi386/bootinfo64.c#2 (text+ko) ==== @@ -138,8 +138,8 @@ struct i386_devdesc *rootdev; struct file_metadata *md; vm_offset_t addr; - vm_offset_t kernend; - vm_offset_t envp; + u_int64_t kernend; + u_int64_t envp; vm_offset_t size; char *rootdevname; int i, howto; From owner-p4-projects@FreeBSD.ORG Mon Apr 7 00:58:46 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 4EEBD37B404; Mon, 7 Apr 2003 00:58:45 -0700 (PDT) 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 E20D937B401 for ; Mon, 7 Apr 2003 00:58:44 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7A14D43F75 for ; Mon, 7 Apr 2003 00:58:44 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h377wi0U050694 for ; Mon, 7 Apr 2003 00:58:44 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h377wia7050691 for perforce@freebsd.org; Mon, 7 Apr 2003 00:58:44 -0700 (PDT) Date: Mon, 7 Apr 2003 00:58:44 -0700 (PDT) Message-Id: <200304070758.h377wia7050691@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28415 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, 07 Apr 2003 07:58:46 -0000 http://perforce.freebsd.org/chv.cgi?CH=28415 Change 28415 by peter@peter_overcee on 2003/04/07 00:58:17 Constrain registers for xchgb that have byte halves. eg: %bh, %bl. The upper %rXX do not have an upper byte half. Affected files ... .. //depot/projects/hammer/sys/x86_64/include/endian.h#6 edit Differences ... ==== //depot/projects/hammer/sys/x86_64/include/endian.h#6 (text+ko) ==== @@ -86,7 +86,7 @@ #define __byte_swap_word(x) \ __extension__ ({ register __uint16_t __X = (x); \ - __asm ("xchgb %h0, %b0" : "+q" (__X)); \ + __asm ("xchgb %h0, %b0" : "+Q" (__X)); \ __X; }) static __inline __uint64_t From owner-p4-projects@FreeBSD.ORG Mon Apr 7 00:59:47 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 1C30937B404; Mon, 7 Apr 2003 00:59:47 -0700 (PDT) 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 AFC0B37B401 for ; Mon, 7 Apr 2003 00:59:46 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 58D4F43F3F for ; Mon, 7 Apr 2003 00:59:46 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h377xk0U050733 for ; Mon, 7 Apr 2003 00:59:46 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h377xjPb050730 for perforce@freebsd.org; Mon, 7 Apr 2003 00:59:45 -0700 (PDT) Date: Mon, 7 Apr 2003 00:59:45 -0700 (PDT) Message-Id: <200304070759.h377xjPb050730@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28416 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, 07 Apr 2003 07:59:48 -0000 http://perforce.freebsd.org/chv.cgi?CH=28416 Change 28416 by peter@peter_overcee on 2003/04/07 00:58:49 add 8-byte PCPU* implementation Affected files ... .. //depot/projects/hammer/sys/x86_64/include/pcpu.h#6 edit Differences ... ==== //depot/projects/hammer/sys/x86_64/include/pcpu.h#6 (text+ko) ==== @@ -104,6 +104,12 @@ : "=r" (__i) \ : "m" (*(u_int *)(__pcpu_offset(name)))); \ __result = *(__pcpu_type(name) *)&__i; \ + } else if (sizeof(__result) == 8) { \ + u_long __l; \ + __asm __volatile("movq %%fs:%1,%0" \ + : "=r" (__l) \ + : "m" (*(u_long *)(__pcpu_offset(name)))); \ + __result = *(__pcpu_type(name) *)&__l; \ } else { \ __result = *__PCPU_PTR(name); \ } \ @@ -135,6 +141,12 @@ __asm __volatile("movl %1,%%fs:%0" \ : "=m" (*(u_int *)(__pcpu_offset(name))) \ : "r" (__i)); \ + } else if (sizeof(__val) == 8) { \ + u_long __l; \ + __l = *(u_long *)&__val; \ + __asm __volatile("movq %1,%%fs:%0" \ + : "=m" (*(u_long *)(__pcpu_offset(name))) \ + : "r" (__l)); \ } else { \ *__PCPU_PTR(name) = __val; \ } \ From owner-p4-projects@FreeBSD.ORG Mon Apr 7 01:00:49 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 0BF0D37B404; Mon, 7 Apr 2003 01:00:49 -0700 (PDT) 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 A0F3837B401 for ; Mon, 7 Apr 2003 01:00:48 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2E01D43FB1 for ; Mon, 7 Apr 2003 01:00:48 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h3780m0U050931 for ; Mon, 7 Apr 2003 01:00:48 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h3780lLb050926 for perforce@freebsd.org; Mon, 7 Apr 2003 01:00:47 -0700 (PDT) Date: Mon, 7 Apr 2003 01:00:47 -0700 (PDT) Message-Id: <200304070800.h3780lLb050926@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28417 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, 07 Apr 2003 08:00:50 -0000 http://perforce.freebsd.org/chv.cgi?CH=28417 Change 28417 by peter@peter_overcee on 2003/04/07 01:00:41 argh. dont ask for 64 bit register when we mean %eax/%edx. Otherwise we get what we ask for.. The *msr instructions are 32 bit.. (!) Affected files ... .. //depot/projects/hammer/sys/x86_64/include/cpufunc.h#9 edit Differences ... ==== //depot/projects/hammer/sys/x86_64/include/cpufunc.h#9 (text+ko) ==== @@ -315,37 +315,37 @@ static __inline u_long read_rflags(void) { - u_long ef; + u_long rf; - __asm __volatile("pushfq; popq %0" : "=r" (ef)); - return (ef); + __asm __volatile("pushfq; popq %0" : "=r" (rf)); + return (rf); } static __inline u_int64_t rdmsr(u_int msr) { - u_int64_t rv; + u_int32_t low, high; - __asm __volatile("rdmsr" : "=A" (rv) : "c" (msr)); - return (rv); + __asm __volatile("rdmsr" : "=a" (low), "=d" (high) : "c" (msr)); + return (low | ((u_int64_t)high << 32)); } static __inline u_int64_t rdpmc(u_int pmc) { - u_int64_t rv; + u_int32_t low, high; - __asm __volatile("rdpmc" : "=A" (rv) : "c" (pmc)); - return (rv); + __asm __volatile("rdpmc" : "=a" (low), "=d" (high) : "c" (pmc)); + return (low | ((u_int64_t)high << 32)); } static __inline u_int64_t rdtsc(void) { - u_int64_t rv; + u_int32_t low, high; - __asm __volatile("rdtsc" : "=A" (rv)); - return (rv); + __asm __volatile("rdtsc" : "=a" (low), "=d" (high)); + return (low | ((u_int64_t)high << 32)); } static __inline void @@ -355,15 +355,19 @@ } static __inline void -write_rflags(u_long ef) +write_rflags(u_long rf) { - __asm __volatile("pushq %0; popfq" : : "r" (ef)); + __asm __volatile("pushq %0; popfq" : : "r" (rf)); } static __inline void wrmsr(u_int msr, u_int64_t newval) { - __asm __volatile("wrmsr" : : "A" (newval), "c" (msr)); + u_int32_t low, high; + + low = newval; + high = newval >> 32; + __asm __volatile("wrmsr" : : "a" (low), "d" (high), "c" (msr)); } static __inline void @@ -557,11 +561,11 @@ u_int64_t rdtsc(void); u_int read_rflags(void); void wbinvd(void); -void write_rflags(u_int ef); +void write_rflags(u_int rf); void wrmsr(u_int msr, u_int64_t newval); void load_dr7(u_int dr7); register_t intr_disable(void); -void intr_restore(register_t ef); +void intr_restore(register_t rf); #endif /* __GNUC__ */ From owner-p4-projects@FreeBSD.ORG Mon Apr 7 01:03:53 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 8FD1D37B404; Mon, 7 Apr 2003 01:03:53 -0700 (PDT) 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 1113A37B401 for ; Mon, 7 Apr 2003 01:03:53 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id A068443FAF for ; Mon, 7 Apr 2003 01:03:52 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h3783q0U052188 for ; Mon, 7 Apr 2003 01:03:52 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h3783qLo052185 for perforce@freebsd.org; Mon, 7 Apr 2003 01:03:52 -0700 (PDT) Date: Mon, 7 Apr 2003 01:03:52 -0700 (PDT) Message-Id: <200304070803.h3783qLo052185@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28418 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, 07 Apr 2003 08:03:54 -0000 http://perforce.freebsd.org/chv.cgi?CH=28418 Change 28418 by peter@peter_overcee on 2003/04/07 01:03:02 checkpoint. set %cs descriptor properly. L=1,D=1 is reserved and causes a fault if I try and use it. (doh!) upset jake and set proc0uarea and proc0kstack dump gdt contents for debugging deal with "elf64 kernel" vs "elf kernel" Affected files ... .. //depot/projects/hammer/sys/x86_64/x86_64/machdep.c#43 edit Differences ... ==== //depot/projects/hammer/sys/x86_64/x86_64/machdep.c#43 (text+ko) ==== @@ -590,7 +590,7 @@ 0, /* segment descriptor priority level */ 1, /* segment descriptor present */ 1, /* long */ - 1, /* default 32 vs 16 bit size */ + 0, /* default 32 vs 16 bit size */ 1 /* limit granularity (byte/page units)*/ }, /* GDATA_SEL 2 Data Descriptor for kernel */ { 0x0, /* segment base address */ @@ -1064,6 +1064,11 @@ p0kpa = allocpages(KSTACK_PAGES); printf("p0kpa = 0x%lx\n", p0kpa); + proc0uarea = (struct user *)(p0upa + KERNBASE); + printf("proc0uarea = 0x%lx\n", proc0uarea); + proc0kstack = p0kpa + KERNBASE; + printf("proc0kstack = 0x%lx\n", proc0kstack); + /* Fill in the underlying page table pages */ /* Read-only from zero to physfree */ /* XXX not actually used, underneath 2M pages */ @@ -1111,18 +1116,11 @@ first = physfree; printf("It is hammer_time!\n"); -printf("first = 0x%lx\n", first); create_pagetables(); -printf("got to the end; activating page tables...\n"); - load_cr3(IdlePML4); -printf("it worked!\n"); -printf("yippee!\n"); -for(;;); - proc0.p_uarea = proc0uarea; thread0.td_kstack = proc0kstack; thread0.td_pcb = (struct pcb *) @@ -1137,24 +1135,19 @@ preload_metadata = (caddr_t)(uintptr_t)(modulep + KERNBASE); preload_bootstrap_relocate(KERNBASE); - kmdp = preload_search_by_type("elf kernel"); + kmdp = preload_search_by_type("elf64 kernel"); + if (kmdp == NULL) + kmdp = preload_search_by_type("elf kernel"); boothowto = MD_FETCH(kmdp, MODINFOMD_HOWTO, int); - kern_envp = MD_FETCH(kmdp, MODINFOMD_ENVP, char *); + kern_envp = MD_FETCH(kmdp, MODINFOMD_ENVP, char *) + KERNBASE; /* Init basic tunables, hz etc */ init_param1(); +printf("gdt time, ugh\n"); /* - * make gdt memory segments, the code segment goes up to end of the - * page with etext in it, the data segment goes to the end of - * the address space - */ - /* - * XXX text protection is temporarily (?) disabled. The limit was - * i386_btop(round_page(etext)) - 1. + * make gdt memory segments */ - gdt_segs[GCODE_SEL].ssd_limit = -1; - gdt_segs[GDATA_SEL].ssd_limit = -1; gdt_segs[GPROC0_SEL].ssd_base = (uintptr_t)&common_tss.tss; for (x = 0; x < NGDT; x++) { @@ -1163,13 +1156,25 @@ } ssdtosyssd(&gdt_segs[GPROC0_SEL], (struct system_segment_descriptor *)&gdt[GPROC0_SEL]); +for (x = 0; x < NGDT; x++) +printf("gdt slot %d: 0x%016lx\n", x, *(long *)&gdt[x]); + r_gdt.rd_limit = NGDT * sizeof(gdt[0]) - 1; r_gdt.rd_base = (long) gdt; +printf("doing lgdt....\n"); lgdt(&r_gdt); +printf("lgdt done\n"); + pc = &__pcpu; + +printf("setting MSR_FSBASE and GSBASE to %p\n", pc); + wrmsr(MSR_FSBASE, (u_int64_t)pc); + wrmsr(MSR_GSBASE, (u_int64_t)pc); - pc = &__pcpu; +printf("pcpu init\n"); pcpu_init(pc, 0, sizeof(struct pcpu)); +printf("PCPU_SET(prvspace, pc)\n"); PCPU_SET(prvspace, pc); +printf("PCPU_SET(curthread, &thread0)\n"); PCPU_SET(curthread, &thread0); /* @@ -1180,9 +1185,11 @@ * must be able to get the icu lock, so it can't be * under witness. */ +printf("mutex init\n"); mutex_init(); mtx_init(&clock_lock, "clk", NULL, MTX_SPIN | MTX_RECURSE); mtx_init(&icu_lock, "icu", NULL, MTX_SPIN | MTX_NOWITNESS); +for(;;); /* exceptions */ for (x = 0; x < NIDT; x++) From owner-p4-projects@FreeBSD.ORG Mon Apr 7 02:15:25 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id E40F337B404; Mon, 7 Apr 2003 02:15:24 -0700 (PDT) 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 9A5FA37B401 for ; Mon, 7 Apr 2003 02:15:24 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3190D43F93 for ; Mon, 7 Apr 2003 02:15:24 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h379FO0U058017 for ; Mon, 7 Apr 2003 02:15:24 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h379FNrF058014 for perforce@freebsd.org; Mon, 7 Apr 2003 02:15:23 -0700 (PDT) Date: Mon, 7 Apr 2003 02:15:23 -0700 (PDT) Message-Id: <200304070915.h379FNrF058014@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28426 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, 07 Apr 2003 09:15:26 -0000 http://perforce.freebsd.org/chv.cgi?CH=28426 Change 28426 by peter@peter_overcee on 2003/04/07 02:14:45 MODINFOMD_SMAP - but the wrong place Affected files ... .. //depot/projects/hammer/sys/sys/linker.h#7 edit Differences ... ==== //depot/projects/hammer/sys/sys/linker.h#7 (text+ko) ==== @@ -194,6 +194,7 @@ #define MODINFOMD_ENVP 0x0006 /* envp[] */ #define MODINFOMD_HOWTO 0x0007 /* boothowto */ #define MODINFOMD_KERNEND 0x0008 /* kernend */ +#define MODINFOMD_SMAP 0x0009 /* i386 bios smap */ #define MODINFOMD_NOCOPY 0x8000 /* don't copy this metadata to the kernel */ #define MODINFOMD_DEPLIST (0x4001 | MODINFOMD_NOCOPY) /* depends on */ From owner-p4-projects@FreeBSD.ORG Mon Apr 7 02:15:26 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 2B38F37B401; Mon, 7 Apr 2003 02:15:26 -0700 (PDT) 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 5A75C37B408 for ; Mon, 7 Apr 2003 02:15:25 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id C326943F93 for ; Mon, 7 Apr 2003 02:15:24 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h379FO0U058023 for ; Mon, 7 Apr 2003 02:15:24 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h379FOU9058020 for perforce@freebsd.org; Mon, 7 Apr 2003 02:15:24 -0700 (PDT) Date: Mon, 7 Apr 2003 02:15:24 -0700 (PDT) Message-Id: <200304070915.h379FOU9058020@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28427 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, 07 Apr 2003 09:15:27 -0000 http://perforce.freebsd.org/chv.cgi?CH=28427 Change 28427 by peter@peter_overcee on 2003/04/07 02:15:11 checkpoint. we get as far as pmap_bootstrap() from getmemsize(). ouch. Affected files ... .. //depot/projects/hammer/sys/x86_64/x86_64/machdep.c#44 edit Differences ... ==== //depot/projects/hammer/sys/x86_64/x86_64/machdep.c#44 (text+ko) ==== @@ -736,41 +736,53 @@ * XXX first should be vm_paddr_t. */ static void -getmemsize(u_int64_t first) +getmemsize(caddr_t kmdp, u_int64_t first) { int i, physmap_idx, pa_indx; u_int basemem, extmem; vm_paddr_t pa, physmap[PHYSMAP_SIZE]; pt_entry_t *pte; char *cp; - struct bios_smap *smap; + struct bios_smap *smapbase, *smap, *smapend; + u_int32_t smapsize; bzero(physmap, sizeof(physmap)); basemem = 0; - smap = 0; + physmap_idx = 0; /* - * map page 1 R/W into the kernel page table so we can use it - * as a buffer. The kernel will unmap this page later. + * get memory map from INT 15:E820, kindly supplied by the loader. + * + * subr_module.c says: + * "Consumer may safely assume that size value precedes data." + * ie: an int32_t immediately precedes smap. */ - pmap_kenter(KERNBASE + (1 << PAGE_SHIFT), 1 << PAGE_SHIFT); + smapbase = MD_FETCH(kmdp, MODINFOMD_SMAP, struct bios_smap *) + KERNBASE; + if (smapbase == 0) { + printf("no bios smap, winging it\n"); + goto deep_shit; + } +printf("smapbase: %p\n", smapbase); + smapsize = ((u_int32_t *)smapbase)[-1]; +printf("smaplen = 0x%x\n", smapsize); + smapend = (struct bios_smap *)((uintptr_t)smapbase + smapsize); +printf("smapend: %p\n", smapend); - /* - * get memory map with INT 15:E820 - */ -/* #error "smap = fetch from loader metadata" */ - - physmap_idx = 0; - do { + for (smap = smapbase; smap < smapend; smap++) { if (boothowto & RB_VERBOSE) - printf("SMAP type=%02x base=%016llx len=%016llx\n", + printf("SMAP type=%02x base=%016lx len=%016lx\n", smap->type, smap->base, smap->length); - if (smap->type != 0x01) - goto next_run; + if (smap->type != 0x01) { +printf("bad type\n"); + continue; + } - if (smap->length == 0) - goto next_run; + if (smap->length == 0) { +printf("bad length\n"); +next_run: + continue; + } for (i = 0; i <= physmap_idx; i += 2) { if (smap->base < physmap[i + 1]) { @@ -783,7 +795,8 @@ if (smap->base == physmap[physmap_idx + 1]) { physmap[physmap_idx + 1] += smap->length; - goto next_run; +printf("contiguous\n"); + continue; } physmap_idx += 2; @@ -794,13 +807,13 @@ } physmap[physmap_idx] = smap->base; physmap[physmap_idx + 1] = smap->base + smap->length; -next_run: ; - } while (1 /* XXX more to go */); -/* #error "while not end of smap table from loader" */ + } +printf("MADE IT TO END!!\n"); /* * Perform "base memory" related probes & setup based on SMAP */ +deep_shit: if (basemem == 0) { for (i = 0; i <= physmap_idx; i += 2) { if (physmap[i] == 0x00000000) { @@ -810,6 +823,11 @@ } if (basemem == 0) { + basemem = rtcin(RTC_BASELO) + (rtcin(RTC_BASEHI) << 8); +printf("rtc says basemem = %d\n", basemem); + } + + if (basemem == 0) { basemem = 640; } @@ -819,29 +837,50 @@ basemem = 640; } +#if 0 for (pa = trunc_page(basemem * 1024); pa < ISA_HOLE_START; pa += PAGE_SIZE) pmap_kenter(KERNBASE + pa, pa); +#endif } if (physmap[1] != 0) goto physmap_done; /* - * If we failed above, try memory map with INT 15:E801 + * Prefer the RTC value for extended memory. + */ + extmem = rtcin(RTC_EXTLO) + (rtcin(RTC_EXTHI) << 8); +printf("rtc says extmem = %d\n", extmem); + + /* + * Special hack for chipsets that still remap the 384k hole when + * there's 16MB of memory - this really confuses people that + * are trying to use bus mastering ISA controllers with the + * "16MB limit"; they only have 16MB, but the remapping puts + * them beyond the limit. + * + * If extended memory is between 15-16MB (16-17MB phys address range), + * chop it to 15MB. */ -/* #error "get smap from loader" */ - else { - /* - * Prefer the RTC value for extended memory. - */ - extmem = rtcin(RTC_EXTLO) + (rtcin(RTC_EXTHI) << 8); - } + if ((extmem > 15 * 1024) && (extmem < 16 * 1024)) + extmem = 15 * 1024; + + physmap[0] = 0; + physmap[1] = basemem * 1024; + physmap_idx = 2; + physmap[physmap_idx] = 0x100000; + physmap[physmap_idx + 1] = physmap[physmap_idx] + extmem * 1024; physmap_done: /* * Now, physmap contains a map of physical memory. */ +printf("physmap_done\n"); +printf("physmap_idx = %d\n", physmap_idx); +for (i = 0; i <= physmap_idx; i += 2) { + printf("slot %d: 0x%16lx - 0x%16lx\n", i/2, physmap[i], physmap[i + 1]); +} /* * Maxmem isn't the "maximum memory", it's one larger than the @@ -855,6 +894,7 @@ Maxmem = MAXMEM / 4; #endif +printf("checking hw.physmem...\n"); /* * hw.physmem is a size in bytes; we also allow k, m, and g suffixes * for the appropriate modifiers. This overrides MAXMEM. @@ -900,8 +940,10 @@ if (atop(physmap[physmap_idx + 1]) < Maxmem) physmap[physmap_idx + 1] = ptoa((vm_paddr_t)Maxmem); +printf("about to call pmap_bootstrap...\n\n"); /* call pmap initialization to make new kernel address space */ pmap_bootstrap(first, 0); +printf("pmap_bootstrap done...\n"); /* * Size up each available chunk of physical memory. @@ -1029,6 +1071,7 @@ phys_avail[pa_indx] -= round_page(MSGBUF_SIZE); avail_end = phys_avail[pa_indx]; +printf("getmemsize finished!\n"); } static u_int64_t @@ -1144,7 +1187,6 @@ /* Init basic tunables, hz etc */ init_param1(); -printf("gdt time, ugh\n"); /* * make gdt memory segments */ @@ -1156,12 +1198,8 @@ } ssdtosyssd(&gdt_segs[GPROC0_SEL], (struct system_segment_descriptor *)&gdt[GPROC0_SEL]); -for (x = 0; x < NGDT; x++) -printf("gdt slot %d: 0x%016lx\n", x, *(long *)&gdt[x]); - r_gdt.rd_limit = NGDT * sizeof(gdt[0]) - 1; r_gdt.rd_base = (long) gdt; -printf("doing lgdt....\n"); lgdt(&r_gdt); printf("lgdt done\n"); pc = &__pcpu; @@ -1170,11 +1208,8 @@ wrmsr(MSR_FSBASE, (u_int64_t)pc); wrmsr(MSR_GSBASE, (u_int64_t)pc); -printf("pcpu init\n"); pcpu_init(pc, 0, sizeof(struct pcpu)); -printf("PCPU_SET(prvspace, pc)\n"); PCPU_SET(prvspace, pc); -printf("PCPU_SET(curthread, &thread0)\n"); PCPU_SET(curthread, &thread0); /* @@ -1185,11 +1220,9 @@ * must be able to get the icu lock, so it can't be * under witness. */ -printf("mutex init\n"); mutex_init(); mtx_init(&clock_lock, "clk", NULL, MTX_SPIN | MTX_RECURSE); mtx_init(&icu_lock, "icu", NULL, MTX_SPIN | MTX_NOWITNESS); -for(;;); /* exceptions */ for (x = 0; x < NIDT; x++) @@ -1242,11 +1275,13 @@ r_idt.rd_limit = sizeof(idt0) - 1; r_idt.rd_base = (long) idt; lidt(&r_idt); +printf("survived lidt!\n"); /* * Initialize the console before we print anything out. */ cninit(); +printf("done cninit\n"); #ifdef DEV_ISA isa_defaultirq(); @@ -1270,12 +1305,14 @@ #endif /* make an initial tss so cpu can get interrupt stack on syscall! */ -#if 0 - PCPU_SET(common_tss.tss_esp0, thread0.td_kstack + - KSTACK_PAGES * PAGE_SIZE - sizeof(struct pcb)); -#endif + common_tss.tss.tss_rsp0 = thread0.td_kstack + KSTACK_PAGES * PAGE_SIZE - sizeof(struct pcb); +printf("thread0.td_kstack = %p\n", thread0.td_kstack); +printf("tss_rsp0 = %p\n", common_tss.tss.tss_rsp0); +printf("about to ltr\n"); + gsel_tss = GSEL(GPROC0_SEL, SEL_KPL); ltr(gsel_tss); +printf("survived ltr!\n"); #if 0 dblfault_tss.tss_esp = dblfault_tss.tss_esp0 = dblfault_tss.tss_esp1 = @@ -1294,21 +1331,29 @@ dblfault_tss.tss_cs = GSEL(GCODE_SEL, SEL_KPL); #endif - getmemsize(first); +printf("calling getmemsize\n"); + getmemsize(kmdp, first); +printf("calling init_param2\n"); init_param2(physmem); /* now running on new page tables, configured,and u/iom is accessible */ +printf("map message buffer\n"); /* Map the message buffer. */ for (off = 0; off < round_page(MSGBUF_SIZE); off += PAGE_SIZE) pmap_kenter((vm_offset_t)msgbufp + off, avail_end + off); +printf("calling msgbufinit\n"); msgbufinit(msgbufp, MSGBUF_SIZE); +printf("setup proc0\n"); /* setup proc 0's pcb */ thread0.td_pcb->pcb_flags = 0; /* XXXKSE */ thread0.td_pcb->pcb_cr3 = IdlePML4; thread0.td_frame = &proc0_tf; + +printf("HAMMER TIME!!\n"); +printf("HALT\n\n"); for(;;); } void From owner-p4-projects@FreeBSD.ORG Mon Apr 7 02:17:29 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id D22C637B404; Mon, 7 Apr 2003 02:17:28 -0700 (PDT) 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 6779737B401 for ; Mon, 7 Apr 2003 02:17:28 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id E797643FAF for ; Mon, 7 Apr 2003 02:17:27 -0700 (PDT) (envelope-from marcel@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h379HR0U058118 for ; Mon, 7 Apr 2003 02:17:27 -0700 (PDT) (envelope-from marcel@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h379HRH0058115 for perforce@freebsd.org; Mon, 7 Apr 2003 02:17:27 -0700 (PDT) Date: Mon, 7 Apr 2003 02:17:27 -0700 (PDT) Message-Id: <200304070917.h379HRH0058115@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 28428 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, 07 Apr 2003 09:17:29 -0000 http://perforce.freebsd.org/chv.cgi?CH=28428 Change 28428 by marcel@marcel_nfs on 2003/04/07 02:16:58 Fix usage of _thread_printf(). Add a file descriptor in two cases and use STDERR_FILENO in all cases. Affected files ... .. //depot/projects/ia64/lib/libthr/thread/thr_create.c#2 edit .. //depot/projects/ia64/lib/libthr/thread/thr_gc.c#2 edit .. //depot/projects/ia64/lib/libthr/thread/thr_kern.c#2 edit Differences ... ==== //depot/projects/ia64/lib/libthr/thread/thr_create.c#2 (text+ko) ==== @@ -187,7 +187,7 @@ ret = thr_create(&new_thread->ctx, &new_thread->thr_id, flags); if (ret != 0) { - _thread_printf("thr_create() == %d\n", ret); + _thread_printf(STDERR_FILENO, "thr_create() == %d\n", ret); PANIC("thr_create"); } ==== //depot/projects/ia64/lib/libthr/thread/thr_gc.c#2 (text+ko) ==== @@ -178,7 +178,7 @@ */ if ((ret = pthread_cond_timedwait(&_gc_cond, &_gc_mutex, &abstime)) != 0 && ret != ETIMEDOUT) { - _thread_printf("ret = %d", ret); + _thread_printf(STDERR_FILENO, "ret = %d", ret); PANIC("gc cannot wait for a signal"); } } ==== //depot/projects/ia64/lib/libthr/thread/thr_kern.c#2 (text+ko) ==== @@ -34,6 +34,7 @@ #include #include #include +#include #include "thr_private.h" @@ -69,14 +70,15 @@ #if 0 error = __sys_sigprocmask(SIG_SETMASK, &set, &sav); if (error) { - _thread_printf(0, "GIANT_LOCK: sig err %d\n", errno); + _thread_printf(STDERR_FILENO, "GIANT_LOCK: sig err %d\n", + errno); abort(); } #endif error = umtx_lock(&_giant_mutex, pthread->thr_id); if (error) { - _thread_printf(0, "GIANT_LOCK: %d\n", errno); + _thread_printf(STDERR_FILENO, "GIANT_LOCK: %d\n", errno); abort(); } @@ -99,7 +101,7 @@ error = umtx_unlock(&_giant_mutex, pthread->thr_id); if (error) { - _thread_printf(0, "GIANT_UNLOCK: %d\n", errno); + _thread_printf(STDERR_FILENO, "GIANT_UNLOCK: %d\n", errno); abort(); } @@ -109,7 +111,8 @@ */ error = __sys_sigprocmask(SIG_SETMASK, &set, NULL); if (error) { - _thread_printf(0, "GIANT_UNLOCK: sig err %d\n", errno); + _thread_printf(STDERR_FILENO, "GIANT_UNLOCK: sig err %d\n", + errno); abort(); } #endif From owner-p4-projects@FreeBSD.ORG Mon Apr 7 02:27:41 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id A900837B404; Mon, 7 Apr 2003 02:27:41 -0700 (PDT) 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 4883837B401 for ; Mon, 7 Apr 2003 02:27:41 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id D3D4943F85 for ; Mon, 7 Apr 2003 02:27:40 -0700 (PDT) (envelope-from marcel@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h379Re0U058782 for ; Mon, 7 Apr 2003 02:27:40 -0700 (PDT) (envelope-from marcel@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h379ReIw058779 for perforce@freebsd.org; Mon, 7 Apr 2003 02:27:40 -0700 (PDT) Date: Mon, 7 Apr 2003 02:27:40 -0700 (PDT) Message-Id: <200304070927.h379ReIw058779@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 28429 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, 07 Apr 2003 09:27:42 -0000 http://perforce.freebsd.org/chv.cgi?CH=28429 Change 28429 by marcel@marcel_nfs on 2003/04/07 02:27:07 Port libthr to ia64. This does not work due to the lack of makecontext(3) on ia64. Affected files ... .. //depot/projects/ia64/lib/libthr/arch/ia64/Makefile.inc#1 add .. //depot/projects/ia64/lib/libthr/arch/ia64/ia64/_curthread.c#1 add Differences ... From owner-p4-projects@FreeBSD.ORG Mon Apr 7 14:20:29 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id F320B37B404; Mon, 7 Apr 2003 14:20:28 -0700 (PDT) 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 8115737B401 for ; Mon, 7 Apr 2003 14:20:28 -0700 (PDT) Received: from mail.speakeasy.net (mail11.speakeasy.net [216.254.0.211]) by mx1.FreeBSD.org (Postfix) with ESMTP id 845D743FBF for ; Mon, 7 Apr 2003 14:20:27 -0700 (PDT) (envelope-from jhb@FreeBSD.org) Received: (qmail 22168 invoked from network); 7 Apr 2003 21:20:35 -0000 Received: from unknown (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender )encrypted SMTP for ; 7 Apr 2003 21:20:35 -0000 Received: from laptop.baldwin.cx (gw1.twc.weather.com [216.133.140.1]) by server.baldwin.cx (8.12.8/8.12.8) with ESMTP id h37LKPOv043914; Mon, 7 Apr 2003 17:20:25 -0400 (EDT) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.5.4 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <200304050333.h353XRdE099823@repoman.freebsd.org> Date: Mon, 07 Apr 2003 16:20:26 -0400 (EDT) From: John Baldwin To: Peter Wemm cc: Perforce Change Reviews Subject: RE: PERFORCE change 28149 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, 07 Apr 2003 21:20:30 -0000 On 05-Apr-2003 Peter Wemm wrote: > http://perforce.freebsd.org/chv.cgi?CH=28149 > > Change 28149 by peter@peter_overcee on 2003/04/04 19:32:58 > > oops. s/l/q/ in write_rflags() > > Affected files ... > > .. //depot/projects/hammer/sys/x86_64/include/cpufunc.h#7 edit > > Differences ... > > ==== //depot/projects/hammer/sys/x86_64/include/cpufunc.h#7 (text+ko) ==== > > @@ -357,7 +357,7 @@ > static __inline void > write_rflags(u_long ef) On an unrelated topic: A lot of these cpufunc things should use register_t rather than int or long. This would have slightly simplified porting them to hammer and reduce the diffs. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ From owner-p4-projects@FreeBSD.ORG Mon Apr 7 16:15:39 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 2978E37B405; Mon, 7 Apr 2003 16:15:39 -0700 (PDT) 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 96D9437B401 for ; Mon, 7 Apr 2003 16:15:38 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2222843FEA for ; Mon, 7 Apr 2003 16:15:38 -0700 (PDT) (envelope-from marcel@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h37NFb0U046830 for ; Mon, 7 Apr 2003 16:15:37 -0700 (PDT) (envelope-from marcel@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h37NFbhh046827 for perforce@freebsd.org; Mon, 7 Apr 2003 16:15:37 -0700 (PDT) Date: Mon, 7 Apr 2003 16:15:37 -0700 (PDT) Message-Id: <200304072315.h37NFbhh046827@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 28459 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, 07 Apr 2003 23:15:40 -0000 http://perforce.freebsd.org/chv.cgi?CH=28459 Change 28459 by marcel@marcel_pluto1 on 2003/04/07 16:15:30 IFia64 Affected files ... .. //depot/projects/ia64_epc/lib/libthr/arch/ia64/Makefile.inc#1 branch .. //depot/projects/ia64_epc/lib/libthr/arch/ia64/ia64/_curthread.c#1 branch .. //depot/projects/ia64_epc/lib/libthr/thread/thr_create.c#2 integrate .. //depot/projects/ia64_epc/lib/libthr/thread/thr_gc.c#2 integrate .. //depot/projects/ia64_epc/lib/libthr/thread/thr_kern.c#2 integrate Differences ... ==== //depot/projects/ia64_epc/lib/libthr/thread/thr_create.c#2 (text+ko) ==== @@ -187,7 +187,7 @@ ret = thr_create(&new_thread->ctx, &new_thread->thr_id, flags); if (ret != 0) { - _thread_printf("thr_create() == %d\n", ret); + _thread_printf(STDERR_FILENO, "thr_create() == %d\n", ret); PANIC("thr_create"); } ==== //depot/projects/ia64_epc/lib/libthr/thread/thr_gc.c#2 (text+ko) ==== @@ -178,7 +178,7 @@ */ if ((ret = pthread_cond_timedwait(&_gc_cond, &_gc_mutex, &abstime)) != 0 && ret != ETIMEDOUT) { - _thread_printf("ret = %d", ret); + _thread_printf(STDERR_FILENO, "ret = %d", ret); PANIC("gc cannot wait for a signal"); } } ==== //depot/projects/ia64_epc/lib/libthr/thread/thr_kern.c#2 (text+ko) ==== @@ -34,6 +34,7 @@ #include #include #include +#include #include "thr_private.h" @@ -69,14 +70,15 @@ #if 0 error = __sys_sigprocmask(SIG_SETMASK, &set, &sav); if (error) { - _thread_printf(0, "GIANT_LOCK: sig err %d\n", errno); + _thread_printf(STDERR_FILENO, "GIANT_LOCK: sig err %d\n", + errno); abort(); } #endif error = umtx_lock(&_giant_mutex, pthread->thr_id); if (error) { - _thread_printf(0, "GIANT_LOCK: %d\n", errno); + _thread_printf(STDERR_FILENO, "GIANT_LOCK: %d\n", errno); abort(); } @@ -99,7 +101,7 @@ error = umtx_unlock(&_giant_mutex, pthread->thr_id); if (error) { - _thread_printf(0, "GIANT_UNLOCK: %d\n", errno); + _thread_printf(STDERR_FILENO, "GIANT_UNLOCK: %d\n", errno); abort(); } @@ -109,7 +111,8 @@ */ error = __sys_sigprocmask(SIG_SETMASK, &set, NULL); if (error) { - _thread_printf(0, "GIANT_UNLOCK: sig err %d\n", errno); + _thread_printf(STDERR_FILENO, "GIANT_UNLOCK: sig err %d\n", + errno); abort(); } #endif From owner-p4-projects@FreeBSD.ORG Mon Apr 7 16:36:05 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id DF63F37B404; Mon, 7 Apr 2003 16:36:04 -0700 (PDT) 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 9467637B401 for ; Mon, 7 Apr 2003 16:36:04 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 409A843F3F for ; Mon, 7 Apr 2003 16:36:04 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h37Na30U048097 for ; Mon, 7 Apr 2003 16:36:03 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h37Na3xa048094 for perforce@freebsd.org; Mon, 7 Apr 2003 16:36:03 -0700 (PDT) Date: Mon, 7 Apr 2003 16:36:03 -0700 (PDT) Message-Id: <200304072336.h37Na3xa048094@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28461 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, 07 Apr 2003 23:36:05 -0000 http://perforce.freebsd.org/chv.cgi?CH=28461 Change 28461 by peter@peter_daintree on 2003/04/07 16:35:32 use -mcmodel=medium for hammer. Otherwise it generates 32 bit instructions for things like invltlb(). kernel model comes later. Affected files ... .. //depot/projects/hammer/sys/conf/kern.mk#3 edit Differences ... ==== //depot/projects/hammer/sys/conf/kern.mk#3 (text+ko) ==== @@ -53,6 +53,14 @@ .endif # +# For AMD x86-64, use a medium model for now. We'll switch to "kernel" +# once pmap is ready. +# +.if ${MACHINE_ARCH} == "x86_64" +CFLAGS+= -mcmodel=medium +.endif + +# # GCC 3.0 and above like to do certain optimizations based on the # assumption that the program is linked against libc. Stop this. # From owner-p4-projects@FreeBSD.ORG Mon Apr 7 16:37:07 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 2426437B404; Mon, 7 Apr 2003 16:37:07 -0700 (PDT) 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 BAEED37B401 for ; Mon, 7 Apr 2003 16:37:06 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6806E43F93 for ; Mon, 7 Apr 2003 16:37:06 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h37Nb60U048143 for ; Mon, 7 Apr 2003 16:37:06 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h37Nb5W3048140 for perforce@freebsd.org; Mon, 7 Apr 2003 16:37:05 -0700 (PDT) Date: Mon, 7 Apr 2003 16:37:05 -0700 (PDT) Message-Id: <200304072337.h37Nb5W3048140@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28462 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, 07 Apr 2003 23:37:08 -0000 http://perforce.freebsd.org/chv.cgi?CH=28462 Change 28462 by peter@peter_daintree on 2003/04/07 16:36:24 having -O crash is a function of my machine at home for some reason. disable CPUTYPE. Affected files ... .. //depot/projects/hammer/sys/conf/Makefile.x86_64#8 edit Differences ... ==== //depot/projects/hammer/sys/conf/Makefile.x86_64#8 (text+ko) ==== @@ -28,7 +28,8 @@ OBJCOPY= x86_64-unknown-freebsd5.0-objcopy OBJDUMP= x86_64-unknown-freebsd5.0-objdump MACHINE_ARCH= x86_64 -COPTFLAGS= # none, -O crashes the 3.2 cross compiler I have +#COPTFLAGS= # none, -O crashes the 3.2 cross compiler I have +NO_CPU_COPTFLAGS= true # Which version of config(8) is required. From owner-p4-projects@FreeBSD.ORG Mon Apr 7 17:16:56 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 680BA37B404; Mon, 7 Apr 2003 17:16:56 -0700 (PDT) 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 068D237B401 for ; Mon, 7 Apr 2003 17:16:56 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id A48A043FA3 for ; Mon, 7 Apr 2003 17:16:55 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h380Gt0U057177 for ; Mon, 7 Apr 2003 17:16:55 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h380Gtq7057174 for perforce@freebsd.org; Mon, 7 Apr 2003 17:16:55 -0700 (PDT) Date: Mon, 7 Apr 2003 17:16:55 -0700 (PDT) Message-Id: <200304080016.h380Gtq7057174@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28464 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, 08 Apr 2003 00:16:57 -0000 http://perforce.freebsd.org/chv.cgi?CH=28464 Change 28464 by peter@peter_daintree on 2003/04/07 17:16:42 collect page table geometry defines together with the others Affected files ... .. //depot/projects/hammer/sys/x86_64/include/param.h#10 edit .. //depot/projects/hammer/sys/x86_64/include/pmap.h#15 edit Differences ... ==== //depot/projects/hammer/sys/x86_64/include/param.h#10 (text+ko) ==== @@ -111,8 +111,9 @@ #define NBPML4T (1ul< Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 117FC37B407; Mon, 7 Apr 2003 17:17:59 -0700 (PDT) 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 A4EF937B401 for ; Mon, 7 Apr 2003 17:17:58 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id AB85443F93 for ; Mon, 7 Apr 2003 17:17:57 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h380Hv0U057207 for ; Mon, 7 Apr 2003 17:17:57 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h380HvG6057204 for perforce@freebsd.org; Mon, 7 Apr 2003 17:17:57 -0700 (PDT) Date: Mon, 7 Apr 2003 17:17:57 -0700 (PDT) Message-Id: <200304080017.h380HvG6057204@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28465 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, 08 Apr 2003 00:18:00 -0000 http://perforce.freebsd.org/chv.cgi?CH=28465 Change 28465 by peter@peter_daintree on 2003/04/07 17:17:24 remove most debug printfs, we get past here now. Affected files ... .. //depot/projects/hammer/sys/x86_64/x86_64/machdep.c#45 edit Differences ... ==== //depot/projects/hammer/sys/x86_64/x86_64/machdep.c#45 (text+ko) ==== @@ -141,7 +141,7 @@ u_int64_t IdlePML4; /* phys addr of kernel level 4 */ struct user *proc0uarea; /* address of proc 0 uarea space */ vm_offset_t proc0kstack; /* address of proc 0 kstack space */ - + int cold = 1; long Maxmem = 0; @@ -712,7 +712,7 @@ sd->sd_p = ssd->ssd_p; sd->sd_gran = ssd->ssd_gran; } - + #define PHYSMAP_SIZE (2 * 8) @@ -774,12 +774,10 @@ smap->type, smap->base, smap->length); if (smap->type != 0x01) { -printf("bad type\n"); continue; } if (smap->length == 0) { -printf("bad length\n"); next_run: continue; } @@ -795,7 +793,6 @@ if (smap->base == physmap[physmap_idx + 1]) { physmap[physmap_idx + 1] += smap->length; -printf("contiguous\n"); continue; } @@ -808,7 +805,6 @@ physmap[physmap_idx] = smap->base; physmap[physmap_idx + 1] = smap->base + smap->length; } -printf("MADE IT TO END!!\n"); /* * Perform "base memory" related probes & setup based on SMAP @@ -876,7 +872,6 @@ /* * Now, physmap contains a map of physical memory. */ -printf("physmap_done\n"); printf("physmap_idx = %d\n", physmap_idx); for (i = 0; i <= physmap_idx; i += 2) { printf("slot %d: 0x%16lx - 0x%16lx\n", i/2, physmap[i], physmap[i + 1]); @@ -885,7 +880,7 @@ /* * Maxmem isn't the "maximum memory", it's one larger than the * highest page of the physical address space. It should be - * called something like "Maxphyspage". We may adjust this + * called something like "Maxphyspage". We may adjust this * based on ``hw.physmem'' and the results of the memory test. */ Maxmem = atop(physmap[physmap_idx + 1]); @@ -894,7 +889,6 @@ Maxmem = MAXMEM / 4; #endif -printf("checking hw.physmem...\n"); /* * hw.physmem is a size in bytes; we also allow k, m, and g suffixes * for the appropriate modifiers. This overrides MAXMEM. @@ -936,14 +930,12 @@ /* * If Maxmem has been increased beyond what the system has detected, * extend the last memory segment to the new limit. - */ + */ if (atop(physmap[physmap_idx + 1]) < Maxmem) physmap[physmap_idx + 1] = ptoa((vm_paddr_t)Maxmem); -printf("about to call pmap_bootstrap...\n\n"); /* call pmap initialization to make new kernel address space */ pmap_bootstrap(first, 0); -printf("pmap_bootstrap done...\n"); /* * Size up each available chunk of physical memory. @@ -973,7 +965,7 @@ */ if (pa >= 0x100000 && pa < first) continue; - + page_bad = FALSE; /* @@ -1071,7 +1063,6 @@ phys_avail[pa_indx] -= round_page(MSGBUF_SIZE); avail_end = phys_avail[pa_indx]; -printf("getmemsize finished!\n"); } static u_int64_t @@ -1096,9 +1087,9 @@ /* Allocate pages */ KPTphys = allocpages(NKPT); printf("KPTphys = 0x%lx\n", KPTphys); - IdlePML4 = allocpages(1); + IdlePML4 = allocpages(NKPML4E); printf("IdlePML4 = 0x%lx\n", IdlePML4); - IdlePDP = allocpages(1); + IdlePDP = allocpages(NKPDPE); printf("IdlePDP = 0x%lx\n", IdlePDP); IdlePTD = allocpages(NPGPTD); printf("IdlePTD = 0x%lx\n", IdlePTD); @@ -1117,14 +1108,16 @@ /* XXX not actually used, underneath 2M pages */ for (i = 0; (i << PAGE_SHIFT) < physfree; i++) { ((pt_entry_t *)KPTphys)[i] = i << PAGE_SHIFT; - ((pt_entry_t *)KPTphys)[i] |= PG_RW; + ((pt_entry_t *)KPTphys)[i] |= PG_RW | PG_V; } - + +#if 0 /* Map from zero to end of allocations under 2M pages */ for (i = 0; (i << PDRSHIFT) < physfree; i++) { ((pd_entry_t *)IdlePTD)[i] = i << PDRSHIFT; ((pd_entry_t *)IdlePTD)[i] |= PG_RW | PG_V | PG_PS; } +#endif /* Now map the page tables at their location within PTmap */ for (i = 0; i < NKPT; i++) { @@ -1132,6 +1125,12 @@ ((pd_entry_t *)IdlePTD)[i + KPTDI] |= PG_RW | PG_V; } + /* Now map the page tables at their location within PTmap */ + for (i = 0; i < NKPT; i++) { + ((pd_entry_t *)IdlePTD)[i] = KPTphys + (i << PAGE_SHIFT); + ((pd_entry_t *)IdlePTD)[i] |= PG_RW | PG_V; + } + /* Now map the PTD at the top of the PTmap (ie: PTD[]) */ for (i = 0; i < NPGPTD; i++) { ((pd_entry_t *)IdlePTD)[i + PTDPTDI] = IdlePTD + (i << PAGE_SHIFT); @@ -1139,9 +1138,10 @@ } /* And connect up the PTD to the PDP */ - /* XXX index 1 == 1GB, where the KERNBASE is for now */ - ((pdp_entry_t *)IdlePDP)[1] = IdlePTD; - ((pdp_entry_t *)IdlePDP)[1] |= PG_RW | PG_V; + for (i = 0; i < NPGPTD; i++) { + ((pdp_entry_t *)IdlePDP)[i] = IdlePTD + (i << PAGE_SHIFT); + ((pdp_entry_t *)IdlePDP)[i] |= PG_RW | PG_V | PG_U; + } /* And connect up the PDP to the PML4 */ ((pdp_entry_t *)IdlePML4)[0] = IdlePDP; @@ -1158,7 +1158,6 @@ u_int64_t first; first = physfree; -printf("It is hammer_time!\n"); create_pagetables(); @@ -1201,10 +1200,8 @@ r_gdt.rd_limit = NGDT * sizeof(gdt[0]) - 1; r_gdt.rd_base = (long) gdt; lgdt(&r_gdt); -printf("lgdt done\n"); - pc = &__pcpu; + pc = &__pcpu; -printf("setting MSR_FSBASE and GSBASE to %p\n", pc); wrmsr(MSR_FSBASE, (u_int64_t)pc); wrmsr(MSR_GSBASE, (u_int64_t)pc); @@ -1275,13 +1272,11 @@ r_idt.rd_limit = sizeof(idt0) - 1; r_idt.rd_base = (long) idt; lidt(&r_idt); -printf("survived lidt!\n"); /* * Initialize the console before we print anything out. */ cninit(); -printf("done cninit\n"); #ifdef DEV_ISA isa_defaultirq(); @@ -1306,13 +1301,9 @@ /* make an initial tss so cpu can get interrupt stack on syscall! */ common_tss.tss.tss_rsp0 = thread0.td_kstack + KSTACK_PAGES * PAGE_SIZE - sizeof(struct pcb); -printf("thread0.td_kstack = %p\n", thread0.td_kstack); -printf("tss_rsp0 = %p\n", common_tss.tss.tss_rsp0); -printf("about to ltr\n"); gsel_tss = GSEL(GPROC0_SEL, SEL_KPL); ltr(gsel_tss); -printf("survived ltr!\n"); #if 0 dblfault_tss.tss_esp = dblfault_tss.tss_esp0 = dblfault_tss.tss_esp1 = @@ -1331,29 +1322,22 @@ dblfault_tss.tss_cs = GSEL(GCODE_SEL, SEL_KPL); #endif -printf("calling getmemsize\n"); getmemsize(kmdp, first); -printf("calling init_param2\n"); init_param2(physmem); /* now running on new page tables, configured,and u/iom is accessible */ -printf("map message buffer\n"); /* Map the message buffer. */ for (off = 0; off < round_page(MSGBUF_SIZE); off += PAGE_SIZE) pmap_kenter((vm_offset_t)msgbufp + off, avail_end + off); -printf("calling msgbufinit\n"); msgbufinit(msgbufp, MSGBUF_SIZE); -printf("setup proc0\n"); /* setup proc 0's pcb */ thread0.td_pcb->pcb_flags = 0; /* XXXKSE */ thread0.td_pcb->pcb_cr3 = IdlePML4; thread0.td_frame = &proc0_tf; -printf("HAMMER TIME!!\n"); -printf("HALT\n\n"); for(;;); } void From owner-p4-projects@FreeBSD.ORG Mon Apr 7 17:26:09 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 177F537B404; Mon, 7 Apr 2003 17:26:09 -0700 (PDT) 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 AA5A537B401 for ; Mon, 7 Apr 2003 17:26:08 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 50ACB43FDD for ; Mon, 7 Apr 2003 17:26:08 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h380Q80U057825 for ; Mon, 7 Apr 2003 17:26:08 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h380Q7d9057822 for perforce@freebsd.org; Mon, 7 Apr 2003 17:26:07 -0700 (PDT) Date: Mon, 7 Apr 2003 17:26:07 -0700 (PDT) Message-Id: <200304080026.h380Q7d9057822@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28466 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, 08 Apr 2003 00:26:10 -0000 http://perforce.freebsd.org/chv.cgi?CH=28466 Change 28466 by peter@peter_overcee on 2003/04/07 17:25:56 update some 4MB page references to 2MB Affected files ... .. //depot/projects/hammer/sys/x86_64/x86_64/pmap.c#17 edit Differences ... ==== //depot/projects/hammer/sys/x86_64/x86_64/pmap.c#17 (text+ko) ==== @@ -246,8 +246,8 @@ /* * Move the kernel virtual free pointer to the next - * 4MB. This is used to help improve performance - * by using a large (4MB) page for much of the kernel + * 2MB. This is used to help improve performance + * by using a large (2MB) page for much of the kernel * (.text, .data, .bss) */ static vm_offset_t @@ -255,6 +255,9 @@ { vm_offset_t newaddr = addr; +#if 0 + newaddr = (addr + (NBPDR - 1)) & ~(NBPDR - 1); +#endif return newaddr; } @@ -364,9 +367,11 @@ pgeflag = 0; /* - * Initialize the 4MB page size flag + * Initialize the 2MB page size flag */ - pseflag = 0; +#if 0 + pseflag = PG_PS; +#endif invltlb(); } @@ -1185,7 +1190,7 @@ ptepa = (vm_offset_t) pmap->pm_pdir[ptepindex]; /* - * This supports switching from a 4MB page to a + * This supports switching from a 2MB page to a * normal 4K page. */ if (ptepa & PG_PS) { @@ -1807,7 +1812,7 @@ opa = origpte & PG_FRAME; if (origpte & PG_PS) - panic("pmap_enter: attempted pmap_enter on 4MB page"); + panic("pmap_enter: attempted pmap_enter on 2MB page"); /* * Mapping has not changed, must be protection or wiring change. @@ -1960,7 +1965,7 @@ */ if (ptepa) { if (ptepa & PG_PS) - panic("pmap_enter_quick: unexpected mapping into 4MB page"); + panic("pmap_enter_quick: unexpected mapping into 2MB page"); if (pmap->pm_pteobj->root && (pmap->pm_pteobj->root->pindex == ptepindex)) { mpte = pmap->pm_pteobj->root; From owner-p4-projects@FreeBSD.ORG Mon Apr 7 17:32:17 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 2AD5037B404; Mon, 7 Apr 2003 17:32:17 -0700 (PDT) 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 BED1D37B401 for ; Mon, 7 Apr 2003 17:32:16 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6A05543F75 for ; Mon, 7 Apr 2003 17:32:16 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h380WG0U058383 for ; Mon, 7 Apr 2003 17:32:16 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h380WFAU058380 for perforce@freebsd.org; Mon, 7 Apr 2003 17:32:15 -0700 (PDT) Date: Mon, 7 Apr 2003 17:32:15 -0700 (PDT) Message-Id: <200304080032.h380WFAU058380@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28467 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, 08 Apr 2003 00:32:18 -0000 http://perforce.freebsd.org/chv.cgi?CH=28467 Change 28467 by peter@peter_daintree on 2003/04/07 17:31:49 nuke some more noisy printfs Affected files ... .. //depot/projects/hammer/sys/x86_64/x86_64/machdep.c#46 edit Differences ... ==== //depot/projects/hammer/sys/x86_64/x86_64/machdep.c#46 (text+ko) ==== @@ -1086,22 +1086,14 @@ /* Allocate pages */ KPTphys = allocpages(NKPT); - printf("KPTphys = 0x%lx\n", KPTphys); IdlePML4 = allocpages(NKPML4E); - printf("IdlePML4 = 0x%lx\n", IdlePML4); IdlePDP = allocpages(NKPDPE); - printf("IdlePDP = 0x%lx\n", IdlePDP); IdlePTD = allocpages(NPGPTD); - printf("IdlePTD = 0x%lx\n", IdlePTD); p0upa = allocpages(UAREA_PAGES); - printf("p0upa = 0x%lx\n", p0upa); p0kpa = allocpages(KSTACK_PAGES); - printf("p0kpa = 0x%lx\n", p0kpa); proc0uarea = (struct user *)(p0upa + KERNBASE); - printf("proc0uarea = 0x%lx\n", proc0uarea); proc0kstack = p0kpa + KERNBASE; - printf("proc0kstack = 0x%lx\n", proc0kstack); /* Fill in the underlying page table pages */ /* Read-only from zero to physfree */ From owner-p4-projects@FreeBSD.ORG Mon Apr 7 18:30:29 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 4AE6937B404; Mon, 7 Apr 2003 18:30:29 -0700 (PDT) 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 01FF137B401 for ; Mon, 7 Apr 2003 18:30:29 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8CABD43F75 for ; Mon, 7 Apr 2003 18:30:28 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h381US0U064361 for ; Mon, 7 Apr 2003 18:30:28 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h381USLn064355 for perforce@freebsd.org; Mon, 7 Apr 2003 18:30:28 -0700 (PDT) Date: Mon, 7 Apr 2003 18:30:28 -0700 (PDT) Message-Id: <200304080130.h381USLn064355@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28470 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, 08 Apr 2003 01:30:30 -0000 http://perforce.freebsd.org/chv.cgi?CH=28470 Change 28470 by peter@peter_daintree on 2003/04/07 18:29:57 -mno-red-zone would be good too. Affected files ... .. //depot/projects/hammer/sys/conf/kern.mk#4 edit Differences ... ==== //depot/projects/hammer/sys/conf/kern.mk#4 (text+ko) ==== @@ -57,7 +57,7 @@ # once pmap is ready. # .if ${MACHINE_ARCH} == "x86_64" -CFLAGS+= -mcmodel=medium +CFLAGS+= -mcmodel=medium -mno-red-zone .endif # From owner-p4-projects@FreeBSD.ORG Mon Apr 7 19:29:43 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 768EC37B40B; Mon, 7 Apr 2003 19:29:42 -0700 (PDT) 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 D7C1737B40F for ; Mon, 7 Apr 2003 19:29:40 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5A40843FBF for ; Mon, 7 Apr 2003 19:29:40 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h382Te0U069069 for ; Mon, 7 Apr 2003 19:29:40 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h382TdsD069066 for perforce@freebsd.org; Mon, 7 Apr 2003 19:29:39 -0700 (PDT) Date: Mon, 7 Apr 2003 19:29:39 -0700 (PDT) Message-Id: <200304080229.h382TdsD069066@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28471 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, 08 Apr 2003 02:29:43 -0000 http://perforce.freebsd.org/chv.cgi?CH=28471 Change 28471 by peter@peter_daintree on 2003/04/07 19:29:18 no SMAP yet Affected files ... .. //depot/projects/hammer/sys/boot/i386/libi386/bootinfo32.c#2 edit .. //depot/projects/hammer/sys/boot/i386/libi386/bootinfo64.c#3 edit Differences ... ==== //depot/projects/hammer/sys/boot/i386/libi386/bootinfo32.c#2 (text+ko) ==== @@ -218,7 +218,7 @@ file_addmetadata(kfp, MODINFOMD_HOWTO, sizeof howto, &howto); file_addmetadata(kfp, MODINFOMD_ENVP, sizeof envp, &envp); file_addmetadata(kfp, MODINFOMD_KERNEND, sizeof kernend, &kernend); -#ifdef MODINFOMD_SMAP +#ifdef MODINFOMD_SMAPxx file_addmetadata(kfp, MODINFOMD_SMAP, smapsize, smap); #endif ==== //depot/projects/hammer/sys/boot/i386/libi386/bootinfo64.c#3 (text+ko) ==== @@ -188,7 +188,7 @@ file_addmetadata(kfp, MODINFOMD_HOWTO, sizeof howto, &howto); file_addmetadata(kfp, MODINFOMD_ENVP, sizeof envp, &envp); file_addmetadata(kfp, MODINFOMD_KERNEND, sizeof kernend, &kernend); -#ifdef MODINFOMD_SMAP +#ifdef MODINFOMD_SMAPxx file_addmetadata(kfp, MODINFOMD_SMAP, smapsize, smap); #endif From owner-p4-projects@FreeBSD.ORG Mon Apr 7 19:29:44 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id D2C6637B446; Mon, 7 Apr 2003 19:29:42 -0700 (PDT) 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 BA04437B41E for ; Mon, 7 Apr 2003 19:29:41 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id D511E43FD7 for ; Mon, 7 Apr 2003 19:29:40 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h382Te0U069075 for ; Mon, 7 Apr 2003 19:29:40 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h382TeQQ069072 for perforce@freebsd.org; Mon, 7 Apr 2003 19:29:40 -0700 (PDT) Date: Mon, 7 Apr 2003 19:29:40 -0700 (PDT) Message-Id: <200304080229.h382TeQQ069072@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28472 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, 08 Apr 2003 02:29:45 -0000 http://perforce.freebsd.org/chv.cgi?CH=28472 Change 28472 by peter@peter_daintree on 2003/04/07 19:29:30 quiet!! Affected files ... .. //depot/projects/hammer/sys/boot/i386/libi386/elf64_freebsd.c#9 edit Differences ... ==== //depot/projects/hammer/sys/boot/i386/libi386/elf64_freebsd.c#9 (text+ko) ==== @@ -105,9 +105,9 @@ entry_lo = ehdr->e_entry & 0xffffffff; entry_hi = (ehdr->e_entry >> 32) & 0xffffffff; +#ifdef DEBUG printf("modulep: 0x%x\n", modulep); printf("kernend: 0x%x\n", kernend); -#ifdef DEBUG printf("Start @ %#llx ...\n", ehdr->e_entry); #endif From owner-p4-projects@FreeBSD.ORG Mon Apr 7 19:30:44 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 80C3537B404; Mon, 7 Apr 2003 19:30:43 -0700 (PDT) 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 33CFB37B401 for ; Mon, 7 Apr 2003 19:30:43 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id BC47843F85 for ; Mon, 7 Apr 2003 19:30:42 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h382Ug0U069295 for ; Mon, 7 Apr 2003 19:30:42 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h382UgWL069290 for perforce@freebsd.org; Mon, 7 Apr 2003 19:30:42 -0700 (PDT) Date: Mon, 7 Apr 2003 19:30:42 -0700 (PDT) Message-Id: <200304080230.h382UgWL069290@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28473 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, 08 Apr 2003 02:30:44 -0000 http://perforce.freebsd.org/chv.cgi?CH=28473 Change 28473 by peter@peter_daintree on 2003/04/07 19:30:00 I swear, one day I'll commit this to freebsd. Affected files ... .. //depot/projects/hammer/sys/kern/init_main.c#8 edit Differences ... ==== //depot/projects/hammer/sys/kern/init_main.c#8 (text+ko) ==== @@ -210,6 +210,8 @@ if ((*sipp)->subsystem == SI_SUB_DONE) continue; +if (bootverbose) +printf("SYSINIT: 0x%08lx:0x%08lx 0x%08lx(0x%08lx)\n", (long)((*sipp)->subsystem), (long)((*sipp)->order), (long)((*sipp)->func), (long)((*sipp)->udata)); /* Call function */ (*((*sipp)->func))((*sipp)->udata); From owner-p4-projects@FreeBSD.ORG Mon Apr 7 19:32:47 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id A909937B401; Mon, 7 Apr 2003 19:32:46 -0700 (PDT) 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 4635237B401 for ; Mon, 7 Apr 2003 19:32:46 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id DFA1D43F3F for ; Mon, 7 Apr 2003 19:32:45 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h382Wj0U069548 for ; Mon, 7 Apr 2003 19:32:45 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h382WjQK069545 for perforce@freebsd.org; Mon, 7 Apr 2003 19:32:45 -0700 (PDT) Date: Mon, 7 Apr 2003 19:32:45 -0700 (PDT) Message-Id: <200304080232.h382WjQK069545@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28474 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, 08 Apr 2003 02:32:47 -0000 http://perforce.freebsd.org/chv.cgi?CH=28474 Change 28474 by peter@peter_daintree on 2003/04/07 19:32:29 It is amazing how many Bad Things Happen(TM) when you overlay one set of data structures on top of your page tables. I was telling the system to bootstrap using the original end-of-kernel, and forgot to account for the allocpages() calls. Argh! Affected files ... .. //depot/projects/hammer/sys/x86_64/x86_64/machdep.c#47 edit Differences ... ==== //depot/projects/hammer/sys/x86_64/x86_64/machdep.c#47 (text+ko) ==== @@ -1147,9 +1147,6 @@ int gsel_tss, off, x; struct region_descriptor r_gdt, r_idt; struct pcpu *pc; - u_int64_t first; - - first = physfree; create_pagetables(); @@ -1314,7 +1311,7 @@ dblfault_tss.tss_cs = GSEL(GCODE_SEL, SEL_KPL); #endif - getmemsize(kmdp, first); + getmemsize(kmdp, physfree); init_param2(physmem); /* now running on new page tables, configured,and u/iom is accessible */ From owner-p4-projects@FreeBSD.ORG Mon Apr 7 19:51:10 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id CDB9337B404; Mon, 7 Apr 2003 19:51:09 -0700 (PDT) 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 6E3B737B401 for ; Mon, 7 Apr 2003 19:51:09 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 034E143F93 for ; Mon, 7 Apr 2003 19:51:09 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h382p80U070868 for ; Mon, 7 Apr 2003 19:51:08 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h382p8V0070865 for perforce@freebsd.org; Mon, 7 Apr 2003 19:51:08 -0700 (PDT) Date: Mon, 7 Apr 2003 19:51:08 -0700 (PDT) Message-Id: <200304080251.h382p8V0070865@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28475 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, 08 Apr 2003 02:51:10 -0000 http://perforce.freebsd.org/chv.cgi?CH=28475 Change 28475 by peter@peter_daintree on 2003/04/07 19:50:36 argh, the shame! Affected files ... .. //depot/projects/hammer/sys/x86_64/x86_64/machdep.c#48 edit Differences ... ==== //depot/projects/hammer/sys/x86_64/x86_64/machdep.c#48 (text+ko) ==== @@ -1715,7 +1715,7 @@ csrc = (const char *)src; cdest = (char *)dest; if (src > dest) { - for (i = len - 1; i >= 0; i--) + for (i = len - 1; i != (size_t)-1; i--) cdest[i] = csrc[i]; } else { for (i = 0; i < len; i++) From owner-p4-projects@FreeBSD.ORG Mon Apr 7 19:53:13 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 0E57537B404; Mon, 7 Apr 2003 19:53:13 -0700 (PDT) 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 7ADC237B401 for ; Mon, 7 Apr 2003 19:53:12 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2624943FAF for ; Mon, 7 Apr 2003 19:53:12 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h382rB0U070934 for ; Mon, 7 Apr 2003 19:53:11 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h382rBD1070931 for perforce@freebsd.org; Mon, 7 Apr 2003 19:53:11 -0700 (PDT) Date: Mon, 7 Apr 2003 19:53:11 -0700 (PDT) Message-Id: <200304080253.h382rBD1070931@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28476 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, 08 Apr 2003 02:53:14 -0000 http://perforce.freebsd.org/chv.cgi?CH=28476 Change 28476 by peter@peter_daintree on 2003/04/07 19:53:11 Make sure we dont blow up in cpu_switch() for unknown reasons. Blow up for known reasons instead. Affected files ... .. //depot/projects/hammer/sys/x86_64/x86_64/swtch.s#14 edit Differences ... ==== //depot/projects/hammer/sys/x86_64/x86_64/swtch.s#14 (text+ko) ==== @@ -59,6 +59,10 @@ * 16(%rsp) = newtd */ ENTRY(cpu_throw) + movq $nothrow, %rdi + call serial_puts + movq $nothrow, %rdi + call panic xorq %rsi, %rsi movl PCPU(CPUID), %esi movq 8(%rsp),%rcx /* Old thread */ @@ -90,6 +94,11 @@ */ ENTRY(cpu_switch) + movq $noswitch, %rdi + call serial_puts + movq $noswitch, %rdi + call panic + /* Switch to new thread. First, save context. */ movq 8(%rsp),%rcx @@ -232,6 +241,8 @@ sw0_3: .asciz "cpu_switch: no newthread supplied" #endif +noswitch: .asciz "cpu_switch: called!" +nothrow: .asciz "cpu_throw: called!" /* * savectx(pcb) * Update pcb, saving current processor state. From owner-p4-projects@FreeBSD.ORG Mon Apr 7 20:06:30 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 2E8D237B405; Mon, 7 Apr 2003 20:06:30 -0700 (PDT) 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 C39E437B401 for ; Mon, 7 Apr 2003 20:06:29 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6B6E443F93 for ; Mon, 7 Apr 2003 20:06:29 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h3836T0U072666 for ; Mon, 7 Apr 2003 20:06:29 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h3836S7g072663 for perforce@freebsd.org; Mon, 7 Apr 2003 20:06:28 -0700 (PDT) Date: Mon, 7 Apr 2003 20:06:28 -0700 (PDT) Message-Id: <200304080306.h3836S7g072663@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28478 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, 08 Apr 2003 03:06:31 -0000 http://perforce.freebsd.org/chv.cgi?CH=28478 Change 28478 by peter@peter_daintree on 2003/04/07 20:05:55 unused stuff Affected files ... .. //depot/projects/hammer/sys/x86_64/isa/vector.s#7 edit Differences ... ==== //depot/projects/hammer/sys/x86_64/isa/vector.s#7 (text+ko) ==== @@ -7,24 +7,6 @@ #include #include -#define FAST_INTR_HANDLER_USES_ES 1 -#ifdef FAST_INTR_HANDLER_USES_ES -#define ACTUALLY_PUSHED 1 -#define MAYBE_MOVW_AX_ES movw %ax,%es -#define MAYBE_POPL_ES popl %es -#define MAYBE_PUSHL_ES pushl %es -#else -/* - * We can usually skip loading %es for fastintr handlers. %es should - * only be used for string instructions, and fastintr handlers shouldn't - * do anything slow enough to justify using a string instruction. - */ -#define ACTUALLY_PUSHED 0 -#define MAYBE_MOVW_AX_ES -#define MAYBE_POPL_ES -#define MAYBE_PUSHL_ES -#endif - .data ALIGN_DATA From owner-p4-projects@FreeBSD.ORG Mon Apr 7 20:11:37 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 2524237B405; Mon, 7 Apr 2003 20:11:37 -0700 (PDT) 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 B961B37B401 for ; Mon, 7 Apr 2003 20:11:36 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3A88C43F3F for ; Mon, 7 Apr 2003 20:11:36 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h383Ba0U073156 for ; Mon, 7 Apr 2003 20:11:36 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h383BZuT073153 for perforce@freebsd.org; Mon, 7 Apr 2003 20:11:35 -0700 (PDT) Date: Mon, 7 Apr 2003 20:11:35 -0700 (PDT) Message-Id: <200304080311.h383BZuT073153@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28479 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, 08 Apr 2003 03:11:38 -0000 http://perforce.freebsd.org/chv.cgi?CH=28479 Change 28479 by peter@peter_daintree on 2003/04/07 20:11:11 quiet the link command again. Affected files ... .. //depot/projects/hammer/sys/conf/kern.pre.mk#7 edit Differences ... ==== //depot/projects/hammer/sys/conf/kern.pre.mk#7 (text+ko) ==== @@ -68,7 +68,7 @@ SYSTEM_OBJS= locore.o ${MDOBJS} ${OBJS} SYSTEM_OBJS+= ${SYSTEM_CFILES:.c=.o} SYSTEM_OBJS+= hack.So -SYSTEM_LD= ${LD} ${FMT} -Bdynamic -T $S/conf/ldscript.$M \ +SYSTEM_LD= @${LD} ${FMT} -Bdynamic -T $S/conf/ldscript.$M \ -warn-common -export-dynamic -dynamic-linker /red/herring \ -o ${.TARGET} -X ${SYSTEM_OBJS} vers.o SYSTEM_LD_TAIL= @${OBJCOPY} --strip-symbol gcc2_compiled. ${.TARGET} ; \ From owner-p4-projects@FreeBSD.ORG Mon Apr 7 20:11:38 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 990A237B41B; Mon, 7 Apr 2003 20:11:37 -0700 (PDT) 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 206AF37B404 for ; Mon, 7 Apr 2003 20:11:37 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id AD5DF43F85 for ; Mon, 7 Apr 2003 20:11:36 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h383Ba0U073162 for ; Mon, 7 Apr 2003 20:11:36 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h383BaAY073159 for perforce@freebsd.org; Mon, 7 Apr 2003 20:11:36 -0700 (PDT) Date: Mon, 7 Apr 2003 20:11:36 -0700 (PDT) Message-Id: <200304080311.h383BaAY073159@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28480 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, 08 Apr 2003 03:11:39 -0000 http://perforce.freebsd.org/chv.cgi?CH=28480 Change 28480 by peter@peter_daintree on 2003/04/07 20:11:31 whoops, need the isa code for interrupts. :-( Affected files ... .. //depot/projects/hammer/sys/x86_64/conf/GENERIC#2 edit Differences ... ==== //depot/projects/hammer/sys/x86_64/conf/GENERIC#2 (text+ko) ==== @@ -24,3 +24,4 @@ maxusers 0 options SCHED_4BSD +device isa From owner-p4-projects@FreeBSD.ORG Mon Apr 7 20:21:51 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 79DA737B404; Mon, 7 Apr 2003 20:21:50 -0700 (PDT) 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 19BFC37B401 for ; Mon, 7 Apr 2003 20:21:50 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9C14F43FCB for ; Mon, 7 Apr 2003 20:21:49 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h383Ln0U073900 for ; Mon, 7 Apr 2003 20:21:49 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h383Lnep073897 for perforce@freebsd.org; Mon, 7 Apr 2003 20:21:49 -0700 (PDT) Date: Mon, 7 Apr 2003 20:21:49 -0700 (PDT) Message-Id: <200304080321.h383Lnep073897@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28481 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, 08 Apr 2003 03:21:51 -0000 http://perforce.freebsd.org/chv.cgi?CH=28481 Change 28481 by peter@peter_daintree on 2003/04/07 20:21:17 Ugh. Now it gets ugly. Anyway, this has a better chance of not blowing up. Do not mess with %fs because we use the MSR version. Affected files ... .. //depot/projects/hammer/sys/x86_64/isa/icu_vector.s#6 edit .. //depot/projects/hammer/sys/x86_64/x86_64/exception.s#14 edit Differences ... ==== //depot/projects/hammer/sys/x86_64/isa/icu_vector.s#6 (text+ko) ==== @@ -49,15 +49,14 @@ mov %ax,%ds ; \ mov %ax,%es ; \ #XXX mov $KPSEL,%ax ; \ - mov %ax,%fs ; \ +#XXX mov %ax,%fs ; \ FAKE_MCOUNT((12+ACTUALLY_PUSHED)*4(%rsp)) ; \ call critical_enter ; \ movq PCPU(CURTHREAD),%rbx ; \ incl TD_INTR_NESTING_LEVEL(%rbx) ; \ - pushq intr_unit + (irq_num) * 4 ; \ + movq intr_unit + (irq_num) * 4, %rdi ; \ call *intr_handler + (irq_num) * 4 ; /* do the work ASAP */ \ enable_icus ; /* (re)enable ASAP (helps edge trigger?) */ \ - addq $8,%rsp ; \ incl cnt+V_INTR ; /* book-keeping can wait */ \ movq intr_countp + (irq_num) * 4,%rax ; \ incq (%rax) ; \ @@ -104,7 +103,7 @@ mov %ax,%ds ; \ mov %ax,%es ; \ #XXX mov $KPSEL,%ax ; \ - mov %ax,%fs ; \ +#XXX mov %ax,%fs ; \ maybe_extra_ipending ; \ movb imen + IRQ_BYTE(irq_num),%al ; \ orb $IRQ_BIT(irq_num),%al ; \ @@ -114,9 +113,8 @@ movq PCPU(CURTHREAD),%rbx ; \ incl TD_INTR_NESTING_LEVEL(%ebx) ; \ FAKE_MCOUNT(13*4(%rsp)) ; /* XXX late to avoid double count */ \ - pushq $irq_num; /* pass the IRQ */ \ + movq $irq_num, %rdi; /* pass the IRQ */ \ call sched_ithd ; \ - addq $8, %rsp ; /* discard the parameter */ \ decl TD_INTR_NESTING_LEVEL(%rbx) ; \ MEXITCOUNT ; \ /* We could usually avoid the following jmp by inlining some of */ \ ==== //depot/projects/hammer/sys/x86_64/x86_64/exception.s#14 (text+ko) ==== @@ -267,9 +267,8 @@ testl $TDF_ASTPENDING | TDF_NEEDRESCHED,TD_FLAGS(%rax) je doreti_exit sti - pushq %rsp /* pass a pointer to the trapframe */ + movq %rsp, %rdi /* pass a pointer to the trapframe */ call ast - addq $8,%rsp jmp doreti_ast /* @@ -284,7 +283,8 @@ .globl doreti_popl_fs doreti_popl_fs: - popq %fs +# popq %fs + addq $8, %rsp .globl doreti_popl_es doreti_popl_es: popq %es From owner-p4-projects@FreeBSD.ORG Mon Apr 7 20:47:23 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id D22A437B404; Mon, 7 Apr 2003 20:47:22 -0700 (PDT) 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 71C6937B401 for ; Mon, 7 Apr 2003 20:47:22 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id EDE6C43FA3 for ; Mon, 7 Apr 2003 20:47:21 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h383lL0U080768 for ; Mon, 7 Apr 2003 20:47:21 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h383lLrC080765 for perforce@freebsd.org; Mon, 7 Apr 2003 20:47:21 -0700 (PDT) Date: Mon, 7 Apr 2003 20:47:21 -0700 (PDT) Message-Id: <200304080347.h383lLrC080765@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28483 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, 08 Apr 2003 03:47:24 -0000 http://perforce.freebsd.org/chv.cgi?CH=28483 Change 28483 by peter@peter_daintree on 2003/04/07 20:46:57 give cpu_switch a chance to work. Update for register conventions etc. note that unlike i386 where %esi and %edi are saved, x86-64 saves %r12-%r15 instead. %rsi/%rdi are not preserved across function calls, so they do not need to be saved in the pcb. Affected files ... .. //depot/projects/hammer/sys/x86_64/include/pcb.h#9 edit .. //depot/projects/hammer/sys/x86_64/x86_64/exception.s#15 edit .. //depot/projects/hammer/sys/x86_64/x86_64/genassym.c#15 edit .. //depot/projects/hammer/sys/x86_64/x86_64/swtch.s#15 edit .. //depot/projects/hammer/sys/x86_64/x86_64/vm_machdep.c#17 edit Differences ... ==== //depot/projects/hammer/sys/x86_64/include/pcb.h#9 (text+ko) ==== @@ -47,8 +47,10 @@ struct pcb { long pcb_cr3; - long pcb_rdi; - long pcb_rsi; + long pcb_r15; + long pcb_r14; + long pcb_r13; + long pcb_r12; long pcb_rbp; long pcb_rsp; long pcb_rbx; ==== //depot/projects/hammer/sys/x86_64/x86_64/exception.s#15 (text+ko) ==== @@ -212,14 +212,13 @@ jmp doreti ENTRY(fork_trampoline) - pushq %rsp /* trapframe pointer */ - pushq %rbx /* arg1 */ - pushq %rsi /* function */ + movq %r12, %rdi /* function */ + movq %rbx, %rsi /* arg1 */ + movq %rsp, %rdx /* trapframe pointer */ movq PCPU(CURTHREAD),%rbx /* setup critnest */ movl $1,TD_CRITNEST(%rbx) sti /* enable interrupts */ call fork_exit - addq $24,%rsp /* cut from syscall */ /* ==== //depot/projects/hammer/sys/x86_64/x86_64/genassym.c#15 (text+ko) ==== @@ -114,8 +114,10 @@ ASSYM(KERNBASE, KERNBASE); ASSYM(MCLBYTES, MCLBYTES); ASSYM(PCB_CR3, offsetof(struct pcb, pcb_cr3)); -ASSYM(PCB_RDI, offsetof(struct pcb, pcb_rdi)); -ASSYM(PCB_RSI, offsetof(struct pcb, pcb_rsi)); +ASSYM(PCB_R15, offsetof(struct pcb, pcb_r15)); +ASSYM(PCB_R14, offsetof(struct pcb, pcb_r14)); +ASSYM(PCB_R13, offsetof(struct pcb, pcb_r13)); +ASSYM(PCB_R12, offsetof(struct pcb, pcb_r12)); ASSYM(PCB_RBP, offsetof(struct pcb, pcb_rbp)); ASSYM(PCB_RSP, offsetof(struct pcb, pcb_rsp)); ASSYM(PCB_RBX, offsetof(struct pcb, pcb_rbx)); ==== //depot/projects/hammer/sys/x86_64/x86_64/swtch.s#15 (text+ko) ==== @@ -54,33 +54,26 @@ * about its state. This is only a slight optimization and is probably * not worth it anymore. Note that we need to clear the pm_active bits so * we do need the old proc if it still exists. - * 0(%rsp) = ret - * 8(%rsp) = oldtd - * 16(%rsp) = newtd + * %rdi = oldtd + * %rsi = newtd */ ENTRY(cpu_throw) - movq $nothrow, %rdi - call serial_puts - movq $nothrow, %rdi - call panic - xorq %rsi, %rsi - movl PCPU(CPUID), %esi - movq 8(%rsp),%rcx /* Old thread */ - testq %rcx,%rcx /* no thread? */ + xorq %rax, %rax + movl PCPU(CPUID), %eax + testq %rdi,%rdi /* no thread? */ jz 1f /* release bit from old pm_active */ - movq TD_PROC(%rcx), %rax /* thread->td_proc */ - movq P_VMSPACE(%rax), %rbx /* proc->p_vmspace */ - btrq %rsi, VM_PMAP+PM_ACTIVE(%rbx) /* clear old */ + movq TD_PROC(%rdi), %rdx /* oldtd->td_proc */ + movq P_VMSPACE(%rdx), %rdx /* proc->p_vmspace */ + btrq %rax, VM_PMAP+PM_ACTIVE(%rdx) /* clear old */ 1: - movq 16(%rsp),%rcx /* New thread */ - movq TD_PCB(%rcx),%rdx - movq PCB_CR3(%rdx),%rax - movq %rax,%cr3 /* new address space */ + movq TD_PCB(%rsi),%rdx /* newtd->td_proc */ + movq PCB_CR3(%rdx),%rdx + movq %rdx,%cr3 /* new address space */ /* set bit in new pm_active */ - movq TD_PROC(%rcx),%rax - movq P_VMSPACE(%rax), %rbx - btsq %rsi, VM_PMAP+PM_ACTIVE(%rbx) /* set new */ + movq TD_PROC(%rsi),%rdx + movq P_VMSPACE(%rdx), %rdx + btsq %rax, VM_PMAP+PM_ACTIVE(%rdx) /* set new */ jmp sw1 /* @@ -88,40 +81,33 @@ * * Save the current thread state, then select the next thread to run * and load its state. - * 0(%rsp) = ret - * 8(%rsp) = oldtd - * 16(%rsp) = newtd + * %rdi = oldtd + * %rsi = newtd */ ENTRY(cpu_switch) - movq $noswitch, %rdi - call serial_puts - movq $noswitch, %rdi - call panic - /* Switch to new thread. First, save context. */ - movq 8(%rsp),%rcx - #ifdef INVARIANTS - testq %rcx,%rcx /* no thread? */ + testq %rdi,%rdi /* no thread? */ jz badsw2 /* no, panic */ #endif - movq TD_PCB(%rcx),%rdx + movq TD_PCB(%rdi),%rdx movq (%rsp),%rax /* Hardware registers */ movq %rax,PCB_RIP(%rdx) movq %rbx,PCB_RBX(%rdx) movq %rsp,PCB_RSP(%rdx) movq %rbp,PCB_RBP(%rdx) - movq %rsi,PCB_RSI(%rdx) - movq %rdi,PCB_RDI(%rdx) -#XXX movq %gs,PCB_GS(%rdx) + movq %r12,PCB_R12(%rdx) + movq %r13,PCB_R13(%rdx) + movq %r14,PCB_R14(%rdx) + movq %r15,PCB_R15(%rdx) pushfq /* PSL */ popq PCB_PSL(%rdx) /* have we used fp, and need a save? */ - cmpq %rcx,PCPU(FPCURTHREAD) + cmpq %rdi,PCPU(FPCURTHREAD) jne 1f addq $PCB_SAVEFPU,%rdx /* h/w bugs make saving complicated */ pushq %rdx @@ -130,52 +116,52 @@ 1: /* Save is done. Now fire up new thread. Leave old vmspace. */ - movq %rcx,%rdi - movq 16(%rsp),%rcx /* New thread */ #ifdef INVARIANTS - testq %rcx,%rcx /* no thread? */ + testq %rsi,%rsi /* no thread? */ jz badsw3 /* no, panic */ #endif - movq TD_PCB(%rcx),%rdx - xorq %rsi, %rsi - movl PCPU(CPUID), %esi + movq TD_PCB(%rsi),%rdx + xorq %rax, %rax + movl PCPU(CPUID), %eax /* switch address space */ - movq PCB_CR3(%rdx),%rax - movq %rax,%cr3 /* new address space */ + movq PCB_CR3(%rdx),%rdx + movq %rdx,%cr3 /* new address space */ /* Release bit from old pmap->pm_active */ - movq TD_PROC(%rdi), %rax /* oldproc */ - movq P_VMSPACE(%rax), %rbx - btrq %rsi, VM_PMAP+PM_ACTIVE(%rbx) /* clear old */ + movq TD_PROC(%rdi), %rdx /* oldproc */ + movq P_VMSPACE(%rdx), %rdx + btrq %rax, VM_PMAP+PM_ACTIVE(%rdx) /* clear old */ /* Set bit in new pmap->pm_active */ - movq TD_PROC(%rcx),%rax /* newproc */ - movq P_VMSPACE(%rax), %rbx - btsq %rsi, VM_PMAP+PM_ACTIVE(%rbx) /* set new */ + movq TD_PROC(%rsi),%rdx /* newproc */ + movq P_VMSPACE(%rdx), %rdx + btsq %rax, VM_PMAP+PM_ACTIVE(%rdx) /* set new */ sw1: /* * At this point, we've switched address spaces and are ready * to load up the rest of the next context. */ + movq TD_PCB(%rsi),%rdx /* Restore context. */ movq PCB_RBX(%rdx),%rbx movq PCB_RSP(%rdx),%rsp movq PCB_RBP(%rdx),%rbp - movq PCB_RSI(%rdx),%rsi - movq PCB_RDI(%rdx),%rdi + movq PCB_R12(%rdx),%r12 + movq PCB_R13(%rdx),%r13 + movq PCB_R14(%rdx),%r14 + movq PCB_R15(%rdx),%r15 movq PCB_RIP(%rdx),%rax movq %rax,(%rsp) pushq PCB_PSL(%rdx) popfq movq %rdx, PCPU(CURPCB) - movq %rcx, PCPU(CURTHREAD) /* into next thread */ + movq %rsi, PCPU(CURTHREAD) /* into next thread */ .globl cpu_switch_load_gs cpu_switch_load_gs: -#XXX movq PCB_GS(%rdx),%gs ret @@ -261,9 +247,10 @@ movq %rbx,PCB_RBX(%rcx) movq %rsp,PCB_RSP(%rcx) movq %rbp,PCB_RBP(%rcx) - movq %rsi,PCB_RSI(%rcx) - movq %rdi,PCB_RDI(%rcx) -#XXX movq %gs,PCB_GS(%rcx) + movq %r12,PCB_R12(%rcx) + movq %r13,PCB_R13(%rcx) + movq %r14,PCB_R14(%rcx) + movq %r15,PCB_R15(%rcx) pushfq popq PCB_PSL(%rcx) ==== //depot/projects/hammer/sys/x86_64/x86_64/vm_machdep.c#17 (text+ko) ==== @@ -139,8 +139,7 @@ #else pcb2->pcb_cr3 = vtophys(vmspace_pmap(p2->p_vmspace)->pm_pdir); #endif - pcb2->pcb_rdi = 0; - pcb2->pcb_rsi = (int)fork_return; /* fork_trampoline argument */ + pcb2->pcb_r12 = (int)fork_return; /* fork_trampoline argument */ pcb2->pcb_rbp = 0; pcb2->pcb_rsp = (long)td2->td_frame - sizeof(void *); pcb2->pcb_rbx = (long)td2; /* fork_trampoline argument */ @@ -180,7 +179,7 @@ * Note that the trap frame follows the args, so the function * is really called like this: func(arg, frame); */ - td->td_pcb->pcb_rsi = (long) func; /* function */ + td->td_pcb->pcb_r12 = (long) func; /* function */ td->td_pcb->pcb_rbx = (long) arg; /* first arg */ } From owner-p4-projects@FreeBSD.ORG Mon Apr 7 21:02:42 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id D144B37B401; Mon, 7 Apr 2003 21:02:41 -0700 (PDT) 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 6F90237B401 for ; Mon, 7 Apr 2003 21:02:41 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 148F943F75 for ; Mon, 7 Apr 2003 21:02:41 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h3842e0U081952 for ; Mon, 7 Apr 2003 21:02:40 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h3842eqV081949 for perforce@freebsd.org; Mon, 7 Apr 2003 21:02:40 -0700 (PDT) Date: Mon, 7 Apr 2003 21:02:40 -0700 (PDT) Message-Id: <200304080402.h3842eqV081949@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28484 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, 08 Apr 2003 04:02:42 -0000 http://perforce.freebsd.org/chv.cgi?CH=28484 Change 28484 by peter@peter_daintree on 2003/04/07 21:01:44 add some chattiness Affected files ... .. //depot/projects/hammer/sys/vm/vm_glue.c#9 edit .. //depot/projects/hammer/sys/x86_64/x86_64/autoconf.c#7 edit Differences ... ==== //depot/projects/hammer/sys/vm/vm_glue.c#9 (text+ko) ==== @@ -586,10 +586,13 @@ struct proc *pp; int ppri; +printf("made it to scheduler()!\n"); + mtx_assert(&Giant, MA_OWNED | MA_NOTRECURSED); /* GIANT_REQUIRED */ loop: +printf("scheduler()::loop\n\n"); if (vm_page_count_min()) { VM_WAIT; goto loop; ==== //depot/projects/hammer/sys/x86_64/x86_64/autoconf.c#7 (text+ko) ==== @@ -107,6 +107,7 @@ configure(dummy) void *dummy; { +printf("configure\n"); /* * Activate the ICU's. Note that we are explicitly at splhigh() @@ -124,12 +125,16 @@ * * This is all rather inconvenient. */ +printf("enable_intr\n"); enable_intr(); +printf("enable IRQ_SLAVE\n"); INTREN(IRQ_SLAVE); +printf("add nexus\n"); /* nexus0 is the top of the i386 device tree */ device_add_child(root_bus, "nexus", 0); +printf("root bus config\n"); /* initialize new bus architecture */ root_bus_configure(); @@ -138,15 +143,19 @@ * Explicitly probe and attach ISA last. The isa bus saves * it's device node at attach time for us here. */ - if (isa_bus_device) + if (isa_bus_device) { +printf("isa_probe_children\n"); isa_probe_children(isa_bus_device); + } #endif +printf("spl0()\n"); /* * Now we're ready to handle (pending) interrupts. * XXX this is slightly misplaced. */ spl0(); +printf("end configure\n"); } static void From owner-p4-projects@FreeBSD.ORG Mon Apr 7 23:18:29 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 3CF4E37B404; Mon, 7 Apr 2003 23:18:29 -0700 (PDT) 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 CEEBA37B401 for ; Mon, 7 Apr 2003 23:18:28 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2BB0C43F93 for ; Mon, 7 Apr 2003 23:18:28 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h386IS0U093611 for ; Mon, 7 Apr 2003 23:18:28 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h386IRwB093608 for perforce@freebsd.org; Mon, 7 Apr 2003 23:18:27 -0700 (PDT) Date: Mon, 7 Apr 2003 23:18:27 -0700 (PDT) Message-Id: <200304080618.h386IRwB093608@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28488 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, 08 Apr 2003 06:18:30 -0000 http://perforce.freebsd.org/chv.cgi?CH=28488 Change 28488 by peter@peter_daintree on 2003/04/07 23:17:56 use the portable in_cksum from powerpc for now Affected files ... .. //depot/projects/hammer/sys/x86_64/include/in_cksum.h#2 edit .. //depot/projects/hammer/sys/x86_64/x86_64/in_cksum.c#2 edit Differences ... ==== //depot/projects/hammer/sys/x86_64/include/in_cksum.h#2 (text+ko) ==== @@ -33,16 +33,12 @@ * from tahoe: in_cksum.c 1.2 86/01/05 * from: @(#)in_cksum.c 1.3 (Berkeley) 1/19/91 * from: Id: in_cksum.c,v 1.8 1995/12/03 18:35:19 bde Exp - * $FreeBSD: src/sys/i386/include/in_cksum.h,v 1.13 2002/06/22 22:35:53 jdp Exp $ + * $FreeBSD: src/sys/powerpc/include/in_cksum.h,v 1.1 2002/06/29 09:49:24 benno Exp $ */ #ifndef _MACHINE_IN_CKSUM_H_ #define _MACHINE_IN_CKSUM_H_ 1 -/* - * MP safe (alfred) - */ - #include #define in_cksum(m, len) in_cksum_skip(m, len, 0) @@ -54,33 +50,6 @@ * therefore always exactly five 32-bit words. */ #ifdef __GNUC__ -static __inline u_int -in_cksum_hdr(const struct ip *ip) -{ - register u_int sum = 0; - -/* __volatile is necessary here because the condition codes are used. */ -#define ADD(n) __asm __volatile ("addl %1, %0" : "+r" (sum) : \ - "g" (((const u_int32_t *)ip)[n / 4])) -#define ADDC(n) __asm __volatile ("adcl %1, %0" : "+r" (sum) : \ - "g" (((const u_int32_t *)ip)[n / 4])) -#define MOP __asm __volatile ("adcl $0, %0" : "+r" (sum)) - - ADD(0); - ADDC(4); - ADDC(8); - ADDC(12); - ADDC(16); - MOP; -#undef ADD -#undef ADDC -#undef MOP - sum = (sum & 0xffff) + (sum >> 16); - if (sum > 0xffff) - sum -= 0xffff; - - return ~sum & 0xffff; -} static __inline void in_cksum_update(struct ip *ip) @@ -90,32 +59,8 @@ ip->ip_sum = htons(__tmpsum + (__tmpsum >> 16)); } -static __inline u_short -in_addword(u_short sum, u_short b) -{ - /* __volatile is necessary because the condition codes are used. */ - __asm __volatile ("addw %1, %0" : "+r" (sum) : "r" (b)); - __asm __volatile ("adcw $0, %0" : "+r" (sum)); +#else - return (sum); -} - -static __inline u_short -in_pseudo(u_int sum, u_int b, u_int c) -{ - /* __volatile is necessary because the condition codes are used. */ - __asm __volatile ("addl %1, %0" : "+r" (sum) : "g" (b)); - __asm __volatile ("adcl %1, %0" : "+r" (sum) : "g" (c)); - __asm __volatile ("adcl $0, %0" : "+r" (sum)); - - sum = (sum & 0xffff) + (sum >> 16); - if (sum > 0xffff) - sum -= 0xffff; - return (sum); -} - -#else -u_int in_cksum_hdr(const struct ip *); #define in_cksum_update(ip) \ do { \ int __tmpsum; \ @@ -126,7 +71,10 @@ #endif #ifdef _KERNEL -u_short in_cksum_skip(struct mbuf *m, int len, int skip); -#endif /* _KERNEL */ +u_int in_cksum_hdr(const struct ip *ip); +u_short in_addword(u_short sum, u_short b); +u_short in_pseudo(u_int sum, u_int b, u_int c); +u_short in_cksum_skip(struct mbuf *m, int len, int skip); +#endif #endif /* _MACHINE_IN_CKSUM_H_ */ ==== //depot/projects/hammer/sys/x86_64/x86_64/in_cksum.c#2 (text+ko) ==== @@ -1,6 +1,11 @@ -/*- - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. +/* $FreeBSD: src/sys/powerpc/powerpc/in_cksum.c,v 1.2 2003/02/13 08:56:41 grehan Exp $ */ +/* $NetBSD: in_cksum.c,v 1.7 1997/09/02 13:18:15 thorpej Exp $ */ + +/* + * Copyright (c) 1988, 1992, 1993 + * The Regents of the University of California. All rights reserved. + * Copyright (c) 1996 + * Matt Thomas * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -30,241 +35,216 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from tahoe: in_cksum.c 1.2 86/01/05 - * from: @(#)in_cksum.c 1.3 (Berkeley) 1/19/91 - * $FreeBSD: src/sys/i386/i386/in_cksum.c,v 1.24 2002/06/22 22:35:49 jdp Exp $ + * @(#)in_cksum.c 8.1 (Berkeley) 6/10/93 */ -/* - * MPsafe: alfred - */ +#include /* RCS ID & Copyright macro defns */ + #include +#include #include -#include - +#include #include -#include #include - #include /* - * Checksum routine for Internet Protocol family headers. + * Checksum routine for Internet Protocol family headers + * (Portable Alpha version). * * This routine is very heavily used in the network * code and should be modified for each CPU to be as fast as possible. - * - * This implementation is 386 version. */ -#undef ADDCARRY -#define ADDCARRY(x) if ((x) > 0xffff) (x) -= 0xffff -#define REDUCE {sum = (sum & 0xffff) + (sum >> 16); ADDCARRY(sum);} +#define ADDCARRY(x) (x > 65535 ? x -= 65535 : x) +#define REDUCE32 \ + { \ + q_util.q = sum; \ + sum = q_util.s[0] + q_util.s[1] + q_util.s[2] + q_util.s[3]; \ + } +#define REDUCE16 \ + { \ + q_util.q = sum; \ + l_util.l = q_util.s[0] + q_util.s[1] + q_util.s[2] + q_util.s[3]; \ + sum = l_util.s[0] + l_util.s[1]; \ + ADDCARRY(sum); \ + } + +static const u_int32_t in_masks[] = { +#if 0 + /*0 bytes*/ /*1 byte*/ /*2 bytes*/ /*3 bytes*/ + 0x00000000, 0x000000FF, 0x0000FFFF, 0x00FFFFFF, /* offset 0 */ + 0x00000000, 0x0000FF00, 0x00FFFF00, 0xFFFFFF00, /* offset 1 */ + 0x00000000, 0x00FF0000, 0xFFFF0000, 0xFFFF0000, /* offset 2 */ + 0x00000000, 0xFF000000, 0xFF000000, 0xFF000000, /* offset 3 */ +#else + /*0 bytes*/ /*1 byte*/ /*2 bytes*/ /*3 bytes*/ + 0x00000000, 0xFF000000, 0xFFFF0000, 0xFFFFFF00, /* offset 0 */ + 0x00000000, 0x00FF0000, 0x00FFFF00, 0x00FFFFFF, /* offset 1 */ + 0x00000000, 0x0000FF00, 0x0000FFFF, 0x0000FFFF, /* offset 2 */ + 0x00000000, 0x000000FF, 0x000000FF, 0x000000FF, /* offset 3 */ +#endif +}; -/* - * These asm statements require __volatile because they pass information - * via the condition codes. GCC does not currently provide a way to specify - * the condition codes as an input or output operand. - * - * The LOAD macro below is effectively a prefetch into cache. GCC will - * load the value into a register but will not use it. Since modern CPUs - * reorder operations, this will generally take place in parallel with - * other calculations. - */ -#define ADD(n) __asm __volatile \ - ("addl %1, %0" : "+r" (sum) : \ - "g" (((const u_int32_t *)w)[n / 4])) -#define ADDC(n) __asm __volatile \ - ("adcl %1, %0" : "+r" (sum) : \ - "g" (((const u_int32_t *)w)[n / 4])) -#define LOAD(n) __asm __volatile \ - ("" : : "r" (((const u_int32_t *)w)[n / 4])) -#define MOP __asm __volatile \ - ("adcl $0, %0" : "+r" (sum)) +union l_util { + u_int16_t s[2]; + u_int32_t l; +}; +union q_util { + u_int16_t s[4]; + u_int32_t l[2]; + u_int64_t q; +}; -u_short -in_cksum_skip(m, len, skip) - struct mbuf *m; - int len; - int skip; +static u_int64_t +in_cksumdata(const void *buf, int len) { - register u_short *w; - register unsigned sum = 0; - register int mlen = 0; - int byte_swapped = 0; - union { char c[2]; u_short s; } su; + const u_int32_t *lw = (const u_int32_t *) buf; + u_int64_t sum = 0; + u_int64_t prefilled; + int offset; + union q_util q_util; + + if ((3 & (long) lw) == 0 && len == 20) { + sum = (u_int64_t) lw[0] + lw[1] + lw[2] + lw[3] + lw[4]; + REDUCE32; + return sum; + } - len -= skip; - for (; skip && m; m = m->m_next) { - if (m->m_len > skip) { - mlen = m->m_len - skip; - w = (u_short *)(mtod(m, u_char *) + skip); - goto skip_start; - } else { - skip -= m->m_len; + if ((offset = 3 & (long) lw) != 0) { + const u_int32_t *masks = in_masks + (offset << 2); + lw = (u_int32_t *) (((long) lw) - offset); + sum = *lw++ & masks[len >= 3 ? 3 : len]; + len -= 4 - offset; + if (len <= 0) { + REDUCE32; + return sum; + } + } +#if 0 + /* + * Force to cache line boundary. + */ + offset = 32 - (0x1f & (long) lw); + if (offset < 32 && len > offset) { + len -= offset; + if (4 & offset) { + sum += (u_int64_t) lw[0]; + lw += 1; + } + if (8 & offset) { + sum += (u_int64_t) lw[0] + lw[1]; + lw += 2; + } + if (16 & offset) { + sum += (u_int64_t) lw[0] + lw[1] + lw[2] + lw[3]; + lw += 4; } } +#endif + /* + * access prefilling to start load of next cache line. + * then add current cache line + * save result of prefilling for loop iteration. + */ + prefilled = lw[0]; + while ((len -= 32) >= 4) { + u_int64_t prefilling = lw[8]; + sum += prefilled + lw[1] + lw[2] + lw[3] + + lw[4] + lw[5] + lw[6] + lw[7]; + lw += 8; + prefilled = prefilling; + } + if (len >= 0) { + sum += prefilled + lw[1] + lw[2] + lw[3] + + lw[4] + lw[5] + lw[6] + lw[7]; + lw += 8; + } else { + len += 32; + } + while ((len -= 16) >= 0) { + sum += (u_int64_t) lw[0] + lw[1] + lw[2] + lw[3]; + lw += 4; + } + len += 16; + while ((len -= 4) >= 0) { + sum += (u_int64_t) *lw++; + } + len += 4; + if (len > 0) + sum += (u_int64_t) (in_masks[len] & *lw); + REDUCE32; + return sum; +} + +u_short +in_addword(u_short a, u_short b) +{ + u_int64_t sum = a + b; + + ADDCARRY(sum); + return (sum); +} + +u_short +in_pseudo(u_int32_t a, u_int32_t b, u_int32_t c) +{ + u_int64_t sum; + union q_util q_util; + union l_util l_util; + + sum = (u_int64_t) a + b + c; + REDUCE16; + return (sum); +} + +u_short +in_cksum_skip(struct mbuf *m, int len, int skip) +{ + u_int64_t sum = 0; + int mlen = 0; + int clen = 0; + caddr_t addr; + union q_util q_util; + union l_util l_util; - for (;m && len; m = m->m_next) { + len -= skip; + for (; skip && m; m = m->m_next) { + if (m->m_len > skip) { + mlen = m->m_len - skip; + addr = mtod(m, caddr_t) + skip; + goto skip_start; + } else { + skip -= m->m_len; + } + } + + for (; m && len; m = m->m_next) { if (m->m_len == 0) continue; - w = mtod(m, u_short *); - if (mlen == -1) { - /* - * The first byte of this mbuf is the continuation - * of a word spanning between this mbuf and the - * last mbuf. - */ - - /* su.c[0] is already saved when scanning previous - * mbuf. sum was REDUCEd when we found mlen == -1 - */ - su.c[1] = *(u_char *)w; - sum += su.s; - w = (u_short *)((char *)w + 1); - mlen = m->m_len - 1; - len--; - } else - mlen = m->m_len; + mlen = m->m_len; + addr = mtod(m, caddr_t); skip_start: if (len < mlen) mlen = len; + + if ((clen ^ (long) addr) & 1) + sum += in_cksumdata(addr, mlen) << 8; + else + sum += in_cksumdata(addr, mlen); + + clen += mlen; len -= mlen; - /* - * Force to long boundary so we do longword aligned - * memory operations - */ - if (3 & (int) w) { - REDUCE; - if ((1 & (int) w) && (mlen > 0)) { - sum <<= 8; - su.c[0] = *(char *)w; - w = (u_short *)((char *)w + 1); - mlen--; - byte_swapped = 1; - } - if ((2 & (int) w) && (mlen >= 2)) { - sum += *w++; - mlen -= 2; - } - } - /* - * Advance to a 486 cache line boundary. - */ - if (4 & (int) w && mlen >= 4) { - ADD(0); - MOP; - w += 2; - mlen -= 4; - } - if (8 & (int) w && mlen >= 8) { - ADD(0); - ADDC(4); - MOP; - w += 4; - mlen -= 8; - } - /* - * Do as much of the checksum as possible 32 bits at at time. - * In fact, this loop is unrolled to make overhead from - * branches &c small. - */ - mlen -= 1; - while ((mlen -= 32) >= 0) { - /* - * Add with carry 16 words and fold in the last - * carry by adding a 0 with carry. - * - * The early ADD(16) and the LOAD(32) are to load - * the next 2 cache lines in advance on 486's. The - * 486 has a penalty of 2 clock cycles for loading - * a cache line, plus whatever time the external - * memory takes to load the first word(s) addressed. - * These penalties are unavoidable. Subsequent - * accesses to a cache line being loaded (and to - * other external memory?) are delayed until the - * whole load finishes. These penalties are mostly - * avoided by not accessing external memory for - * 8 cycles after the ADD(16) and 12 cycles after - * the LOAD(32). The loop terminates when mlen - * is initially 33 (not 32) to guaranteed that - * the LOAD(32) is within bounds. - */ - ADD(16); - ADDC(0); - ADDC(4); - ADDC(8); - ADDC(12); - LOAD(32); - ADDC(20); - ADDC(24); - ADDC(28); - MOP; - w += 16; - } - mlen += 32 + 1; - if (mlen >= 32) { - ADD(16); - ADDC(0); - ADDC(4); - ADDC(8); - ADDC(12); - ADDC(20); - ADDC(24); - ADDC(28); - MOP; - w += 16; - mlen -= 32; - } - if (mlen >= 16) { - ADD(0); - ADDC(4); - ADDC(8); - ADDC(12); - MOP; - w += 8; - mlen -= 16; - } - if (mlen >= 8) { - ADD(0); - ADDC(4); - MOP; - w += 4; - mlen -= 8; - } - if (mlen == 0 && byte_swapped == 0) - continue; /* worth 1% maybe ?? */ - REDUCE; - while ((mlen -= 2) >= 0) { - sum += *w++; - } - if (byte_swapped) { - sum <<= 8; - byte_swapped = 0; - if (mlen == -1) { - su.c[1] = *(char *)w; - sum += su.s; - mlen = 0; - } else - mlen = -1; - } else if (mlen == -1) - /* - * This mbuf has odd number of bytes. - * There could be a word split betwen - * this mbuf and the next mbuf. - * Save the last byte (to prepend to next mbuf). - */ - su.c[0] = *(char *)w; } + REDUCE16; + return (~sum & 0xffff); +} - if (len) - printf("%s: out of data by %d\n", __func__, len); - if (mlen == -1) { - /* The last mbuf has odd # of bytes. Follow the - standard (the odd byte is shifted left by 8 bits) */ - su.c[1] = 0; - sum += su.s; - } - REDUCE; - return (~sum & 0xffff); +u_int in_cksum_hdr(const struct ip *ip) +{ + u_int64_t sum = in_cksumdata(ip, sizeof(struct ip)); + union q_util q_util; + union l_util l_util; + REDUCE16; + return (~sum & 0xffff); } From owner-p4-projects@FreeBSD.ORG Mon Apr 7 23:19:31 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id DE96437B404; Mon, 7 Apr 2003 23:19:30 -0700 (PDT) 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 7DAB837B401 for ; Mon, 7 Apr 2003 23:19:30 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 150D843F3F for ; Mon, 7 Apr 2003 23:19:30 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h386JT0U093631 for ; Mon, 7 Apr 2003 23:19:29 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h386JTqP093628 for perforce@freebsd.org; Mon, 7 Apr 2003 23:19:29 -0700 (PDT) Date: Mon, 7 Apr 2003 23:19:29 -0700 (PDT) Message-Id: <200304080619.h386JTqP093628@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28489 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, 08 Apr 2003 06:19:31 -0000 http://perforce.freebsd.org/chv.cgi?CH=28489 Change 28489 by peter@peter_daintree on 2003/04/07 23:19:14 probe the keyboard Affected files ... .. //depot/projects/hammer/sys/boot/i386/pxeldr/Makefile#4 edit Differences ... ==== //depot/projects/hammer/sys/boot/i386/pxeldr/Makefile#4 (text+ko) ==== @@ -1,5 +1,6 @@ # $FreeBSD: src/sys/boot/i386/pxeldr/Makefile,v 1.8 2002/09/17 01:48:56 peter Exp $ +BOOT_PXELDR_PROBE_KEYBOARD=yes MAINTAINER=jhb@FreeBSD.org ORG= 0x7c00 From owner-p4-projects@FreeBSD.ORG Mon Apr 7 23:20:33 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id C499237B404; Mon, 7 Apr 2003 23:20:32 -0700 (PDT) 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 63F6C37B401 for ; Mon, 7 Apr 2003 23:20:32 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id EEB1443FAF for ; Mon, 7 Apr 2003 23:20:31 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h386KV0U093887 for ; Mon, 7 Apr 2003 23:20:31 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h386KVei093881 for perforce@freebsd.org; Mon, 7 Apr 2003 23:20:31 -0700 (PDT) Date: Mon, 7 Apr 2003 23:20:31 -0700 (PDT) Message-Id: <200304080620.h386KVei093881@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28490 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, 08 Apr 2003 06:20:33 -0000 http://perforce.freebsd.org/chv.cgi?CH=28490 Change 28490 by peter@peter_daintree on 2003/04/07 23:19:33 add the ppc in_cksum for inet Affected files ... .. //depot/projects/hammer/sys/conf/files.x86_64#11 edit Differences ... ==== //depot/projects/hammer/sys/conf/files.x86_64#11 (text+ko) ==== @@ -49,6 +49,7 @@ x86_64/x86_64/trap.c standard x86_64/x86_64/tsc.c standard x86_64/x86_64/vm_machdep.c standard +x86_64/x86_64/in_cksum.c optional inet x86_64/isa/clock.c standard x86_64/isa/intr_machdep.c standard From owner-p4-projects@FreeBSD.ORG Mon Apr 7 23:25:40 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id DF2F737B404; Mon, 7 Apr 2003 23:25:39 -0700 (PDT) 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 5C34537B401 for ; Mon, 7 Apr 2003 23:25:39 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id E732143F85 for ; Mon, 7 Apr 2003 23:25:38 -0700 (PDT) (envelope-from jmallett@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h386Pc0U094199 for ; Mon, 7 Apr 2003 23:25:38 -0700 (PDT) (envelope-from jmallett@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h386PcJE094196 for perforce@freebsd.org; Mon, 7 Apr 2003 23:25:38 -0700 (PDT) Date: Mon, 7 Apr 2003 23:25:38 -0700 (PDT) Message-Id: <200304080625.h386PcJE094196@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jmallett@freebsd.org using -f From: Juli Mallett To: Perforce Change Reviews Subject: PERFORCE change 28491 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, 08 Apr 2003 06:25:41 -0000 http://perforce.freebsd.org/chv.cgi?CH=28491 Change 28491 by jmallett@jmallett_dalek on 2003/04/07 23:25:08 Add something to fake out buildworld. I'm sick of locally fixing this. Really *do* need to get hacking on this soon, though. Affected files ... .. //depot/projects/mips/sys/boot/sgimips/Makefile#1 add Differences ... From owner-p4-projects@FreeBSD.ORG Tue Apr 8 01:15:00 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id C7E9137B404; Tue, 8 Apr 2003 01:14:59 -0700 (PDT) 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 63F7A37B401 for ; Tue, 8 Apr 2003 01:14:59 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id B6FF743F93 for ; Tue, 8 Apr 2003 01:14:58 -0700 (PDT) (envelope-from marcel@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h388Ew0U009055 for ; Tue, 8 Apr 2003 01:14:58 -0700 (PDT) (envelope-from marcel@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h388Ew6U009052 for perforce@freebsd.org; Tue, 8 Apr 2003 01:14:58 -0700 (PDT) Date: Tue, 8 Apr 2003 01:14:58 -0700 (PDT) Message-Id: <200304080814.h388Ew6U009052@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 28499 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, 08 Apr 2003 08:15:00 -0000 http://perforce.freebsd.org/chv.cgi?CH=28499 Change 28499 by marcel@marcel_nfs on 2003/04/08 01:14:28 Snapshot highlights: o cpu_switch() and cpu_throw() are now C functions. cpu_switch() handles the high-level switching, while the low-level switching is handled by swapctx(). cpu_throw() depends on restorectx(). o New implementation of exception_save() and exception_restore(). Does not have everything yet for interrupting user space. We also don't use physical addressing anymore. We align the frame on a 1K boundary and arrange for a well-defined failure point so that we know where to jump to if we have a nested fault. o We pass the address of the EPC page in ar.k3. We don't have to worry about PAL clobbering the value, because we only need it for syscalls, which don't use exceptions. We have to make sure we restore ar.k3 when we return to user space though. There are probably a lot of loose ends... Affected files ... .. //depot/projects/ia64_epc/sys/conf/files.ia64#5 edit .. //depot/projects/ia64_epc/sys/ia64/ia64/context.s#6 edit .. //depot/projects/ia64_epc/sys/ia64/ia64/db_interface.c#3 edit .. //depot/projects/ia64_epc/sys/ia64/ia64/exception.s#6 edit .. //depot/projects/ia64_epc/sys/ia64/ia64/genassym.c#6 edit .. //depot/projects/ia64_epc/sys/ia64/ia64/locore.s#5 edit .. //depot/projects/ia64_epc/sys/ia64/ia64/machdep.c#6 edit .. //depot/projects/ia64_epc/sys/ia64/ia64/swtch.s#3 delete .. //depot/projects/ia64_epc/sys/ia64/ia64/syscall.s#3 edit .. //depot/projects/ia64_epc/sys/ia64/ia64/trap.c#7 edit .. //depot/projects/ia64_epc/sys/ia64/ia64/vm_machdep.c#4 edit .. //depot/projects/ia64_epc/sys/ia64/include/_regset.h#5 edit .. //depot/projects/ia64_epc/sys/ia64/include/asm.h#2 edit .. //depot/projects/ia64_epc/sys/ia64/include/cpu.h#4 edit .. //depot/projects/ia64_epc/sys/ia64/include/db_machdep.h#3 edit .. //depot/projects/ia64_epc/sys/ia64/include/pcb.h#4 edit Differences ... ==== //depot/projects/ia64_epc/sys/conf/files.ia64#5 (text+ko) ==== @@ -57,7 +57,6 @@ ia64/ia64/support.s standard ia64/ia64/ssc.c optional ski ia64/ia64/sscdisk.c optional ski -ia64/ia64/swtch.s standard ia64/ia64/sys_machdep.c standard ia64/ia64/syscall.s standard ia64/ia64/trap.c standard ==== //depot/projects/ia64_epc/sys/ia64/ia64/context.s#6 (text+ko) ==== @@ -32,6 +32,302 @@ .section .text.context, "ax" /* + * void restorectx(struct pcb *) + */ +ENTRY(restorectx, 1) +{ .mmi + invala + mov ar.rsc=0 + add r31=8,r32 + ;; +} +{ .mmi + ld8 r12=[r32] // sp + ld8 r16=[r31],16 // unat (before) + add r30=16,r32 + ;; +} +{ .mmi + ld8 r17=[r30],16 // rp + ld8 r18=[r31],16 // pr + add r32=SIZEOF_SPECIAL,r32 + ;; +} +{ .mmi + ld8 r19=[r30],16 // pfs + ld8 r20=[r31],16 // bspstore + mov rp=r17 + ;; +} +{ .mmi + loadrs + ld8 r21=[r30],16 // rnat + mov pr=r18,0x1fffe + ;; +} +{ .mmi + ld8 r17=[r32],8 // unat (after) + mov ar.bspstore=r20 + mov ar.pfs=19 + ;; +} +{ .mmi + mov ar.unat=r17 + mov ar.rnat=r21 + add r31=8,r32 + ;; +} +{ .mmi + ld8.fill r4=[r32],16 // r4 + ld8.fill r5=[r31],16 // r5 + nop 0 + ;; +} +{ .mmi + ld8.fill r6=[r32],16 // r6 + ld8.fill r7=[r31],16 // r7 + nop 1 + ;; +} +{ .mmi + mov ar.unat=r16 + mov ar.rsc=3 + nop 2 +} +{ .mmi + ld8 r17=[r32],16 // b1 + ld8 r18=[r31],16 // b2 + nop 3 + ;; +} +{ .mmi + ld8 r19=[r32],16 // b3 + ld8 r20=[r31],16 // b4 + mov b1=r17 + ;; +} +{ .mmi + ld8 r16=[r32],24 // b5 + ld8 r17=[r31],32 // lc + mov b2=r18 + ;; +} +{ .mmi + ldf.fill f2=[r32],32 + ldf.fill f3=[r31],32 + mov b3=r19 + ;; +} +{ .mmi + ldf.fill f4=[r32],32 + ldf.fill f5=[r31],32 + mov b4=r20 + ;; +} +{ .mmi + ldf.fill f16=[r32],32 + ldf.fill f17=[r31],32 + mov b5=r16 + ;; +} +{ .mmi + ldf.fill f18=[r32],32 + ldf.fill f19=[r31],32 + mov ar.lc=r17 + ;; +} + ldf.fill f20=[r32],32 + ldf.fill f21=[r31],32 + ;; + ldf.fill f22=[r32],32 + ldf.fill f23=[r31],32 + ;; + ldf.fill f24=[r32],32 + ldf.fill f25=[r31],32 + ;; + ldf.fill f26=[r32],32 + ldf.fill f27=[r31],32 + ;; + ldf.fill f28=[r32],32 + ldf.fill f29=[r31],32 + ;; +{ .mmb + ldf.fill f30=[r32] + ldf.fill f31=[r31] + br.ret.sptk rp + ;; +} +END(restorectx) + +/* + * void savectx(struct pcb *) + * void swapctx(struct pcb *old, struct pcb *new) + */ + +ENTRY(savectx,1) +{ .mmi + alloc r16=ar.pfs,1,1,0,0 + ;; + add r33=0,r0 + nop 0 +} + /* FALLTHROUGH */ + +ENTRY(swapctx, 2) +{ .mmi + flushrs + mov r16=ar.unat + add r31=8,r32 + ;; +} +{ .mmi + st8 [r32]=sp,16 // sp + mov ar.rsc=0 + mov r17=rp + ;; +} +{ .mmi + st8 [r31]=r16,16 // unat (before) + st8 [r32]=r17,16 // rp + mov r16=pr + ;; +} +{ .mmi + st8 [r31]=r16,16 // pr + mov r17=ar.bspstore + mov r16=ar.pfs + ;; +} +{ .mmi + st8 [r32]=r16,16 // pfs + st8 [r31]=r17,16 // bspstore + cmp.eq p15,p0=0,r33 + ;; +} +{ .mmi + mov r16=ar.rnat +(p15) mov ar.rsc=3 + add r30=SIZEOF_SPECIAL-(6*8),r32 + ;; +} +{ .mmi + st8 [r32]=r16,SIZEOF_SPECIAL-(4*8) // rnat + st8 [r31]=r0,SIZEOF_SPECIAL-(6*8) // __spare + mov r16=b1 + ;; +} + /* callee_saved */ +{ .mmi + .mem.offset 8,0 + st8.spill [r31]=r4,16 // r4 + .mem.offset 16,0 + st8.spill [r32]=r5,16 // r5 + mov r17=b2 + ;; +} +{ .mmi + .mem.offset 24,0 + st8.spill [r31]=r6,16 // r6 + .mem.offset 32,0 + st8.spill [r32]=r7,16 // r7 + mov r18=b3 + ;; +} +{ .mmi + st8 [r31]=r16,16 // b1 + mov r16=ar.unat + mov r19=b4 + ;; +} +{ .mmi + st8 [r30]=r16 // unat (after) + st8 [r32]=r17,16 // b2 + mov r16=b5 + ;; +} +{ .mmi + st8 [r31]=r18,16 // b3 + st8 [r32]=r19,16 // b4 + mov r17=ar.lc + ;; +} + st8 [r31]=r16,16 // b5 + st8 [r32]=r17,16 // lc + ;; + st8 [r31]=r0,24 // __spare + stf.spill [r32]=f2,32 + ;; + stf.spill [r31]=f3,32 + stf.spill [r32]=f4,32 + ;; + stf.spill [r31]=f5,32 + stf.spill [r32]=f16,32 + ;; + stf.spill [r31]=f17,32 + stf.spill [r32]=f18,32 + ;; + stf.spill [r31]=f19,32 + stf.spill [r32]=f20,32 + ;; + stf.spill [r31]=f21,32 + stf.spill [r32]=f22,32 + ;; + stf.spill [r31]=f23,32 + stf.spill [r32]=f24,32 + ;; + stf.spill [r31]=f25,32 + stf.spill [r32]=f26,32 + ;; + stf.spill [r31]=f27,32 + stf.spill [r32]=f28,32 + ;; + stf.spill [r31]=f29,32 + stf.spill [r32]=f30 + ;; +{ .mfb + stf.spill [r31]=f31 + nop 0 +(p15) br.ret.sptk rp + ;; +} +{ .mfb + mov r32=r33 + nop 0 + br.sptk restorectx + ;; +} +END(swapctx) + +/* + * fork_trampoline() + * + * Arrange for a function to be invoked neatly, after a cpu_switch(). + * + * Invokes fork_exit() passing in three arguments: a callout function, an + * argument to the callout, and a trapframe pointer. For child processes + * returning from fork(2), the argument is a pointer to the child process. + * + * The callout function is in r4, the address to return to after executing + * fork_exit() is in r5, and the argument is in r6. + */ +ENTRY(fork_trampoline, 0) + .prologue + .save rp,r0 + .body + alloc r14=ar.pfs,0,0,3,0 + ;; + mov b0=r5 + mov out0=r4 + mov out1=r6 + add out2=16,sp + ;; + br.call.sptk.few rp=fork_exit + ;; + br.cond.sptk.many exception_restore + ;; +END(fork_trampoline) + +/* * _getcontext(ucontext_t *ucp) */ ENTRY(_getcontext, 1) ==== //depot/projects/ia64_epc/sys/ia64/ia64/db_interface.c#3 (text+ko) ==== @@ -79,7 +79,7 @@ #define DB_MISC_REGS 13 /* make sure this is correct */ {"pc", (db_expr_t*) 0, db_get_pc_reg}, - {"ip", (db_expr_t*) &ddb_regs.tf_special.ip, FCN_NULL}, + {"ip", (db_expr_t*) &ddb_regs.tf_special.iip, FCN_NULL}, {"psr", (db_expr_t*) &ddb_regs.tf_special.psr, FCN_NULL}, {"cr.isr", (db_expr_t*) &ddb_regs.tf_special.isr, FCN_NULL}, {"cr.ifa", (db_expr_t*) &ddb_regs.tf_special.ifa, FCN_NULL}, ==== //depot/projects/ia64_epc/sys/ia64/ia64/exception.s#6 (text+ko) ==== @@ -31,12 +31,498 @@ #include /* - * ar.k7 = address of gateway page - * ar.k6 = ksp - * ar.k5 = kbsp - * ar.k4 = pcpup + * ar.k7 = kernel memory stack + * ar.k6 = kernel register stack + * ar.k4 = PCPU data + */ + + .text + +/* + * exception_save: save interrupted state + * + * Arguments: + * r16 address of bundle that contains the branch. The + * return address will be the next bundle. + */ +ENTRY(exception_save, 0) +{ .mii + mov r17=sp + mov r18=pr + extr.u r31=sp,61,3 + ;; +} +{ .mmi + cmp.le p14,p15=5,r31 + ;; +(p15) mov r31=ar.k7 // kernel memory stack +(p14) mov r31=sp + ;; +} +{ .mmi + add r30=-SIZEOF_TRAPFRAME,r31 + ;; + mov r20=ar.unat + dep sp=0,r30,0,10 + ;; +} +{ .mmi + mov r21=ar.rsc + mov ar.rsc=0 + sub r19=r31,sp + ;; +} + + /* + * We have a 1KB aligned trapframe, pointed to by sp. If we write + * to the trapframe, we may trigger a data nested TLB fault. By + * aligning the trapframe on a 1KB boundary, we guarantee that if + * we get a data nested TLB fault, it will be on the very first + * write. Since the data nested TLB fault does not preserve any + * state, we have to be careful what we clobber. Consequently, we + * have to be careful what we use here. The registers that must + * not be clobbered by the data nested TLB fault handler on top + * of any interrupted state we haven't saved yet (ie almost all + * of it) are: p14, p15, sp and r16-r21. + */ +exception_save_restart: +{ .mmi + st8 [sp]=r19 // length + mov r22=cr.iip + add r31=8,sp + ;; +} +{ .mmi + st8 [r31]=r0,16 // flags + mov r29=ar.bspstore + add r30=16,sp + ;; +} +{ .mmi + st8.spill [r30]=r17,16 // sp + st8 [r31]=r20,16 // unat + mov r27=b0 + ;; +} +{ .mmi + st8 [r30]=r27,16 // rp + st8 [r31]=r18,16 // pr + mov r27=ar.pfs + ;; +} +{ .mmb + st8 [r30]=r27,16 // pfs + st8 [r31]=r29,16 // bspstore + cover + ;; +} +{ .mmi + mov r17=ar.rnat + mov r18=ar.fpsr + extr.u r28=r29,61,3 + ;; +} +{ .mmi + st8 [r30]=r17,16 // rnat + st8 [r31]=r0,16 // __spare + cmp.le p12,p13=5,r28 + ;; +} +{ .mmi + st8.spill [r30]=r13,16 // tp + st8 [r31]=r21,16 // rsc + nop 0 + ;; +} +{ .mmi + mov r17=cr.ipsr +(p13) mov r29=ar.k6 // kernel register stack + nop 0 + ;; +} +{ .mmi + st8 [r30]=r18,16 // fpsr + st8 [r31]=r17,16 // psr + nop 0 + ;; +} +{ .mmi + mov ar.bspstore=r29 + ;; + mov r18=ar.bsp + nop 0 + ;; +} +{ .mmi + st8.spill [r30]=gp,16 // gp + mov r19=cr.ifs + sub r18=r18,r29 + ;; +} +{ .mmi + st8 [r31]=r18,16 // ndirty + mov r20=cr.ifa + nop 0 + ;; +} +{ .mmi + st8 [r30]=r19,16 // cfm + st8 [r31]=r22,16 // iip + nop 0 + ;; +} +{ .mmi + st8 [r30]=r20 // ifa + mov r18=cr.isr + add r29=16,r30 + ;; +} +{ .mmi + st8 [r31]=r18 // isr + add r30=8,r29 + add r31=16,r29 + ;; +} +{ .mmi + .mem.offset 0,0 + st8.spill [r30]=r2,16 // r2 + .mem.offset 8,0 + st8.spill [r31]=r3,16 // r3 + add r2=9*8,r29 + ;; +} +{ .mmi + .mem.offset 0,0 + st8.spill [r30]=r8,16 // r8 + .mem.offset 8,0 + st8.spill [r31]=r9,16 // r9 + add r3=8,r2 + ;; +} +{ .mmi + .mem.offset 0,0 + st8.spill [r30]=r10,16 // r10 + .mem.offset 8,0 + st8.spill [r31]=r11,16 // r11 + add r8=16,r16 + ;; +} +{ .mmi + .mem.offset 0,0 + st8.spill [r30]=r14 // r14 + .mem.offset 8,0 + st8.spill [r31]=r15 // r15 + mov r9=r29 +} +{ .mmb + mov r10=ar.csd + mov r11=ar.ssd + bsw.1 + ;; +} +{ .mmi + .mem.offset 0,0 + st8.spill [r2]=r16,16 // r16 + .mem.offset 8,0 + st8.spill [r3]=r17,16 // r17 + mov r14=b6 + ;; +} +{ .mmi + .mem.offset 0,0 + st8.spill [r2]=r18,16 // r18 + .mem.offset 8,0 + st8.spill [r3]=r19,16 // r19 + mov r15=b7 + ;; +} +{ .mmi + .mem.offset 0,0 + st8.spill [r2]=r20,16 // r20 + .mem.offset 8,0 + st8.spill [r3]=r21,16 // r21 + mov b7=r8 + ;; +} +{ .mmi + .mem.offset 0,0 + st8.spill [r2]=r22,16 // r22 + .mem.offset 8,0 + st8.spill [r3]=r23,16 // r23 + ;; +} + + .mem.offset 0,0 + st8.spill [r2]=r24,16 // r24 + .mem.offset 8,0 + st8.spill [r3]=r25,16 // r25 + ;; + .mem.offset 0,0 + st8.spill [r2]=r26,16 // r26 + .mem.offset 8,0 + st8.spill [r3]=r27,16 // r27 + ;; + .mem.offset 0,0 + st8.spill [r2]=r28,16 // r28 + .mem.offset 8,0 + st8.spill [r3]=r29,16 // r29 + ;; + .mem.offset 0,0 + st8.spill [r2]=r30,16 // r30 + .mem.offset 8,0 + st8.spill [r3]=r31,16 // r31 + ;; + +{ .mmi + st8 [r2]=r14,16 // b6 + mov r17=ar.unat + nop 0 + ;; +} +{ .mmi + st8 [r3]=r15,16 // b7 + mov r16=ar.ccv + nop 0 + ;; +} +{ .mmi + st8 [r2]=r16,16 // ccv + st8 [r3]=r10,16 // csd + nop 0 + ;; +} +{ .mmi + st8 [r2]=r11,24 // ssd + st8 [r9]=r17 + nop 0 + ;; +} + + stf.spill [r3]=f6,32 // f6 + stf.spill [r2]=f7,32 // f7 + ;; + stf.spill [r3]=f8,32 // f8 + stf.spill [r2]=f9,32 // f9 + ;; + stf.spill [r3]=f10,32 // f10 + stf.spill [r2]=f11,32 // f11 + ;; + stf.spill [r3]=f12,32 // f12 + stf.spill [r2]=f13,32 // f13 + ;; + stf.spill [r3]=f14 // f14 + stf.spill [r2]=f15 // f15 + ;; +{ .mmi + mov ar.rsc=3 + mov r13=ar.k4 + nop 0 + ;; +} +{ .mlx + ssm psr.ic + movl gp=__gp + ;; +} +{ .mfb + srlz.d + nop 0 + br.sptk b7 + ;; +} +END(exception_save) + +/* + * exception_restore: restore interrupted state + * + * Arguments: + * sp+16 trapframe pointer */ +ENTRY(exception_restore, 0) + /* + * Read the length of the trapframe with interrupts enabled and + * interrupt collection enabled. That way we can safely trap on + * the load in case the address translation of the trapframe has + * been flushed. + */ +{ .mmi + add sp=16,sp + ;; + ld8 r9=[sp] // length + add r3=SIZEOF_TRAPFRAME-32,sp + ;; +} +{ .mmi + rsm psr.ic|psr.i + ;; + srlz.d + add r2=16,r3 + ;; +} +{ .mmi + ldf.fill f15=[r2],-32 // f15 + ldf.fill f14=[r3],-32 // f14 + add r8=SIZEOF_SPECIAL+16,sp + ;; +} +{ .mmi + ldf.fill f13=[r2],-32 // f13 + ldf.fill f12=[r3],-32 // f12 + add r9=r9,sp + ;; +} + + ldf.fill f11=[r2],-32 // f11 + ldf.fill f10=[r3],-32 // f10 + ;; + ldf.fill f9=[r2],-32 // f9 + ldf.fill f8=[r3],-32 // f8 + ;; + ldf.fill f7=[r2],-24 // f7 + ldf.fill f6=[r3],-16 // f6 + ;; + +{ .mmi + ld8 r8=[r8] // unat (after) + mov ar.k7=r9 + nop 0 + ;; +} +{ .mmi + ld8 r10=[r2],-16 // ssd + ld8 r11=[r3],-16 // csd + nop 0 + ;; +} +{ .mmi + mov ar.unat=r8 + mov ar.ssd=r10 + nop 0 +} +{ .mmi + ld8 r14=[r2],-16 // ccv + ld8 r15=[r3],-16 // b7 + nop 0 + ;; +} +{ .mmi + mov ar.csd=r11 + mov ar.ccv=r14 + mov b7=r15 + ;; +} +{ .mmi + ld8 r8=[r2],-16 // b6 + ld8.fill r31=[r3],-16 // r31 + nop 0 + ;; +} +{ .mmi + ld8.fill r30=[r2],-16 // r30 + ld8.fill r29=[r3],-16 // r29 + mov b6=r8 + ;; +} + + ld8.fill r28=[r2],-16 // r28 + ld8.fill r27=[r3],-16 // r27 + ;; + ld8.fill r26=[r2],-16 // r26 + ld8.fill r25=[r3],-16 // r25 + ;; + ld8.fill r24=[r2],-16 // r24 + ld8.fill r23=[r3],-16 // r23 + ;; + ld8.fill r22=[r2],-16 // r22 + ld8.fill r21=[r3],-16 // r21 + ;; + ld8.fill r20=[r2],-16 // r20 + ld8.fill r19=[r3],-16 // r19 + ;; + ld8.fill r18=[r2],-16 // r18 + ld8.fill r17=[r3],-16 // r17 + ;; + +{ .mmb + ld8.fill r16=[r2],-16 // r16 + ld8.fill r15=[r3],-16 // r15 + bsw.0 + ;; +} +{ .mmi + ld8.fill r14=[r2],-16 // r14 + ld8.fill r11=[r3],-16 // r11 + add r31=16,sp + ;; +} +{ .mmi + ld8.fill r10=[r2],-16 // r10 + ld8.fill r9=[r3],-16 // r9 + add r30=24,sp + ;; +} + + ld8.fill r8=[r2],-16 // r8 + ld8.fill r3=[r3] // r3 + ;; + ld8.fill r2=[r2] // r2 + ld8.fill sp=[r31],16 // sp + ;; + ld8 r16=[r30],16 // unat + ld8 r17=[r31],16 // rp + ;; + ld8 r18=[r30],16 // pr + ld8 r19=[r31],16 // pfs + mov rp=r17 + ;; + ld8 r20=[r30],24 // bspstore + ld8 r21=[r31],24 // rnat + ;; + ld8.fill r29=[r30],16 // tp + ld8 r22=[r31],16 // rsc + ;; + ld8 r23=[r30],16 // fpsr + ld8 r24=[r31],16 // psr + ;; + ld8.fill r1=[r30],16 // gp + ld8 r25=[r31],16 // ndirty + ;; + ld8 r26=[r30] // cfm + ld8 r27=[r31] // ip + ;; + // Switch register stack +#if 0 + alloc r31=ar.pfs,0,0,0,0 // discard current frame + shl r30=r25,16 // value for ar.rsc + ;; + mov ar.rsc=r30 // setup for loadrs + ;; + loadrs // load user regs + ;; + mov ar.bspstore=r20 + ;; + mov ar.rnat=r21 +#endif + + // Don't restore r13 if returning to kernel + + mov ar.unat=r16 + mov ar.pfs=r19 + mov ar.fpsr=r23 + mov cr.ipsr=r24 + mov cr.ifs=r26 + mov cr.iip=r27 + ;; + +{ .mib + mov ar.rsc=r22 + mov pr=r18,0x1fffe + rfi + ;; +} +END(exception_restore) + /* * Call exception_save_regs to preserve the interrupted state in a * trapframe. Note that we don't use a call instruction because we @@ -47,12 +533,12 @@ * resume it. */ #define TRAP(_n_) \ -1: mov r17=ip;; \ - add r17=2f-1b,r17; \ - mov r16=b6;; \ - mov b6=r17; \ - br.sptk.few exception_save; \ -2: (p3) ssm psr.i; \ +{ .mib ; \ + nop _n_ ; \ + mov r16=ip ; \ + br.sptk.few exception_save ; \ +} ; \ +(p3) ssm psr.i; \ alloc r15=ar.pfs,0,0,3,0; \ mov out0=_n_; \ mov out1=r14; \ @@ -519,16 +1005,17 @@ IVT_END(Break_Instruction) IVT_ENTRY(External_Interrupt, 0x3000) - mov r16=b6 // save user's b6 -1: mov r17=ip;; // construct return address - add r17=2f-1b,r17;; // for exception_save - mov b6=r17 - br.sptk.few exception_save // 'call' exception_save - +{ .mib + nop 12 + mov r16=ip + br.sptk exception_save + ;; +} +{ .mmi 2: alloc r14=ar.pfs,0,0,2,0 // make a frame for calling with - - mov out1=sp;; - add sp=-16,sp;; + mov out1=sp + add sp=-16,sp +} 3: mov out0=cr.ivr // find interrupt vector ;; @@ -538,17 +1025,16 @@ ssm psr.i // re-enable interrupts ;; // now that we are in-progress srlz.d + br.call.sptk.many rp=interrupt // call high-level handler ;; - br.call.sptk.many rp=interrupt // call high-level handler - rsm psr.i // disable interrupts ;; srlz.d - ;; mov cr.eoi=r0 // and ack the interrupt ;; srlz.d br.sptk.few 3b // loop for more + ;; IVT_END(External_Interrupt) IVT_ENTRY(Reserved_3400, 0x3400) @@ -770,705 +1256,3 @@ IVT_ENTRY(Reserved_7f00, 0x7f00) TRAP(67) IVT_END(Reserved_7f00) - - .text - -/* - * exception_restore: restore interrupted state - * - * Arguments: - * sp+16 trapframe pointer - * r4 ar.pfs before the alloc in TRAP() - * - */ -ENTRY(exception_restore, 0) -{ .mfi - alloc r14=ar.pfs,0,0,1,0 // in case we call ast() - nop 1 - add r3=TF_SPECIAL_PSR+16,sp - ;; -} -{ .mmi - ld8 r30=[r3] // ipsr - ;; - nop 2 - extr.u r16=r30,32,2 // extract ipsr.cpl - ;; -} -{ .mfb - cmp.eq p1,p2=r0,r16 // test for return to kernel mode - nop 3 -(p1) br.cond.dpnt 2f // no ast check for returns to kernel -} -3: -{ .mmi - add r3=PC_CURTHREAD,r13 // &curthread - ;; - ld8 r3=[r3] // curthread - add r2=(TDF_ASTPENDING|TDF_NEEDRESCHED),r0 - ;; -} -{ .mmb - mov r15=psr // save interrupt enable status - nop 4 - ;; -} -{ .mmi - ;; - rsm psr.i // disable interrupts - add r3=TD_FLAGS,r3 // &curthread->td_flags - ;; -} -{ .mmi - ld4 r14=[r3] // fetch curthread->td_flags - ;; - and r14=r2,r14 // flags & (TDF_ASTPENDING|TDF_NEEDRESCHED) - nop 5 - ;; -} -{ .mfb >>> TRUNCATED FOR MAIL (1000 lines) <<< From owner-p4-projects@FreeBSD.ORG Tue Apr 8 01:51:46 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id DA0E237B404; Tue, 8 Apr 2003 01:51:45 -0700 (PDT) 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 79F2437B401 for ; Tue, 8 Apr 2003 01:51:45 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 073F243F85 for ; Tue, 8 Apr 2003 01:51:45 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h388pi0U011860 for ; Tue, 8 Apr 2003 01:51:44 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h388pi3A011857 for perforce@freebsd.org; Tue, 8 Apr 2003 01:51:44 -0700 (PDT) Date: Tue, 8 Apr 2003 01:51:44 -0700 (PDT) Message-Id: <200304080851.h388pi3A011857@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28502 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, 08 Apr 2003 08:51:47 -0000 http://perforce.freebsd.org/chv.cgi?CH=28502 Change 28502 by peter@peter_daintree on 2003/04/08 01:50:45 actually create the 4-level structure. extra mappings are needed because I'm not using UMA for the pages. Affected files ... .. //depot/projects/hammer/sys/x86_64/x86_64/pmap.c#18 edit Differences ... ==== //depot/projects/hammer/sys/x86_64/x86_64/pmap.c#18 (text+ko) ==== @@ -1036,6 +1036,8 @@ register struct pmap *pmap; { vm_page_t ptdpg[NPGPTD]; + vm_page_t pdppg; + vm_page_t pml4pg; vm_paddr_t pa; int i; @@ -1057,7 +1059,7 @@ */ if (pmap->pm_pteobj == NULL) pmap->pm_pteobj = vm_object_allocate(OBJT_DEFAULT, PTDPTDI + - NPGPTD); + NPGPTD + 2); /* * allocate the page directory page(s) @@ -1072,12 +1074,32 @@ vm_page_unlock_queues(); } + pml4pg = vm_page_grab(pmap->pm_pteobj, PTDPTDI + NPGPTD, + VM_ALLOC_NORMAL | VM_ALLOC_RETRY | VM_ALLOC_WIRED | VM_ALLOC_ZERO); + vm_page_lock_queues(); + vm_page_flag_clear(pml4pg, PG_BUSY); + pml4pg->valid = VM_PAGE_BITS_ALL; + vm_page_unlock_queues(); + + pdppg = vm_page_grab(pmap->pm_pteobj, PTDPTDI + NPGPTD + 1, + VM_ALLOC_NORMAL | VM_ALLOC_RETRY | VM_ALLOC_WIRED | VM_ALLOC_ZERO); + vm_page_lock_queues(); + vm_page_flag_clear(pdppg, PG_BUSY); + pdppg->valid = VM_PAGE_BITS_ALL; + vm_page_unlock_queues(); + pmap_qenter((vm_offset_t)pmap->pm_pdir, ptdpg, NPGPTD); + pmap_qenter((vm_offset_t)pmap->pm_pdp, &pdppg, 1); + pmap_qenter((vm_offset_t)pmap->pm_pml4, &pml4pg, 1); for (i = 0; i < NPGPTD; i++) { if ((ptdpg[i]->flags & PG_ZERO) == 0) bzero(pmap->pm_pdir + (i * NPDEPG), PAGE_SIZE); } + if ((pdppg->flags & PG_ZERO) == 0) + bzero(pmap->pm_pdp, PAGE_SIZE); + if ((pml4pg->flags & PG_ZERO) == 0) + bzero(pmap->pm_pml4, PAGE_SIZE); mtx_lock_spin(&allpmaps_lock); LIST_INSERT_HEAD(&allpmaps, pmap, pm_list); @@ -1089,10 +1111,9 @@ for (i = 0; i < NPGPTD; i++) { pa = VM_PAGE_TO_PHYS(ptdpg[i]); pmap->pm_pdir[PTDPTDI + i] = pa | PG_V | PG_RW | PG_A | PG_M; -#ifdef PAE pmap->pm_pdp[i] = pa | PG_V; -#endif } + pmap->pm_pml4[0] = VM_PAGE_TO_PHYS(pdppg) | PG_V; pmap->pm_active = 0; TAILQ_INIT(&pmap->pm_pvlist); From owner-p4-projects@FreeBSD.ORG Tue Apr 8 01:51:47 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 5FE2837B40E; Tue, 8 Apr 2003 01:51:46 -0700 (PDT) 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 DBF8137B401 for ; Tue, 8 Apr 2003 01:51:45 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 875F143F85 for ; Tue, 8 Apr 2003 01:51:45 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h388pj0U011866 for ; Tue, 8 Apr 2003 01:51:45 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h388pjGq011863 for perforce@freebsd.org; Tue, 8 Apr 2003 01:51:45 -0700 (PDT) Date: Tue, 8 Apr 2003 01:51:45 -0700 (PDT) Message-Id: <200304080851.h388pjGq011863@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28503 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, 08 Apr 2003 08:51:47 -0000 http://perforce.freebsd.org/chv.cgi?CH=28503 Change 28503 by peter@peter_daintree on 2003/04/08 01:51:16 point %cr3 to the pml4 or cpu_switch doesn't work too well Affected files ... .. //depot/projects/hammer/sys/x86_64/x86_64/vm_machdep.c#18 edit Differences ... ==== //depot/projects/hammer/sys/x86_64/x86_64/vm_machdep.c#18 (text+ko) ==== @@ -134,11 +134,7 @@ * Set registers for trampoline to user mode. Leave space for the * return address on stack. These are the kernel mode register values. */ -#ifdef PAE - pcb2->pcb_cr3 = vtophys(vmspace_pmap(p2->p_vmspace)->pm_pdpt); -#else - pcb2->pcb_cr3 = vtophys(vmspace_pmap(p2->p_vmspace)->pm_pdir); -#endif + pcb2->pcb_cr3 = vtophys(vmspace_pmap(p2->p_vmspace)->pm_pml4); pcb2->pcb_r12 = (int)fork_return; /* fork_trampoline argument */ pcb2->pcb_rbp = 0; pcb2->pcb_rsp = (long)td2->td_frame - sizeof(void *); From owner-p4-projects@FreeBSD.ORG Tue Apr 8 01:52:48 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 6824F37B404; Tue, 8 Apr 2003 01:52:48 -0700 (PDT) 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 1E68337B401 for ; Tue, 8 Apr 2003 01:52:48 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 969A543F75 for ; Tue, 8 Apr 2003 01:52:47 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h388ql0U011913 for ; Tue, 8 Apr 2003 01:52:47 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h388qkxA011910 for perforce@freebsd.org; Tue, 8 Apr 2003 01:52:47 -0700 (PDT) Date: Tue, 8 Apr 2003 01:52:47 -0700 (PDT) Message-Id: <200304080852.h388qkxA011910@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28504 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, 08 Apr 2003 08:52:49 -0000 http://perforce.freebsd.org/chv.cgi?CH=28504 Change 28504 by peter@peter_daintree on 2003/04/08 01:52:25 actually use hammer-style calling conventions rather than i386 style stack based conventions. This is both a blessing and a curse. Affected files ... .. //depot/projects/hammer/sys/x86_64/x86_64/support.s#16 edit Differences ... ==== //depot/projects/hammer/sys/x86_64/x86_64/support.s#16 (text+ko) ==== @@ -63,17 +63,12 @@ /* * copyout(from_kernel, to_user, len) - MP SAFE + * %rdi, %rsi, %rdx */ ENTRY(copyout) movq PCPU(CURPCB),%rax movq $copyout_fault,PCB_ONFAULT(%rax) - pushq %rsi - pushq %rdi - pushq %rbx - movq 32(%rsp),%rsi - movq 40(%rsp),%rdi - movq 48(%rsp),%rbx - testl %ebx,%ebx /* anything to do? */ + testq %rdx,%rdx /* anything to do? */ jz done_copyout /* @@ -86,8 +81,8 @@ /* * First, prevent address wrapping. */ - movq %rdi,%rax - addq %rbx,%rax + movq %rsi,%rax + addq %rdx,%rax jc copyout_fault /* * XXX STOP USING VM_MAXUSER_ADDRESS. @@ -99,8 +94,9 @@ cmpq %rcx,%rax ja copyout_fault - /* bcopy(%rsi, %rdi, %rbx) */ - movq %rbx,%rcx + xchgq %rdi, %rsi + /* bcopy(%rsi, %rdi, %rdx) */ + movq %rdx,%rcx shrq $3,%rcx cld @@ -112,9 +108,6 @@ movsb done_copyout: - popq %rbx - popq %rdi - popq %rsi xorq %rax,%rax movq PCPU(CURPCB),%rdx movq %rax,PCB_ONFAULT(%rdx) @@ -122,9 +115,6 @@ ALIGN_TEXT copyout_fault: - popq %rbx - popq %rdi - popq %rsi movq PCPU(CURPCB),%rdx movq $0,PCB_ONFAULT(%rdx) movq $EFAULT,%rax @@ -132,26 +122,26 @@ /* * copyin(from_user, to_kernel, len) - MP SAFE + * %rdi, %rsi, %rdx */ ENTRY(copyin) movq PCPU(CURPCB),%rax movq $copyin_fault,PCB_ONFAULT(%rax) - pushq %rsi - pushq %rdi - movq 24(%rsp),%rsi /* caddr_t from */ - movq 32(%rsp),%rdi /* caddr_t to */ - movq 40(%rsp),%rcx /* size_t len */ + testq %rdx,%rdx /* anything to do? */ + jz done_copyin /* * make sure address is valid */ - movq %rsi,%rdx - addq %rcx,%rdx + movq %rdi,%rax + addq %rdx,%rax jc copyin_fault - movq $VM_MAXUSER_ADDRESS,%rax - cmpq %rax,%rdx + movq $VM_MAXUSER_ADDRESS,%rcx + cmpq %rcx,%rax ja copyin_fault + xchgq %rdi, %rsi + movq %rdx, %rcx movb %cl,%al shrq $3,%rcx /* copy longword-wise */ cld @@ -162,8 +152,7 @@ rep movsb - popq %rdi - popq %rsi +done_copyin: xorq %rax,%rax movq PCPU(CURPCB),%rdx movq %rax,PCB_ONFAULT(%rdx) @@ -171,8 +160,6 @@ ALIGN_TEXT copyin_fault: - popq %rdi - popq %rsi movq PCPU(CURPCB),%rdx movq $0,PCB_ONFAULT(%rdx) movq $EFAULT,%rax @@ -180,19 +167,18 @@ /* * casuptr. Compare and set user pointer. Returns -1 or the current value. + * dst = %rdi, old = %rsi, new = %rdx */ ENTRY(casuptr) movq PCPU(CURPCB),%rcx movq $fusufault,PCB_ONFAULT(%rcx) - movq 8(%rsp),%rdx /* dst */ movq $VM_MAXUSER_ADDRESS-4,%rax - cmpq %rax,%rdx /* verify address is valid */ + cmpq %rax,%rdi /* verify address is valid */ ja fusufault - movq 16(%rsp),%rax /* old */ - movq 24(%rsp),%rcx /* new */ - cmpxchgq %rcx, (%rdx) + movq %rsi, %rax /* old */ + cmpxchgq %rdx, (%rdi) /* new = %rdx */ /* * The old value is in %eax. If the store succeeded it will be the @@ -209,32 +195,31 @@ * fu{byte,sword,word} - MP SAFE * * Fetch a byte (sword, word) from user memory + * %rdi */ ENTRY(fuword64) movq PCPU(CURPCB),%rcx movq $fusufault,PCB_ONFAULT(%rcx) - movq 8(%rsp),%rdx /* from */ movq $VM_MAXUSER_ADDRESS-8,%rax - cmpq %rax,%rdx /* verify address is valid */ + cmpq %rax,%rdi /* verify address is valid */ ja fusufault - movq (%rdx),%rax + movq (%rdi),%rax movq $0,PCB_ONFAULT(%rcx) ret ENTRY(fuword32) movq PCPU(CURPCB),%rcx movq $fusufault,PCB_ONFAULT(%rcx) - movq 8(%rsp),%rdx /* from */ movq $VM_MAXUSER_ADDRESS-4,%rax - cmpq %rax,%rdx /* verify address is valid */ + cmpq %rax,%rdi /* verify address is valid */ ja fusufault # XXX use the 64 extend xorq %rax, %rax - movl (%rdx),%eax + movl (%rdi),%eax movq $0,PCB_ONFAULT(%rcx) ret @@ -258,15 +243,14 @@ ENTRY(fuword16) movq PCPU(CURPCB),%rcx movq $fusufault,PCB_ONFAULT(%rcx) - movq 8(%rsp),%rdx movq $VM_MAXUSER_ADDRESS-2,%rax - cmpq %rax,%rdx + cmpq %rax,%rdi ja fusufault # XXX use the 64 extend xorq %rax, %rax - movzwl (%rdx),%eax + movzwl (%rdi),%eax movq $0,PCB_ONFAULT(%rcx) ret @@ -276,15 +260,14 @@ ENTRY(fubyte) movq PCPU(CURPCB),%rcx movq $fusufault,PCB_ONFAULT(%rcx) - movq 8(%rsp),%rdx movq $VM_MAXUSER_ADDRESS-1,%rax - cmpq %rax,%rdx + cmpq %rax,%rdi ja fusufault # XXX use the 64 extend xorq %rax, %rax - movzbl (%rdx),%eax + movzbl (%rdi),%eax movq $0,PCB_ONFAULT(%rcx) ret @@ -300,18 +283,17 @@ * su{byte,sword,word} - MP SAFE * * Write a byte (word, longword) to user memory + * addr = %rdi, value = %rsi */ ENTRY(suword64) movq PCPU(CURPCB),%rcx movq $fusufault,PCB_ONFAULT(%rcx) - movq 8(%rsp),%rdx movq $VM_MAXUSER_ADDRESS-8,%rax - cmpq %rax,%rdx /* verify address validity */ + cmpq %rax,%rdi /* verify address validity */ ja fusufault - movq 16(%rsp),%rax - movq %rax,(%rdx) + movq %rsi,(%rdi) xorq %rax,%rax movq PCPU(CURPCB),%rcx movq %rax,PCB_ONFAULT(%rcx) @@ -320,14 +302,12 @@ ENTRY(suword32) movq PCPU(CURPCB),%rcx movq $fusufault,PCB_ONFAULT(%rcx) - movq 8(%rsp),%rdx movq $VM_MAXUSER_ADDRESS-4,%rax - cmpq %rax,%rdx /* verify address validity */ + cmpq %rax,%rdi /* verify address validity */ ja fusufault - movl 16(%rsp),%eax - movl %eax,(%rdx) + movl %esi,(%rdi) xorq %rax,%rax movq PCPU(CURPCB),%rcx movq %rax,PCB_ONFAULT(%rcx) @@ -342,14 +322,12 @@ ENTRY(suword16) movq PCPU(CURPCB),%rcx movq $fusufault,PCB_ONFAULT(%rcx) - movq 8(%rsp),%rdx movq $VM_MAXUSER_ADDRESS-2,%rax - cmpq %rax,%rdx /* verify address validity */ + cmpq %rax,%rdi /* verify address validity */ ja fusufault - movw 16(%rsp),%ax - movw %ax,(%rdx) + movw %si,(%rdi) xorq %rax,%rax movq PCPU(CURPCB),%rcx /* restore trashed register */ movq %rax,PCB_ONFAULT(%rcx) @@ -361,14 +339,13 @@ ENTRY(subyte) movq PCPU(CURPCB),%rcx movq $fusufault,PCB_ONFAULT(%rcx) - movq 8(%rsp),%rdx movq $VM_MAXUSER_ADDRESS-1,%rax - cmpq %rax,%rdx /* verify address validity */ + cmpq %rax,%rdi /* verify address validity */ ja fusufault - movb 16(%rsp),%al - movb %al,(%rdx) + movl %esi, %eax + movb %al,(%rdi) xorq %rax,%rax movq PCPU(CURPCB),%rcx /* restore trashed register */ movq %rax,PCB_ONFAULT(%rcx) @@ -376,6 +353,7 @@ /* * copyinstr(from, to, maxlen, int *lencopied) - MP SAFE + * %rdi, %rsi, %rdx, %rcx * * copy a string from from to to, stop when a 0 character is reached. * return ENAMETOOLONG if string is longer than maxlen, and @@ -383,15 +361,12 @@ * return the actual length in *lencopied. */ ENTRY(copyinstr) - pushq %rsi - pushq %rdi movq PCPU(CURPCB),%rcx movq $cpystrflt,PCB_ONFAULT(%rcx) + movq %rdx, %r8 /* %r8 = maxlen */ + movq %rcx, %r9 /* %r9 = *len */ + xchgq %rdi, %rsi /* %rdi = from, %rsi = to */ - movq 24(%rsp),%rsi /* %esi = from */ - movq 32(%rsp),%rdi /* %edi = to */ - movq 40(%rsp),%rdx /* %edx = maxlen */ - movq $VM_MAXUSER_ADDRESS,%rax /* make sure 'from' is within bounds */ @@ -402,7 +377,7 @@ cmpq %rdx,%rax jae 1f movq %rax,%rdx - movq %rax,40(%rsp) + movq %rax,%r8 1: incq %rdx cld @@ -436,28 +411,23 @@ /* set *lencopied and return %eax */ movq PCPU(CURPCB),%rcx movq $0,PCB_ONFAULT(%rcx) - movq 40(%rsp),%rcx - subq %rdx,%rcx - movq 48(%rsp),%rdx - testq %rdx,%rdx + + testq %r9,%r9 jz 1f - movq %rcx,(%rdx) + subq %rdx,%r8 + movq %r8,(%r9) 1: - popq %rdi - popq %rsi ret /* * copystr(from, to, maxlen, int *lencopied) - MP SAFE + * %rdi, %rsi, %rdx, %rcx */ ENTRY(copystr) - pushq %rsi - pushq %rdi + movq %rdx, %r8 /* %r8 = maxlen */ - movq 24(%rsp),%rsi /* %esi = from */ - movq 32(%rsp),%rdi /* %edi = to */ - movq 40(%rsp),%rdx /* %edx = maxlen */ + xchgq %rdi, %rsi incq %rdx cld 1: @@ -477,20 +447,18 @@ movq $ENAMETOOLONG,%rax 6: + + testq %rcx, %rcx + jz 7f /* set *lencopied and return %rax */ - movq 40(%rsp),%rcx - subq %rdx,%rcx - movq 48(%rsp),%rdx - testq %rdx,%rdx - jz 7f - movq %rcx,(%rdx) + subq %rdx, %r8 + movq %r8, (%rcx) 7: - popq %rdi - popq %rsi ret /* * Handling of special 386 registers and descriptor tables etc + * %rdi */ /* void lgdt(struct region_descriptor *rdp); */ ENTRY(lgdt) @@ -501,12 +469,6 @@ jmp 1f nop 1: - /* reload "stale" selectors */ - movl $KDSEL,%eax - mov %ax,%ds - mov %ax,%es - mov %ax,%ss - /* reload code selector by turning return into intersegmental return */ popq %rax pushq $KCSEL From owner-p4-projects@FreeBSD.ORG Tue Apr 8 01:53:50 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 3D1E837B404; Tue, 8 Apr 2003 01:53:50 -0700 (PDT) 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 E673137B401 for ; Tue, 8 Apr 2003 01:53:49 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7E3EB43F75 for ; Tue, 8 Apr 2003 01:53:49 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h388rn0U011960 for ; Tue, 8 Apr 2003 01:53:49 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h388rn2L011957 for perforce@freebsd.org; Tue, 8 Apr 2003 01:53:49 -0700 (PDT) Date: Tue, 8 Apr 2003 01:53:49 -0700 (PDT) Message-Id: <200304080853.h388rn2L011957@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28505 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, 08 Apr 2003 08:53:51 -0000 http://perforce.freebsd.org/chv.cgi?CH=28505 Change 28505 by peter@peter_daintree on 2003/04/08 01:52:57 cpu_switch is new-style Affected files ... .. //depot/projects/hammer/sys/sys/proc.h#14 edit Differences ... ==== //depot/projects/hammer/sys/sys/proc.h#14 (text+ko) ==== @@ -889,7 +889,7 @@ void sleepinit(void); void stopevent(struct proc *, u_int, u_int); void cpu_idle(void); -#if defined(__i386__) || defined(__sparc64__) +#if defined(__i386__) || defined(__sparc64__) || defined(__x86_64__) void cpu_switch(struct thread *old, struct thread *new); void cpu_throw(struct thread *old, struct thread *new) __dead2; #else From owner-p4-projects@FreeBSD.ORG Tue Apr 8 01:53:52 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 5F54837B404; Tue, 8 Apr 2003 01:53:51 -0700 (PDT) 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 5A5D737B40D for ; Tue, 8 Apr 2003 01:53:50 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 036B843F75 for ; Tue, 8 Apr 2003 01:53:50 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h388rn0U011966 for ; Tue, 8 Apr 2003 01:53:49 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h388rnF7011963 for perforce@freebsd.org; Tue, 8 Apr 2003 01:53:49 -0700 (PDT) Date: Tue, 8 Apr 2003 01:53:49 -0700 (PDT) Message-Id: <200304080853.h388rnF7011963@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28506 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, 08 Apr 2003 08:53:52 -0000 http://perforce.freebsd.org/chv.cgi?CH=28506 Change 28506 by peter@peter_daintree on 2003/04/08 01:53:18 cpu_throw is new-style Affected files ... .. //depot/projects/hammer/sys/kern/kern_thr.c#2 edit .. //depot/projects/hammer/sys/kern/kern_thread.c#16 edit Differences ... ==== //depot/projects/hammer/sys/kern/kern_thr.c#2 (text+ko) ==== @@ -106,7 +106,7 @@ td->td_last_kse = NULL; thread_stash(td); -#if defined(__i386__) || defined(__sparc64__) +#if defined(__i386__) || defined(__sparc64__) || defined(__x86_64__) cpu_throw(td, choosethread()); #else cpu_throw(); ==== //depot/projects/hammer/sys/kern/kern_thread.c#16 (text+ko) ==== @@ -1251,7 +1251,7 @@ } /* XXX Shouldn't cpu_throw() here. */ mtx_assert(&sched_lock, MA_OWNED); -#if defined(__i386__) || defined(__sparc64__) +#if defined(__i386__) || defined(__sparc64__) || defined(__x86_64__) cpu_throw(td, choosethread()); #else cpu_throw(); From owner-p4-projects@FreeBSD.ORG Tue Apr 8 01:54:53 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 9CEF437B404; Tue, 8 Apr 2003 01:54:52 -0700 (PDT) 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 3E5BA37B401 for ; Tue, 8 Apr 2003 01:54:52 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id DF57643FBF for ; Tue, 8 Apr 2003 01:54:51 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h388sp0U012009 for ; Tue, 8 Apr 2003 01:54:51 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h388spcf012006 for perforce@freebsd.org; Tue, 8 Apr 2003 01:54:51 -0700 (PDT) Date: Tue, 8 Apr 2003 01:54:51 -0700 (PDT) Message-Id: <200304080854.h388spcf012006@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28507 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, 08 Apr 2003 08:54:53 -0000 http://perforce.freebsd.org/chv.cgi?CH=28507 Change 28507 by peter@peter_daintree on 2003/04/08 01:54:10 cpu_switch is new-style Affected files ... .. //depot/projects/hammer/sys/kern/kern_synch.c#10 edit Differences ... ==== //depot/projects/hammer/sys/kern/kern_synch.c#10 (text+ko) ==== @@ -456,7 +456,7 @@ { struct bintime new_switchtime; struct thread *td; -#if defined(__i386__) || defined(__sparc64__) +#if defined(__i386__) || defined(__sparc64__) || defined(__x86_64__) struct thread *newtd; #endif struct proc *p; @@ -516,7 +516,7 @@ thread_switchout(td); sched_switchout(td); -#if defined(__i386__) || defined(__sparc64__) +#if defined(__i386__) || defined(__sparc64__) || defined(__x86_64__) newtd = choosethread(); if (td != newtd) cpu_switch(td, newtd); /* SHAZAM!! */ From owner-p4-projects@FreeBSD.ORG Tue Apr 8 01:55:54 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 76CBF37B404; Tue, 8 Apr 2003 01:55:54 -0700 (PDT) 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 2DC3637B401 for ; Tue, 8 Apr 2003 01:55:54 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id CD01143FBD for ; Tue, 8 Apr 2003 01:55:53 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h388tr0U012134 for ; Tue, 8 Apr 2003 01:55:53 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h388trxM012131 for perforce@freebsd.org; Tue, 8 Apr 2003 01:55:53 -0700 (PDT) Date: Tue, 8 Apr 2003 01:55:53 -0700 (PDT) Message-Id: <200304080855.h388trxM012131@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28508 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, 08 Apr 2003 08:55:55 -0000 http://perforce.freebsd.org/chv.cgi?CH=28508 Change 28508 by peter@peter_daintree on 2003/04/08 01:55:11 drop the segment registers, thats one more thing to go wrong for now. Affected files ... .. //depot/projects/hammer/sys/x86_64/include/frame.h#6 edit Differences ... ==== //depot/projects/hammer/sys/x86_64/include/frame.h#6 (text+ko) ==== @@ -49,9 +49,6 @@ */ struct trapframe { - int64_t tf_fs; - int64_t tf_es; - int64_t tf_ds; int64_t tf_r15; int64_t tf_r14; int64_t tf_r13; @@ -82,9 +79,6 @@ struct intrframe { int64_t if_vec; - int64_t if_fs; - int64_t if_es; - int64_t if_ds; int64_t if_r15; int64_t if_r14; int64_t if_r13; @@ -115,9 +109,6 @@ struct clockframe { int64_t cf_vec; - int64_t cf_fs; - int64_t cf_es; - int64_t cf_ds; int64_t cf_r15; int64_t cf_r14; int64_t cf_r13; @@ -146,6 +137,6 @@ int kdb_trap(int, int, struct trapframe *); -#define INTR_TO_TRAPFRAME(frame) ((struct trapframe *)&(frame)->if_fs) +#define INTR_TO_TRAPFRAME(frame) ((struct trapframe *)&(frame)->if_r15) #endif /* _MACHINE_FRAME_H_ */ From owner-p4-projects@FreeBSD.ORG Tue Apr 8 01:56:57 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 9EB8937B404; Tue, 8 Apr 2003 01:56:56 -0700 (PDT) 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 26F8437B401 for ; Tue, 8 Apr 2003 01:56:56 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id B9F6F43F85 for ; Tue, 8 Apr 2003 01:56:55 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h388ut0U012170 for ; Tue, 8 Apr 2003 01:56:55 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h388uthJ012167 for perforce@freebsd.org; Tue, 8 Apr 2003 01:56:55 -0700 (PDT) Date: Tue, 8 Apr 2003 01:56:55 -0700 (PDT) Message-Id: <200304080856.h388uthJ012167@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28509 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, 08 Apr 2003 08:56:57 -0000 http://perforce.freebsd.org/chv.cgi?CH=28509 Change 28509 by peter@peter_daintree on 2003/04/08 01:56:28 dont save/restore truncated segment registers Affected files ... .. //depot/projects/hammer/sys/x86_64/x86_64/exception.s#16 edit .. //depot/projects/hammer/sys/x86_64/x86_64/machdep.c#49 edit Differences ... ==== //depot/projects/hammer/sys/x86_64/x86_64/exception.s#16 (text+ko) ==== @@ -145,15 +145,7 @@ pushq %r13 pushq %r14 pushq %r15 - pushq %ds - pushq %es - pushq %fs alltraps_with_regs_pushed: - mov $KDSEL,%ax - mov %ax,%ds - mov %ax,%es -#XXX mov $KPSEL,%ax - mov %ax,%fs FAKE_MCOUNT(13*4(%rsp)) calltrap: FAKE_MCOUNT(btrap) /* init "from" btrap -> calltrap */ @@ -198,14 +190,6 @@ pushq %r13 pushq %r14 pushq %r15 - pushq %ds - pushq %es - pushq %fs - mov $KDSEL,%ax /* switch to kernel segments */ - mov %ax,%ds - mov %ax,%es -#XXX mov $KPSEL,%ax - mov %ax,%fs FAKE_MCOUNT(13*4(%rsp)) call syscall MEXITCOUNT @@ -280,16 +264,6 @@ doreti_exit: MEXITCOUNT - .globl doreti_popl_fs -doreti_popl_fs: -# popq %fs - addq $8, %rsp - .globl doreti_popl_es -doreti_popl_es: - popq %es - .globl doreti_popl_ds -doreti_popl_ds: - popq %ds popq %r15 popq %r14 popq %r13 @@ -336,15 +310,6 @@ pushq %r13 pushq %r14 pushq %r15 - pushq %ds - .globl doreti_popl_ds_fault -doreti_popl_ds_fault: - pushq %es - .globl doreti_popl_es_fault -doreti_popl_es_fault: - pushq %fs - .globl doreti_popl_fs_fault -doreti_popl_fs_fault: movq $0,TF_ERR(%rsp) /* XXX should be the error code */ movq $T_PROTFLT,TF_TRAPNO(%rsp) jmp alltraps_with_regs_pushed ==== //depot/projects/hammer/sys/x86_64/x86_64/machdep.c#49 (text+ko) ==== @@ -309,10 +309,6 @@ regs->tf_rip = PS_STRINGS - *(p->p_sysent->sv_szsigcode); regs->tf_rflags &= ~PSL_T; regs->tf_cs = _ucodesel; - regs->tf_ds = _udatasel; - regs->tf_es = _udatasel; - regs->tf_fs = _udatasel; - regs->tf_ss = _udatasel; PROC_LOCK(p); } @@ -484,10 +480,6 @@ regs->tf_rsp = stack; regs->tf_rflags = PSL_USER | (regs->tf_rflags & PSL_T); regs->tf_ss = _udatasel; - regs->tf_ds = _udatasel; - regs->tf_es = _udatasel; - regs->tf_fs = _udatasel; - regs->tf_cs = _ucodesel; /* * Arrange to trap the next npx or `fwait' instruction (see npx.c @@ -1355,9 +1347,6 @@ struct trapframe *tp; tp = td->td_frame; - regs->r_fs = tp->tf_fs; - regs->r_es = tp->tf_es; - regs->r_ds = tp->tf_ds; regs->r_rdi = tp->tf_rdi; regs->r_rsi = tp->tf_rsi; regs->r_rbp = tp->tf_rbp; @@ -1385,9 +1374,6 @@ if (!EFL_SECURE(regs->r_rflags, tp->tf_rflags) || !CS_SECURE(regs->r_cs)) return (EINVAL); - tp->tf_fs = regs->r_fs; - tp->tf_es = regs->r_es; - tp->tf_ds = regs->r_ds; tp->tf_rdi = regs->r_rdi; tp->tf_rsi = regs->r_rsi; tp->tf_rbp = regs->r_rbp; @@ -1487,9 +1473,6 @@ mcp->mc_onstack = sigonstack(tp->tf_rsp); mcp->mc_gs = td->td_pcb->pcb_gs; - mcp->mc_fs = tp->tf_fs; - mcp->mc_es = tp->tf_es; - mcp->mc_ds = tp->tf_ds; mcp->mc_rdi = tp->tf_rdi; mcp->mc_rsi = tp->tf_rsi; mcp->mc_rbp = tp->tf_rbp; @@ -1526,9 +1509,6 @@ rflags = (mcp->mc_rflags & PSL_USERCHANGE) | (tp->tf_rflags & ~PSL_USERCHANGE); if ((ret = set_fpcontext(td, mcp)) == 0) { - tp->tf_fs = mcp->mc_fs; - tp->tf_es = mcp->mc_es; - tp->tf_ds = mcp->mc_ds; tp->tf_rdi = mcp->mc_rdi; tp->tf_rsi = mcp->mc_rsi; tp->tf_rbp = mcp->mc_rbp; From owner-p4-projects@FreeBSD.ORG Tue Apr 8 01:57:58 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 65D9537B404; Tue, 8 Apr 2003 01:57:58 -0700 (PDT) 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 061B237B401 for ; Tue, 8 Apr 2003 01:57:58 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id A43C843F75 for ; Tue, 8 Apr 2003 01:57:57 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h388vv0U012215 for ; Tue, 8 Apr 2003 01:57:57 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h388vvT7012212 for perforce@freebsd.org; Tue, 8 Apr 2003 01:57:57 -0700 (PDT) Date: Tue, 8 Apr 2003 01:57:57 -0700 (PDT) Message-Id: <200304080857.h388vvT7012212@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28510 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, 08 Apr 2003 08:57:59 -0000 http://perforce.freebsd.org/chv.cgi?CH=28510 Change 28510 by peter@peter_daintree on 2003/04/08 01:57:05 the hacks in trap.c to counter faults restoring user segment registers are not needed here for the time being. Affected files ... .. //depot/projects/hammer/sys/x86_64/x86_64/trap.c#22 edit Differences ... ==== //depot/projects/hammer/sys/x86_64/x86_64/trap.c#22 (text+ko) ==== @@ -398,18 +398,6 @@ frame.tf_rip = (long)doreti_iret_fault; goto out; } - if (frame.tf_rip == (long)doreti_popl_ds) { - frame.tf_rip = (long)doreti_popl_ds_fault; - goto out; - } - if (frame.tf_rip == (long)doreti_popl_es) { - frame.tf_rip = (long)doreti_popl_es_fault; - goto out; - } - if (frame.tf_rip == (long)doreti_popl_fs) { - frame.tf_rip = (long)doreti_popl_fs_fault; - goto out; - } if (PCPU_GET(curpcb) != NULL && PCPU_GET(curpcb)->pcb_onfault != NULL) { frame.tf_rip = From owner-p4-projects@FreeBSD.ORG Tue Apr 8 01:59:00 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 8087F37B404; Tue, 8 Apr 2003 01:59:00 -0700 (PDT) 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 0935A37B401 for ; Tue, 8 Apr 2003 01:59:00 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9B6FE43F85 for ; Tue, 8 Apr 2003 01:58:59 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h388wx0U012307 for ; Tue, 8 Apr 2003 01:58:59 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h388wxXK012304 for perforce@freebsd.org; Tue, 8 Apr 2003 01:58:59 -0700 (PDT) Date: Tue, 8 Apr 2003 01:58:59 -0700 (PDT) Message-Id: <200304080858.h388wxXK012304@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28511 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, 08 Apr 2003 08:59:01 -0000 http://perforce.freebsd.org/chv.cgi?CH=28511 Change 28511 by peter@peter_daintree on 2003/04/08 01:58:17 tidy up some loose ends. update trapframe format. fix some syntax errors and undefined symbols Affected files ... .. //depot/projects/hammer/sys/x86_64/isa/icu_vector.s#7 edit Differences ... ==== //depot/projects/hammer/sys/x86_64/isa/icu_vector.s#7 (text+ko) ==== @@ -41,16 +41,7 @@ pushq %r13 ; \ pushq %r14 ; \ pushq %r15 ; \ - pushq %ds ; /* save our data and extra segments */ \ - pushq %es ; \ - pushq %fs ; \ - pushq %gs ; \ - mov $KDSEL,%ax ; \ - mov %ax,%ds ; \ - mov %ax,%es ; \ -#XXX mov $KPSEL,%ax ; \ -#XXX mov %ax,%fs ; \ - FAKE_MCOUNT((12+ACTUALLY_PUSHED)*4(%rsp)) ; \ + FAKE_MCOUNT((12)*4(%rsp)) ; \ call critical_enter ; \ movq PCPU(CURTHREAD),%rbx ; \ incl TD_INTR_NESTING_LEVEL(%rbx) ; \ @@ -74,7 +65,7 @@ * interrupt handler and don't run anything. We could just do an * iret. FIXME. */ -#define INTR(irq_num, vec_name, enable_icus, maybe_extra_ipending) \ +#define INTR(irq_num, vec_name, icu, enable_icus, maybe_extra_ipending) \ .text ; \ SUPERALIGN_TEXT ; \ IDTVEC(vec_name) ; \ @@ -95,23 +86,14 @@ pushq %r13 ; \ pushq %r14 ; \ pushq %r15 ; \ - pushq %ds ; /* save our data and extra segments */ \ - pushq %es ; \ - pushq %fs ; \ - pushq %gs ; \ - mov $KDSEL,%ax ; /* load kernel ds, es and fs */ \ - mov %ax,%ds ; \ - mov %ax,%es ; \ -#XXX mov $KPSEL,%ax ; \ -#XXX mov %ax,%fs ; \ maybe_extra_ipending ; \ movb imen + IRQ_BYTE(irq_num),%al ; \ orb $IRQ_BIT(irq_num),%al ; \ movb %al,imen + IRQ_BYTE(irq_num) ; \ - #XXXoutb %al,$icu+ICU_IMR_OFFSET ; \ + outb %al,$icu+ICU_IMR_OFFSET ; \ enable_icus ; \ movq PCPU(CURTHREAD),%rbx ; \ - incl TD_INTR_NESTING_LEVEL(%ebx) ; \ + incl TD_INTR_NESTING_LEVEL(%rbx) ; \ FAKE_MCOUNT(13*4(%rsp)) ; /* XXX late to avoid double count */ \ movq $irq_num, %rdi; /* pass the IRQ */ \ call sched_ithd ; \ @@ -141,22 +123,22 @@ #define CLKINTR_PENDING movl $1,CNAME(clkintr_pending) /* Threaded interrupts */ - INTR(0,intr0, ENABLE_ICU1, CLKINTR_PENDING) - INTR(1,intr1, ENABLE_ICU1,) - INTR(2,intr2, ENABLE_ICU1,) - INTR(3,intr3, ENABLE_ICU1,) - INTR(4,intr4, ENABLE_ICU1,) - INTR(5,intr5, ENABLE_ICU1,) - INTR(6,intr6, ENABLE_ICU1,) - INTR(7,intr7, ENABLE_ICU1,) - INTR(8,intr8, ENABLE_ICU1_AND_2,) - INTR(9,intr9, ENABLE_ICU1_AND_2,) - INTR(10,intr10, ENABLE_ICU1_AND_2,) - INTR(11,intr11, ENABLE_ICU1_AND_2,) - INTR(12,intr12, ENABLE_ICU1_AND_2,) - INTR(13,intr13, ENABLE_ICU1_AND_2,) - INTR(14,intr14, ENABLE_ICU1_AND_2,) - INTR(15,intr15, ENABLE_ICU1_AND_2,) + INTR(0,intr0, IO_ICU1, ENABLE_ICU1, CLKINTR_PENDING) + INTR(1,intr1, IO_ICU1, ENABLE_ICU1,) + INTR(2,intr2, IO_ICU1, ENABLE_ICU1,) + INTR(3,intr3, IO_ICU1, ENABLE_ICU1,) + INTR(4,intr4, IO_ICU1, ENABLE_ICU1,) + INTR(5,intr5, IO_ICU1, ENABLE_ICU1,) + INTR(6,intr6, IO_ICU1, ENABLE_ICU1,) + INTR(7,intr7, IO_ICU1, ENABLE_ICU1,) + INTR(8,intr8, IO_ICU2, ENABLE_ICU1_AND_2,) + INTR(9,intr9, IO_ICU2, ENABLE_ICU1_AND_2,) + INTR(10,intr10, IO_ICU2, ENABLE_ICU1_AND_2,) + INTR(11,intr11, IO_ICU2, ENABLE_ICU1_AND_2,) + INTR(12,intr12, IO_ICU2, ENABLE_ICU1_AND_2,) + INTR(13,intr13, IO_ICU2, ENABLE_ICU1_AND_2,) + INTR(14,intr14, IO_ICU2, ENABLE_ICU1_AND_2,) + INTR(15,intr15, IO_ICU2, ENABLE_ICU1_AND_2,) MCOUNT_LABEL(eintr) From owner-p4-projects@FreeBSD.ORG Tue Apr 8 02:00:02 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 3F72837B404; Tue, 8 Apr 2003 02:00:02 -0700 (PDT) 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 E977537B401 for ; Tue, 8 Apr 2003 02:00:01 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8D30F43F3F for ; Tue, 8 Apr 2003 02:00:01 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h389010U012348 for ; Tue, 8 Apr 2003 02:00:01 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h38901f6012345 for perforce@freebsd.org; Tue, 8 Apr 2003 02:00:01 -0700 (PDT) Date: Tue, 8 Apr 2003 02:00:01 -0700 (PDT) Message-Id: <200304080900.h38901f6012345@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28512 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, 08 Apr 2003 09:00:03 -0000 http://perforce.freebsd.org/chv.cgi?CH=28512 Change 28512 by peter@peter_daintree on 2003/04/08 01:59:46 I'm not using zones for the pdp and pml4 Affected files ... .. //depot/projects/hammer/sys/x86_64/x86_64/pmap.c#19 edit Differences ... ==== //depot/projects/hammer/sys/x86_64/x86_64/pmap.c#19 (text+ko) ==== @@ -186,9 +186,6 @@ static int nkpt; vm_offset_t kernel_vm_end; -static uma_zone_t pdpzone; -static uma_zone_t pml4zone; - /* * Data for the pv entry allocation mechanism */ @@ -238,8 +235,6 @@ static int pmap_unuse_pt(pmap_t, vm_offset_t, vm_page_t); static vm_offset_t pmap_kmem_choose(vm_offset_t addr); static void *pmap_pv_allocf(uma_zone_t zone, int bytes, u_int8_t *flags, int wait); -static void *pmap_pdp_allocf(uma_zone_t zone, int bytes, u_int8_t *flags, int wait); -static void *pmap_pml4_allocf(uma_zone_t zone, int bytes, u_int8_t *flags, int wait); CTASSERT(1 << PDESHIFT == sizeof(pd_entry_t)); CTASSERT(1 << PTESHIFT == sizeof(pt_entry_t)); @@ -383,20 +378,6 @@ return (void *)kmem_alloc(kernel_map, bytes); } -static void * -pmap_pdp_allocf(uma_zone_t zone, int bytes, u_int8_t *flags, int wait) -{ - *flags = UMA_SLAB_PRIV; - return (void *)kmem_alloc(kernel_map, bytes); -} - -static void * -pmap_pml4_allocf(uma_zone_t zone, int bytes, u_int8_t *flags, int wait) -{ - *flags = UMA_SLAB_PRIV; - return (void *)kmem_alloc(kernel_map, bytes); -} - /* * Initialize the pmap module. * Called by vm_init, to initialize any structures that the pmap @@ -435,14 +416,6 @@ uma_zone_set_allocf(pvzone, pmap_pv_allocf); uma_prealloc(pvzone, initial_pvs); - pdpzone = uma_zcreate("PDPT", NPGPTD * sizeof(pdp_entry_t), NULL, - NULL, NULL, NULL, (NPGPTD * sizeof(pdp_entry_t)) - 1, 0); - uma_zone_set_allocf(pdpzone, pmap_pdp_allocf); - - pml4zone = uma_zcreate("PML4", sizeof(pml4_entry_t), NULL, - NULL, NULL, NULL, sizeof(pml4_entry_t) - 1, 0); - uma_zone_set_allocf(pml4zone, pmap_pml4_allocf); - /* * Now it is safe to enable pv_table recording. */ From owner-p4-projects@FreeBSD.ORG Tue Apr 8 02:27:41 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id B3F2937B404; Tue, 8 Apr 2003 02:27:40 -0700 (PDT) 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 54E3D37B401 for ; Tue, 8 Apr 2003 02:27:40 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id C125443FB1 for ; Tue, 8 Apr 2003 02:27:39 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h389Rd0U015235 for ; Tue, 8 Apr 2003 02:27:39 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h389RdsC015232 for perforce@freebsd.org; Tue, 8 Apr 2003 02:27:39 -0700 (PDT) Date: Tue, 8 Apr 2003 02:27:39 -0700 (PDT) Message-Id: <200304080927.h389RdsC015232@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28515 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, 08 Apr 2003 09:27:41 -0000 http://perforce.freebsd.org/chv.cgi?CH=28515 Change 28515 by peter@peter_daintree on 2003/04/08 02:27:28 fork works better when the entire address space isn't read-only Affected files ... .. //depot/projects/hammer/sys/x86_64/x86_64/pmap.c#20 edit Differences ... ==== //depot/projects/hammer/sys/x86_64/x86_64/pmap.c#20 (text+ko) ==== @@ -1084,9 +1084,9 @@ for (i = 0; i < NPGPTD; i++) { pa = VM_PAGE_TO_PHYS(ptdpg[i]); pmap->pm_pdir[PTDPTDI + i] = pa | PG_V | PG_RW | PG_A | PG_M; - pmap->pm_pdp[i] = pa | PG_V; + pmap->pm_pdp[i] = pa | PG_RW | PG_V; } - pmap->pm_pml4[0] = VM_PAGE_TO_PHYS(pdppg) | PG_V; + pmap->pm_pml4[0] = VM_PAGE_TO_PHYS(pdppg) | PG_RW | PG_V; pmap->pm_active = 0; TAILQ_INIT(&pmap->pm_pvlist); From owner-p4-projects@FreeBSD.ORG Tue Apr 8 02:31:47 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 13B3137B404; Tue, 8 Apr 2003 02:31:47 -0700 (PDT) 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 B924B37B401 for ; Tue, 8 Apr 2003 02:31:46 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5193143FBD for ; Tue, 8 Apr 2003 02:31:46 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h389Vk0U015781 for ; Tue, 8 Apr 2003 02:31:46 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h389VjJB015778 for perforce@freebsd.org; Tue, 8 Apr 2003 02:31:45 -0700 (PDT) Date: Tue, 8 Apr 2003 02:31:45 -0700 (PDT) Message-Id: <200304080931.h389VjJB015778@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28517 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, 08 Apr 2003 09:31:48 -0000 http://perforce.freebsd.org/chv.cgi?CH=28517 Change 28517 by peter@peter_daintree on 2003/04/08 02:31:10 oops, no need for this chatty stuff Affected files ... .. //depot/projects/hammer/sys/vm/vm_glue.c#10 edit Differences ... ==== //depot/projects/hammer/sys/vm/vm_glue.c#10 (text+ko) ==== @@ -586,13 +586,10 @@ struct proc *pp; int ppri; -printf("made it to scheduler()!\n"); - mtx_assert(&Giant, MA_OWNED | MA_NOTRECURSED); /* GIANT_REQUIRED */ loop: -printf("scheduler()::loop\n\n"); if (vm_page_count_min()) { VM_WAIT; goto loop; From owner-p4-projects@FreeBSD.ORG Tue Apr 8 08:24:01 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id E8A2937B404; Tue, 8 Apr 2003 08:24:00 -0700 (PDT) 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 868CE37B401 for ; Tue, 8 Apr 2003 08:24:00 -0700 (PDT) Received: from mail.speakeasy.net (mail13.speakeasy.net [216.254.0.213]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8DACB43FAF for ; Tue, 8 Apr 2003 08:23:59 -0700 (PDT) (envelope-from jhb@FreeBSD.org) Received: (qmail 2430 invoked from network); 8 Apr 2003 15:24:01 -0000 Received: from unknown (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender )encrypted SMTP for ; 8 Apr 2003 15:24:01 -0000 Received: from laptop.baldwin.cx (gw1.twc.weather.com [216.133.140.1]) by server.baldwin.cx (8.12.8/8.12.8) with ESMTP id h38FNtOv046078; Tue, 8 Apr 2003 11:23:55 -0400 (EDT) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.5.4 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <200304072336.h37Na3xa048094@repoman.freebsd.org> Date: Tue, 08 Apr 2003 10:23:56 -0400 (EDT) From: John Baldwin To: Peter Wemm cc: Perforce Change Reviews Subject: RE: PERFORCE change 28461 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, 08 Apr 2003 15:24:02 -0000 On 07-Apr-2003 Peter Wemm wrote: > http://perforce.freebsd.org/chv.cgi?CH=28461 > > Change 28461 by peter@peter_daintree on 2003/04/07 16:35:32 > > use -mcmodel=medium for hammer. Otherwise it generates > 32 bit instructions for things like invltlb(). kernel model > comes later. Side topic: are we going to call it amd64 some day instead of x86-64? > Affected files ... > > .. //depot/projects/hammer/sys/conf/kern.mk#3 edit > > Differences ... > > ==== //depot/projects/hammer/sys/conf/kern.mk#3 (text+ko) ==== > > @@ -53,6 +53,14 @@ > .endif > > # > +# For AMD x86-64, use a medium model for now. We'll switch to "kernel" > +# once pmap is ready. > +# > +.if ${MACHINE_ARCH} == "x86_64" > +CFLAGS+= -mcmodel=medium > +.endif > + > +# > # GCC 3.0 and above like to do certain optimizations based on the > # assumption that the program is linked against libc. Stop this. > # -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ From owner-p4-projects@FreeBSD.ORG Tue Apr 8 09:46:38 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 9584E37B404; Tue, 8 Apr 2003 09:46:37 -0700 (PDT) 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 32BA037B401 for ; Tue, 8 Apr 2003 09:46:37 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id D3F0143FBD for ; Tue, 8 Apr 2003 09:46:36 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h38Gka0U062301 for ; Tue, 8 Apr 2003 09:46:36 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h38GkalV062298 for perforce@freebsd.org; Tue, 8 Apr 2003 09:46:36 -0700 (PDT) Date: Tue, 8 Apr 2003 09:46:36 -0700 (PDT) Message-Id: <200304081646.h38GkalV062298@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28525 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, 08 Apr 2003 16:46:38 -0000 http://perforce.freebsd.org/chv.cgi?CH=28525 Change 28525 by peter@peter_daintree on 2003/04/08 09:45:53 update cpu_switch for C calling conventions. save/restore %rdi/%rsi around call to npxsave, and pass npxsave arg in %rdi. Affected files ... .. //depot/projects/hammer/sys/x86_64/x86_64/swtch.s#16 edit Differences ... ==== //depot/projects/hammer/sys/x86_64/x86_64/swtch.s#16 (text+ko) ==== @@ -109,10 +109,13 @@ /* have we used fp, and need a save? */ cmpq %rdi,PCPU(FPCURTHREAD) jne 1f + pushq %rdi + pushq %rsi addq $PCB_SAVEFPU,%rdx /* h/w bugs make saving complicated */ - pushq %rdx + movq %rdx, %rdi call npxsave /* do it in a big C function */ - popq %rax + popq %rsi + popq %rdi 1: /* Save is done. Now fire up new thread. Leave old vmspace. */ From owner-p4-projects@FreeBSD.ORG Tue Apr 8 09:48:41 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id B741037B404; Tue, 8 Apr 2003 09:48:40 -0700 (PDT) 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 56D9B37B401 for ; Tue, 8 Apr 2003 09:48:40 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0269743FB1 for ; Tue, 8 Apr 2003 09:48:40 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h38Gmd0U062351 for ; Tue, 8 Apr 2003 09:48:39 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h38Gmd5C062348 for perforce@freebsd.org; Tue, 8 Apr 2003 09:48:39 -0700 (PDT) Date: Tue, 8 Apr 2003 09:48:39 -0700 (PDT) Message-Id: <200304081648.h38Gmd5C062348@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28526 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, 08 Apr 2003 16:48:41 -0000 http://perforce.freebsd.org/chv.cgi?CH=28526 Change 28526 by peter@peter_daintree on 2003/04/08 09:48:32 remove a verbose boot printf. boot -v is sufficient now. Affected files ... .. //depot/projects/hammer/sys/x86_64/x86_64/machdep.c#50 edit Differences ... ==== //depot/projects/hammer/sys/x86_64/x86_64/machdep.c#50 (text+ko) ==== @@ -751,7 +751,7 @@ */ smapbase = MD_FETCH(kmdp, MODINFOMD_SMAP, struct bios_smap *) + KERNBASE; if (smapbase == 0) { - printf("no bios smap, winging it\n"); + printf("no bios smap info from loader, winging it\n"); goto deep_shit; } printf("smapbase: %p\n", smapbase); @@ -864,11 +864,6 @@ /* * Now, physmap contains a map of physical memory. */ -printf("physmap_idx = %d\n", physmap_idx); -for (i = 0; i <= physmap_idx; i += 2) { - printf("slot %d: 0x%16lx - 0x%16lx\n", i/2, physmap[i], physmap[i + 1]); -} - /* * Maxmem isn't the "maximum memory", it's one larger than the * highest page of the physical address space. It should be From owner-p4-projects@FreeBSD.ORG Tue Apr 8 09:50:44 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 3508037B404; Tue, 8 Apr 2003 09:50:44 -0700 (PDT) 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 C9B4E37B401 for ; Tue, 8 Apr 2003 09:50:43 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7379443F75 for ; Tue, 8 Apr 2003 09:50:43 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h38Goh0U062635 for ; Tue, 8 Apr 2003 09:50:43 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h38Gog5l062631 for perforce@freebsd.org; Tue, 8 Apr 2003 09:50:42 -0700 (PDT) Date: Tue, 8 Apr 2003 09:50:42 -0700 (PDT) Message-Id: <200304081650.h38Gog5l062631@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28527 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, 08 Apr 2003 16:50:45 -0000 http://perforce.freebsd.org/chv.cgi?CH=28527 Change 28527 by peter@peter_daintree on 2003/04/08 09:50:09 bracket PSE support code in #if ENABLE_PSE so I dont accidently remove it as #if 0 code. Affected files ... .. //depot/projects/hammer/sys/x86_64/x86_64/machdep.c#51 edit .. //depot/projects/hammer/sys/x86_64/x86_64/pmap.c#21 edit Differences ... ==== //depot/projects/hammer/sys/x86_64/x86_64/machdep.c#51 (text+ko) ==== @@ -1090,7 +1090,7 @@ ((pt_entry_t *)KPTphys)[i] |= PG_RW | PG_V; } -#if 0 +#if ENABLE_PSE /* Map from zero to end of allocations under 2M pages */ for (i = 0; (i << PDRSHIFT) < physfree; i++) { ((pd_entry_t *)IdlePTD)[i] = i << PDRSHIFT; ==== //depot/projects/hammer/sys/x86_64/x86_64/pmap.c#21 (text+ko) ==== @@ -250,7 +250,7 @@ { vm_offset_t newaddr = addr; -#if 0 +#if ENABLE_PSE newaddr = (addr + (NBPDR - 1)) & ~(NBPDR - 1); #endif return newaddr; @@ -364,7 +364,7 @@ /* * Initialize the 2MB page size flag */ -#if 0 +#if ENABLE_PSE pseflag = PG_PS; #endif From owner-p4-projects@FreeBSD.ORG Tue Apr 8 10:07:05 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id E2D8237B404; Tue, 8 Apr 2003 10:07:04 -0700 (PDT) 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 7B4DC37B401 for ; Tue, 8 Apr 2003 10:07:04 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 01C5A43FA3 for ; Tue, 8 Apr 2003 10:07:04 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h38H730U064670 for ; Tue, 8 Apr 2003 10:07:03 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h38H73xV064667 for perforce@freebsd.org; Tue, 8 Apr 2003 10:07:03 -0700 (PDT) Date: Tue, 8 Apr 2003 10:07:03 -0700 (PDT) Message-Id: <200304081707.h38H73xV064667@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28528 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, 08 Apr 2003 17:07:06 -0000 http://perforce.freebsd.org/chv.cgi?CH=28528 Change 28528 by peter@peter_daintree on 2003/04/08 10:06:24 What the heck. turn on PG_G and PG_PS unconditionally. It seems to work. Affected files ... .. //depot/projects/hammer/sys/x86_64/x86_64/machdep.c#52 edit .. //depot/projects/hammer/sys/x86_64/x86_64/pmap.c#22 edit Differences ... ==== //depot/projects/hammer/sys/x86_64/x86_64/machdep.c#52 (text+ko) ==== @@ -1084,25 +1084,24 @@ /* Fill in the underlying page table pages */ /* Read-only from zero to physfree */ - /* XXX not actually used, underneath 2M pages */ + /* XXX not fully used, underneath 2M pages */ for (i = 0; (i << PAGE_SHIFT) < physfree; i++) { ((pt_entry_t *)KPTphys)[i] = i << PAGE_SHIFT; ((pt_entry_t *)KPTphys)[i] |= PG_RW | PG_V; } -#if ENABLE_PSE + /* Now map the page tables at their location within PTmap */ + for (i = 0; i < NKPT; i++) { + ((pd_entry_t *)IdlePTD)[i + KPTDI] = KPTphys + (i << PAGE_SHIFT); + ((pd_entry_t *)IdlePTD)[i + KPTDI] |= PG_RW | PG_V; + } + /* Map from zero to end of allocations under 2M pages */ + /* This replaces some of the PTD entries above */ for (i = 0; (i << PDRSHIFT) < physfree; i++) { ((pd_entry_t *)IdlePTD)[i] = i << PDRSHIFT; ((pd_entry_t *)IdlePTD)[i] |= PG_RW | PG_V | PG_PS; } -#endif - - /* Now map the page tables at their location within PTmap */ - for (i = 0; i < NKPT; i++) { - ((pd_entry_t *)IdlePTD)[i + KPTDI] = KPTphys + (i << PAGE_SHIFT); - ((pd_entry_t *)IdlePTD)[i + KPTDI] |= PG_RW | PG_V; - } /* Now map the page tables at their location within PTmap */ for (i = 0; i < NKPT; i++) { ==== //depot/projects/hammer/sys/x86_64/x86_64/pmap.c#22 (text+ko) ==== @@ -180,8 +180,6 @@ vm_offset_t virtual_avail; /* VA of first avail page (after kernel bss) */ vm_offset_t virtual_end; /* VA of last avail page (end of kernel AS) */ static boolean_t pmap_initialized = FALSE; /* Has pmap_init completed? */ -static int pgeflag; /* PG_G or-in */ -static int pseflag; /* PG_PS or-in */ static int nkpt; vm_offset_t kernel_vm_end; @@ -250,9 +248,7 @@ { vm_offset_t newaddr = addr; -#if ENABLE_PSE newaddr = (addr + (NBPDR - 1)) & ~(NBPDR - 1); -#endif return newaddr; } @@ -359,15 +355,6 @@ for (i = 0; i < NKPT; i++) PTD[i] = 0; - pgeflag = 0; - -/* - * Initialize the 2MB page size flag - */ -#if ENABLE_PSE - pseflag = PG_PS; -#endif - invltlb(); } @@ -595,7 +582,7 @@ pt_entry_t *pte; pte = vtopte(va); - *pte = pa | PG_RW | PG_V | pgeflag; + *pte = pa | PG_RW | PG_V | PG_G; } /* @@ -1901,7 +1888,7 @@ if (va < VM_MAXUSER_ADDRESS) newpte |= PG_U; if (pmap == kernel_pmap) - newpte |= pgeflag; + newpte |= PG_G; /* * if the mapping or permission bits are different, we need @@ -2057,7 +2044,7 @@ * processor address space. Note that some shortcuts * are taken, but the code works. */ - if (pseflag && (object->type == OBJT_DEVICE) && + if ((object->type == OBJT_DEVICE) && ((addr & (NBPDR - 1)) == 0) && ((size & (NBPDR - 1)) == 0)) { int i; vm_page_t m[1]; From owner-p4-projects@FreeBSD.ORG Tue Apr 8 10:20:22 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id B002737B404; Tue, 8 Apr 2003 10:20:21 -0700 (PDT) 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 4676A37B401 for ; Tue, 8 Apr 2003 10:20:21 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id D003243F85 for ; Tue, 8 Apr 2003 10:20:20 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h38HKK0U065423 for ; Tue, 8 Apr 2003 10:20:20 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h38HKKJx065420 for perforce@freebsd.org; Tue, 8 Apr 2003 10:20:20 -0700 (PDT) Date: Tue, 8 Apr 2003 10:20:20 -0700 (PDT) Message-Id: <200304081720.h38HKKJx065420@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28529 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, 08 Apr 2003 17:20:22 -0000 http://perforce.freebsd.org/chv.cgi?CH=28529 Change 28529 by peter@peter_daintree on 2003/04/08 10:20:14 ensure CR4_PGE and CR4_PSE is on. CR4_PSE is on from the loader (since we're using it for 2MB pages, but dont assume that). I must remember to set up %cr0 the way we like it too. Affected files ... .. //depot/projects/hammer/sys/x86_64/x86_64/machdep.c#53 edit Differences ... ==== //depot/projects/hammer/sys/x86_64/x86_64/machdep.c#53 (text+ko) ==== @@ -1136,6 +1136,8 @@ create_pagetables(); + /* XXX do %cr0 as well */ + load_cr4(rcr4() | CR4_PGE | CR4_PSE); load_cr3(IdlePML4); proc0.p_uarea = proc0uarea; From owner-p4-projects@FreeBSD.ORG Tue Apr 8 10:45:57 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 2874637B401; Tue, 8 Apr 2003 10:45:57 -0700 (PDT) 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 7185037B40C for ; Tue, 8 Apr 2003 10:45:56 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4AA1D43F3F for ; Tue, 8 Apr 2003 10:45:54 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h38Hjs0U067273 for ; Tue, 8 Apr 2003 10:45:54 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h38Hjr6P067270 for perforce@freebsd.org; Tue, 8 Apr 2003 10:45:53 -0700 (PDT) Date: Tue, 8 Apr 2003 10:45:53 -0700 (PDT) Message-Id: <200304081745.h38Hjr6P067270@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28532 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, 08 Apr 2003 17:45:58 -0000 http://perforce.freebsd.org/chv.cgi?CH=28532 Change 28532 by peter@peter_overcee on 2003/04/08 10:45:22 IFC @28531 Affected files ... .. //depot/projects/hammer/Makefile.inc1#10 integrate .. //depot/projects/hammer/bin/cp/cp.1#3 integrate .. //depot/projects/hammer/bin/cp/cp.c#5 integrate .. //depot/projects/hammer/bin/cp/extern.h#3 integrate .. //depot/projects/hammer/bin/cp/utils.c#3 integrate .. //depot/projects/hammer/etc/Makefile#7 integrate .. //depot/projects/hammer/etc/newsyslog.conf#5 integrate .. //depot/projects/hammer/etc/syslog.conf#5 integrate .. //depot/projects/hammer/include/fstab.h#2 integrate .. //depot/projects/hammer/include/paths.h#2 integrate .. //depot/projects/hammer/lib/libc/gen/Makefile.inc#7 integrate .. //depot/projects/hammer/lib/libc/gen/fstab.c#2 integrate .. //depot/projects/hammer/lib/libc/gen/getfsent.3#2 integrate .. //depot/projects/hammer/lib/libc/stdio/vfprintf.c#9 integrate .. //depot/projects/hammer/lib/libc/stdio/vfwprintf.c#6 integrate .. //depot/projects/hammer/lib/libpam/modules/modules.inc#3 integrate .. //depot/projects/hammer/lib/libpam/modules/pam_chroot/pam_chroot.8#2 integrate .. //depot/projects/hammer/lib/libpam/modules/pam_chroot/pam_chroot.c#2 integrate .. //depot/projects/hammer/lib/libusbhid/libusbhid.h#2 integrate .. //depot/projects/hammer/lib/libusbhid/parse.c#2 integrate .. //depot/projects/hammer/lib/libusbhid/usage.c#2 integrate .. //depot/projects/hammer/lib/libusbhid/usbhid.h#1 branch .. //depot/projects/hammer/libexec/rtld-elf/Makefile#3 integrate .. //depot/projects/hammer/libexec/rtld-elf/libmap.c#1 branch .. //depot/projects/hammer/libexec/rtld-elf/libmap.h#1 branch .. //depot/projects/hammer/libexec/rtld-elf/rtld.1#3 integrate .. //depot/projects/hammer/libexec/rtld-elf/rtld.c#5 integrate .. //depot/projects/hammer/release/doc/en_US.ISO8859-1/early-adopter/article.sgml#4 integrate .. //depot/projects/hammer/sbin/dump/dump.h#5 integrate .. //depot/projects/hammer/sbin/dump/main.c#6 integrate .. //depot/projects/hammer/sbin/dump/optr.c#4 integrate .. //depot/projects/hammer/sbin/mount/mount.8#4 integrate .. //depot/projects/hammer/sbin/mount/mount.c#4 integrate .. //depot/projects/hammer/sbin/ping/ping.c#8 integrate .. //depot/projects/hammer/sbin/umount/umount.8#3 integrate .. //depot/projects/hammer/sbin/umount/umount.c#4 integrate .. //depot/projects/hammer/share/man/man4/polling.4#3 integrate .. //depot/projects/hammer/share/man/man4/umass.4#5 integrate .. //depot/projects/hammer/share/man/man5/Makefile#3 integrate .. //depot/projects/hammer/share/man/man5/libmap.conf.5#1 branch .. //depot/projects/hammer/share/man/man7/release.7#7 integrate .. //depot/projects/hammer/sys/alpha/alpha/busdma_machdep.c#5 integrate .. //depot/projects/hammer/sys/cam/cam_periph.c#6 integrate .. //depot/projects/hammer/sys/conf/files#14 integrate .. //depot/projects/hammer/sys/dev/ata/ata-all.c#8 integrate .. //depot/projects/hammer/sys/dev/ata/ata-all.h#5 integrate .. //depot/projects/hammer/sys/dev/ata/ata-chipset.c#3 integrate .. //depot/projects/hammer/sys/dev/ata/ata-disk.c#5 integrate .. //depot/projects/hammer/sys/dev/ata/ata-dma.c#6 integrate .. //depot/projects/hammer/sys/dev/ata/ata-pci.c#7 integrate .. //depot/projects/hammer/sys/dev/ata/ata-pci.h#3 integrate .. //depot/projects/hammer/sys/dev/ata/ata-raid.c#6 integrate .. //depot/projects/hammer/sys/dev/ata/ata-raid.h#4 integrate .. //depot/projects/hammer/sys/dev/cardbus/cardbus_cis.c#6 integrate .. //depot/projects/hammer/sys/dev/fxp/if_fxp.c#10 integrate .. //depot/projects/hammer/sys/dev/fxp/if_fxpreg.h#5 integrate .. //depot/projects/hammer/sys/dev/pccard/pccard.c#9 integrate .. //depot/projects/hammer/sys/dev/pccard/pccardvar.h#3 integrate .. //depot/projects/hammer/sys/dev/pccbb/pccbb.c#9 integrate .. //depot/projects/hammer/sys/dev/puc/pucdata.c#5 integrate .. //depot/projects/hammer/sys/dev/snc/dp83932.c#4 integrate .. //depot/projects/hammer/sys/dev/stg/tmc18c30.h#1 branch .. //depot/projects/hammer/sys/dev/stg/tmc18c30_isa.c#3 integrate .. //depot/projects/hammer/sys/dev/stg/tmc18c30_pccard.c#4 integrate .. //depot/projects/hammer/sys/dev/stg/tmc18c30_pci.c#1 branch .. //depot/projects/hammer/sys/dev/stg/tmc18c30_subr.c#1 branch .. //depot/projects/hammer/sys/dev/usb/if_kue.c#5 integrate .. //depot/projects/hammer/sys/dev/usb/usbdevs#6 integrate .. //depot/projects/hammer/sys/dev/usb/usbdevs.h#6 integrate .. //depot/projects/hammer/sys/dev/usb/usbdevs_data.h#6 integrate .. //depot/projects/hammer/sys/dev/vx/if_vx.c#6 integrate .. //depot/projects/hammer/sys/dev/wi/if_wi_pccard.c#6 integrate .. //depot/projects/hammer/sys/i386/conf/PAE#1 branch .. //depot/projects/hammer/sys/i386/i386/busdma_machdep.c#6 integrate .. //depot/projects/hammer/sys/i386/include/pmap.h#4 integrate .. //depot/projects/hammer/sys/i386/include/vmparam.h#4 integrate .. //depot/projects/hammer/sys/i386/isa/mca_machdep.c#4 delete .. //depot/projects/hammer/sys/i386/isa/mca_machdep.h#2 delete .. //depot/projects/hammer/sys/ia64/conf/GENERIC#8 integrate .. //depot/projects/hammer/sys/ia64/conf/SKI#6 integrate .. //depot/projects/hammer/sys/ia64/ia64/busdma_machdep.c#5 integrate .. //depot/projects/hammer/sys/ia64/ia64/exception.s#7 integrate .. //depot/projects/hammer/sys/ia64/ia64/locore.s#5 integrate .. //depot/projects/hammer/sys/kern/kern_mac.c#12 integrate .. //depot/projects/hammer/sys/kern/kern_thr.c#3 integrate .. //depot/projects/hammer/sys/kern/kern_thread.c#17 integrate .. //depot/projects/hammer/sys/kern/uipc_mbuf.c#6 integrate .. //depot/projects/hammer/sys/modules/stg/Makefile#2 integrate .. //depot/projects/hammer/sys/net/if_disc.c#4 integrate .. //depot/projects/hammer/sys/net/if_faith.c#4 integrate .. //depot/projects/hammer/sys/net/if_loop.c#5 integrate .. //depot/projects/hammer/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c#3 integrate .. //depot/projects/hammer/sys/netgraph/ng_base.c#4 integrate .. //depot/projects/hammer/sys/netgraph/ng_iface.c#5 integrate .. //depot/projects/hammer/sys/netinet/ip_divert.c#6 integrate .. //depot/projects/hammer/sys/netinet/ip_input.c#9 integrate .. //depot/projects/hammer/sys/netinet/ip_mroute.c#8 integrate .. //depot/projects/hammer/sys/netinet/ip_output.c#10 integrate .. //depot/projects/hammer/sys/netipsec/keysock.c#3 integrate .. //depot/projects/hammer/sys/netkey/keysock.c#3 integrate .. //depot/projects/hammer/sys/netnatm/natm.c#3 integrate .. //depot/projects/hammer/sys/pci/agp_if.m#2 integrate .. //depot/projects/hammer/sys/pci/if_rl.c#9 integrate .. //depot/projects/hammer/sys/pci/if_xl.c#11 integrate .. //depot/projects/hammer/sys/powerpc/powerpc/busdma_machdep.c#4 integrate .. //depot/projects/hammer/sys/sparc64/include/cache.h#3 integrate .. //depot/projects/hammer/sys/sparc64/include/iommuvar.h#3 integrate .. //depot/projects/hammer/sys/sparc64/include/kerneldump.h#2 integrate .. //depot/projects/hammer/sys/sparc64/include/md_var.h#4 integrate .. //depot/projects/hammer/sys/sparc64/include/ofw_mem.h#2 integrate .. //depot/projects/hammer/sys/sparc64/include/pmap.h#9 integrate .. //depot/projects/hammer/sys/sparc64/include/smp.h#4 integrate .. //depot/projects/hammer/sys/sparc64/include/tsb.h#3 integrate .. //depot/projects/hammer/sys/sparc64/include/watch.h#2 integrate .. //depot/projects/hammer/sys/sparc64/pci/psycho.c#7 integrate .. //depot/projects/hammer/sys/sparc64/pci/psychovar.h#4 integrate .. //depot/projects/hammer/sys/sparc64/sparc64/bus_machdep.c#6 integrate .. //depot/projects/hammer/sys/sparc64/sparc64/cheetah.c#2 integrate .. //depot/projects/hammer/sys/sparc64/sparc64/db_hwwatch.c#2 integrate .. //depot/projects/hammer/sys/sparc64/sparc64/dump_machdep.c#4 integrate .. //depot/projects/hammer/sys/sparc64/sparc64/iommu.c#4 integrate .. //depot/projects/hammer/sys/sparc64/sparc64/machdep.c#11 integrate .. //depot/projects/hammer/sys/sparc64/sparc64/mem.c#4 integrate .. //depot/projects/hammer/sys/sparc64/sparc64/mp_machdep.c#7 integrate .. //depot/projects/hammer/sys/sparc64/sparc64/pmap.c#11 integrate .. //depot/projects/hammer/sys/sparc64/sparc64/spitfire.c#2 integrate .. //depot/projects/hammer/sys/sparc64/sparc64/tsb.c#5 integrate .. //depot/projects/hammer/sys/sparc64/sparc64/vm_machdep.c#5 integrate .. //depot/projects/hammer/sys/sys/mbuf.h#8 integrate .. //depot/projects/hammer/sys/ufs/ffs/ffs_rawread.c#2 integrate .. //depot/projects/hammer/tools/build/Makefile#2 integrate .. //depot/projects/hammer/tools/build/Makefile.boot#2 integrate .. //depot/projects/hammer/tools/regression/lib/libc/stdio/test-printfloat.c#3 integrate .. //depot/projects/hammer/usr.bin/su/su.c#7 integrate .. //depot/projects/hammer/usr.sbin/ctm/ctm/ctm.h#2 integrate .. //depot/projects/hammer/usr.sbin/ctm/ctm/ctm_input.c#2 integrate .. //depot/projects/hammer/usr.sbin/jail/jail.c#3 integrate .. //depot/projects/hammer/usr.sbin/pppd/lcp.c#3 integrate .. //depot/projects/hammer/usr.sbin/wicontrol/wicontrol.8#5 integrate .. //depot/projects/hammer/usr.sbin/wicontrol/wicontrol.c#4 integrate Differences ... ==== //depot/projects/hammer/Makefile.inc1#10 (text+ko) ==== @@ -1,5 +1,5 @@ # -# $FreeBSD: src/Makefile.inc1,v 1.333 2003/04/06 03:50:28 imp Exp $ +# $FreeBSD: src/Makefile.inc1,v 1.339 2003/04/07 00:01:33 ru Exp $ # # Make command line options: # -DMAKE_KERBEROS5 to build Kerberos5 @@ -159,18 +159,19 @@ # # Building a world goes through the following stages # -# 1. libbuild stage [BMAKE] -# This stage is responsible for creating compatibility shims that are -# needed by the bootstrap-tool, build-tool and cross-tool stages. -# 1. bootstrap-tool stage [BMAKE] +# 1. legacy stage [BMAKE] +# This stage is responsible for creating compatibility +# shims that are needed by the bootstrap-tools, +# build-tools and cross-tools stages. +# 1. bootstrap-tools stage [BMAKE] # This stage is responsible for creating programs that # are needed for backward compatibility reasons. They # are not built as cross-tools. -# 2. build-tool stage [TMAKE] +# 2. build-tools stage [TMAKE] # This stage is responsible for creating the object # tree and building any tools that are needed during # the build process. -# 3. cross-tool stage [XMAKE] +# 3. cross-tools stage [XMAKE] # This stage is responsible for creating any tools that # are needed for cross-builds. A cross-compiler is one # of them. @@ -189,7 +190,7 @@ GROFF_FONT_PATH=${WORLDTMP}/usr/share/groff_font \ GROFF_TMAC_PATH=${WORLDTMP}/usr/share/tmac -# bootstrap-tool stage +# bootstrap-tools stage BMAKEENV= DESTDIR= \ INSTALL="sh ${.CURDIR}/tools/install.sh" \ __MAKE_CONF=${.CURDIR}/tools/build/Makefile.boot \ @@ -201,12 +202,12 @@ -DNOHTML -DNOINFO -DNOMAN -DNOPIC -DNOPROFILE -DNOSHARED \ -DNO_CPU_CFLAGS -DNO_WARNS -# build-tool stage +# build-tools stage TMAKE= MAKEOBJDIRPREFIX=${OBJTREE} \ ${BMAKEENV} ${MAKE} -f Makefile.inc1 \ BOOTSTRAPPING=${OSRELDATE} -DNO_CPU_CFLAGS -DNO_WARNS -# cross-tool stage +# cross-tools stage XMAKE= TOOLS_PREFIX=${WORLDTMP} ${BMAKE} -DNO_FORTRAN -DNO_GDB # world stage @@ -268,6 +269,7 @@ .if !defined(NOCLEAN) rm -rf ${WORLDTMP} .else + rm -rf ${WORLDTMP}/legacy/usr/include # XXX - These two can depend on any header file. rm -f ${OBJTREE}${.CURDIR}/usr.bin/kdump/ioctl.c rm -f ${OBJTREE}${.CURDIR}/usr.bin/truss/ioctl.c @@ -279,15 +281,15 @@ mkdir -p ${WORLDTMP}/usr/include/${_dir} .endfor ln -sf ${.CURDIR}/sys ${WORLDTMP} -.for _dir in lib include include/sys - mkdir -p ${WORLDTMP}/build/usr/${_dir} +.for _dir in lib include/sys + mkdir -p ${WORLDTMP}/legacy/usr/${_dir} .endfor -_libbuild: +_legacy: @echo @echo "--------------------------------------------------------------" - @echo ">>> stage 1: libbuild" + @echo ">>> stage 1: legacy release compatibility shims" @echo "--------------------------------------------------------------" - cd ${.CURDIR}; ${BMAKE} libbuild + cd ${.CURDIR}; ${BMAKE} legacy _bootstrap-tools: @echo @echo "--------------------------------------------------------------" @@ -348,7 +350,7 @@ WMAKE_TGTS= .if !defined(SUBDIR_OVERRIDE) -WMAKE_TGTS+= _worldtmp _libbuild _bootstrap-tools +WMAKE_TGTS+= _worldtmp _legacy _bootstrap-tools .endif WMAKE_TGTS+= _cleanobj _obj _build-tools .if !defined(SUBDIR_OVERRIDE) @@ -616,22 +618,25 @@ # # -# bootstrap-tools: Build tools needed for compatibility +# legacy: Build compatibility shims for the next three targets # -.if exists(${.CURDIR}/games) && !defined(NOGAMES) -_strfile= games/fortune/strfile -.endif - -libbuild: +legacy: .for _tool in tools/build @${ECHODIR} "===> ${_tool}"; \ cd ${.CURDIR}/${_tool}; \ ${MAKE} DIRPRFX=${_tool}/ obj; \ ${MAKE} DIRPRFX=${_tool}/ depend; \ ${MAKE} DIRPRFX=${_tool}/ all; \ - ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/build install + ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy install .endfor +# +# bootstrap-tools: Build tools needed for compatibility +# +.if exists(${.CURDIR}/games) && !defined(NOGAMES) +_strfile= games/fortune/strfile +.endif + bootstrap-tools: .for _tool in ${_strfile} usr.bin/yacc usr.bin/colldef \ usr.bin/makewhatis usr.bin/rpcgen usr.bin/uudecode \ ==== //depot/projects/hammer/bin/cp/cp.1#3 (text+ko) ==== @@ -33,7 +33,7 @@ .\" SUCH DAMAGE. .\" .\" @(#)cp.1 8.3 (Berkeley) 4/18/94 -.\" $FreeBSD: src/bin/cp/cp.1,v 1.25 2002/08/16 03:13:59 johan Exp $ +.\" $FreeBSD: src/bin/cp/cp.1,v 1.26 2003/04/07 11:00:56 mdodd Exp $ .\" .Dd July 23, 2002 .Dt CP 1 @@ -225,6 +225,17 @@ option is specified. In addition, these options override each other and the command's actions are determined by the last one specified. +.Pp +If +.Nm +receives a +.Dv SIGINFO +(see the +.Cm status +argument for +.Xr stty 1 ) +signal, the current input and output file and the percentage complete +will be written to the standard output. .Sh DIAGNOSTICS .Ex -std .Sh COMPATIBILITY ==== //depot/projects/hammer/bin/cp/cp.c#5 (text+ko) ==== @@ -46,7 +46,7 @@ #endif #endif /* not lint */ #include -__FBSDID("$FreeBSD: src/bin/cp/cp.c,v 1.43 2002/10/18 14:44:59 markm Exp $"); +__FBSDID("$FreeBSD: src/bin/cp/cp.c,v 1.45 2003/04/07 12:09:17 mdodd Exp $"); /* * Cp copies source files to target files. @@ -89,6 +89,9 @@ int fflag, iflag, nflag, pflag, vflag; static int Rflag, rflag; +volatile sig_atomic_t info; +static void siginfo (int notused __unused); + enum op { FILE_TO_FILE, FILE_TO_DIR, DIR_TO_DNE }; static int copy(char *[], enum op, int); @@ -173,6 +176,7 @@ fts_options &= ~FTS_PHYSICAL; fts_options |= FTS_LOGICAL | FTS_COMFOLLOW; } + (void)signal(SIGINFO, siginfo); /* Save the target base in "to". */ target = argv[--argc]; @@ -501,3 +505,10 @@ return (1); return (0); } + +static void +siginfo (int notused __unused) +{ + + info = 1; +} ==== //depot/projects/hammer/bin/cp/extern.h#3 (text+ko) ==== @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)extern.h 8.2 (Berkeley) 4/1/94 - * $FreeBSD: src/bin/cp/extern.h,v 1.16 2002/10/18 14:44:59 markm Exp $ + * $FreeBSD: src/bin/cp/extern.h,v 1.18 2003/04/07 12:09:17 mdodd Exp $ */ typedef struct { @@ -42,6 +42,7 @@ extern PATH_T to; extern int fflag, iflag, nflag, pflag, vflag; +extern volatile sig_atomic_t info; __BEGIN_DECLS int copy_fifo(struct stat *, int); ==== //depot/projects/hammer/bin/cp/utils.c#3 (text+ko) ==== @@ -37,7 +37,7 @@ #endif #endif /* not lint */ #include -__FBSDID("$FreeBSD: src/bin/cp/utils.c,v 1.39 2002/10/18 14:45:00 markm Exp $"); +__FBSDID("$FreeBSD: src/bin/cp/utils.c,v 1.40 2003/04/07 11:00:56 mdodd Exp $"); #include #include @@ -56,6 +56,7 @@ #include #include "extern.h" +#define cp_pct(x,y) (int)(100.0 * (double)(x) / (double)(y)) int copy_file(const FTSENT *entp, int dne) @@ -65,6 +66,7 @@ int ch, checkch, from_fd, rcount, rval, to_fd; ssize_t wcount; size_t wresid; + size_t wtotal; char *bufp; #ifdef VM_AND_BUFFER_CACHE_SYNCHRONIZED char *p; @@ -137,9 +139,19 @@ warn("%s", entp->fts_path); rval = 1; } else { + wtotal = 0; for (bufp = p, wresid = fs->st_size; ; bufp += wcount, wresid -= (size_t)wcount) { wcount = write(to_fd, bufp, wresid); + wtotal += wcount; + if (info) { + info = 0; + (void)fprintf(stderr, + "%s -> %s %3d%%\n", + entp->fts_path, to.p_path, + cp_pct(wtotal, fs->st_size)); + + } if (wcount >= (ssize_t)wresid || wcount <= 0) break; } @@ -156,10 +168,20 @@ } else #endif { + wtotal = 0; while ((rcount = read(from_fd, buf, MAXBSIZE)) > 0) { for (bufp = buf, wresid = rcount; ; bufp += wcount, wresid -= wcount) { wcount = write(to_fd, bufp, wresid); + wtotal += wcount; + if (info) { + info = 0; + (void)fprintf(stderr, + "%s -> %s %3d%%\n", + entp->fts_path, to.p_path, + cp_pct(wtotal, fs->st_size)); + + } if (wcount >= (ssize_t)wresid || wcount <= 0) break; } ==== //depot/projects/hammer/etc/Makefile#7 (text+ko) ==== @@ -1,5 +1,5 @@ # from: @(#)Makefile 5.11 (Berkeley) 5/21/91 -# $FreeBSD: src/etc/Makefile,v 1.307 2003/04/02 20:13:59 ru Exp $ +# $FreeBSD: src/etc/Makefile,v 1.308 2003/04/08 16:14:02 des Exp $ .if !defined(NO_SENDMAIL) SUBDIR= sendmail @@ -129,6 +129,8 @@ ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 /dev/null \ ${DESTDIR}/var/log/cron ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 /dev/null \ + ${DESTDIR}/var/log/debug.log + ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 /dev/null \ ${DESTDIR}/var/log/xferlog ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \ ${DESTDIR}/var/log/lpd-errs ==== //depot/projects/hammer/etc/newsyslog.conf#5 (text+ko) ==== @@ -1,5 +1,5 @@ # configuration file for newsyslog -# $FreeBSD: src/etc/newsyslog.conf,v 1.43 2003/02/16 13:07:20 des Exp $ +# $FreeBSD: src/etc/newsyslog.conf,v 1.44 2003/04/08 16:14:02 des Exp $ # # Note: some sites will want to select more restrictive protections than the # defaults. In particular, it may be desirable to switch many of the 644 @@ -14,6 +14,7 @@ /var/log/console.log 600 5 100 * J /var/log/cron 600 3 100 * J /var/log/daily.log 640 7 * @T00 J +/var/log/debug.log 600 7 100 * J /var/log/kerberos.log 600 7 100 * J /var/log/lpd-errs 644 7 100 * J /var/log/maillog 640 7 * @T00 J ==== //depot/projects/hammer/etc/syslog.conf#5 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/etc/syslog.conf,v 1.24 2003/04/03 18:37:49 yar Exp $ +# $FreeBSD: src/etc/syslog.conf,v 1.25 2003/04/08 16:14:02 des Exp $ # # Spaces ARE valid field separators in this file. However, # other *nix-like systems still insist on using tabs as field @@ -13,6 +13,7 @@ lpr.info /var/log/lpd-errs ftp.info /var/log/xferlog cron.* /var/log/cron +*.debug /var/log/debug.log *.emerg * # uncomment this to log all writes to /dev/console to /var/log/console.log #console.info /var/log/console.log ==== //depot/projects/hammer/include/fstab.h#2 (text+ko) ==== @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)fstab.h 8.1 (Berkeley) 6/2/93 - * $FreeBSD: src/include/fstab.h,v 1.3 2002/03/23 17:24:53 imp Exp $ + * $FreeBSD: src/include/fstab.h,v 1.4 2003/04/07 12:54:59 mdodd Exp $ */ #ifndef _FSTAB_H_ @@ -75,6 +75,8 @@ struct fstab *getfsfile(const char *); int setfsent(void); void endfsent(void); +void setfstab(const char *); +const char *getfstab(void); __END_DECLS #endif /* !_FSTAB_H_ */ ==== //depot/projects/hammer/include/paths.h#2 (text+ko) ==== @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)paths.h 8.1 (Berkeley) 6/2/93 - * $FreeBSD: src/include/paths.h,v 1.17 2002/07/14 13:04:15 sobomax Exp $ + * $FreeBSD: src/include/paths.h,v 1.18 2003/04/07 16:21:25 mdodd Exp $ */ #ifndef _PATHS_H_ @@ -60,6 +60,7 @@ #define _PATH_ETC "/etc" #define _PATH_FTPUSERS "/etc/ftpusers" #define _PATH_KMEM "/dev/kmem" +#define _PATH_LIBMAP_CONF "/etc/libmap.conf" #define _PATH_LOGIN "/usr/bin/login" #define _PATH_MAILDIR "/var/mail" #define _PATH_MAN "/usr/share/man" ==== //depot/projects/hammer/lib/libc/gen/Makefile.inc#7 (text+ko) ==== @@ -1,5 +1,5 @@ # @(#)Makefile.inc 8.6 (Berkeley) 5/4/95 -# $FreeBSD: src/lib/libc/gen/Makefile.inc,v 1.104 2003/02/15 10:52:46 phantom Exp $ +# $FreeBSD: src/lib/libc/gen/Makefile.inc,v 1.105 2003/04/07 12:55:00 mdodd Exp $ # machine-independent gen sources .PATH: ${.CURDIR}/${MACHINE_ARCH}/gen ${.CURDIR}/gen @@ -84,7 +84,8 @@ MLINKS+=getcontext.3 setcontext.3 MLINKS+=getdomainname.3 setdomainname.3 MLINKS+=getfsent.3 endfsent.3 getfsent.3 getfsfile.3 getfsent.3 getfsspec.3 \ - getfsent.3 getfstype.3 getfsent.3 setfsent.3 + getfsent.3 getfstype.3 getfsent.3 setfsent.3 \ + getfsent.3 setfstab.3 getfsent.3 getfstab.3 MLINKS+=getgrent.3 endgrent.3 getgrent.3 getgrgid.3 getgrent.3 getgrnam.3 \ getgrent.3 setgrent.3 getgrent.3 setgroupent.3 MLINKS+=gethostname.3 sethostname.3 ==== //depot/projects/hammer/lib/libc/gen/fstab.c#2 (text+ko) ==== @@ -35,7 +35,7 @@ static char sccsid[] = "@(#)fstab.c 8.1 (Berkeley) 6/4/93"; #endif /* LIBC_SCCS and not lint */ #include -__FBSDID("$FreeBSD: src/lib/libc/gen/fstab.c,v 1.13 2002/02/01 01:32:19 obrien Exp $"); +__FBSDID("$FreeBSD: src/lib/libc/gen/fstab.c,v 1.14 2003/04/07 12:55:00 mdodd Exp $"); #include "namespace.h" #include @@ -54,11 +54,40 @@ static FILE *_fs_fp; static struct fstab _fs_fstab; static int LineNo = 0; +static char *path_fstab; +static char fstab_path[PATH_MAX]; +static int fsp_set = 0; static void error(int); static void fixfsfile(void); static int fstabscan(void); +void +setfstab(const char *file) +{ + + if (file == NULL) { + path_fstab = _PATH_FSTAB; + } else { + strncpy(fstab_path, file, PATH_MAX); + fstab_path[PATH_MAX - 1] = '\0'; + path_fstab = fstab_path; + } + fsp_set = 1; + + return; +} + +const char * +getfstab (void) +{ + + if (fsp_set) + return (path_fstab); + else + return (_PATH_FSTAB); +} + static void fixfsfile() { @@ -226,7 +255,13 @@ LineNo = 0; return(1); } - if ((_fs_fp = fopen(_PATH_FSTAB, "r")) != NULL) { + if (fsp_set == 0) { + if (issetugid()) + setfstab(NULL); + else + setfstab(getenv("PATH_FSTAB")); + } + if ((_fs_fp = fopen(path_fstab, "r")) != NULL) { LineNo = 0; return(1); } @@ -241,6 +276,8 @@ (void)fclose(_fs_fp); _fs_fp = NULL; } + + fsp_set = 0; } static void @@ -251,7 +288,7 @@ char num[30]; (void)_write(STDERR_FILENO, "fstab: ", 7); - (void)_write(STDERR_FILENO, _PATH_FSTAB, sizeof(_PATH_FSTAB) - 1); + (void)_write(STDERR_FILENO, path_fstab, strlen(path_fstab)); (void)_write(STDERR_FILENO, ":", 1); sprintf(num, "%d: ", LineNo); (void)_write(STDERR_FILENO, num, strlen(num)); ==== //depot/projects/hammer/lib/libc/gen/getfsent.3#2 (text+ko) ==== @@ -30,9 +30,9 @@ .\" SUCH DAMAGE. .\" .\" @(#)getfsent.3 8.1 (Berkeley) 6/4/93 -.\" $FreeBSD: src/lib/libc/gen/getfsent.3,v 1.9 2001/10/01 16:08:51 ru Exp $ +.\" $FreeBSD: src/lib/libc/gen/getfsent.3,v 1.12 2003/04/07 22:59:12 mdodd Exp $ .\" -.Dd June 4, 1993 +.Dd April 7, 2003 .Dt GETFSENT 3 .Os .Sh NAME @@ -56,6 +56,10 @@ .Fn setfsent void .Ft void .Fn endfsent void +.Ft void +.Fn setfstab "const char *file" +.Ft const char * +.Fn getfstab void .Sh DESCRIPTION The .Fn getfsent , @@ -94,6 +98,18 @@ closes the file. .Pp The +.Fn setfstab +function sets the file to be used by subsequent operations. +The value set by +.Fn setfstab +does not persist across calls to +.Fn endfsent +.Pp +The +.Fn getfstab +function returns the name of the file that that will be used. +.Pp +The .Fn getfsspec and .Fn getfsfile @@ -128,6 +144,20 @@ .Fn endfsent function returns nothing. +.Sh ENVIRONMENT +.Bl -tag -width PATH_FSTAB +.It Pa PATH_FSTAB +If the environment variable +.Pa PATH_FSTAB +is set all operations are performed against the specified file. +.Pa PATH_FSTAB +will not be honored if the process environment or memory address space is +considred +.Dq tainted . +(See +.Fn issetugid +for more information.) +.El .Sh FILES .Bl -tag -width /etc/fstab -compact .It Pa /etc/fstab @@ -146,7 +176,13 @@ and .Fn setfsent functions appeared in -.Bx 4.3 . +.Bx 4.3 ; +the +.Fn setfstab +and +.Fn getfstab +functions appeared in +.Fx 5.1. .Sh BUGS These functions use static data storage; if the data is needed for future use, it should be ==== //depot/projects/hammer/lib/libc/stdio/vfprintf.c#9 (text+ko) ==== @@ -38,7 +38,7 @@ static char sccsid[] = "@(#)vfprintf.c 8.1 (Berkeley) 6/4/93"; #endif /* LIBC_SCCS and not lint */ #include -__FBSDID("$FreeBSD: src/lib/libc/stdio/vfprintf.c,v 1.54 2003/04/05 22:11:42 das Exp $"); +__FBSDID("$FreeBSD: src/lib/libc/stdio/vfprintf.c,v 1.57 2003/04/07 03:17:39 ache Exp $"); /* * Actual printf innards. @@ -384,9 +384,11 @@ break; mbp += clen; } + if (clen == (size_t)-1) { + free(convbuf); + return (NULL); + } *mbp = '\0'; - if (clen == (size_t)-1) - return (NULL); return (convbuf); } @@ -557,6 +559,14 @@ PRINT(with, n); \ } \ } +#define PRINTANDPAD(p, ep, len, with) do { \ + n2 = (ep) - (p); \ + if (n2 > (len)) \ + n2 = (len); \ + if (n2 > 0) \ + PRINT((p), n2); \ + PAD((len) - (n2 > 0 ? n2 : 0), (with)); \ +} while(0) #define FLUSH() { \ if (uio.uio_resid && __sprint(fp, &uio)) \ goto error; \ @@ -714,16 +724,14 @@ goto rflag; case '.': if ((ch = *fmt++) == '*') { - GETASTER (n); - prec = n < 0 ? -1 : n; + GETASTER (prec); goto rflag; } - n = 0; + prec = 0; while (is_digit(ch)) { - n = 10 * n + to_digit(ch); + prec = 10 * prec + to_digit(ch); ch = *fmt++; } - prec = n < 0 ? -1 : n; goto reswitch; case '0': /*- @@ -917,7 +925,7 @@ if (expchar) { expsize = exponent(expstr, expt - 1, expchar); size = expsize + prec; - if (prec || flags & ALT) + if (prec > 1 || flags & ALT) ++size; } else { if (expt > 0) { @@ -942,7 +950,7 @@ } size += nseps + nrepeats; } else - lead = (expt < ndig) ? expt : ndig; + lead = expt; } break; #endif /* FLOATING_POINT */ @@ -1159,10 +1167,10 @@ buf[1] = *decimal_point; PRINT(buf, 2); PAD(-expt, zeroes); - if (ndig > 0) - PRINT(cp, ndig); + /* already handled initial 0's */ + prec += expt; } else { - PRINT(cp, lead); + PRINTANDPAD(cp, dtoaend, lead, zeroes); cp += lead; if (grouping) { while (nseps>0 || nrepeats>0) { @@ -1174,20 +1182,19 @@ } PRINT(&thousands_sep, 1); - PRINT(cp, *grouping); + PRINTANDPAD(cp,dtoaend, + *grouping, zeroes); cp += *grouping; } - } else { - PAD(expt - lead, zeroes); + if (cp > dtoaend) + cp = dtoaend; } if (prec || flags & ALT) PRINT(decimal_point,1); - if (ndig > lead) - PRINT(cp, ndig - lead); } - PAD(prec - ndig + expt, zeroes); + PRINTANDPAD(cp, dtoaend, prec, zeroes); } else { /* %[eE] or sufficiently long %[gG] */ - if (prec || flags & ALT) { + if (prec > 1 || flags & ALT) { buf[0] = *cp++; buf[1] = *decimal_point; PRINT(buf, 2); @@ -1195,7 +1202,6 @@ PAD(prec - ndig, zeroes); } else /* XeYYY */ PRINT(cp, 1); - PRINT(expstr, expsize); } } ==== //depot/projects/hammer/lib/libc/stdio/vfwprintf.c#6 (text+ko) ==== @@ -39,9 +39,9 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)vfprintf.c 8.1 (Berkeley) 6/4/93"; #endif /* LIBC_SCCS and not lint */ -__FBSDID("FreeBSD: src/lib/libc/stdio/vfprintf.c,v 1.52 2003/03/14 04:48:09 das Exp"); +__FBSDID("FreeBSD: src/lib/libc/stdio/vfprintf.c,v 1.57 2003/04/07 03:17:39 ache Exp"); #endif -__FBSDID("$FreeBSD: src/lib/libc/stdio/vfwprintf.c,v 1.9 2003/04/05 22:08:53 das Exp $"); +__FBSDID("$FreeBSD: src/lib/libc/stdio/vfwprintf.c,v 1.10 2003/04/07 06:36:49 tjr Exp $"); /* * Actual wprintf innards. @@ -114,10 +114,10 @@ }; static int __sbprintf(FILE *, const wchar_t *, va_list); -static wchar_t *__ujtoa(uintmax_t, wchar_t *, int, int, wchar_t *, int, char, - const char *); -static wchar_t *__ultoa(u_long, wchar_t *, int, int, wchar_t *, int, char, - const char *); +static wchar_t *__ujtoa(uintmax_t, wchar_t *, int, int, const wchar_t *, int, + char, const char *); +static wchar_t *__ultoa(u_long, wchar_t *, int, int, const wchar_t *, int, + char, const char *); static wchar_t *__mbsconv(char *, int); static void __find_arguments(const wchar_t *, va_list, union arg **); static void __grow_type_table(int, enum typeid **, int *); @@ -169,7 +169,7 @@ * use the given digits. */ static wchar_t * -__ultoa(u_long val, wchar_t *endp, int base, int octzero, wchar_t *xdigs, +__ultoa(u_long val, wchar_t *endp, int base, int octzero, const wchar_t *xdigs, int needgrp, char thousep, const char *grp) { wchar_t *cp = endp; @@ -246,8 +246,8 @@ /* Identical to __ultoa, but for intmax_t. */ static wchar_t * -__ujtoa(uintmax_t val, wchar_t *endp, int base, int octzero, wchar_t *xdigs, - int needgrp, char thousep, const char *grp) +__ujtoa(uintmax_t val, wchar_t *endp, int base, int octzero, + const wchar_t *xdigs, int needgrp, char thousep, const char *grp) { wchar_t *cp = endp; intmax_t sval; @@ -330,6 +330,9 @@ size_t insize, nchars, nconv; mbstate_t mbs; + if (mbsarg == NULL) + return (NULL); + /* * Supplied argument is a multibyte string; convert it to wide * characters first. @@ -400,16 +403,17 @@ } #ifdef FLOATING_POINT + +#define dtoa __dtoa +#define freedtoa __freedtoa + #include #include #include "floatio.h" +#include "gdtoa.h" #define DEFPREC 6 -extern char *__dtoa(double, int, int, int *, int *, char **); -extern void __freedtoa(char *s); - -static wchar_t *cvt(double, int, int, char *, int *, wchar_t, int *); static int exponent(wchar_t *, int, wchar_t); #endif /* FLOATING_POINT */ @@ -429,7 +433,6 @@ * Flags used during conversion. */ #define ALT 0x001 /* alternate form */ -#define HEXPREFIX 0x002 /* add 0x or 0X prefix */ #define LADJUST 0x004 /* left adjustment */ #define LONGDBL 0x008 /* long double */ #define LONGINT 0x010 /* long integer */ @@ -452,24 +455,46 @@ { wchar_t *fmt; /* format string */ wchar_t ch; /* character from fmt */ - int n, n2; /* handy integer (short term usage) */ + int n, n2, n3; /* handy integer (short term usage) */ wchar_t *cp; /* handy char pointer (short term usage) */ int flags; /* flags as above */ int ret; /* return value accumulator */ int width; /* width from format (%8d), or 0 */ - int prec; /* precision from format (%.3d), or -1 */ + int prec; /* precision from format; <0 for N/A */ wchar_t sign; /* sign prefix (' ', '+', '-', or \0) */ char thousands_sep; /* locale specific thousands separator */ const char *grouping; /* locale specific numeric grouping rules */ #ifdef FLOATING_POINT + /* + * We can decompose the printed representation of floating + * point numbers into several parts, some of which may be empty: + * + * [+|-| ] [0x|0X] MMM . NNN [e|E|p|P] [+|-] ZZ + * A B ---C--- D E F + * + * A: 'sign' holds this value if present; '\0' otherwise + * B: ox[1] holds the 'x' or 'X'; '\0' if not hexadecimal + * C: cp points to the string MMMNNN. Leading and trailing + * zeros are not in the string and must be added. + * D: expchar holds this character; '\0' if no exponent, e.g. %f + * F: at least two digits for decimal, at least one digit for hex + */ char *decimal_point; /* locale specific decimal point */ - char softsign; /* temporary negative sign for floats */ - double _double; /* double precision arguments %[eEfgG] */ + int signflag; /* true if float is negative */ + union { /* floating point arguments %[aAeEfFgG] */ + double dbl; + long double ldbl; + } fparg; int expt; /* integer value of exponent */ + char expchar; /* exponent character: [eEpP\0] */ + char *dtoaend; /* pointer to end of converted digits */ int expsize; /* character count for expstr */ - int ndig; /* actual number of digits returned by cvt */ - wchar_t expstr[7]; /* buffer for exponent string */ - wchar_t *dtoaresult; /* buffer allocated by dtoa */ + int lead; /* sig figs before decimal or group sep */ + int ndig; /* actual number of digits returned by dtoa */ + wchar_t expstr[MAXEXPDIG+2]; /* buffer for exponent string: e+ZZZ */ + char *dtoaresult; /* buffer allocated by dtoa */ + int nseps; /* number of group separators with ' */ + int nrepeats; /* number of repeats of the last group */ #endif u_long ulval; /* integer arguments %[diouxX] */ uintmax_t ujval; /* %j, %ll, %q, %t, %z integers */ @@ -478,7 +503,7 @@ int realsz; /* field size expanded by dprec, sign, etc */ int size; /* size of converted field or string */ int prsize; /* max size of printed field */ - wchar_t *xdigs; /* digits for [xX] conversion */ + const wchar_t *xdigs; /* digits for [xX] conversion */ wchar_t buf[BUF]; /* buffer with space for digits of uintmax_t */ >>> TRUNCATED FOR MAIL (1000 lines) <<< From owner-p4-projects@FreeBSD.ORG Tue Apr 8 11:38:01 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 8617537B404; Tue, 8 Apr 2003 11:38:00 -0700 (PDT) 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 25C1037B401 for ; Tue, 8 Apr 2003 11:38:00 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id A403043F75 for ; Tue, 8 Apr 2003 11:37:59 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h38Ibx0U071607 for ; Tue, 8 Apr 2003 11:37:59 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h38IbxFs071604 for perforce@freebsd.org; Tue, 8 Apr 2003 11:37:59 -0700 (PDT) Date: Tue, 8 Apr 2003 11:37:59 -0700 (PDT) Message-Id: <200304081837.h38IbxFs071604@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28535 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, 08 Apr 2003 18:38:01 -0000 http://perforce.freebsd.org/chv.cgi?CH=28535 Change 28535 by peter@peter_daintree on 2003/04/08 11:37:23 deal with "elf32 kernel" and "elf64 kernel" if necessary Affected files ... .. //depot/projects/hammer/sys/boot/powerpc/loader/metadata.c#3 edit .. //depot/projects/hammer/sys/boot/sparc64/loader/metadata.c#4 edit .. //depot/projects/hammer/sys/powerpc/powerpc/machdep.c#9 edit .. //depot/projects/hammer/sys/sparc64/sparc64/machdep.c#12 edit Differences ... ==== //depot/projects/hammer/sys/boot/powerpc/loader/metadata.c#3 (text+ko) ==== @@ -294,7 +294,9 @@ addr = roundup(addr, PAGE_SIZE); kernend = 0; - kfp = file_findfile(NULL, "elf kernel"); + kfp = file_findfile(NULL, "elf32 kernel"); + if (kfp == NULL) + kfp = file_findfile(NULL, "elf kernel"); if (kfp == NULL) panic("can't find kernel file"); file_addmetadata(kfp, MODINFOMD_HOWTO, sizeof howto, &howto); ==== //depot/projects/hammer/sys/boot/sparc64/loader/metadata.c#4 (text+ko) ==== @@ -296,7 +296,9 @@ addr = roundup(addr, PAGE_SIZE); kernend = 0; - kfp = file_findfile(NULL, "elf kernel"); + kfp = file_findfile(NULL, "elf64 kernel"); + if (kfp == NULL) + kfp = file_findfile(NULL, "elf kernel"); if (kfp == NULL) panic("can't find kernel file"); file_addmetadata(kfp, MODINFOMD_HOWTO, sizeof howto, &howto); ==== //depot/projects/hammer/sys/powerpc/powerpc/machdep.c#9 (text+ko) ==== @@ -267,7 +267,9 @@ */ if (mdp != NULL) { preload_metadata = mdp; - kmdp = preload_search_by_type("elf kernel"); + kmdp = preload_search_by_type("elf32 kernel"); + if (kmdp == NULL) + kmdp = preload_search_by_type("elf kernel"); if (kmdp != NULL) { boothowto = MD_FETCH(kmdp, MODINFOMD_HOWTO, int); kern_envp = MD_FETCH(kmdp, MODINFOMD_ENVP, char *); ==== //depot/projects/hammer/sys/sparc64/sparc64/machdep.c#12 (text+ko) ==== @@ -234,7 +234,9 @@ */ if (mdp != NULL) { preload_metadata = mdp; - kmdp = preload_search_by_type("elf kernel"); + kmdp = preload_search_by_type("elf64 kernel"); + if (kmdp == NULL) + kmdp = preload_search_by_type("elf kernel"); if (kmdp != NULL) { boothowto = MD_FETCH(kmdp, MODINFOMD_HOWTO, int); kern_envp = MD_FETCH(kmdp, MODINFOMD_ENVP, char *); From owner-p4-projects@FreeBSD.ORG Tue Apr 8 11:44:09 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 2045237B405; Tue, 8 Apr 2003 11:44:09 -0700 (PDT) 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 A5EF337B401 for ; Tue, 8 Apr 2003 11:44:08 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3B8FD43F3F for ; Tue, 8 Apr 2003 11:44:08 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h38Ii80U072166 for ; Tue, 8 Apr 2003 11:44:08 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h38Ii7uM072163 for perforce@freebsd.org; Tue, 8 Apr 2003 11:44:07 -0700 (PDT) Date: Tue, 8 Apr 2003 11:44:07 -0700 (PDT) Message-Id: <200304081844.h38Ii7uM072163@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28537 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, 08 Apr 2003 18:44:10 -0000 http://perforce.freebsd.org/chv.cgi?CH=28537 Change 28537 by peter@peter_daintree on 2003/04/08 11:43:39 untangle Affected files ... .. //depot/projects/hammer/sys/x86_64/include/pmap.h#16 edit Differences ... ==== //depot/projects/hammer/sys/x86_64/include/pmap.h#16 (text+ko) ==== @@ -178,10 +178,10 @@ { vm_paddr_t pa; -/* XXX the acronyms are giving me headaches at the moment */ -/* XXX if ((pa = (vm_offset_t) PTD[va >> PDRSHIFT]) & PG_PS) { + pa = PTD[va >> PDRSHIFT]; + if (pa & PG_PS) { pa = (pa & ~(NBPDR - 1)) | (va & (NBPDR - 1)); - } else */ { + } else { pa = *vtopte(va); pa = (pa & PG_FRAME) | (va & PAGE_MASK); } From owner-p4-projects@FreeBSD.ORG Tue Apr 8 11:58:29 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 4BEDB37B404; Tue, 8 Apr 2003 11:58:29 -0700 (PDT) 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 DFDE437B401 for ; Tue, 8 Apr 2003 11:58:28 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7686F43F85 for ; Tue, 8 Apr 2003 11:58:28 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h38IwS0U073072 for ; Tue, 8 Apr 2003 11:58:28 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h38IwRYn073069 for perforce@freebsd.org; Tue, 8 Apr 2003 11:58:27 -0700 (PDT) Date: Tue, 8 Apr 2003 11:58:27 -0700 (PDT) Message-Id: <200304081858.h38IwRYn073069@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28540 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, 08 Apr 2003 18:58:30 -0000 http://perforce.freebsd.org/chv.cgi?CH=28540 Change 28540 by peter@peter_daintree on 2003/04/08 11:57:30 convert to hammer regparm Affected files ... .. //depot/projects/hammer/sys/x86_64/isa/icu_ipl.s#3 edit Differences ... ==== //depot/projects/hammer/sys/x86_64/isa/icu_ipl.s#3 (text+ko) ==== @@ -48,7 +48,7 @@ SUPERALIGN_TEXT ENTRY(INTREN) - movq 8(%rsp), %rax # XXX wrong, use regparm + movq %rdi, %rax movl %eax, %ecx notl %eax andl %eax, imen @@ -65,7 +65,7 @@ ret ENTRY(INTRDIS) - movq 8(%rsp), %rax # XXX wrong, use regparm + movq %rdi, %rax movl %eax, %ecx orl %eax, imen movl imen, %eax From owner-p4-projects@FreeBSD.ORG Tue Apr 8 11:59:31 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 1D9C737B404; Tue, 8 Apr 2003 11:59:31 -0700 (PDT) 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 C842337B401 for ; Tue, 8 Apr 2003 11:59:30 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5F79843F75 for ; Tue, 8 Apr 2003 11:59:30 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h38IxU0U073117 for ; Tue, 8 Apr 2003 11:59:30 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h38IxT3E073114 for perforce@freebsd.org; Tue, 8 Apr 2003 11:59:29 -0700 (PDT) Date: Tue, 8 Apr 2003 11:59:29 -0700 (PDT) Message-Id: <200304081859.h38IxT3E073114@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28541 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, 08 Apr 2003 18:59:32 -0000 http://perforce.freebsd.org/chv.cgi?CH=28541 Change 28541 by peter@peter_daintree on 2003/04/08 11:58:30 64 bit counters. Affected files ... .. //depot/projects/hammer/sys/x86_64/isa/vector.s#8 edit Differences ... ==== //depot/projects/hammer/sys/x86_64/isa/vector.s#8 (text+ko) ==== @@ -19,12 +19,12 @@ .globl intrcnt, eintrcnt intrcnt: - .space INTRCNT_COUNT * 4 + .space INTRCNT_COUNT * 8 eintrcnt: .globl intrnames, eintrnames intrnames: - .space INTRCNT_COUNT * 16 + .space INTRCNT_COUNT * 32 eintrnames: .text From owner-p4-projects@FreeBSD.ORG Tue Apr 8 12:02:38 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id D1DC737B404; Tue, 8 Apr 2003 12:02:37 -0700 (PDT) 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 6ADC037B401 for ; Tue, 8 Apr 2003 12:02:37 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0ED4D43FB1 for ; Tue, 8 Apr 2003 12:02:36 -0700 (PDT) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h38J2Z0U073583 for ; Tue, 8 Apr 2003 12:02:35 -0700 (PDT) (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h38J2ZrZ073579 for perforce@freebsd.org; Tue, 8 Apr 2003 12:02:35 -0700 (PDT) Date: Tue, 8 Apr 2003 12:02:35 -0700 (PDT) Message-Id: <200304081902.h38J2ZrZ073579@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jhb@freebsd.org using -f From: John Baldwin To: Perforce Change Reviews Subject: PERFORCE change 28543 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, 08 Apr 2003 19:02:39 -0000 http://perforce.freebsd.org/chv.cgi?CH=28543 Change 28543 by jhb@jhb_laptop on 2003/04/08 12:02:18 IFC @28536. Affected files ... .. //depot/projects/smpng/sys/alpha/alpha/busdma_machdep.c#13 integrate .. //depot/projects/smpng/sys/boot/common/bootstrap.h#6 integrate .. //depot/projects/smpng/sys/cam/cam_periph.c#9 integrate .. //depot/projects/smpng/sys/conf/files#70 integrate .. //depot/projects/smpng/sys/conf/options.i386#25 integrate .. //depot/projects/smpng/sys/dev/ata/ata-all.c#35 integrate .. //depot/projects/smpng/sys/dev/ata/ata-all.h#15 integrate .. //depot/projects/smpng/sys/dev/ata/ata-chipset.c#7 integrate .. //depot/projects/smpng/sys/dev/ata/ata-disk.c#28 integrate .. //depot/projects/smpng/sys/dev/ata/ata-dma.c#29 integrate .. //depot/projects/smpng/sys/dev/ata/ata-pci.c#29 integrate .. //depot/projects/smpng/sys/dev/ata/ata-pci.h#4 integrate .. //depot/projects/smpng/sys/dev/ata/ata-raid.c#18 integrate .. //depot/projects/smpng/sys/dev/ata/ata-raid.h#12 integrate .. //depot/projects/smpng/sys/dev/cardbus/cardbus_cis.c#13 integrate .. //depot/projects/smpng/sys/dev/ed/if_ed.c#12 integrate .. //depot/projects/smpng/sys/dev/fxp/if_fxp.c#27 integrate .. //depot/projects/smpng/sys/dev/fxp/if_fxpreg.h#6 integrate .. //depot/projects/smpng/sys/dev/pccard/pccard.c#19 integrate .. //depot/projects/smpng/sys/dev/pccard/pccardvar.h#11 integrate .. //depot/projects/smpng/sys/dev/pccbb/pccbb.c#25 integrate .. //depot/projects/smpng/sys/dev/puc/pucdata.c#12 integrate .. //depot/projects/smpng/sys/dev/snc/dp83932.c#5 integrate .. //depot/projects/smpng/sys/dev/stg/tmc18c30.h#1 branch .. //depot/projects/smpng/sys/dev/stg/tmc18c30_isa.c#5 integrate .. //depot/projects/smpng/sys/dev/stg/tmc18c30_pccard.c#8 integrate .. //depot/projects/smpng/sys/dev/stg/tmc18c30_pci.c#1 branch .. //depot/projects/smpng/sys/dev/stg/tmc18c30_subr.c#1 branch .. //depot/projects/smpng/sys/dev/usb/if_kue.c#12 integrate .. //depot/projects/smpng/sys/dev/usb/usbdevs#27 integrate .. //depot/projects/smpng/sys/dev/usb/usbdevs.h#28 integrate .. //depot/projects/smpng/sys/dev/usb/usbdevs_data.h#28 integrate .. //depot/projects/smpng/sys/dev/usb/uvisor.c#4 integrate .. //depot/projects/smpng/sys/dev/vx/if_vx.c#9 integrate .. //depot/projects/smpng/sys/dev/wi/if_wi_pccard.c#13 integrate .. //depot/projects/smpng/sys/i386/conf/NOTES#54 integrate .. //depot/projects/smpng/sys/i386/conf/PAE#1 branch .. //depot/projects/smpng/sys/i386/i386/busdma_machdep.c#14 integrate .. //depot/projects/smpng/sys/i386/i386/mp_clock.c#5 integrate .. //depot/projects/smpng/sys/i386/i386/swtch.s#17 integrate .. //depot/projects/smpng/sys/i386/i386/tsc.c#3 integrate .. //depot/projects/smpng/sys/i386/include/pmap.h#15 integrate .. //depot/projects/smpng/sys/i386/include/vmparam.h#3 integrate .. //depot/projects/smpng/sys/i386/isa/mca_machdep.c#4 delete .. //depot/projects/smpng/sys/i386/isa/mca_machdep.h#2 delete .. //depot/projects/smpng/sys/i386/isa/vesa.c#7 integrate .. //depot/projects/smpng/sys/ia64/conf/GENERIC#30 integrate .. //depot/projects/smpng/sys/ia64/conf/SKI#12 integrate .. //depot/projects/smpng/sys/ia64/ia64/busdma_machdep.c#13 integrate .. //depot/projects/smpng/sys/ia64/ia64/exception.s#23 integrate .. //depot/projects/smpng/sys/ia64/ia64/locore.s#16 integrate .. //depot/projects/smpng/sys/ia64/ia64/sscdisk.c#13 integrate .. //depot/projects/smpng/sys/kern/kern_mac.c#20 integrate .. //depot/projects/smpng/sys/kern/kern_physio.c#8 integrate .. //depot/projects/smpng/sys/kern/kern_thr.c#3 integrate .. //depot/projects/smpng/sys/kern/kern_thread.c#23 integrate .. //depot/projects/smpng/sys/kern/link_elf.c#19 integrate .. //depot/projects/smpng/sys/kern/uipc_cow.c#10 integrate .. //depot/projects/smpng/sys/kern/uipc_mbuf.c#16 integrate .. //depot/projects/smpng/sys/kern/vfs_aio.c#37 integrate .. //depot/projects/smpng/sys/kern/vfs_bio.c#41 integrate .. //depot/projects/smpng/sys/modules/stg/Makefile#2 integrate .. //depot/projects/smpng/sys/net/if_disc.c#7 integrate .. //depot/projects/smpng/sys/net/if_faith.c#14 integrate .. //depot/projects/smpng/sys/net/if_loop.c#16 integrate .. //depot/projects/smpng/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c#5 integrate .. //depot/projects/smpng/sys/netgraph/ng_base.c#14 integrate .. //depot/projects/smpng/sys/netgraph/ng_iface.c#8 integrate .. //depot/projects/smpng/sys/netinet/ip_divert.c#23 integrate .. //depot/projects/smpng/sys/netinet/ip_input.c#32 integrate .. //depot/projects/smpng/sys/netinet/ip_mroute.c#22 integrate .. //depot/projects/smpng/sys/netinet/ip_output.c#35 integrate .. //depot/projects/smpng/sys/netipsec/keysock.c#4 integrate .. //depot/projects/smpng/sys/netkey/keysock.c#14 integrate .. //depot/projects/smpng/sys/netnatm/natm.c#10 integrate .. //depot/projects/smpng/sys/pci/agp_if.m#2 integrate .. //depot/projects/smpng/sys/pci/if_rl.c#24 integrate .. //depot/projects/smpng/sys/pci/if_xl.c#22 integrate .. //depot/projects/smpng/sys/powerpc/powerpc/busdma_machdep.c#8 integrate .. //depot/projects/smpng/sys/sparc64/include/cache.h#7 integrate .. //depot/projects/smpng/sys/sparc64/include/cpufunc.h#17 integrate .. //depot/projects/smpng/sys/sparc64/include/iommuvar.h#8 integrate .. //depot/projects/smpng/sys/sparc64/include/kerneldump.h#2 integrate .. //depot/projects/smpng/sys/sparc64/include/md_var.h#11 integrate .. //depot/projects/smpng/sys/sparc64/include/ofw_mem.h#2 integrate .. //depot/projects/smpng/sys/sparc64/include/pmap.h#22 integrate .. //depot/projects/smpng/sys/sparc64/include/smp.h#13 integrate .. //depot/projects/smpng/sys/sparc64/include/tsb.h#10 integrate .. //depot/projects/smpng/sys/sparc64/include/watch.h#2 integrate .. //depot/projects/smpng/sys/sparc64/pci/psycho.c#18 integrate .. //depot/projects/smpng/sys/sparc64/pci/psychovar.h#7 integrate .. //depot/projects/smpng/sys/sparc64/sparc64/bus_machdep.c#14 integrate .. //depot/projects/smpng/sys/sparc64/sparc64/cheetah.c#2 integrate .. //depot/projects/smpng/sys/sparc64/sparc64/db_hwwatch.c#4 integrate .. //depot/projects/smpng/sys/sparc64/sparc64/dump_machdep.c#4 integrate .. //depot/projects/smpng/sys/sparc64/sparc64/iommu.c#13 integrate .. //depot/projects/smpng/sys/sparc64/sparc64/machdep.c#46 integrate .. //depot/projects/smpng/sys/sparc64/sparc64/mem.c#7 integrate .. //depot/projects/smpng/sys/sparc64/sparc64/mp_machdep.c#17 integrate .. //depot/projects/smpng/sys/sparc64/sparc64/pmap.c#36 integrate .. //depot/projects/smpng/sys/sparc64/sparc64/spitfire.c#2 integrate .. //depot/projects/smpng/sys/sparc64/sparc64/tsb.c#19 integrate .. //depot/projects/smpng/sys/sparc64/sparc64/vm_machdep.c#30 integrate .. //depot/projects/smpng/sys/sys/mbuf.h#20 integrate .. //depot/projects/smpng/sys/ufs/ffs/ffs_rawread.c#2 integrate .. //depot/projects/smpng/sys/vm/vm_pager.c#11 integrate Differences ... ==== //depot/projects/smpng/sys/alpha/alpha/busdma_machdep.c#13 (text+ko) ==== @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/alpha/alpha/busdma_machdep.c,v 1.33 2003/03/20 19:45:26 mux Exp $ + * $FreeBSD: src/sys/alpha/alpha/busdma_machdep.c,v 1.34 2003/04/08 14:25:44 des Exp $ */ #include @@ -667,8 +667,7 @@ KASSERT(dmat->lowaddr >= ptoa(Maxmem) || map != NULL, ("bus_dmamap_load_mbuf: No support for bounce pages!")); - KASSERT(m0->m_flags & M_PKTHDR, - ("bus_dmamap_load_mbuf: no packet header")); + M_ASSERTPKTHDR(m0); nsegs = 0; error = 0; ==== //depot/projects/smpng/sys/boot/common/bootstrap.h#6 (text+ko) ==== @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/boot/common/bootstrap.h,v 1.36 2002/03/10 22:33:04 sobomax Exp $ + * $FreeBSD: src/sys/boot/common/bootstrap.h,v 1.37 2003/04/06 06:28:08 peter Exp $ */ #include @@ -231,9 +231,6 @@ /* MI module loaders */ -int aout_loadfile(char *filename, vm_offset_t dest, struct preloaded_file **result); -vm_offset_t aout_findsym(char *name, struct preloaded_file *fp); - int elf_loadfile(char *filename, vm_offset_t dest, struct preloaded_file **result); /* ==== //depot/projects/smpng/sys/cam/cam_periph.c#9 (text+ko) ==== @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/cam/cam_periph.c,v 1.47 2003/03/15 21:59:05 phk Exp $ + * $FreeBSD: src/sys/cam/cam_periph.c,v 1.48 2003/04/06 22:21:03 alc Exp $ */ #include @@ -605,29 +605,10 @@ if (dirs[i] & CAM_DIR_OUT) { flags[i] = BIO_WRITE; - if (!useracc(*data_ptrs[i], lengths[i], - VM_PROT_READ)) { - printf("cam_periph_mapmem: error, " - "address %p, length %lu isn't " - "user accessible for READ\n", - (void *)*data_ptrs[i], - (u_long)lengths[i]); - return(EACCES); - } } if (dirs[i] & CAM_DIR_IN) { flags[i] = BIO_READ; - if (!useracc(*data_ptrs[i], lengths[i], - VM_PROT_WRITE)) { - printf("cam_periph_mapmem: error, " - "address %p, length %lu isn't " - "user accessible for WRITE\n", - (void *)*data_ptrs[i], - (u_long)lengths[i]); - - return(EACCES); - } } } ==== //depot/projects/smpng/sys/conf/files#70 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/conf/files,v 1.777 2003/04/04 18:53:04 phk Exp $ +# $FreeBSD: src/sys/conf/files,v 1.778 2003/04/07 10:13:25 mdodd Exp $ # # The long compile-with and dependency lines are required because of # limitations in config: backslash-newline doesn't work in strings, and @@ -723,8 +723,10 @@ dev/sr/if_sr_pci.c optional sr pci dev/streams/streams.c optional streams dev/stg/tmc18c30.c optional stg +dev/stg/tmc18c30_subr.c optional stg dev/stg/tmc18c30_pccard.c optional stg card dev/stg/tmc18c30_pccard.c optional stg pccard +dev/stg/tmc18c30_pci.c optional stg pci dev/stg/tmc18c30_isa.c optional stg isa dev/sym/sym_hipd.c optional sym \ dependency "$S/dev/sym/sym_{conf,defs}.h" ==== //depot/projects/smpng/sys/conf/options.i386#25 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/conf/options.i386,v 1.188 2003/04/02 23:53:28 peter Exp $ +# $FreeBSD: src/sys/conf/options.i386,v 1.189 2003/04/04 23:54:46 tegge Exp $ # Options specific to the i386 platform kernels MATH_EMULATE opt_math_emulate.h @@ -41,6 +41,7 @@ CLK_CALIBRATION_LOOP opt_clock.h CLK_USE_I8254_CALIBRATION opt_clock.h CLK_USE_TSC_CALIBRATION opt_clock.h +SMP_TSC opt_clock.h TIMER_FREQ opt_clock.h NO_F00F_HACK opt_cpu.h ==== //depot/projects/smpng/sys/dev/ata/ata-all.c#35 (text+ko) ==== @@ -25,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/ata/ata-all.c,v 1.176 2003/04/01 15:06:23 phk Exp $ + * $FreeBSD: src/sys/dev/ata/ata-all.c,v 1.177 2003/04/07 14:12:12 sos Exp $ */ #include "opt_ata.h" @@ -447,7 +447,7 @@ /* apparently some devices needs this repeated */ do { if (ata_command(atadev, command, 0, 0, 0, - dumping ? ATA_WAIT_READY : ATA_WAIT_INTR)) { /* XXX */ + dumping ? ATA_WAIT_READY : ATA_WAIT_INTR)) { ata_prtdev(atadev, "%s identify failed\n", command == ATA_C_ATAPI_IDENTIFY ? "ATAPI" : "ATA"); free(ata_parm, M_ATA); ==== //depot/projects/smpng/sys/dev/ata/ata-all.h#15 (text+ko) ==== @@ -25,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/ata/ata-all.h,v 1.60 2003/03/29 13:37:09 sos Exp $ + * $FreeBSD: src/sys/dev/ata/ata-all.h,v 1.61 2003/04/07 14:12:12 sos Exp $ */ /* ATA register defines */ @@ -145,6 +145,7 @@ #define ATA_BMCMD_START_STOP 0x01 #define ATA_BMCMD_WRITE_READ 0x08 +#define ATA_BMCTL_PORT 0x09 #define ATA_BMDEVSPEC_0 0x0a #define ATA_BMSTAT_PORT 0x0b #define ATA_BMSTAT_ACTIVE 0x01 @@ -158,6 +159,8 @@ #define ATA_BMDEVSPEC_1 0x0c #define ATA_BMDTP_PORT 0x0d +#define ATA_IDX_ADDR 0x0e +#define ATA_IDX_DATA 0x0f #define ATA_MAX_RES 0x10 /* structure for holding DMA address data */ @@ -207,7 +210,6 @@ int (*setup)(struct ata_device *, caddr_t, int32_t); int (*start)(struct ata_channel *, caddr_t, int32_t, int); int (*stop)(struct ata_channel *); - int (*status)(struct ata_channel *); }; /* structure holding resources for an ATA channel */ @@ -365,31 +367,102 @@ bus_space_write_multi_stream_4(rman_get_bustag((res)), \ rman_get_bushandle((res)), \ (offset), (addr), (count)) + +#define ATA_IDX_SET(ch, idx) \ + ATA_OUTB(ch->r_io[ATA_IDX_ADDR].res, ch->r_io[ATA_IDX_ADDR].offset, \ + ch->r_io[idx].offset) + #define ATA_IDX_INB(ch, idx) \ - ATA_INB(ch->r_io[idx].res, ch->r_io[idx].offset) + ((ch->r_io[idx].res) \ + ? ATA_INB(ch->r_io[idx].res, ch->r_io[idx].offset) \ + : (ATA_IDX_SET(ch, idx), \ + ATA_INB(ch->r_io[ATA_IDX_DATA].res, ch->r_io[ATA_IDX_DATA].offset))) + #define ATA_IDX_INW(ch, idx) \ - ATA_INW(ch->r_io[idx].res, ch->r_io[idx].offset) + ((ch->r_io[idx].res) \ + ? ATA_INW(ch->r_io[idx].res, ch->r_io[idx].offset) \ + : (ATA_IDX_SET(ch, idx), \ + ATA_INW(ch->r_io[ATA_IDX_DATA].res, ch->r_io[ATA_IDX_DATA].offset))) + #define ATA_IDX_INL(ch, idx) \ - ATA_INL(ch->r_io[idx].res, ch->r_io[idx].offset) + ((ch->r_io[idx].res) \ + ? ATA_INL(ch->r_io[idx].res, ch->r_io[idx].offset) \ + : (ATA_IDX_SET(ch, idx), \ + ATA_INL(ch->r_io[ATA_IDX_DATA].res, ch->r_io[ATA_IDX_DATA].offset))) + #define ATA_IDX_INSW(ch, idx, addr, count) \ - ATA_INSW(ch->r_io[idx].res, ch->r_io[idx].offset, addr, count) + ((ch->r_io[idx].res) \ + ? ATA_INSW(ch->r_io[idx].res, ch->r_io[idx].offset, addr, count) \ + : (ATA_IDX_SET(ch, idx), \ + ATA_INSW(ch->r_io[ATA_IDX_DATA].res, \ + ch->r_io[ATA_IDX_DATA].offset, addr, count))) + #define ATA_IDX_INSW_STRM(ch, idx, addr, count) \ - ATA_INSW_STRM(ch->r_io[idx].res, ch->r_io[idx].offset, addr, count) + ((ch->r_io[idx].res) \ + ? ATA_INSW_STRM(ch->r_io[idx].res, ch->r_io[idx].offset, addr, count) \ + : (ATA_IDX_SET(ch, idx), \ + ATA_INSW_STRM(ch->r_io[ATA_IDX_DATA].res, \ + ch->r_io[ATA_IDX_DATA].offset, addr, count))) + #define ATA_IDX_INSL(ch, idx, addr, count) \ - ATA_INSL(ch->r_io[idx].res, ch->r_io[idx].offset, addr, count) + ((ch->r_io[idx].res) \ + ? ATA_INSL(ch->r_io[idx].res, ch->r_io[idx].offset, addr, count) \ + : (ATA_IDX_SET(ch, idx), \ + ATA_INSL(ch->r_io[ATA_IDX_DATA].res, \ + ch->r_io[ATA_IDX_DATA].offset, addr, count))) + #define ATA_IDX_INSL_STRM(ch, idx, addr, count) \ - ATA_INSL_STRM(ch->r_io[idx].res, ch->r_io[idx].offset, addr, count) + ((ch->r_io[idx].res) \ + ? ATA_INSL_STRM(ch->r_io[idx].res, ch->r_io[idx].offset, addr, count) \ + : (ATA_IDX_SET(ch, idx), \ + ATA_INSL_STRM(ch->r_io[ATA_IDX_DATA].res, \ + ch->r_io[ATA_IDX_DATA].offset, addr, count))) + #define ATA_IDX_OUTB(ch, idx, value) \ - ATA_OUTB(ch->r_io[idx].res, ch->r_io[idx].offset, value) + ((ch->r_io[idx].res) \ + ? ATA_OUTB(ch->r_io[idx].res, ch->r_io[idx].offset, value) \ + : (ATA_IDX_SET(ch, idx), \ + ATA_OUTB(ch->r_io[ATA_IDX_DATA].res, \ + ch->r_io[ATA_IDX_DATA].offset, value))) + #define ATA_IDX_OUTW(ch, idx, value) \ - ATA_OUTW(ch->r_io[idx].res, ch->r_io[idx].offset, value) + ((ch->r_io[idx].res) \ + ? ATA_OUTW(ch->r_io[idx].res, ch->r_io[idx].offset, value) \ + : (ATA_IDX_SET(ch, idx), \ + ATA_OUTW(ch->r_io[ATA_IDX_DATA].res, \ + ch->r_io[ATA_IDX_DATA].offset, value))) + #define ATA_IDX_OUTL(ch, idx, value) \ - ATA_OUTL(ch->r_io[idx].res, ch->r_io[idx].offset, value) + ((ch->r_io[idx].res) \ + ? ATA_OUTL(ch->r_io[idx].res, ch->r_io[idx].offset, value) \ + : (ATA_IDX_SET(ch, idx), \ + ATA_OUTL(ch->r_io[ATA_IDX_DATA].res, \ + ch->r_io[ATA_IDX_DATA].offset, value))) + #define ATA_IDX_OUTSW(ch, idx, addr, count) \ - ATA_OUTSW(ch->r_io[idx].res, ch->r_io[idx].offset, addr, count) + ((ch->r_io[idx].res) \ + ? ATA_OUTSW(ch->r_io[idx].res, ch->r_io[idx].offset, addr, count) \ + : (ATA_IDX_SET(ch, idx), \ + ATA_OUTSW(ch->r_io[ATA_IDX_DATA].res, \ + ch->r_io[ATA_IDX_DATA].offset, addr, count))) + #define ATA_IDX_OUTSW_STRM(ch, idx, addr, count) \ - ATA_OUTSW_STRM(ch->r_io[idx].res, ch->r_io[idx].offset, addr, count) + ((ch->r_io[idx].res) \ + ? ATA_OUTSW_STRM(ch->r_io[idx].res, ch->r_io[idx].offset, addr, count) \ + : (ATA_IDX_SET(ch, idx), \ + ATA_OUTSW_STRM(ch->r_io[ATA_IDX_DATA].res, \ + ch->r_io[ATA_IDX_DATA].offset, addr, count))) + #define ATA_IDX_OUTSL(ch, idx, addr, count) \ - ATA_OUTSL(ch->r_io[idx].res, ch->r_io[idx].offset, addr, count) + ((ch->r_io[idx].res) \ + ? ATA_OUTSL(ch->r_io[idx].res, ch->r_io[idx].offset, addr, count) \ + : (ATA_IDX_SET(ch, idx), \ + ATA_OUTSL(ch->r_io[ATA_IDX_DATA].res, \ + ch->r_io[ATA_IDX_DATA].offset, addr, count))) + #define ATA_IDX_OUTSL_STRM(ch, idx, addr, count) \ - ATA_OUTSL_STRM(ch->r_io[idx].res, ch->r_io[idx].offset, addr, count) + ((ch->r_io[idx].res) \ + ? ATA_OUTSL_STRM(ch->r_io[idx].res, ch->r_io[idx].offset, addr, count) \ + : (ATA_IDX_SET(ch, idx), \ + ATA_OUTSL_STRM(ch->r_io[ATA_IDX_DATA].res, \ + ch->r_io[ATA_IDX_DATA].offset, addr, count))) ==== //depot/projects/smpng/sys/dev/ata/ata-chipset.c#7 (text+ko) ==== @@ -25,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/ata/ata-chipset.c,v 1.16 2003/03/29 13:37:09 sos Exp $ + * $FreeBSD: src/sys/dev/ata/ata-chipset.c,v 1.17 2003/04/07 14:12:12 sos Exp $ */ #include "opt_ata.h" #include @@ -135,7 +135,8 @@ if (!(ch = ctlr->interrupt[unit].argument)) continue; if (ch->dma->flags & ATA_DMA_ACTIVE) { - if (!((dmastat = ch->dma->status(ch)) & ATA_BMSTAT_INTERRUPT)) + if (!((dmastat = (ATA_IDX_INB(ch, ATA_BMSTAT_PORT) & + ATA_BMSTAT_MASK)) & ATA_BMSTAT_INTERRUPT)) continue; ATA_IDX_OUTB(ch, ATA_BMSTAT_PORT, dmastat|ATA_BMSTAT_INTERRUPT); DELAY(1); @@ -220,7 +221,8 @@ continue; ch = ctlr->interrupt[unit].argument; if (ch->dma->flags & ATA_DMA_ACTIVE) { - if (!((dmastat = ch->dma->status(ch)) & ATA_BMSTAT_INTERRUPT)) + if (!((dmastat = (ATA_IDX_INB(ch, ATA_BMSTAT_PORT) & + ATA_BMSTAT_MASK)) & ATA_BMSTAT_INTERRUPT)) continue; ATA_IDX_OUTB(ch, ATA_BMSTAT_PORT, dmastat|ATA_BMSTAT_INTERRUPT); DELAY(1); @@ -480,7 +482,7 @@ if (ata_default_interrupt(dev)) return ENXIO; - if (ctlr->r_bmio) + if (ctlr->r_io1) ctlr->setmode = ata_cyrix_setmode; else ctlr->setmode = ata_generic_setmode; @@ -664,7 +666,7 @@ for (unit = 0; unit < 2; unit++) { if (!(ch = ctlr->interrupt[unit].argument)) continue; - if (((dmastat = ch->dma->status(ch)) & + if (((dmastat = (ATA_IDX_INB(ch, ATA_BMSTAT_PORT) & ATA_BMSTAT_MASK)) & (ATA_BMSTAT_ACTIVE | ATA_BMSTAT_INTERRUPT))!=ATA_BMSTAT_INTERRUPT) continue; ATA_IDX_OUTB(ch, ATA_BMSTAT_PORT, dmastat | ATA_BMSTAT_INTERRUPT); @@ -1014,7 +1016,6 @@ } break; } - ctlr->setmode = ata_promise_setmode; return 0; } @@ -1023,7 +1024,7 @@ ata_promise_old_intr(void *data) { struct ata_pci_controller *ctlr = data; - struct ata_channel *ch = ctlr->interrupt[0].argument; + struct ata_channel *ch; u_int8_t dmastat; int unit; @@ -1031,9 +1032,10 @@ for (unit = 0; unit < 2; unit++) { if (!(ch = ctlr->interrupt[unit].argument)) continue; - if (ATA_INL(ctlr->r_bmio, 0x1c) & (ch->unit ? 0x00004000 : 0x00000400)){ + if (ATA_INL(ctlr->r_io1, 0x1c) & (ch->unit ? 0x00004000 : 0x00000400)) { if (ch->dma->flags & ATA_DMA_ACTIVE) { - if (!((dmastat = ch->dma->status(ch)) & ATA_BMSTAT_INTERRUPT)) + if (!((dmastat = (ATA_IDX_INB(ch, ATA_BMSTAT_PORT) & + ATA_BMSTAT_MASK)) & ATA_BMSTAT_INTERRUPT)) continue; ATA_IDX_OUTB(ch, ATA_BMSTAT_PORT, dmastat|ATA_BMSTAT_INTERRUPT); DELAY(1); @@ -1058,9 +1060,10 @@ ATA_IDX_OUTB(ch, ATA_BMDEVSPEC_0, 0x0b); if (ATA_IDX_INB(ch, ATA_BMDEVSPEC_1) & 0x20) { if (ch->dma->flags & ATA_DMA_ACTIVE) { - if (!((dmastat = ch->dma->status(ch)) & ATA_BMSTAT_INTERRUPT)) + if (!((dmastat = (ATA_IDX_INB(ch, ATA_BMSTAT_PORT) & + ATA_BMSTAT_MASK)) & ATA_BMSTAT_INTERRUPT)) continue; - ATA_IDX_OUTB(ch, ATA_BMSTAT_PORT, dmastat | ATA_BMSTAT_INTERRUPT); + ATA_IDX_OUTB(ch, ATA_BMSTAT_PORT, dmastat|ATA_BMSTAT_INTERRUPT); DELAY(1); } ctlr->interrupt[unit].function(ch); @@ -1150,7 +1153,7 @@ static int ata_promise_old_dmastart(struct ata_channel *ch, - caddr_t data, int32_t count, int dir) + caddr_t data, int32_t count, int dir) { struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(ch->dev)); @@ -1158,14 +1161,19 @@ if ((error = ata_dmastart(ch, data, count, dir))) return error; - if (ch->flags & ATA_48BIT_ACTIVE) { - ATA_OUTB(ctlr->r_bmio, 0x11, - ATA_INB(ctlr->r_bmio, 0x11) | (ch->unit ? 0x08 : 0x02)); - ATA_OUTL(ctlr->r_bmio, 0x20, + ATA_OUTB(ctlr->r_io1, 0x11, + ATA_INB(ctlr->r_io1, 0x11) | (ch->unit ? 0x08 : 0x02)); + ATA_OUTL(ctlr->r_io1, 0x20, (dir ? 0x05000000 : 0x06000000) | (count >> 1)); } - return 0; + ATA_IDX_OUTL(ch, ATA_BMDTP_PORT, ch->dma->mdmatab); + ATA_IDX_OUTB(ch, ATA_BMCMD_PORT, dir ? ATA_BMCMD_WRITE_READ : 0); + ATA_IDX_OUTB(ch, ATA_BMSTAT_PORT, (ATA_IDX_INB(ch, ATA_BMSTAT_PORT) | + (ATA_BMSTAT_INTERRUPT | ATA_BMSTAT_ERROR))); + ATA_IDX_OUTB(ch, ATA_BMCMD_PORT, + ATA_IDX_INB(ch, ATA_BMCMD_PORT) | ATA_BMCMD_START_STOP); + return error; } static int @@ -1173,13 +1181,19 @@ { struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(ch->dev)); + int error; if (ch->flags & ATA_48BIT_ACTIVE) { - ATA_OUTB(ctlr->r_bmio, 0x11, - ATA_INB(ctlr->r_bmio, 0x11) & ~(ch->unit ? 0x08 : 0x02)); - ATA_OUTL(ctlr->r_bmio, 0x20, 0); + ATA_OUTB(ctlr->r_io1, 0x11, + ATA_INB(ctlr->r_io1, 0x11) & ~(ch->unit ? 0x08 : 0x02)); + ATA_OUTL(ctlr->r_io1, 0x20, 0); } - return ata_dmastop(ch); + error = ATA_IDX_INB(ch, ATA_BMSTAT_PORT); + ATA_IDX_OUTB(ch, ATA_BMCMD_PORT, + ATA_IDX_INB(ch, ATA_BMCMD_PORT) & ~ATA_BMCMD_START_STOP); + ATA_IDX_OUTB(ch, ATA_BMSTAT_PORT, ATA_BMSTAT_INTERRUPT | ATA_BMSTAT_ERROR); + ata_dmastop(ch); + return error; } /* @@ -1351,7 +1365,8 @@ pci_write_config(device_get_parent(ch->dev), 0x71, (ch->unit ? 0x08 : 0x04), 1); if (ch->dma->flags & ATA_DMA_ACTIVE) { - if (!((dmastat = ch->dma->status(ch)) & ATA_BMSTAT_INTERRUPT)) + if (!((dmastat = (ATA_IDX_INB(ch, ATA_BMSTAT_PORT) & + ATA_BMSTAT_MASK)) & ATA_BMSTAT_INTERRUPT)) continue; ATA_IDX_OUTB(ch, ATA_BMSTAT_PORT, dmastat | ATA_BMSTAT_INTERRUPT); DELAY(1); ==== //depot/projects/smpng/sys/dev/ata/ata-disk.c#28 (text+ko) ==== @@ -25,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/ata/ata-disk.c,v 1.150 2003/04/01 15:06:23 phk Exp $ + * $FreeBSD: src/sys/dev/ata/ata-disk.c,v 1.151 2003/04/07 14:14:29 sos Exp $ */ #include "opt_ata.h" @@ -203,14 +203,10 @@ ata_enclosure_print(atadev); - /* if this disk belongs to an ATA RAID dont print the probe */ - if (ata_raiddisk_attach(adp)) - adp->flags |= AD_F_RAID_SUBDISK; - else { - if (atadev->driver) { + /* only print probe banner if we are not part of a RAID array */ + if (!ata_raiddisk_attach(adp)) + if (atadev->driver) ad_print(adp); - } - } } void ==== //depot/projects/smpng/sys/dev/ata/ata-dma.c#29 (text+ko) ==== @@ -25,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/ata/ata-dma.c,v 1.114 2003/03/29 13:37:09 sos Exp $ + * $FreeBSD: src/sys/dev/ata/ata-dma.c,v 1.115 2003/04/07 14:12:12 sos Exp $ */ #include @@ -47,7 +47,6 @@ static void ata_dmafree(struct ata_channel *); static void ata_dmasetupd_cb(void *, bus_dma_segment_t *, int, int); static int ata_dmasetup(struct ata_device *, caddr_t, int32_t); -static int ata_dmastatus(struct ata_channel *); /* local vars */ static MALLOC_DEFINE(M_ATADMA, "ATA DMA", "ATA driver DMA"); @@ -73,7 +72,6 @@ ch->dma->setup = ata_dmasetup; ch->dma->start = ata_dmastart; ch->dma->stop = ata_dmastop; - ch->dma->status = ata_dmastatus; ch->dma->alignment = 2; return 0; } @@ -219,12 +217,6 @@ return 0; } -static int -ata_dmastatus(struct ata_channel *ch) -{ - return ch->dma->flags & ATA_DMA_ACTIVE; -} - int ata_dmastart(struct ata_channel *ch, caddr_t data, int32_t count, int dir) { ==== //depot/projects/smpng/sys/dev/ata/ata-pci.c#29 (text+ko) ==== @@ -25,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/ata/ata-pci.c,v 1.58 2003/03/29 13:37:09 sos Exp $ + * $FreeBSD: src/sys/dev/ata/ata-pci.c,v 1.59 2003/04/07 14:12:12 sos Exp $ */ #include "opt_ata.h" @@ -157,8 +157,8 @@ if ((cmd & PCIM_CMD_BUSMASTEREN) == PCIM_CMD_BUSMASTEREN) { int rid = ATA_BMADDR_RID; - if (!ctlr->r_mem) { - if (!(ctlr->r_bmio = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, + if (!ctlr->r_io2) { + if (!(ctlr->r_io1 = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0, ~0, 1, RF_ACTIVE))) device_printf(dev, "Busmastering DMA not configured\n"); } @@ -182,7 +182,7 @@ int retval = 0; retval += bus_print_child_header(dev, child); - retval += printf(": at 0x%lx", rman_get_start(ch->r_io[0].res)); + retval += printf(": at 0x%lx", rman_get_start(ch->r_io[ATA_IDX_ADDR].res)); if (ATA_MASTERDEV(dev)) retval += printf(" irq %d", 14 + ch->unit); @@ -390,10 +390,11 @@ } ch->r_io[ATA_ALTSTAT].res = altio; ch->r_io[ATA_ALTSTAT].offset = 0; + ch->r_io[ATA_IDX_ADDR].res = io; - if (ctlr->r_bmio) { + if (ctlr->r_io1) { for (i = ATA_BMCMD_PORT; i <= ATA_BMDTP_PORT; i++) { - ch->r_io[i].res = ctlr->r_bmio; + ch->r_io[i].res = ctlr->r_io1; ch->r_io[i].offset = (i - ATA_BMCMD_PORT)+(ch->unit * ATA_BMIOSIZE); } @@ -420,9 +421,9 @@ ATA_IDX_OUTL(ch, ATA_BMDTP_PORT, ch->dma->mdmatab); ATA_IDX_OUTB(ch, ATA_BMCMD_PORT, dir ? ATA_BMCMD_WRITE_READ : 0); ATA_IDX_OUTB(ch, ATA_BMSTAT_PORT, (ATA_IDX_INB(ch, ATA_BMSTAT_PORT) | - (ATA_BMSTAT_INTERRUPT | ATA_BMSTAT_ERROR))); + (ATA_BMSTAT_INTERRUPT | ATA_BMSTAT_ERROR))); ATA_IDX_OUTB(ch, ATA_BMCMD_PORT, - ATA_IDX_INB(ch, ATA_BMCMD_PORT) | ATA_BMCMD_START_STOP); + ATA_IDX_INB(ch, ATA_BMCMD_PORT) | ATA_BMCMD_START_STOP); return 0; } @@ -433,7 +434,7 @@ error = ATA_IDX_INB(ch, ATA_BMSTAT_PORT); ATA_IDX_OUTB(ch, ATA_BMCMD_PORT, - ATA_IDX_INB(ch, ATA_BMCMD_PORT) & ~ATA_BMCMD_START_STOP); + ATA_IDX_INB(ch, ATA_BMCMD_PORT) & ~ATA_BMCMD_START_STOP); ATA_IDX_OUTB(ch, ATA_BMSTAT_PORT, ATA_BMSTAT_INTERRUPT | ATA_BMSTAT_ERROR); ata_dmastop(ch); @@ -441,12 +442,6 @@ return (error & ATA_BMSTAT_MASK); } -static int -ata_pci_dmastatus(struct ata_channel *ch) -{ - return ATA_IDX_INB(ch, ATA_BMSTAT_PORT) & ATA_BMSTAT_MASK; -} - static int ata_pci_dmainit(struct ata_channel *ch) { @@ -457,7 +452,6 @@ ch->dma->start = ata_pci_dmastart; ch->dma->stop = ata_pci_dmastop; - ch->dma->status = ata_pci_dmastatus; return 0; } ==== //depot/projects/smpng/sys/dev/ata/ata-pci.h#4 (text+ko) ==== @@ -25,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/ata/ata-pci.h,v 1.5 2003/03/29 13:37:09 sos Exp $ + * $FreeBSD: src/sys/dev/ata/ata-pci.h,v 1.6 2003/04/07 14:12:12 sos Exp $ */ /* structure holding chipset config info */ @@ -40,8 +40,8 @@ /* structure describing a PCI ATA controller */ struct ata_pci_controller { - struct resource *r_bmio; - struct resource *r_mem; + struct resource *r_io1; + struct resource *r_io2; struct resource *r_irq; void *handle; struct ata_chip_id *chip; ==== //depot/projects/smpng/sys/dev/ata/ata-raid.c#18 (text+ko) ==== @@ -25,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/ata/ata-raid.c,v 1.58 2003/04/01 15:06:23 phk Exp $ + * $FreeBSD: src/sys/dev/ata/ata-raid.c,v 1.61 2003/04/08 18:01:30 sos Exp $ */ #include "opt_ata.h" @@ -64,6 +64,7 @@ static int ar_promise_write_conf(struct ar_softc *); static int ar_rw(struct ad_softc *, u_int32_t, int, caddr_t, int); static struct ata_device *ar_locate_disk(int); +static void ar_print_conf(struct ar_softc *); /* internal vars */ static struct ar_softc **ar_table = NULL; @@ -87,7 +88,7 @@ "inserted into ar%d disk%d as spare\n", array, disk); rdp->disks[disk].flags |= (AR_DF_PRESENT | AR_DF_SPARE); - AD_SOFTC(rdp->disks[disk])->flags = AD_F_RAID_SUBDISK; + AD_SOFTC(rdp->disks[disk])->flags |= AD_F_RAID_SUBDISK; ar_config_changed(rdp, 1); return 1; } @@ -133,6 +134,7 @@ "deleted from ar%d disk%d\n", array, disk); rdp->disks[disk].flags &= ~(AR_DF_PRESENT | AR_DF_ONLINE); AD_SOFTC(rdp->disks[disk])->flags &= ~AD_F_RAID_SUBDISK; + rdp->disks[disk].device = NULL; ar_config_changed(rdp, 1); return 1; } @@ -154,6 +156,8 @@ for (array = 0; array < MAX_ARRAYS; array++) { if (!(rdp = ar_table[array]) || !rdp->flags) continue; + if (bootverbose) + ar_print_conf(rdp); ar_attach_raid(rdp, 0); } } @@ -327,7 +331,7 @@ } for (disk = 0; disk < total_disks; disk++) - AD_SOFTC(rdp->disks[disk])->flags = AD_F_RAID_SUBDISK; + AD_SOFTC(rdp->disks[disk])->flags |= AD_F_RAID_SUBDISK; rdp->lun = array; if (rdp->flags & AR_F_RAID0) { @@ -492,11 +496,17 @@ case AR_F_RAID0 | AR_F_RAID1: tmplba = blkno / rdp->interleave; chunk = blkno % rdp->interleave; - if (tmplba == rdp->total_sectors / rdp->interleave) { - lbs = (rdp->total_sectors-(tmplba*rdp->interleave))/rdp->width; - drv = chunk / lbs; - lba = ((tmplba/rdp->width)*rdp->interleave) + chunk%lbs; - chunk = min(count, lbs); + if (blkno >= (rdp->total_sectors / (rdp->interleave * rdp->width)) * + (rdp->interleave * rdp->width) ) { + lbs = (rdp->total_sectors - + ((rdp->total_sectors / (rdp->interleave * rdp->width)) * + (rdp->interleave * rdp->width))) / rdp->width; + drv = (blkno - + ((rdp->total_sectors / (rdp->interleave * rdp->width)) * + (rdp->interleave * rdp->width))) / lbs; + lba = ((tmplba / rdp->width) * rdp->interleave) + + (blkno - ((tmplba / rdp->width) * rdp->interleave)) % lbs; + chunk = min(count, lbs); } else { drv = tmplba % rdp->width; @@ -972,6 +982,7 @@ raid->flags |= AR_F_HIGHPOINT_RAID; raid->disks[disk_number].device = adp->device; raid->disks[disk_number].flags = (AR_DF_PRESENT | AR_DF_ASSIGNED); + AD_SOFTC(raid->disks[disk_number])->flags |= AD_F_RAID_SUBDISK; raid->lun = array; if (info->magic == HPT_MAGIC_OK) { raid->disks[disk_number].flags |= AR_DF_ONLINE; @@ -1232,6 +1243,8 @@ raid->disks[info->raid.disk_number].flags |= AR_DF_PRESENT; raid->disks[info->raid.disk_number].disk_sectors = info->raid.disk_sectors; + AD_SOFTC(raid->disks[info->raid.disk_number])->flags |= + AD_F_RAID_SUBDISK; retval = 1; } break; @@ -1427,3 +1440,31 @@ } return NULL; } + +static void +ar_print_conf(struct ar_softc *config) +{ + int i; + + printf("lun %d\n", config->lun); + printf("magic_0 0x%08x\n", config->magic_0); + printf("magic_1 0x%08x\n", config->magic_1); + printf("flags 0x%02x %b\n", config->flags, config->flags, + "\20\16HIGHPOINT\15PROMISE\13REBUILDING\12DEGRADED\11READY\3SPAN\2RAID1\1RAID0\n"); + printf("total_disks %d\n", config->total_disks); + printf("generation %d\n", config->generation); + printf("width %d\n", config->width); + printf("heads %d\n", config->heads); + printf("sectors %d\n", config->sectors); + printf("cylinders %d\n", config->cylinders); + printf("total_sectors %lld\n", (long long)config->total_sectors); + printf("interleave %d\n", config->interleave); + printf("reserved %d\n", config->reserved); + printf("offset %d\n", config->offset); + for (i = 0; i < config->total_disks; i++) { + printf("disk %d: flags = 0x%02x %b\n", i, config->disks[i].flags, config->disks[i].flags, "\20\4ONLINE\3SPARE\2ASSIGNED\1PRESENT\n"); + if (config->disks[i].device) + printf(" %s\n", config->disks[i].device->name); + printf(" sectors %lld\n", (long long)config->disks[i].disk_sectors); + } +} ==== //depot/projects/smpng/sys/dev/ata/ata-raid.h#12 (text+ko) ==== @@ -25,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/ata/ata-raid.h,v 1.21 2003/02/25 15:33:36 sos Exp $ + * $FreeBSD: src/sys/dev/ata/ata-raid.h,v 1.22 2003/04/08 07:48:52 sos Exp $ */ /* misc defines */ @@ -221,11 +221,10 @@ u_int32_t checksum; } __packed; -int ata_raiddisk_probe(struct ad_softc *); int ata_raiddisk_attach(struct ad_softc *); int ata_raiddisk_detach(struct ad_softc *); void ata_raid_attach(void); int ata_raid_create(struct raid_setup *); int ata_raid_delete(int); -int ata_raid_status(int array, struct raid_status *); +int ata_raid_status(int, struct raid_status *); int ata_raid_rebuild(int); ==== //depot/projects/smpng/sys/dev/cardbus/cardbus_cis.c#13 (text+ko) ==== @@ -25,7 +25,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/cardbus/cardbus_cis.c,v 1.35 2003/02/19 05:47:01 imp Exp $ + * $FreeBSD: src/sys/dev/cardbus/cardbus_cis.c,v 1.36 2003/04/08 07:05:16 imp Exp $ */ /* @@ -849,6 +849,11 @@ res = bus_alloc_resource(cbdev, SYS_RES_MEMORY, &rid, 0, (dinfo->mprefetchable & dinfo->mbelow1mb)?0xFFFFF:~0UL, mem_psize, flags); + if (res == NULL) { + device_printf(cbdev, + "Can't get memory for prefetch mem\n"); + return (EIO); + } start = rman_get_start(res); end = rman_get_end(res); DEVPRINTF((cbdev, "Prefetchable memory at %x-%x\n", start, end)); @@ -890,6 +895,11 @@ res = bus_alloc_resource(cbdev, SYS_RES_MEMORY, &rid, 0, ((~dinfo->mprefetchable) & dinfo->mbelow1mb)?0xFFFFF:~0UL, mem_nsize, flags); + if (res == NULL) { + device_printf(cbdev, + "Can't get memory for non-prefetch mem\n"); + return (EIO); + } start = rman_get_start(res); end = rman_get_end(res); DEVPRINTF((cbdev, "Non-prefetchable memory at %x-%x\n", @@ -930,6 +940,11 @@ rid = 0; res = bus_alloc_resource(cbdev, SYS_RES_IOPORT, &rid, 0, (dinfo->ibelow1mb)?0xFFFFF:~0UL, io_size, flags); + if (res == NULL) { + device_printf(cbdev, + "Can't get memory for IO ports\n"); + return (EIO); + } start = rman_get_start(res); end = rman_get_end(res); DEVPRINTF((cbdev, "IO port at %x-%x\n", start, end)); @@ -951,6 +966,10 @@ rid = 0; res = bus_alloc_resource(cbdev, SYS_RES_IRQ, &rid, 0, ~0UL, 1, RF_SHAREABLE); + if (res == NULL) { + device_printf(cbdev, "Can't get memory for irq\n"); + return (EIO); + } start = rman_get_start(res); end = rman_get_end(res); bus_release_resource(cbdev, SYS_RES_IRQ, rid, res); ==== //depot/projects/smpng/sys/dev/ed/if_ed.c#12 (text+ko) ==== @@ -24,7 +24,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/ed/if_ed.c,v 1.216 2003/03/25 00:07:00 jake Exp $ + * $FreeBSD: src/sys/dev/ed/if_ed.c,v 1.217 2003/04/05 18:12:36 cognet Exp $ */ /* @@ -568,8 +568,8 @@ for (i = 0; i < memsize; ++i) { if (sc->mem_start[i]) { - device_printf(dev, "failed to clear shared memory at %x - check configuration\n", - kvtop(sc->mem_start + i)); + device_printf(dev, "failed to clear shared memory at %jx - check configuration\n", + (uintmax_t)kvtop(sc->mem_start + i)); /* * Disable 16 bit access to shared memory @@ -903,8 +903,8 @@ for (i = 0; i < memsize; ++i) if (sc->mem_start[i]) { - device_printf(dev, "failed to clear shared memory at %x - check configuration\n", - kvtop(sc->mem_start + i)); + device_printf(dev, "failed to clear shared memory at %jx - check configuration\n", + (uintmax_t)kvtop(sc->mem_start + i)); return (ENXIO); } return (0); >>> TRUNCATED FOR MAIL (1000 lines) <<< From owner-p4-projects@FreeBSD.ORG Tue Apr 8 12:03:39 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 4B38637B401; Tue, 8 Apr 2003 12:03:39 -0700 (PDT) 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 D988937B405 for ; Tue, 8 Apr 2003 12:03:38 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id F0F5943F75 for ; Tue, 8 Apr 2003 12:03:37 -0700 (PDT) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h38J3b0U074566 for ; Tue, 8 Apr 2003 12:03:37 -0700 (PDT) (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h38J3btB074563 for perforce@freebsd.org; Tue, 8 Apr 2003 12:03:37 -0700 (PDT) Date: Tue, 8 Apr 2003 12:03:37 -0700 (PDT) Message-Id: <200304081903.h38J3btB074563@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jhb@freebsd.org using -f From: John Baldwin To: Perforce Change Reviews Subject: PERFORCE change 28544 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, 08 Apr 2003 19:03:40 -0000 http://perforce.freebsd.org/chv.cgi?CH=28544 Change 28544 by jhb@jhb_laptop on 2003/04/08 12:03:00 IFC @28542. Affected files ... .. //depot/projects/smpng/sys/dev/fxp/if_fxp.c#28 integrate Differences ... ==== //depot/projects/smpng/sys/dev/fxp/if_fxp.c#28 (text+ko) ==== @@ -32,7 +32,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/fxp/if_fxp.c,v 1.165 2003/04/08 18:35:51 mux Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/fxp/if_fxp.c,v 1.166 2003/04/08 18:56:45 mux Exp $"); #include #include @@ -223,8 +223,9 @@ static int sysctl_hw_fxp_int_delay(SYSCTL_HANDLER_ARGS); static __inline void fxp_scb_wait(struct fxp_softc *sc); static __inline void fxp_scb_cmd(struct fxp_softc *sc, int cmd); -static __inline void fxp_dma_wait(volatile u_int16_t *status, - struct fxp_softc *sc); +static __inline void fxp_dma_wait(struct fxp_softc *sc, + volatile u_int16_t *status, bus_dma_tag_t dmat, + bus_dmamap_t map); static device_method_t fxp_methods[] = { /* Device interface */ @@ -288,12 +289,16 @@ } static __inline void -fxp_dma_wait(volatile u_int16_t *status, struct fxp_softc *sc) +fxp_dma_wait(struct fxp_softc *sc, volatile u_int16_t *status, + bus_dma_tag_t dmat, bus_dmamap_t map) { int i = 10000; - while (!(le16toh(*status) & FXP_CB_STATUS_C) && --i) + bus_dmamap_sync(dmat, map, BUS_DMASYNC_POSTREAD); + while (!(le16toh(*status) & FXP_CB_STATUS_C) && --i) { DELAY(2); + bus_dmamap_sync(dmat, map, BUS_DMASYNC_POSTREAD); + } if (i == 0) device_printf(sc->dev, "DMA timeout\n"); } @@ -1904,7 +1909,7 @@ CSR_WRITE_4(sc, FXP_CSR_SCB_GENERAL, sc->mcs_addr); fxp_scb_cmd(sc, FXP_SCB_COMMAND_CU_START); /* ...and wait for it to complete. */ - fxp_dma_wait(&mcsp->cb_status, sc); + fxp_dma_wait(sc, &mcsp->cb_status, sc->mcs_tag, sc->mcs_map); bus_dmamap_sync(sc->mcs_tag, sc->mcs_map, BUS_DMASYNC_POSTWRITE); } @@ -2016,7 +2021,7 @@ CSR_WRITE_4(sc, FXP_CSR_SCB_GENERAL, sc->fxp_desc.cbl_addr); fxp_scb_cmd(sc, FXP_SCB_COMMAND_CU_START); /* ...and wait for it to complete. */ - fxp_dma_wait(&cbp->cb_status, sc); + fxp_dma_wait(sc, &cbp->cb_status, sc->cbl_tag, sc->cbl_map); bus_dmamap_sync(sc->cbl_tag, sc->cbl_map, BUS_DMASYNC_POSTWRITE); /* @@ -2037,7 +2042,7 @@ bus_dmamap_sync(sc->cbl_tag, sc->cbl_map, BUS_DMASYNC_PREWRITE); fxp_scb_cmd(sc, FXP_SCB_COMMAND_CU_START); /* ...and wait for it to complete. */ - fxp_dma_wait(&cb_ias->cb_status, sc); + fxp_dma_wait(sc, &cb_ias->cb_status, sc->cbl_tag, sc->cbl_map); bus_dmamap_sync(sc->cbl_tag, sc->cbl_map, BUS_DMASYNC_POSTWRITE); /* @@ -2555,7 +2560,7 @@ CSR_WRITE_4(sc, FXP_CSR_SCB_GENERAL, sc->fxp_desc.cbl_addr); fxp_scb_cmd(sc, FXP_SCB_COMMAND_CU_START); /* ...and wait for it to complete. */ - fxp_dma_wait(&cbp->cb_status, sc); + fxp_dma_wait(sc, &cbp->cb_status, sc->cbl_tag, sc->cbl_map); bus_dmamap_sync(sc->cbl_tag, sc->cbl_map, BUS_DMASYNC_POSTWRITE); device_printf(sc->dev, "Microcode loaded, int_delay: %d usec bundle_max: %d\n", From owner-p4-projects@FreeBSD.ORG Tue Apr 8 12:05:49 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id C0C7637B401; Tue, 8 Apr 2003 12:05:48 -0700 (PDT) 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 70FCF37B407 for ; Tue, 8 Apr 2003 12:05:48 -0700 (PDT) Received: from mail.speakeasy.net (mail12.speakeasy.net [216.254.0.212]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1B89743FBD for ; Tue, 8 Apr 2003 12:05:47 -0700 (PDT) (envelope-from jhb@FreeBSD.org) Received: (qmail 6762 invoked from network); 8 Apr 2003 19:05:53 -0000 Received: from unknown (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender )encrypted SMTP for ; 8 Apr 2003 19:05:53 -0000 Received: from laptop.baldwin.cx (gw1.twc.weather.com [216.133.140.1]) by server.baldwin.cx (8.12.8/8.12.8) with ESMTP id h38J5iOv046697; Tue, 8 Apr 2003 15:05:45 -0400 (EDT) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.5.4 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <200304081859.h38IxT3E073114@repoman.freebsd.org> Date: Tue, 08 Apr 2003 15:05:44 -0400 (EDT) From: John Baldwin To: Peter Wemm cc: Perforce Change Reviews Subject: RE: PERFORCE change 28541 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, 08 Apr 2003 19:05:49 -0000 On 08-Apr-2003 Peter Wemm wrote: > http://perforce.freebsd.org/chv.cgi?CH=28541 > > Change 28541 by peter@peter_daintree on 2003/04/08 11:58:30 > > 64 bit counters. More crap that should be redesigned and done in C. Perhaps in some sort of MI way maybe called from MD code. > Affected files ... > > .. //depot/projects/hammer/sys/x86_64/isa/vector.s#8 edit > > Differences ... > > ==== //depot/projects/hammer/sys/x86_64/isa/vector.s#8 (text+ko) ==== > > @@ -19,12 +19,12 @@ > > .globl intrcnt, eintrcnt > intrcnt: > - .space INTRCNT_COUNT * 4 > + .space INTRCNT_COUNT * 8 > eintrcnt: > > .globl intrnames, eintrnames > intrnames: > - .space INTRCNT_COUNT * 16 > + .space INTRCNT_COUNT * 32 > eintrnames: > .text > -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ From owner-p4-projects@FreeBSD.ORG Tue Apr 8 14:05:21 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id AEDED37B404; Tue, 8 Apr 2003 14:05:20 -0700 (PDT) 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 4BC8F37B401 for ; Tue, 8 Apr 2003 14:05:20 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id D6B3143F75 for ; Tue, 8 Apr 2003 14:05:19 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h38L5J0U090186 for ; Tue, 8 Apr 2003 14:05:19 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h38L5Juv090183 for perforce@freebsd.org; Tue, 8 Apr 2003 14:05:19 -0700 (PDT) Date: Tue, 8 Apr 2003 14:05:19 -0700 (PDT) Message-Id: <200304082105.h38L5Juv090183@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28561 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, 08 Apr 2003 21:05:21 -0000 http://perforce.freebsd.org/chv.cgi?CH=28561 Change 28561 by peter@peter_daintree on 2003/04/08 14:04:44 drop the selector etc args and add ist index Affected files ... .. //depot/projects/hammer/sys/x86_64/include/md_var.h#14 edit Differences ... ==== //depot/projects/hammer/sys/x86_64/include/md_var.h#14 (text+ko) ==== @@ -75,7 +75,7 @@ void fillw(int /*u_short*/ pat, void *base, size_t cnt); void pagezero(void *addr); int is_physical_memory(vm_offset_t addr); -void setidt(int idx, alias_for_inthand_t *func, int typ, int dpl, int selec); +void setidt(int idx, alias_for_inthand_t *func, int typ, int ist); void swi_vm(void *); #endif /* !_MACHINE_MD_VAR_H_ */ From owner-p4-projects@FreeBSD.ORG Tue Apr 8 14:06:23 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 93D5737B404; Tue, 8 Apr 2003 14:06:22 -0700 (PDT) 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 344CA37B401 for ; Tue, 8 Apr 2003 14:06:22 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id BE72443F85 for ; Tue, 8 Apr 2003 14:06:21 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h38L6L0U090281 for ; Tue, 8 Apr 2003 14:06:21 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h38L6LBc090278 for perforce@freebsd.org; Tue, 8 Apr 2003 14:06:21 -0700 (PDT) Date: Tue, 8 Apr 2003 14:06:21 -0700 (PDT) Message-Id: <200304082106.h38L6LBc090278@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28562 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, 08 Apr 2003 21:06:23 -0000 http://perforce.freebsd.org/chv.cgi?CH=28562 Change 28562 by peter@peter_daintree on 2003/04/08 14:05:34 It would help if the high bits start address wasn't rounded up. Affected files ... .. //depot/projects/hammer/sys/x86_64/include/segments.h#13 edit Differences ... ==== //depot/projects/hammer/sys/x86_64/include/segments.h#13 (text+ko) ==== @@ -108,7 +108,7 @@ u_int64_t gd_type:5; /* segment type */ u_int64_t gd_dpl:2; /* segment descriptor priority level */ u_int64_t gd_p:1; /* segment descriptor present */ - u_int64_t gd_hioffset:48; /* gate offset (msb) */ + u_int64_t gd_hioffset:48 __packed; /* gate offset (msb) */ u_int64_t sd_xx1:32; }; From owner-p4-projects@FreeBSD.ORG Tue Apr 8 14:06:24 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id C276937B40E; Tue, 8 Apr 2003 14:06:23 -0700 (PDT) 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 B0C0E37B40B for ; Tue, 8 Apr 2003 14:06:22 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3D6EB43F85 for ; Tue, 8 Apr 2003 14:06:22 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h38L6M0U090287 for ; Tue, 8 Apr 2003 14:06:22 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h38L6L6I090284 for perforce@freebsd.org; Tue, 8 Apr 2003 14:06:21 -0700 (PDT) Date: Tue, 8 Apr 2003 14:06:21 -0700 (PDT) Message-Id: <200304082106.h38L6L6I090284@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28563 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, 08 Apr 2003 21:06:24 -0000 http://perforce.freebsd.org/chv.cgi?CH=28563 Change 28563 by peter@peter_daintree on 2003/04/08 14:06:00 no need for this mess to be public. It is static within machdep.c Affected files ... .. //depot/projects/hammer/sys/x86_64/include/tss.h#6 edit Differences ... ==== //depot/projects/hammer/sys/x86_64/include/tss.h#6 (text+ko) ==== @@ -70,13 +70,4 @@ }; #pragma pack() -#ifdef _KERNEL -/* Hack to fight with the crazy alignment */ -struct aligned_tss { - u_int32_t pad; - struct x86_64tss tss __packed; -}; -extern struct aligned_tss common_tss; -#endif - #endif /* _MACHINE_TSS_H_ */ From owner-p4-projects@FreeBSD.ORG Tue Apr 8 14:11:30 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 1B5D337B404; Tue, 8 Apr 2003 14:11:30 -0700 (PDT) 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 AF2A337B401 for ; Tue, 8 Apr 2003 14:11:29 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2D74F43F93 for ; Tue, 8 Apr 2003 14:11:29 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h38LBT0U090768 for ; Tue, 8 Apr 2003 14:11:29 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h38LBS1V090761 for perforce@freebsd.org; Tue, 8 Apr 2003 14:11:28 -0700 (PDT) Date: Tue, 8 Apr 2003 14:11:28 -0700 (PDT) Message-Id: <200304082111.h38LBS1V090761@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28564 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, 08 Apr 2003 21:11:31 -0000 http://perforce.freebsd.org/chv.cgi?CH=28564 Change 28564 by peter@peter_daintree on 2003/04/08 14:10:38 add a double fault handler. I'm not sure how useful this will be though since we didn't get a %cr3 reload. The hardware task switch stuff is gone in 64 bit mode. Remove leftovers. clean up setidt() args. Connect doublefault handler on ist1. Affected files ... .. //depot/projects/hammer/sys/x86_64/x86_64/machdep.c#54 edit .. //depot/projects/hammer/sys/x86_64/x86_64/trap.c#23 edit Differences ... ==== //depot/projects/hammer/sys/x86_64/x86_64/machdep.c#54 (text+ko) ==== @@ -111,9 +111,7 @@ #include extern void hammer_time(void); -#if 0 extern void dblfault_handler(void); -#endif #if 0 extern void printcpuinfo(void); /* XXX header file */ @@ -552,16 +550,16 @@ static struct gate_descriptor idt0[NIDT]; struct gate_descriptor *idt = &idt0[0]; /* interrupt descriptor table */ -#if 0 -static struct x86_64tss dblfault_tss; static char dblfault_stack[PAGE_SIZE]; -#endif /* * Nasty hack to arrange internal longword alignment. - * Probably not necessary. + * What were they thinking?? */ -static struct aligned_tss common_tss; +static struct { + u_int32_t pad; + struct x86_64tss tss __packed; +} common_tss; /* software prototypes -- in more palatable form */ @@ -612,38 +610,27 @@ 0, /* long */ 0, /* default 32 vs 16 bit size */ 0 /* limit granularity (byte/page units)*/ }, -#if 0 -/* GPANIC_SEL 4 Panic Tss Descriptor */ -{ (int) &dblfault_tss, /* segment base address */ - sizeof(struct x86_64tss)-1,/* length - all address space */ - SDT_SYSTSS, /* segment type */ - 0, /* segment descriptor priority level */ - 1, /* segment descriptor present */ - 0, /* long */ - 0, /* unused - default 32 vs 16 bit size */ - 0 /* limit granularity (byte/page units)*/ }, -#endif }; void -setidt(idx, func, typ, dpl, selec) +setidt(idx, func, typ, ist) int idx; inthand_t *func; int typ; - int dpl; - int selec; + int ist; { struct gate_descriptor *ip; ip = idt + idx; ip->gd_looffset = (uintptr_t)func; - ip->gd_selector = selec; - ip->gd_ist = 0; + ip->gd_selector = GSEL(GCODE_SEL, SEL_KPL); + ip->gd_ist = ist; ip->gd_xx = 0; ip->gd_type = typ; - ip->gd_dpl = dpl; + ip->gd_dpl = SEL_KPL; ip->gd_p = 1; ip->gd_hioffset = ((uintptr_t)func)>>16 ; +printf("setidt: idx:%2d 0x%08x 0x%08x 0x%08x 0x%08x\n", idx, ((u_int32_t *)ip)[0], ((u_int32_t *)ip)[1], ((u_int32_t *)ip)[2], ((u_int32_t *)ip)[3]); } #define IDTVEC(name) __CONCAT(X,name) @@ -1200,51 +1187,28 @@ /* exceptions */ for (x = 0; x < NIDT; x++) - setidt(x, &IDTVEC(rsvd), SDT_SYSTGT, SEL_KPL, - GSEL(GCODE_SEL, SEL_KPL)); - setidt(0, &IDTVEC(div), SDT_SYSTGT, SEL_KPL, - GSEL(GCODE_SEL, SEL_KPL)); - setidt(1, &IDTVEC(dbg), SDT_SYSIGT, SEL_KPL, - GSEL(GCODE_SEL, SEL_KPL)); - setidt(2, &IDTVEC(nmi), SDT_SYSTGT, SEL_KPL, - GSEL(GCODE_SEL, SEL_KPL)); - setidt(3, &IDTVEC(bpt), SDT_SYSIGT, SEL_UPL, - GSEL(GCODE_SEL, SEL_KPL)); - setidt(4, &IDTVEC(ofl), SDT_SYSTGT, SEL_UPL, - GSEL(GCODE_SEL, SEL_KPL)); - setidt(5, &IDTVEC(bnd), SDT_SYSTGT, SEL_KPL, - GSEL(GCODE_SEL, SEL_KPL)); - setidt(6, &IDTVEC(ill), SDT_SYSTGT, SEL_KPL, - GSEL(GCODE_SEL, SEL_KPL)); - setidt(7, &IDTVEC(dna), SDT_SYSTGT, SEL_KPL, - GSEL(GCODE_SEL, SEL_KPL)); -#if 0 - setidt(8, 0, SDT_SYSTASKGT, SEL_KPL, GSEL(GPANIC_SEL, SEL_KPL)); -#endif - setidt(9, &IDTVEC(fpusegm), SDT_SYSTGT, SEL_KPL, - GSEL(GCODE_SEL, SEL_KPL)); - setidt(10, &IDTVEC(tss), SDT_SYSTGT, SEL_KPL, - GSEL(GCODE_SEL, SEL_KPL)); - setidt(11, &IDTVEC(missing), SDT_SYSTGT, SEL_KPL, - GSEL(GCODE_SEL, SEL_KPL)); - setidt(12, &IDTVEC(stk), SDT_SYSTGT, SEL_KPL, - GSEL(GCODE_SEL, SEL_KPL)); - setidt(13, &IDTVEC(prot), SDT_SYSTGT, SEL_KPL, - GSEL(GCODE_SEL, SEL_KPL)); - setidt(14, &IDTVEC(page), SDT_SYSTGT, SEL_KPL, - GSEL(GCODE_SEL, SEL_KPL)); - setidt(15, &IDTVEC(rsvd), SDT_SYSTGT, SEL_KPL, - GSEL(GCODE_SEL, SEL_KPL)); - setidt(16, &IDTVEC(fpu), SDT_SYSTGT, SEL_KPL, - GSEL(GCODE_SEL, SEL_KPL)); - setidt(17, &IDTVEC(align), SDT_SYSTGT, SEL_KPL, - GSEL(GCODE_SEL, SEL_KPL)); - setidt(18, &IDTVEC(mchk), SDT_SYSTGT, SEL_KPL, - GSEL(GCODE_SEL, SEL_KPL)); - setidt(19, &IDTVEC(xmm), SDT_SYSTGT, SEL_KPL, - GSEL(GCODE_SEL, SEL_KPL)); - setidt(0x80, &IDTVEC(int0x80_syscall), SDT_SYSTGT, SEL_UPL, - GSEL(GCODE_SEL, SEL_KPL)); + setidt(x, &IDTVEC(rsvd), SDT_SYSTGT, 0); + setidt(0, &IDTVEC(div), SDT_SYSTGT, 0); + setidt(1, &IDTVEC(dbg), SDT_SYSIGT, 0); + setidt(2, &IDTVEC(nmi), SDT_SYSTGT, 0); + setidt(3, &IDTVEC(bpt), SDT_SYSIGT, 0); + setidt(4, &IDTVEC(ofl), SDT_SYSTGT, 0); + setidt(5, &IDTVEC(bnd), SDT_SYSTGT, 0); + setidt(6, &IDTVEC(ill), SDT_SYSTGT, 0); + setidt(7, &IDTVEC(dna), SDT_SYSTGT, 0); + setidt(8, (inthand_t *)dblfault_handler, SDT_SYSIGT, 1); + setidt(9, &IDTVEC(fpusegm), SDT_SYSTGT, 0); + setidt(10, &IDTVEC(tss), SDT_SYSTGT, 0); + setidt(11, &IDTVEC(missing), SDT_SYSTGT, 0); + setidt(12, &IDTVEC(stk), SDT_SYSTGT, 0); + setidt(13, &IDTVEC(prot), SDT_SYSTGT, 0); + setidt(14, &IDTVEC(page), SDT_SYSTGT, 0); + setidt(15, &IDTVEC(rsvd), SDT_SYSTGT, 0); + setidt(16, &IDTVEC(fpu), SDT_SYSTGT, 0); + setidt(17, &IDTVEC(align), SDT_SYSTGT, 0); + setidt(18, &IDTVEC(mchk), SDT_SYSTGT, 0); + setidt(19, &IDTVEC(xmm), SDT_SYSTGT, 0); + setidt(0x80, &IDTVEC(int0x80_syscall), SDT_SYSTGT, 0); r_idt.rd_limit = sizeof(idt0) - 1; r_idt.rd_base = (long) idt; @@ -1268,36 +1232,22 @@ #if 0 finishidentcpu(); /* Final stage of CPU initialization */ #endif - setidt(6, &IDTVEC(ill), SDT_SYSTGT, SEL_KPL, - GSEL(GCODE_SEL, SEL_KPL)); - setidt(13, &IDTVEC(prot), SDT_SYSTGT, SEL_KPL, - GSEL(GCODE_SEL, SEL_KPL)); + setidt(6, &IDTVEC(ill), SDT_SYSTGT, 0); + setidt(13, &IDTVEC(prot), SDT_SYSTGT, 0); #if 0 initializecpu(); /* Initialize CPU registers */ #endif /* make an initial tss so cpu can get interrupt stack on syscall! */ common_tss.tss.tss_rsp0 = thread0.td_kstack + KSTACK_PAGES * PAGE_SIZE - sizeof(struct pcb); + common_tss.tss.tss_rsp1 = common_tss.tss.tss_rsp0; + common_tss.tss.tss_rsp2 = common_tss.tss.tss_rsp0; + /* doublefault stack space, runs on ist1 */ + common_tss.tss.tss_ist1 = (long)&dblfault_stack[sizeof(dblfault_stack)]; gsel_tss = GSEL(GPROC0_SEL, SEL_KPL); ltr(gsel_tss); -#if 0 - dblfault_tss.tss_esp = dblfault_tss.tss_esp0 = dblfault_tss.tss_esp1 = - dblfault_tss.tss_esp2 = (int)&dblfault_stack[sizeof(dblfault_stack)]; - dblfault_tss.tss_ss = dblfault_tss.tss_ss0 = dblfault_tss.tss_ss1 = - dblfault_tss.tss_ss2 = GSEL(GDATA_SEL, SEL_KPL); -#ifdef PAE - dblfault_tss.tss_cr3 = IdlePDPT; -#else - dblfault_tss.tss_cr3 = IdlePTD; -#endif - dblfault_tss.tss_eip = (int)dblfault_handler; - dblfault_tss.tss_rflags = PSL_KERNEL; - dblfault_tss.tss_ds = dblfault_tss.tss_es = dblfault_tss.tss_fs = - dblfault_tss.tss_gs = GSEL(GDATA_SEL, SEL_KPL); - dblfault_tss.tss_cs = GSEL(GCODE_SEL, SEL_KPL); -#endif getmemsize(kmdp, physfree); init_param2(physmem); ==== //depot/projects/hammer/sys/x86_64/x86_64/trap.c#23 (text+ko) ==== @@ -651,29 +651,18 @@ panic("unknown/reserved trap"); } -#if 0 /* * Double fault handler. Called when a fault occurs while writing * a frame for a trap/exception onto the stack. This usually occurs * when the stack overflows (such is the case with infinite recursion, * for example). - * - * XXX Note that the current PTD gets replaced by IdlePTD when the - * task switch occurs. This means that the stack that was active at - * the time of the double fault is not available at unless - * the machine was idle when the double fault occurred. The downside - * of this is that "trace " in ddb won't work. */ void dblfault_handler() { - printf("\nFatal double fault:\n"); - printf("eip = 0x%x\n", common_tss.tss_rip); - printf("esp = 0x%x\n", common_tss.tss_rsp); - printf("ebp = 0x%x\n", common_tss.tss_rbp); + printf("\nFatal double fault\n"); panic("double fault"); } -#endif /* * syscall - system call request C handler From owner-p4-projects@FreeBSD.ORG Tue Apr 8 15:19:53 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 727B737B404; Tue, 8 Apr 2003 15:19:53 -0700 (PDT) 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 126DC37B401 for ; Tue, 8 Apr 2003 15:19:53 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id B1B3E43FAF for ; Tue, 8 Apr 2003 15:19:52 -0700 (PDT) (envelope-from marcel@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h38MJq0U096199 for ; Tue, 8 Apr 2003 15:19:52 -0700 (PDT) (envelope-from marcel@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h38MJqqR096196 for perforce@freebsd.org; Tue, 8 Apr 2003 15:19:52 -0700 (PDT) Date: Tue, 8 Apr 2003 15:19:52 -0700 (PDT) Message-Id: <200304082219.h38MJqqR096196@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 28566 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, 08 Apr 2003 22:19:54 -0000 http://perforce.freebsd.org/chv.cgi?CH=28566 Change 28566 by marcel@marcel_nfs on 2003/04/08 15:19:18 We never save and restore iip when doing context switches (neither kernel nor userland). Set rp to the new threads entry point. Affected files ... .. //depot/projects/ia64_epc/sys/ia64/ia64/vm_machdep.c#5 edit Differences ... ==== //depot/projects/ia64_epc/sys/ia64/ia64/vm_machdep.c#5 (text+ko) ==== @@ -293,7 +293,7 @@ td2->td_pcb->pcb_preserved.gr4 = (u_int64_t)fork_return; td2->td_pcb->pcb_preserved.gr5 = FDESC_FUNC(exception_restore); td2->td_pcb->pcb_preserved.gr6 = (u_int64_t)td2; - td2->td_pcb->pcb_special.iip = FDESC_FUNC(fork_trampoline); + td2->td_pcb->pcb_special.rp = FDESC_FUNC(fork_trampoline); } /* From owner-p4-projects@FreeBSD.ORG Tue Apr 8 15:35:13 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id C67BC37B401; Tue, 8 Apr 2003 15:35:12 -0700 (PDT) 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 4B79C37B405 for ; Tue, 8 Apr 2003 15:35:12 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id E600643FA3 for ; Tue, 8 Apr 2003 15:35:11 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h38MZB0U097476 for ; Tue, 8 Apr 2003 15:35:11 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h38MZBuh097473 for perforce@freebsd.org; Tue, 8 Apr 2003 15:35:11 -0700 (PDT) Date: Tue, 8 Apr 2003 15:35:11 -0700 (PDT) Message-Id: <200304082235.h38MZBuh097473@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28567 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, 08 Apr 2003 22:35:13 -0000 http://perforce.freebsd.org/chv.cgi?CH=28567 Change 28567 by peter@peter_daintree on 2003/04/08 15:34:13 remove damn noisy printf in setidt(). remove tss_rsp1/rsp2 - we dont use ring 1 or 2 anywhere (neither on i386) add comment about missing an update of tss_rsp0 in cpu_switch() Affected files ... .. //depot/projects/hammer/sys/x86_64/x86_64/machdep.c#55 edit Differences ... ==== //depot/projects/hammer/sys/x86_64/x86_64/machdep.c#55 (text+ko) ==== @@ -630,7 +630,6 @@ ip->gd_dpl = SEL_KPL; ip->gd_p = 1; ip->gd_hioffset = ((uintptr_t)func)>>16 ; -printf("setidt: idx:%2d 0x%08x 0x%08x 0x%08x 0x%08x\n", idx, ((u_int32_t *)ip)[0], ((u_int32_t *)ip)[1], ((u_int32_t *)ip)[2], ((u_int32_t *)ip)[3]); } #define IDTVEC(name) __CONCAT(X,name) @@ -1240,8 +1239,7 @@ /* make an initial tss so cpu can get interrupt stack on syscall! */ common_tss.tss.tss_rsp0 = thread0.td_kstack + KSTACK_PAGES * PAGE_SIZE - sizeof(struct pcb); - common_tss.tss.tss_rsp1 = common_tss.tss.tss_rsp0; - common_tss.tss.tss_rsp2 = common_tss.tss.tss_rsp0; + /* XXX we need to update tss_rsp0 in cpu_switch */ /* doublefault stack space, runs on ist1 */ common_tss.tss.tss_ist1 = (long)&dblfault_stack[sizeof(dblfault_stack)]; From owner-p4-projects@FreeBSD.ORG Tue Apr 8 15:35:14 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 01E6A37B404; Tue, 8 Apr 2003 15:35:13 -0700 (PDT) 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 2156637B40C for ; Tue, 8 Apr 2003 15:35:13 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6D6D643F75 for ; Tue, 8 Apr 2003 15:35:12 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h38MZC0U097482 for ; Tue, 8 Apr 2003 15:35:12 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h38MZBKN097479 for perforce@freebsd.org; Tue, 8 Apr 2003 15:35:11 -0700 (PDT) Date: Tue, 8 Apr 2003 15:35:11 -0700 (PDT) Message-Id: <200304082235.h38MZBKN097479@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28568 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, 08 Apr 2003 22:35:14 -0000 http://perforce.freebsd.org/chv.cgi?CH=28568 Change 28568 by peter@peter_daintree on 2003/04/08 15:34:50 setidt() takes less args now. Affected files ... .. //depot/projects/hammer/sys/x86_64/isa/intr_machdep.c#11 edit Differences ... ==== //depot/projects/hammer/sys/x86_64/isa/intr_machdep.c#11 (text+ko) ==== @@ -375,7 +375,7 @@ intr_unit[intr] = arg; setidt(ICU_OFFSET + intr, flags & INTR_FAST ? fastintr[intr] : slowintr[intr], - SDT_SYSIGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL)); + SDT_SYSIGT, 0); INTREN(1 << intr); mtx_unlock_spin(&icu_lock); intr_restore(crit); @@ -403,8 +403,7 @@ intr_countp[intr] = &intrcnt[1 + intr]; intr_handler[intr] = isa_strayintr; intr_unit[intr] = &intr_unit[intr]; - setidt(ICU_OFFSET + intr, slowintr[intr], SDT_SYSIGT, SEL_KPL, - GSEL(GCODE_SEL, SEL_KPL)); + setidt(ICU_OFFSET + intr, slowintr[intr], SDT_SYSIGT, 0); mtx_unlock_spin(&icu_lock); intr_restore(crit); return (0); From owner-p4-projects@FreeBSD.ORG Tue Apr 8 15:37:16 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 787C037B404; Tue, 8 Apr 2003 15:37:16 -0700 (PDT) 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 2FFF137B401 for ; Tue, 8 Apr 2003 15:37:16 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id D00F343F85 for ; Tue, 8 Apr 2003 15:37:15 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h38MbF0U097574 for ; Tue, 8 Apr 2003 15:37:15 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h38MbFX6097571 for perforce@freebsd.org; Tue, 8 Apr 2003 15:37:15 -0700 (PDT) Date: Tue, 8 Apr 2003 15:37:15 -0700 (PDT) Message-Id: <200304082237.h38MbFX6097571@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28569 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, 08 Apr 2003 22:37:17 -0000 http://perforce.freebsd.org/chv.cgi?CH=28569 Change 28569 by peter@peter_daintree on 2003/04/08 15:36:30 use 8-byte array indexes in the pointer arrays, thanks Jake. Affected files ... .. //depot/projects/hammer/sys/x86_64/isa/icu_vector.s#8 edit Differences ... ==== //depot/projects/hammer/sys/x86_64/isa/icu_vector.s#8 (text+ko) ==== @@ -45,11 +45,11 @@ call critical_enter ; \ movq PCPU(CURTHREAD),%rbx ; \ incl TD_INTR_NESTING_LEVEL(%rbx) ; \ - movq intr_unit + (irq_num) * 4, %rdi ; \ - call *intr_handler + (irq_num) * 4 ; /* do the work ASAP */ \ + movq intr_unit + (irq_num) * 8, %rdi ; \ + call *intr_handler + (irq_num) * 8 ; /* do the work ASAP */ \ enable_icus ; /* (re)enable ASAP (helps edge trigger?) */ \ incl cnt+V_INTR ; /* book-keeping can wait */ \ - movq intr_countp + (irq_num) * 4,%rax ; \ + movq intr_countp + (irq_num) * 8,%rax ; \ incq (%rax) ; \ decl TD_INTR_NESTING_LEVEL(%rbx) ; \ call critical_exit ; \ From owner-p4-projects@FreeBSD.ORG Tue Apr 8 15:38:18 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 748CD37B404; Tue, 8 Apr 2003 15:38:18 -0700 (PDT) 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 1737E37B401 for ; Tue, 8 Apr 2003 15:38:18 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id B6A0A43F75 for ; Tue, 8 Apr 2003 15:38:17 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h38McH0U097624 for ; Tue, 8 Apr 2003 15:38:17 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h38McHTJ097621 for perforce@freebsd.org; Tue, 8 Apr 2003 15:38:17 -0700 (PDT) Date: Tue, 8 Apr 2003 15:38:17 -0700 (PDT) Message-Id: <200304082238.h38McHTJ097621@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28570 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, 08 Apr 2003 22:38:19 -0000 http://perforce.freebsd.org/chv.cgi?CH=28570 Change 28570 by peter@peter_daintree on 2003/04/08 15:37:40 Use iretq, not iret. DOH! this is why I was getting a GPF on interrupts. The manual made me do it. Tidy some comments. Affected files ... .. //depot/projects/hammer/sys/x86_64/x86_64/exception.s#17 edit Differences ... ==== //depot/projects/hammer/sys/x86_64/x86_64/exception.s#17 (text+ko) ==== @@ -150,12 +150,8 @@ calltrap: FAKE_MCOUNT(btrap) /* init "from" btrap -> calltrap */ call trap - - /* - * Return via doreti to handle ASTs. - */ MEXITCOUNT - jmp doreti + jmp doreti /* Handle any pending ASTs */ /* * Call gate entry for FreeBSD ELF and Linux/NetBSD syscall (int 0x80) @@ -203,13 +199,8 @@ movl $1,TD_CRITNEST(%rbx) sti /* enable interrupts */ call fork_exit - /* cut from syscall */ - - /* - * Return via doreti to handle ASTs. - */ MEXITCOUNT - jmp doreti + jmp doreti /* Handle any ASTs */ /* @@ -282,7 +273,7 @@ addq $16,%rsp .globl doreti_iret doreti_iret: - iret + iretq /* * doreti_iret_fault and friends. Alternative return code for From owner-p4-projects@FreeBSD.ORG Tue Apr 8 15:50:34 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 0B58537B404; Tue, 8 Apr 2003 15:50:34 -0700 (PDT) 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 B684E37B401 for ; Tue, 8 Apr 2003 15:50:33 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5BDAF43FA3 for ; Tue, 8 Apr 2003 15:50:33 -0700 (PDT) (envelope-from marcel@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h38MoX0U098506 for ; Tue, 8 Apr 2003 15:50:33 -0700 (PDT) (envelope-from marcel@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h38MoWb1098485 for perforce@freebsd.org; Tue, 8 Apr 2003 15:50:32 -0700 (PDT) Date: Tue, 8 Apr 2003 15:50:32 -0700 (PDT) Message-Id: <200304082250.h38MoWb1098485@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 28571 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, 08 Apr 2003 22:50:35 -0000 http://perforce.freebsd.org/chv.cgi?CH=28571 Change 28571 by marcel@marcel_nfs on 2003/04/08 15:50:16 Have savectx() return 0 and restorectx() return 1. That way we can swap contexts without actually having to create a swapctx() function, because we can write it like: if (!savectx(oldpcb)) restorectx(newpcb); This pretty much behaves like setjmp()/longjmp() this way. The prime reason is that we have the right pmap installed when we save and restore the contexts. Keep swapctx() around for now in case things don't turn out the way I thought it would do. Affected files ... .. //depot/projects/ia64_epc/sys/ia64/ia64/context.s#7 edit .. //depot/projects/ia64_epc/sys/ia64/ia64/machdep.c#7 edit .. //depot/projects/ia64_epc/sys/ia64/include/pcb.h#5 edit Differences ... ==== //depot/projects/ia64_epc/sys/ia64/ia64/context.s#7 (text+ko) ==== @@ -148,9 +148,12 @@ ldf.fill f26=[r32],32 ldf.fill f27=[r31],32 ;; +{ .mmi ldf.fill f28=[r32],32 ldf.fill f29=[r31],32 + add r8=1,r0 ;; +} { .mmb ldf.fill f30=[r32] ldf.fill f31=[r31] @@ -284,9 +287,9 @@ stf.spill [r31]=f29,32 stf.spill [r32]=f30 ;; -{ .mfb +{ .mib stf.spill [r31]=f31 - nop 0 +(p15) add r8=0,r0 (p15) br.ret.sptk rp ;; } ==== //depot/projects/ia64_epc/sys/ia64/ia64/machdep.c#7 (text+ko) ==== @@ -215,9 +215,11 @@ oldpcb = old->td_pcb; oldpcb->pcb_current_pmap = PCPU_GET(current_pmap); - newpcb = new->td_pcb; - pmap_install(newpcb->pcb_current_pmap); - swapctx(oldpcb, newpcb); + if (!savectx(oldpcb)) { + newpcb = new->td_pcb; + pmap_install(newpcb->pcb_current_pmap); + restorectx(newpcb); + } } void ==== //depot/projects/ia64_epc/sys/ia64/include/pcb.h#5 (text+ko) ==== @@ -49,8 +49,8 @@ }; #ifdef _KERNEL -void restorectx(struct pcb *); -void savectx(struct pcb *); +void restorectx(struct pcb *) __dead2; +int savectx(struct pcb *); void swapctx(struct pcb *old, struct pcb *new); #endif From owner-p4-projects@FreeBSD.ORG Tue Apr 8 16:08:59 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id DE18937B404; Tue, 8 Apr 2003 16:08:58 -0700 (PDT) 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 7A65437B401 for ; Tue, 8 Apr 2003 16:08:58 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5B3AC43FBD for ; Tue, 8 Apr 2003 16:08:57 -0700 (PDT) (envelope-from marcel@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h38N8v0U000865 for ; Tue, 8 Apr 2003 16:08:57 -0700 (PDT) (envelope-from marcel@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h38N8uZT000862 for perforce@freebsd.org; Tue, 8 Apr 2003 16:08:56 -0700 (PDT) Date: Tue, 8 Apr 2003 16:08:56 -0700 (PDT) Message-Id: <200304082308.h38N8uZT000862@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 28573 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, 08 Apr 2003 23:09:00 -0000 http://perforce.freebsd.org/chv.cgi?CH=28573 Change 28573 by marcel@marcel_nfs on 2003/04/08 16:08:15 IFC @28565 Affected files ... .. //depot/projects/ia64/bin/cp/cp.1#5 integrate .. //depot/projects/ia64/bin/cp/cp.c#11 integrate .. //depot/projects/ia64/bin/cp/extern.h#5 integrate .. //depot/projects/ia64/bin/cp/utils.c#8 integrate .. //depot/projects/ia64/etc/Makefile#25 integrate .. //depot/projects/ia64/etc/newsyslog.conf#8 integrate .. //depot/projects/ia64/etc/syslog.conf#8 integrate .. //depot/projects/ia64/include/fstab.h#3 integrate .. //depot/projects/ia64/include/paths.h#7 integrate .. //depot/projects/ia64/lib/libc/gen/Makefile.inc#22 integrate .. //depot/projects/ia64/lib/libc/gen/fstab.c#3 integrate .. //depot/projects/ia64/lib/libc/gen/getfsent.3#2 integrate .. //depot/projects/ia64/lib/libc/stdio/vfwprintf.c#5 integrate .. //depot/projects/ia64/lib/libpam/modules/modules.inc#14 integrate .. //depot/projects/ia64/lib/libpam/modules/pam_chroot/pam_chroot.8#2 integrate .. //depot/projects/ia64/lib/libpam/modules/pam_chroot/pam_chroot.c#2 integrate .. //depot/projects/ia64/lib/libusbhid/usbhid.h#1 branch .. //depot/projects/ia64/lib/libutil/pw_util.c#6 integrate .. //depot/projects/ia64/libexec/rtld-elf/Makefile#4 integrate .. //depot/projects/ia64/libexec/rtld-elf/libmap.c#1 branch .. //depot/projects/ia64/libexec/rtld-elf/libmap.h#1 branch .. //depot/projects/ia64/libexec/rtld-elf/rtld.1#6 integrate .. //depot/projects/ia64/libexec/rtld-elf/rtld.c#12 integrate .. //depot/projects/ia64/release/doc/en_US.ISO8859-1/early-adopter/article.sgml#9 integrate .. //depot/projects/ia64/sbin/dump/dump.h#13 integrate .. //depot/projects/ia64/sbin/dump/main.c#16 integrate .. //depot/projects/ia64/sbin/dump/optr.c#10 integrate .. //depot/projects/ia64/sbin/mount/mount.8#11 integrate .. //depot/projects/ia64/sbin/mount/mount.c#8 integrate .. //depot/projects/ia64/sbin/ping/ping.c#20 integrate .. //depot/projects/ia64/sbin/umount/umount.8#4 integrate .. //depot/projects/ia64/sbin/umount/umount.c#6 integrate .. //depot/projects/ia64/share/man/man4/polling.4#5 integrate .. //depot/projects/ia64/share/man/man4/umass.4#7 integrate .. //depot/projects/ia64/share/man/man5/Makefile#12 integrate .. //depot/projects/ia64/share/man/man5/libmap.conf.5#1 branch .. //depot/projects/ia64/share/man/man7/release.7#19 integrate .. //depot/projects/ia64/sys/alpha/alpha/busdma_machdep.c#12 integrate .. //depot/projects/ia64/sys/conf/files#71 integrate .. //depot/projects/ia64/sys/dev/adlink/adlink.c#2 integrate .. //depot/projects/ia64/sys/dev/ata/ata-all.c#34 integrate .. //depot/projects/ia64/sys/dev/ata/ata-all.h#12 integrate .. //depot/projects/ia64/sys/dev/ata/ata-chipset.c#8 integrate .. //depot/projects/ia64/sys/dev/ata/ata-disk.c#21 integrate .. //depot/projects/ia64/sys/dev/ata/ata-dma.c#24 integrate .. //depot/projects/ia64/sys/dev/ata/ata-pci.c#25 integrate .. //depot/projects/ia64/sys/dev/ata/ata-pci.h#5 integrate .. //depot/projects/ia64/sys/dev/ata/ata-raid.c#19 integrate .. //depot/projects/ia64/sys/dev/ata/ata-raid.h#10 integrate .. //depot/projects/ia64/sys/dev/cardbus/cardbus_cis.c#13 integrate .. //depot/projects/ia64/sys/dev/fxp/if_fxp.c#24 integrate .. //depot/projects/ia64/sys/dev/pccard/pccard.c#18 integrate .. //depot/projects/ia64/sys/dev/pccard/pccardvar.h#8 integrate .. //depot/projects/ia64/sys/dev/pccbb/pccbb.c#22 integrate .. //depot/projects/ia64/sys/dev/puc/pucdata.c#13 integrate .. //depot/projects/ia64/sys/dev/snc/dp83932.c#7 integrate .. //depot/projects/ia64/sys/dev/stg/tmc18c30.h#1 branch .. //depot/projects/ia64/sys/dev/stg/tmc18c30_isa.c#4 integrate .. //depot/projects/ia64/sys/dev/stg/tmc18c30_pccard.c#7 integrate .. //depot/projects/ia64/sys/dev/stg/tmc18c30_pci.c#1 branch .. //depot/projects/ia64/sys/dev/stg/tmc18c30_subr.c#1 branch .. //depot/projects/ia64/sys/dev/usb/if_kue.c#12 integrate .. //depot/projects/ia64/sys/dev/usb/usbdevs#30 integrate .. //depot/projects/ia64/sys/dev/usb/usbdevs.h#29 integrate .. //depot/projects/ia64/sys/dev/usb/usbdevs_data.h#29 integrate .. //depot/projects/ia64/sys/dev/vx/if_vx.c#9 integrate .. //depot/projects/ia64/sys/dev/wi/if_wi_pccard.c#16 integrate .. //depot/projects/ia64/sys/i386/conf/PAE#1 branch .. //depot/projects/ia64/sys/i386/i386/busdma_machdep.c#14 integrate .. //depot/projects/ia64/sys/i386/include/pmap.h#12 integrate .. //depot/projects/ia64/sys/i386/include/vmparam.h#3 integrate .. //depot/projects/ia64/sys/ia64/conf/GENERIC#27 integrate .. //depot/projects/ia64/sys/ia64/conf/SKI#13 integrate .. //depot/projects/ia64/sys/ia64/ia64/busdma_machdep.c#11 integrate .. //depot/projects/ia64/sys/kern/kern_mac.c#21 integrate .. //depot/projects/ia64/sys/kern/kern_thr.c#2 integrate .. //depot/projects/ia64/sys/kern/kern_thread.c#35 integrate .. //depot/projects/ia64/sys/kern/uipc_cow.c#9 integrate .. //depot/projects/ia64/sys/kern/uipc_mbuf.c#16 integrate .. //depot/projects/ia64/sys/modules/stg/Makefile#2 integrate .. //depot/projects/ia64/sys/net/if_disc.c#7 integrate .. //depot/projects/ia64/sys/net/if_faith.c#11 integrate .. //depot/projects/ia64/sys/net/if_loop.c#15 integrate .. //depot/projects/ia64/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c#6 integrate .. //depot/projects/ia64/sys/netgraph/ng_base.c#12 integrate .. //depot/projects/ia64/sys/netgraph/ng_iface.c#8 integrate .. //depot/projects/ia64/sys/netinet/ip_divert.c#18 integrate .. //depot/projects/ia64/sys/netinet/ip_input.c#27 integrate .. //depot/projects/ia64/sys/netinet/ip_mroute.c#19 integrate .. //depot/projects/ia64/sys/netinet/ip_output.c#24 integrate .. //depot/projects/ia64/sys/netipsec/keysock.c#5 integrate .. //depot/projects/ia64/sys/netkey/keysock.c#14 integrate .. //depot/projects/ia64/sys/netnatm/natm.c#11 integrate .. //depot/projects/ia64/sys/pci/agp_if.m#2 integrate .. //depot/projects/ia64/sys/pci/if_rl.c#27 integrate .. //depot/projects/ia64/sys/pci/if_xl.c#27 integrate .. //depot/projects/ia64/sys/powerpc/powerpc/busdma_machdep.c#10 integrate .. //depot/projects/ia64/sys/sparc64/conf/GENERIC#32 integrate .. //depot/projects/ia64/sys/sparc64/include/cache.h#6 integrate .. //depot/projects/ia64/sys/sparc64/include/iommuvar.h#8 integrate .. //depot/projects/ia64/sys/sparc64/include/kerneldump.h#2 integrate .. //depot/projects/ia64/sys/sparc64/include/md_var.h#6 integrate .. //depot/projects/ia64/sys/sparc64/include/ofw_mem.h#2 integrate .. //depot/projects/ia64/sys/sparc64/include/pmap.h#17 integrate .. //depot/projects/ia64/sys/sparc64/include/smp.h#10 integrate .. //depot/projects/ia64/sys/sparc64/include/tsb.h#8 integrate .. //depot/projects/ia64/sys/sparc64/include/watch.h#2 integrate .. //depot/projects/ia64/sys/sparc64/pci/psycho.c#19 integrate .. //depot/projects/ia64/sys/sparc64/pci/psychovar.h#6 integrate .. //depot/projects/ia64/sys/sparc64/sparc64/bus_machdep.c#14 integrate .. //depot/projects/ia64/sys/sparc64/sparc64/cheetah.c#2 integrate .. //depot/projects/ia64/sys/sparc64/sparc64/db_hwwatch.c#4 integrate .. //depot/projects/ia64/sys/sparc64/sparc64/dump_machdep.c#4 integrate .. //depot/projects/ia64/sys/sparc64/sparc64/iommu.c#13 integrate .. //depot/projects/ia64/sys/sparc64/sparc64/machdep.c#33 integrate .. //depot/projects/ia64/sys/sparc64/sparc64/mem.c#7 integrate .. //depot/projects/ia64/sys/sparc64/sparc64/mp_machdep.c#16 integrate .. //depot/projects/ia64/sys/sparc64/sparc64/pmap.c#35 integrate .. //depot/projects/ia64/sys/sparc64/sparc64/spitfire.c#2 integrate .. //depot/projects/ia64/sys/sparc64/sparc64/tsb.c#14 integrate .. //depot/projects/ia64/sys/sparc64/sparc64/vm_machdep.c#22 integrate .. //depot/projects/ia64/sys/sys/mbuf.h#19 integrate .. //depot/projects/ia64/usr.bin/su/su.c#12 integrate .. //depot/projects/ia64/usr.sbin/ctm/ctm/ctm.h#3 integrate .. //depot/projects/ia64/usr.sbin/ctm/ctm/ctm_input.c#3 integrate .. //depot/projects/ia64/usr.sbin/jail/jail.c#4 integrate .. //depot/projects/ia64/usr.sbin/pppd/lcp.c#3 integrate .. //depot/projects/ia64/usr.sbin/wicontrol/wicontrol.8#12 integrate Differences ... ==== //depot/projects/ia64/bin/cp/cp.1#5 (text+ko) ==== @@ -33,7 +33,7 @@ .\" SUCH DAMAGE. .\" .\" @(#)cp.1 8.3 (Berkeley) 4/18/94 -.\" $FreeBSD: src/bin/cp/cp.1,v 1.25 2002/08/16 03:13:59 johan Exp $ +.\" $FreeBSD: src/bin/cp/cp.1,v 1.26 2003/04/07 11:00:56 mdodd Exp $ .\" .Dd July 23, 2002 .Dt CP 1 @@ -225,6 +225,17 @@ option is specified. In addition, these options override each other and the command's actions are determined by the last one specified. +.Pp +If +.Nm +receives a +.Dv SIGINFO +(see the +.Cm status +argument for +.Xr stty 1 ) +signal, the current input and output file and the percentage complete +will be written to the standard output. .Sh DIAGNOSTICS .Ex -std .Sh COMPATIBILITY ==== //depot/projects/ia64/bin/cp/cp.c#11 (text+ko) ==== @@ -46,7 +46,7 @@ #endif #endif /* not lint */ #include -__FBSDID("$FreeBSD: src/bin/cp/cp.c,v 1.43 2002/10/18 14:44:59 markm Exp $"); +__FBSDID("$FreeBSD: src/bin/cp/cp.c,v 1.45 2003/04/07 12:09:17 mdodd Exp $"); /* * Cp copies source files to target files. @@ -89,6 +89,9 @@ int fflag, iflag, nflag, pflag, vflag; static int Rflag, rflag; +volatile sig_atomic_t info; +static void siginfo (int notused __unused); + enum op { FILE_TO_FILE, FILE_TO_DIR, DIR_TO_DNE }; static int copy(char *[], enum op, int); @@ -173,6 +176,7 @@ fts_options &= ~FTS_PHYSICAL; fts_options |= FTS_LOGICAL | FTS_COMFOLLOW; } + (void)signal(SIGINFO, siginfo); /* Save the target base in "to". */ target = argv[--argc]; @@ -501,3 +505,10 @@ return (1); return (0); } + +static void +siginfo (int notused __unused) +{ + + info = 1; +} ==== //depot/projects/ia64/bin/cp/extern.h#5 (text+ko) ==== @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)extern.h 8.2 (Berkeley) 4/1/94 - * $FreeBSD: src/bin/cp/extern.h,v 1.16 2002/10/18 14:44:59 markm Exp $ + * $FreeBSD: src/bin/cp/extern.h,v 1.18 2003/04/07 12:09:17 mdodd Exp $ */ typedef struct { @@ -42,6 +42,7 @@ extern PATH_T to; extern int fflag, iflag, nflag, pflag, vflag; +extern volatile sig_atomic_t info; __BEGIN_DECLS int copy_fifo(struct stat *, int); ==== //depot/projects/ia64/bin/cp/utils.c#8 (text+ko) ==== @@ -37,7 +37,7 @@ #endif #endif /* not lint */ #include -__FBSDID("$FreeBSD: src/bin/cp/utils.c,v 1.39 2002/10/18 14:45:00 markm Exp $"); +__FBSDID("$FreeBSD: src/bin/cp/utils.c,v 1.40 2003/04/07 11:00:56 mdodd Exp $"); #include #include @@ -56,6 +56,7 @@ #include #include "extern.h" +#define cp_pct(x,y) (int)(100.0 * (double)(x) / (double)(y)) int copy_file(const FTSENT *entp, int dne) @@ -65,6 +66,7 @@ int ch, checkch, from_fd, rcount, rval, to_fd; ssize_t wcount; size_t wresid; + size_t wtotal; char *bufp; #ifdef VM_AND_BUFFER_CACHE_SYNCHRONIZED char *p; @@ -137,9 +139,19 @@ warn("%s", entp->fts_path); rval = 1; } else { + wtotal = 0; for (bufp = p, wresid = fs->st_size; ; bufp += wcount, wresid -= (size_t)wcount) { wcount = write(to_fd, bufp, wresid); + wtotal += wcount; + if (info) { + info = 0; + (void)fprintf(stderr, + "%s -> %s %3d%%\n", + entp->fts_path, to.p_path, + cp_pct(wtotal, fs->st_size)); + + } if (wcount >= (ssize_t)wresid || wcount <= 0) break; } @@ -156,10 +168,20 @@ } else #endif { + wtotal = 0; while ((rcount = read(from_fd, buf, MAXBSIZE)) > 0) { for (bufp = buf, wresid = rcount; ; bufp += wcount, wresid -= wcount) { wcount = write(to_fd, bufp, wresid); + wtotal += wcount; + if (info) { + info = 0; + (void)fprintf(stderr, + "%s -> %s %3d%%\n", + entp->fts_path, to.p_path, + cp_pct(wtotal, fs->st_size)); + + } if (wcount >= (ssize_t)wresid || wcount <= 0) break; } ==== //depot/projects/ia64/etc/Makefile#25 (text+ko) ==== @@ -1,5 +1,5 @@ # from: @(#)Makefile 5.11 (Berkeley) 5/21/91 -# $FreeBSD: src/etc/Makefile,v 1.307 2003/04/02 20:13:59 ru Exp $ +# $FreeBSD: src/etc/Makefile,v 1.308 2003/04/08 16:14:02 des Exp $ .if !defined(NO_SENDMAIL) SUBDIR= sendmail @@ -129,6 +129,8 @@ ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 /dev/null \ ${DESTDIR}/var/log/cron ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 /dev/null \ + ${DESTDIR}/var/log/debug.log + ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 /dev/null \ ${DESTDIR}/var/log/xferlog ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \ ${DESTDIR}/var/log/lpd-errs ==== //depot/projects/ia64/etc/newsyslog.conf#8 (text+ko) ==== @@ -1,5 +1,5 @@ # configuration file for newsyslog -# $FreeBSD: src/etc/newsyslog.conf,v 1.43 2003/02/16 13:07:20 des Exp $ +# $FreeBSD: src/etc/newsyslog.conf,v 1.44 2003/04/08 16:14:02 des Exp $ # # Note: some sites will want to select more restrictive protections than the # defaults. In particular, it may be desirable to switch many of the 644 @@ -14,6 +14,7 @@ /var/log/console.log 600 5 100 * J /var/log/cron 600 3 100 * J /var/log/daily.log 640 7 * @T00 J +/var/log/debug.log 600 7 100 * J /var/log/kerberos.log 600 7 100 * J /var/log/lpd-errs 644 7 100 * J /var/log/maillog 640 7 * @T00 J ==== //depot/projects/ia64/etc/syslog.conf#8 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/etc/syslog.conf,v 1.24 2003/04/03 18:37:49 yar Exp $ +# $FreeBSD: src/etc/syslog.conf,v 1.25 2003/04/08 16:14:02 des Exp $ # # Spaces ARE valid field separators in this file. However, # other *nix-like systems still insist on using tabs as field @@ -13,6 +13,7 @@ lpr.info /var/log/lpd-errs ftp.info /var/log/xferlog cron.* /var/log/cron +*.debug /var/log/debug.log *.emerg * # uncomment this to log all writes to /dev/console to /var/log/console.log #console.info /var/log/console.log ==== //depot/projects/ia64/include/fstab.h#3 (text+ko) ==== @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)fstab.h 8.1 (Berkeley) 6/2/93 - * $FreeBSD: src/include/fstab.h,v 1.3 2002/03/23 17:24:53 imp Exp $ + * $FreeBSD: src/include/fstab.h,v 1.4 2003/04/07 12:54:59 mdodd Exp $ */ #ifndef _FSTAB_H_ @@ -75,6 +75,8 @@ struct fstab *getfsfile(const char *); int setfsent(void); void endfsent(void); +void setfstab(const char *); +const char *getfstab(void); __END_DECLS #endif /* !_FSTAB_H_ */ ==== //depot/projects/ia64/include/paths.h#7 (text+ko) ==== @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)paths.h 8.1 (Berkeley) 6/2/93 - * $FreeBSD: src/include/paths.h,v 1.17 2002/07/14 13:04:15 sobomax Exp $ + * $FreeBSD: src/include/paths.h,v 1.18 2003/04/07 16:21:25 mdodd Exp $ */ #ifndef _PATHS_H_ @@ -60,6 +60,7 @@ #define _PATH_ETC "/etc" #define _PATH_FTPUSERS "/etc/ftpusers" #define _PATH_KMEM "/dev/kmem" +#define _PATH_LIBMAP_CONF "/etc/libmap.conf" #define _PATH_LOGIN "/usr/bin/login" #define _PATH_MAILDIR "/var/mail" #define _PATH_MAN "/usr/share/man" ==== //depot/projects/ia64/lib/libc/gen/Makefile.inc#22 (text+ko) ==== @@ -1,5 +1,5 @@ # @(#)Makefile.inc 8.6 (Berkeley) 5/4/95 -# $FreeBSD: src/lib/libc/gen/Makefile.inc,v 1.104 2003/02/15 10:52:46 phantom Exp $ +# $FreeBSD: src/lib/libc/gen/Makefile.inc,v 1.105 2003/04/07 12:55:00 mdodd Exp $ # machine-independent gen sources .PATH: ${.CURDIR}/${MACHINE_ARCH}/gen ${.CURDIR}/gen @@ -84,7 +84,8 @@ MLINKS+=getcontext.3 setcontext.3 MLINKS+=getdomainname.3 setdomainname.3 MLINKS+=getfsent.3 endfsent.3 getfsent.3 getfsfile.3 getfsent.3 getfsspec.3 \ - getfsent.3 getfstype.3 getfsent.3 setfsent.3 + getfsent.3 getfstype.3 getfsent.3 setfsent.3 \ + getfsent.3 setfstab.3 getfsent.3 getfstab.3 MLINKS+=getgrent.3 endgrent.3 getgrent.3 getgrgid.3 getgrent.3 getgrnam.3 \ getgrent.3 setgrent.3 getgrent.3 setgroupent.3 MLINKS+=gethostname.3 sethostname.3 ==== //depot/projects/ia64/lib/libc/gen/fstab.c#3 (text+ko) ==== @@ -35,7 +35,7 @@ static char sccsid[] = "@(#)fstab.c 8.1 (Berkeley) 6/4/93"; #endif /* LIBC_SCCS and not lint */ #include -__FBSDID("$FreeBSD: src/lib/libc/gen/fstab.c,v 1.13 2002/02/01 01:32:19 obrien Exp $"); +__FBSDID("$FreeBSD: src/lib/libc/gen/fstab.c,v 1.14 2003/04/07 12:55:00 mdodd Exp $"); #include "namespace.h" #include @@ -54,11 +54,40 @@ static FILE *_fs_fp; static struct fstab _fs_fstab; static int LineNo = 0; +static char *path_fstab; +static char fstab_path[PATH_MAX]; +static int fsp_set = 0; static void error(int); static void fixfsfile(void); static int fstabscan(void); +void +setfstab(const char *file) +{ + + if (file == NULL) { + path_fstab = _PATH_FSTAB; + } else { + strncpy(fstab_path, file, PATH_MAX); + fstab_path[PATH_MAX - 1] = '\0'; + path_fstab = fstab_path; + } + fsp_set = 1; + + return; +} + +const char * +getfstab (void) +{ + + if (fsp_set) + return (path_fstab); + else + return (_PATH_FSTAB); +} + static void fixfsfile() { @@ -226,7 +255,13 @@ LineNo = 0; return(1); } - if ((_fs_fp = fopen(_PATH_FSTAB, "r")) != NULL) { + if (fsp_set == 0) { + if (issetugid()) + setfstab(NULL); + else + setfstab(getenv("PATH_FSTAB")); + } + if ((_fs_fp = fopen(path_fstab, "r")) != NULL) { LineNo = 0; return(1); } @@ -241,6 +276,8 @@ (void)fclose(_fs_fp); _fs_fp = NULL; } + + fsp_set = 0; } static void @@ -251,7 +288,7 @@ char num[30]; (void)_write(STDERR_FILENO, "fstab: ", 7); - (void)_write(STDERR_FILENO, _PATH_FSTAB, sizeof(_PATH_FSTAB) - 1); + (void)_write(STDERR_FILENO, path_fstab, strlen(path_fstab)); (void)_write(STDERR_FILENO, ":", 1); sprintf(num, "%d: ", LineNo); (void)_write(STDERR_FILENO, num, strlen(num)); ==== //depot/projects/ia64/lib/libc/gen/getfsent.3#2 (text+ko) ==== @@ -30,9 +30,9 @@ .\" SUCH DAMAGE. .\" .\" @(#)getfsent.3 8.1 (Berkeley) 6/4/93 -.\" $FreeBSD: src/lib/libc/gen/getfsent.3,v 1.9 2001/10/01 16:08:51 ru Exp $ +.\" $FreeBSD: src/lib/libc/gen/getfsent.3,v 1.12 2003/04/07 22:59:12 mdodd Exp $ .\" -.Dd June 4, 1993 +.Dd April 7, 2003 .Dt GETFSENT 3 .Os .Sh NAME @@ -56,6 +56,10 @@ .Fn setfsent void .Ft void .Fn endfsent void +.Ft void +.Fn setfstab "const char *file" +.Ft const char * +.Fn getfstab void .Sh DESCRIPTION The .Fn getfsent , @@ -94,6 +98,18 @@ closes the file. .Pp The +.Fn setfstab +function sets the file to be used by subsequent operations. +The value set by +.Fn setfstab +does not persist across calls to +.Fn endfsent +.Pp +The +.Fn getfstab +function returns the name of the file that that will be used. +.Pp +The .Fn getfsspec and .Fn getfsfile @@ -128,6 +144,20 @@ .Fn endfsent function returns nothing. +.Sh ENVIRONMENT +.Bl -tag -width PATH_FSTAB +.It Pa PATH_FSTAB +If the environment variable +.Pa PATH_FSTAB +is set all operations are performed against the specified file. +.Pa PATH_FSTAB +will not be honored if the process environment or memory address space is +considred +.Dq tainted . +(See +.Fn issetugid +for more information.) +.El .Sh FILES .Bl -tag -width /etc/fstab -compact .It Pa /etc/fstab @@ -146,7 +176,13 @@ and .Fn setfsent functions appeared in -.Bx 4.3 . +.Bx 4.3 ; +the +.Fn setfstab +and +.Fn getfstab +functions appeared in +.Fx 5.1. .Sh BUGS These functions use static data storage; if the data is needed for future use, it should be ==== //depot/projects/ia64/lib/libc/stdio/vfwprintf.c#5 (text+ko) ==== @@ -39,9 +39,9 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)vfprintf.c 8.1 (Berkeley) 6/4/93"; #endif /* LIBC_SCCS and not lint */ -__FBSDID("FreeBSD: src/lib/libc/stdio/vfprintf.c,v 1.52 2003/03/14 04:48:09 das Exp"); +__FBSDID("FreeBSD: src/lib/libc/stdio/vfprintf.c,v 1.57 2003/04/07 03:17:39 ache Exp"); #endif -__FBSDID("$FreeBSD: src/lib/libc/stdio/vfwprintf.c,v 1.9 2003/04/05 22:08:53 das Exp $"); +__FBSDID("$FreeBSD: src/lib/libc/stdio/vfwprintf.c,v 1.10 2003/04/07 06:36:49 tjr Exp $"); /* * Actual wprintf innards. @@ -114,10 +114,10 @@ }; static int __sbprintf(FILE *, const wchar_t *, va_list); -static wchar_t *__ujtoa(uintmax_t, wchar_t *, int, int, wchar_t *, int, char, - const char *); -static wchar_t *__ultoa(u_long, wchar_t *, int, int, wchar_t *, int, char, - const char *); +static wchar_t *__ujtoa(uintmax_t, wchar_t *, int, int, const wchar_t *, int, + char, const char *); +static wchar_t *__ultoa(u_long, wchar_t *, int, int, const wchar_t *, int, + char, const char *); static wchar_t *__mbsconv(char *, int); static void __find_arguments(const wchar_t *, va_list, union arg **); static void __grow_type_table(int, enum typeid **, int *); @@ -169,7 +169,7 @@ * use the given digits. */ static wchar_t * -__ultoa(u_long val, wchar_t *endp, int base, int octzero, wchar_t *xdigs, +__ultoa(u_long val, wchar_t *endp, int base, int octzero, const wchar_t *xdigs, int needgrp, char thousep, const char *grp) { wchar_t *cp = endp; @@ -246,8 +246,8 @@ /* Identical to __ultoa, but for intmax_t. */ static wchar_t * -__ujtoa(uintmax_t val, wchar_t *endp, int base, int octzero, wchar_t *xdigs, - int needgrp, char thousep, const char *grp) +__ujtoa(uintmax_t val, wchar_t *endp, int base, int octzero, + const wchar_t *xdigs, int needgrp, char thousep, const char *grp) { wchar_t *cp = endp; intmax_t sval; @@ -330,6 +330,9 @@ size_t insize, nchars, nconv; mbstate_t mbs; + if (mbsarg == NULL) + return (NULL); + /* * Supplied argument is a multibyte string; convert it to wide * characters first. @@ -400,16 +403,17 @@ } #ifdef FLOATING_POINT + +#define dtoa __dtoa +#define freedtoa __freedtoa + #include #include #include "floatio.h" +#include "gdtoa.h" #define DEFPREC 6 -extern char *__dtoa(double, int, int, int *, int *, char **); -extern void __freedtoa(char *s); - -static wchar_t *cvt(double, int, int, char *, int *, wchar_t, int *); static int exponent(wchar_t *, int, wchar_t); #endif /* FLOATING_POINT */ @@ -429,7 +433,6 @@ * Flags used during conversion. */ #define ALT 0x001 /* alternate form */ -#define HEXPREFIX 0x002 /* add 0x or 0X prefix */ #define LADJUST 0x004 /* left adjustment */ #define LONGDBL 0x008 /* long double */ #define LONGINT 0x010 /* long integer */ @@ -452,24 +455,46 @@ { wchar_t *fmt; /* format string */ wchar_t ch; /* character from fmt */ - int n, n2; /* handy integer (short term usage) */ + int n, n2, n3; /* handy integer (short term usage) */ wchar_t *cp; /* handy char pointer (short term usage) */ int flags; /* flags as above */ int ret; /* return value accumulator */ int width; /* width from format (%8d), or 0 */ - int prec; /* precision from format (%.3d), or -1 */ + int prec; /* precision from format; <0 for N/A */ wchar_t sign; /* sign prefix (' ', '+', '-', or \0) */ char thousands_sep; /* locale specific thousands separator */ const char *grouping; /* locale specific numeric grouping rules */ #ifdef FLOATING_POINT + /* + * We can decompose the printed representation of floating + * point numbers into several parts, some of which may be empty: + * + * [+|-| ] [0x|0X] MMM . NNN [e|E|p|P] [+|-] ZZ + * A B ---C--- D E F + * + * A: 'sign' holds this value if present; '\0' otherwise + * B: ox[1] holds the 'x' or 'X'; '\0' if not hexadecimal + * C: cp points to the string MMMNNN. Leading and trailing + * zeros are not in the string and must be added. + * D: expchar holds this character; '\0' if no exponent, e.g. %f + * F: at least two digits for decimal, at least one digit for hex + */ char *decimal_point; /* locale specific decimal point */ - char softsign; /* temporary negative sign for floats */ - double _double; /* double precision arguments %[eEfgG] */ + int signflag; /* true if float is negative */ + union { /* floating point arguments %[aAeEfFgG] */ + double dbl; + long double ldbl; + } fparg; int expt; /* integer value of exponent */ + char expchar; /* exponent character: [eEpP\0] */ + char *dtoaend; /* pointer to end of converted digits */ int expsize; /* character count for expstr */ - int ndig; /* actual number of digits returned by cvt */ - wchar_t expstr[7]; /* buffer for exponent string */ - wchar_t *dtoaresult; /* buffer allocated by dtoa */ + int lead; /* sig figs before decimal or group sep */ + int ndig; /* actual number of digits returned by dtoa */ + wchar_t expstr[MAXEXPDIG+2]; /* buffer for exponent string: e+ZZZ */ + char *dtoaresult; /* buffer allocated by dtoa */ + int nseps; /* number of group separators with ' */ + int nrepeats; /* number of repeats of the last group */ #endif u_long ulval; /* integer arguments %[diouxX] */ uintmax_t ujval; /* %j, %ll, %q, %t, %z integers */ @@ -478,7 +503,7 @@ int realsz; /* field size expanded by dprec, sign, etc */ int size; /* size of converted field or string */ int prsize; /* max size of printed field */ - wchar_t *xdigs; /* digits for [xX] conversion */ + const wchar_t *xdigs; /* digits for [xX] conversion */ wchar_t buf[BUF]; /* buffer with space for digits of uintmax_t */ wchar_t ox[2]; /* space for 0x hex-prefix */ union arg *argtable; /* args, built due to positional arg */ @@ -498,13 +523,16 @@ static wchar_t zeroes[PADSIZE] = {'0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0'}; + static const wchar_t xdigs_lower[16] = L"0123456789abcdef"; + static const wchar_t xdigs_upper[16] = L"0123456789ABCDEF"; + /* * BEWARE, these `goto error' on error, PRINT uses `n2' and * PAD uses `n'. */ #define PRINT(ptr, len) do { \ - for (n2 = 0; n2 < (len); n2++) \ - __fputwc((ptr)[n2], fp); \ + for (n3 = 0; n3 < (len); n3++) \ + __fputwc((ptr)[n3], fp); \ } while (0) #define PAD(howmany, with) do { \ if ((n = (howmany)) > 0) { \ @@ -515,6 +543,14 @@ PRINT(with, n); \ } \ } while (0) +#define PRINTANDPAD(p, ep, len, with) do { \ + n2 = (ep) - (p); \ + if (n2 > (len)) \ + n2 = (len); \ + if (n2 > 0) \ + PRINT((p), n2); \ + PAD((len) - (n2 > 0 ? n2 : 0), (with)); \ +} while(0) /* * Get the argument indexed by nextarg. If the argument table is @@ -580,7 +616,6 @@ thousands_sep = '\0'; grouping = NULL; #ifdef FLOATING_POINT - dtoaresult = NULL; decimal_point = localeconv()->decimal_point; #endif convbuf = NULL; @@ -622,6 +657,7 @@ width = 0; prec = -1; sign = '\0'; + ox[1] = '\0'; rflag: ch = *fmt++; reswitch: switch (ch) { @@ -662,16 +698,14 @@ goto rflag; case '.': if ((ch = *fmt++) == '*') { - GETASTER (n); - prec = n < 0 ? -1 : n; + GETASTER (prec); goto rflag; } - n = 0; + prec = 0; while (is_digit(ch)) { - n = 10 * n + to_digit(ch); + prec = 10 * prec + to_digit(ch); ch = *fmt++; } - prec = n < 0 ? -1 : n; goto reswitch; case '0': /*- @@ -765,86 +799,128 @@ #ifdef HEXFLOAT case 'a': case 'A': + if (ch == 'a') { + ox[1] = 'x'; + xdigs = xdigs_lower; + expchar = 'p'; + } else { + ox[1] = 'X'; + xdigs = xdigs_upper; + expchar = 'P'; + } + /* + * XXX We don't actually have a conversion + * XXX routine for this yet. + */ + if (flags & LONGDBL) { + fparg.ldbl = (double)GETARG(long double); + dtoaresult = + __hldtoa(fparg.ldbl, xdigs, prec, + &expt, &signflag, &dtoaend); + } else { + fparg.dbl = GETARG(double); + dtoaresult = + __hdtoa(fparg.dbl, xdigs, prec, + &expt, &signflag, &dtoaend); + } + if (convbuf != NULL) + free(convbuf); + cp = convbuf = __mbsconv(dtoaresult, -1); + freedtoa(dtoaresult); + goto fp_begin; #endif case 'e': case 'E': - /*- - * Grouping apply to %i, %d, %u, %f, %F, %g, %G - * conversion specifiers only. For other conversions - * behavior is undefined. - * -- POSIX - */ - flags &= ~GROUPING; - /*FALLTHROUGH*/ + expchar = ch; + if (prec < 0) /* account for digit before decpt */ + prec = DEFPREC + 1; + else + prec++; + goto fp_begin; case 'f': case 'F': + expchar = '\0'; goto fp_begin; case 'g': case 'G': + expchar = ch - ('g' - 'e'); if (prec == 0) prec = 1; -fp_begin: if (prec == -1) +fp_begin: + if (prec < 0) prec = DEFPREC; - if (flags & LONGDBL) - /* XXX this loses precision. */ - _double = (double)GETARG(long double); - else - _double = GETARG(double); - /* do this before tricky precision changes */ - if (isinf(_double)) { - if (_double < 0) - sign = '-'; - if (iswupper(ch)) - cp = L"INF"; - else - cp = L"inf"; - size = 3; - break; + if (convbuf != NULL) + free(convbuf); + if (flags & LONGDBL) { + fparg.ldbl = GETARG(long double); + dtoaresult = + __ldtoa(&fparg.ldbl, expchar ? 2 : 3, prec, + &expt, &signflag, &dtoaend); + } else { + fparg.dbl = GETARG(double); + dtoaresult = + dtoa(fparg.dbl, expchar ? 2 : 3, prec, + &expt, &signflag, &dtoaend); + if (expt == 9999) + expt = INT_MAX; } - if (isnan(_double)) { - if (iswupper(ch)) - cp = L"NAN"; - else - cp = L"nan"; + ndig = dtoaend - dtoaresult; + cp = convbuf = __mbsconv(dtoaresult, -1); + freedtoa(dtoaresult); + if (signflag) + sign = '-'; + if (expt == INT_MAX) { /* inf or nan */ + if (*cp == 'N') { + cp = (ch >= 'a') ? L"nan" : L"NAN"; + sign = '\0'; + } else + cp = (ch >= 'a') ? L"inf" : L"INF"; size = 3; break; } flags |= FPT; - if (dtoaresult != NULL) { - free(dtoaresult); - dtoaresult = NULL; - } - dtoaresult = cp = cvt(_double, prec, flags, &softsign, - &expt, ch, &ndig); if (ch == 'g' || ch == 'G') { - if (expt <= -4 || expt > prec) - ch = (ch == 'g') ? 'e' : 'E'; - else - ch = 'g'; + if (expt > -4 && expt <= prec) { + /* Make %[gG] smell like %[fF] */ + expchar = '\0'; + if (flags & ALT) + prec -= expt; + else + prec = ndig - expt; + if (prec < 0) + prec = 0; + } } - if (ch == 'e' || ch == 'E') { - --expt; - expsize = exponent(expstr, expt, ch); - size = expsize + ndig; - if (ndig > 1 || flags & ALT) + if (expchar) { + expsize = exponent(expstr, expt - 1, expchar); + size = expsize + prec; + if (prec > 1 || flags & ALT) ++size; - } else if (ch == 'f' || ch == 'F') { + } else { if (expt > 0) { size = expt; if (prec || flags & ALT) size += prec + 1; } else /* "0.X" */ size = prec + 2; - } else if (expt >= ndig) { /* fixed g fmt */ - size = expt; - if (flags & ALT) - ++size; - } else - size = ndig + (expt > 0 ? - 1 : 2 - expt); - - if (softsign) - sign = '-'; + if (grouping && expt > 0) { + /* space for thousands' grouping */ + nseps = nrepeats = 0; + lead = expt; + while (*grouping != CHAR_MAX) { + if (lead <= *grouping) + break; + lead -= *grouping; + if (*(grouping+1)) { + nseps++; + grouping++; + } else + nrepeats++; + } + size += nseps + nrepeats; + } else + lead = expt; + } break; #endif /* FLOATING_POINT */ case 'n': @@ -890,9 +966,9 @@ */ ujval = (uintmax_t)(uintptr_t)GETARG(void *); base = 16; - xdigs = L"0123456789abcdef"; - flags = flags | INTMAXT | HEXPREFIX; - ch = 'x'; + xdigs = xdigs_lower; + flags = flags | INTMAXT; + ox[1] = 'x'; goto nosign; case 'S': flags |= LONGINT; @@ -947,10 +1023,10 @@ base = 10; >>> TRUNCATED FOR MAIL (1000 lines) <<< From owner-p4-projects@FreeBSD.ORG Tue Apr 8 17:02:07 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id EEC5B37B404; Tue, 8 Apr 2003 17:02:03 -0700 (PDT) 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 8426A37B401 for ; Tue, 8 Apr 2003 17:02:03 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6096543F85 for ; Tue, 8 Apr 2003 17:02:02 -0700 (PDT) (envelope-from marcel@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h390220U011488 for ; Tue, 8 Apr 2003 17:02:02 -0700 (PDT) (envelope-from marcel@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h39021ED011485 for perforce@freebsd.org; Tue, 8 Apr 2003 17:02:01 -0700 (PDT) Date: Tue, 8 Apr 2003 17:02:01 -0700 (PDT) Message-Id: <200304090002.h39021ED011485@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 28574 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, 09 Apr 2003 00:02:08 -0000 http://perforce.freebsd.org/chv.cgi?CH=28574 Change 28574 by marcel@marcel_pluto1 on 2003/04/08 17:01:55 IFia64 Affected files ... .. //depot/projects/ia64_epc/bin/cp/cp.1#2 integrate .. //depot/projects/ia64_epc/bin/cp/cp.c#2 integrate .. //depot/projects/ia64_epc/bin/cp/extern.h#2 integrate .. //depot/projects/ia64_epc/bin/cp/utils.c#2 integrate .. //depot/projects/ia64_epc/etc/Makefile#4 integrate .. //depot/projects/ia64_epc/etc/newsyslog.conf#3 integrate .. //depot/projects/ia64_epc/etc/syslog.conf#3 integrate .. //depot/projects/ia64_epc/include/fstab.h#2 integrate .. //depot/projects/ia64_epc/include/paths.h#2 integrate .. //depot/projects/ia64_epc/lib/libc/gen/Makefile.inc#4 integrate .. //depot/projects/ia64_epc/lib/libc/gen/fstab.c#2 integrate .. //depot/projects/ia64_epc/lib/libc/gen/getfsent.3#2 integrate .. //depot/projects/ia64_epc/lib/libc/stdio/vfwprintf.c#4 integrate .. //depot/projects/ia64_epc/lib/libpam/modules/modules.inc#3 integrate .. //depot/projects/ia64_epc/lib/libpam/modules/pam_chroot/pam_chroot.8#2 integrate .. //depot/projects/ia64_epc/lib/libpam/modules/pam_chroot/pam_chroot.c#2 integrate .. //depot/projects/ia64_epc/lib/libusbhid/usbhid.h#1 branch .. //depot/projects/ia64_epc/lib/libutil/pw_util.c#3 integrate .. //depot/projects/ia64_epc/libexec/rtld-elf/Makefile#3 integrate .. //depot/projects/ia64_epc/libexec/rtld-elf/libmap.c#1 branch .. //depot/projects/ia64_epc/libexec/rtld-elf/libmap.h#1 branch .. //depot/projects/ia64_epc/libexec/rtld-elf/rtld.1#3 integrate .. //depot/projects/ia64_epc/libexec/rtld-elf/rtld.c#4 integrate .. //depot/projects/ia64_epc/release/doc/en_US.ISO8859-1/early-adopter/article.sgml#2 integrate .. //depot/projects/ia64_epc/sbin/dump/dump.h#2 integrate .. //depot/projects/ia64_epc/sbin/dump/main.c#3 integrate .. //depot/projects/ia64_epc/sbin/dump/optr.c#2 integrate .. //depot/projects/ia64_epc/sbin/mount/mount.8#3 integrate .. //depot/projects/ia64_epc/sbin/mount/mount.c#2 integrate .. //depot/projects/ia64_epc/sbin/ping/ping.c#6 integrate .. //depot/projects/ia64_epc/sbin/umount/umount.8#2 integrate .. //depot/projects/ia64_epc/sbin/umount/umount.c#2 integrate .. //depot/projects/ia64_epc/share/man/man4/polling.4#2 integrate .. //depot/projects/ia64_epc/share/man/man4/umass.4#2 integrate .. //depot/projects/ia64_epc/share/man/man5/Makefile#3 integrate .. //depot/projects/ia64_epc/share/man/man5/libmap.conf.5#1 branch .. //depot/projects/ia64_epc/share/man/man7/release.7#5 integrate .. //depot/projects/ia64_epc/sys/alpha/alpha/busdma_machdep.c#4 integrate .. //depot/projects/ia64_epc/sys/conf/files#8 integrate .. //depot/projects/ia64_epc/sys/dev/adlink/adlink.c#2 integrate .. //depot/projects/ia64_epc/sys/dev/ata/ata-all.c#8 integrate .. //depot/projects/ia64_epc/sys/dev/ata/ata-all.h#4 integrate .. //depot/projects/ia64_epc/sys/dev/ata/ata-chipset.c#5 integrate .. //depot/projects/ia64_epc/sys/dev/ata/ata-disk.c#5 integrate .. //depot/projects/ia64_epc/sys/dev/ata/ata-dma.c#4 integrate .. //depot/projects/ia64_epc/sys/dev/ata/ata-pci.c#4 integrate .. //depot/projects/ia64_epc/sys/dev/ata/ata-pci.h#4 integrate .. //depot/projects/ia64_epc/sys/dev/ata/ata-raid.c#6 integrate .. //depot/projects/ia64_epc/sys/dev/ata/ata-raid.h#3 integrate .. //depot/projects/ia64_epc/sys/dev/cardbus/cardbus_cis.c#3 integrate .. //depot/projects/ia64_epc/sys/dev/fxp/if_fxp.c#7 integrate .. //depot/projects/ia64_epc/sys/dev/pccard/pccard.c#5 integrate .. //depot/projects/ia64_epc/sys/dev/pccard/pccardvar.h#2 integrate .. //depot/projects/ia64_epc/sys/dev/pccbb/pccbb.c#3 integrate .. //depot/projects/ia64_epc/sys/dev/puc/pucdata.c#4 integrate .. //depot/projects/ia64_epc/sys/dev/snc/dp83932.c#3 integrate .. //depot/projects/ia64_epc/sys/dev/stg/tmc18c30.h#1 branch .. //depot/projects/ia64_epc/sys/dev/stg/tmc18c30_isa.c#2 integrate .. //depot/projects/ia64_epc/sys/dev/stg/tmc18c30_pccard.c#2 integrate .. //depot/projects/ia64_epc/sys/dev/stg/tmc18c30_pci.c#1 branch .. //depot/projects/ia64_epc/sys/dev/stg/tmc18c30_subr.c#1 branch .. //depot/projects/ia64_epc/sys/dev/usb/if_kue.c#4 integrate .. //depot/projects/ia64_epc/sys/dev/usb/usbdevs#5 integrate .. //depot/projects/ia64_epc/sys/dev/usb/usbdevs.h#5 integrate .. //depot/projects/ia64_epc/sys/dev/usb/usbdevs_data.h#5 integrate .. //depot/projects/ia64_epc/sys/dev/vx/if_vx.c#3 integrate .. //depot/projects/ia64_epc/sys/dev/wi/if_wi_pccard.c#5 integrate .. //depot/projects/ia64_epc/sys/i386/conf/PAE#1 branch .. //depot/projects/ia64_epc/sys/i386/i386/busdma_machdep.c#5 integrate .. //depot/projects/ia64_epc/sys/i386/include/pmap.h#5 integrate .. //depot/projects/ia64_epc/sys/i386/include/vmparam.h#3 integrate .. //depot/projects/ia64_epc/sys/ia64/conf/GENERIC#4 integrate .. //depot/projects/ia64_epc/sys/ia64/conf/SKI#4 integrate .. //depot/projects/ia64_epc/sys/ia64/ia64/busdma_machdep.c#4 integrate .. //depot/projects/ia64_epc/sys/kern/kern_mac.c#5 integrate .. //depot/projects/ia64_epc/sys/kern/kern_thr.c#3 integrate .. //depot/projects/ia64_epc/sys/kern/kern_thread.c#8 integrate .. //depot/projects/ia64_epc/sys/kern/uipc_cow.c#5 integrate .. //depot/projects/ia64_epc/sys/kern/uipc_mbuf.c#5 integrate .. //depot/projects/ia64_epc/sys/modules/stg/Makefile#2 integrate .. //depot/projects/ia64_epc/sys/net/if_disc.c#3 integrate .. //depot/projects/ia64_epc/sys/net/if_faith.c#4 integrate .. //depot/projects/ia64_epc/sys/net/if_loop.c#4 integrate .. //depot/projects/ia64_epc/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c#3 integrate .. //depot/projects/ia64_epc/sys/netgraph/ng_base.c#3 integrate .. //depot/projects/ia64_epc/sys/netgraph/ng_iface.c#4 integrate .. //depot/projects/ia64_epc/sys/netinet/ip_divert.c#3 integrate .. //depot/projects/ia64_epc/sys/netinet/ip_input.c#5 integrate .. //depot/projects/ia64_epc/sys/netinet/ip_mroute.c#4 integrate .. //depot/projects/ia64_epc/sys/netinet/ip_output.c#4 integrate .. //depot/projects/ia64_epc/sys/netipsec/keysock.c#3 integrate .. //depot/projects/ia64_epc/sys/netkey/keysock.c#3 integrate .. //depot/projects/ia64_epc/sys/netnatm/natm.c#4 integrate .. //depot/projects/ia64_epc/sys/pci/agp_if.m#2 integrate .. //depot/projects/ia64_epc/sys/pci/if_rl.c#5 integrate .. //depot/projects/ia64_epc/sys/pci/if_xl.c#7 integrate .. //depot/projects/ia64_epc/sys/powerpc/powerpc/busdma_machdep.c#5 integrate .. //depot/projects/ia64_epc/sys/sparc64/conf/GENERIC#5 integrate .. //depot/projects/ia64_epc/sys/sparc64/include/cache.h#3 integrate .. //depot/projects/ia64_epc/sys/sparc64/include/iommuvar.h#2 integrate .. //depot/projects/ia64_epc/sys/sparc64/include/kerneldump.h#2 integrate .. //depot/projects/ia64_epc/sys/sparc64/include/md_var.h#3 integrate .. //depot/projects/ia64_epc/sys/sparc64/include/ofw_mem.h#2 integrate .. //depot/projects/ia64_epc/sys/sparc64/include/pmap.h#4 integrate .. //depot/projects/ia64_epc/sys/sparc64/include/smp.h#3 integrate .. //depot/projects/ia64_epc/sys/sparc64/include/tsb.h#2 integrate .. //depot/projects/ia64_epc/sys/sparc64/include/watch.h#2 integrate .. //depot/projects/ia64_epc/sys/sparc64/pci/psycho.c#3 integrate .. //depot/projects/ia64_epc/sys/sparc64/pci/psychovar.h#2 integrate .. //depot/projects/ia64_epc/sys/sparc64/sparc64/bus_machdep.c#4 integrate .. //depot/projects/ia64_epc/sys/sparc64/sparc64/cheetah.c#2 integrate .. //depot/projects/ia64_epc/sys/sparc64/sparc64/db_hwwatch.c#2 integrate .. //depot/projects/ia64_epc/sys/sparc64/sparc64/dump_machdep.c#2 integrate .. //depot/projects/ia64_epc/sys/sparc64/sparc64/iommu.c#3 integrate .. //depot/projects/ia64_epc/sys/sparc64/sparc64/machdep.c#5 integrate .. //depot/projects/ia64_epc/sys/sparc64/sparc64/mem.c#5 integrate .. //depot/projects/ia64_epc/sys/sparc64/sparc64/mp_machdep.c#4 integrate .. //depot/projects/ia64_epc/sys/sparc64/sparc64/pmap.c#6 integrate .. //depot/projects/ia64_epc/sys/sparc64/sparc64/spitfire.c#2 integrate .. //depot/projects/ia64_epc/sys/sparc64/sparc64/tsb.c#3 integrate .. //depot/projects/ia64_epc/sys/sparc64/sparc64/vm_machdep.c#5 integrate .. //depot/projects/ia64_epc/sys/sys/mbuf.h#5 integrate .. //depot/projects/ia64_epc/usr.bin/su/su.c#4 integrate .. //depot/projects/ia64_epc/usr.sbin/ctm/ctm/ctm.h#2 integrate .. //depot/projects/ia64_epc/usr.sbin/ctm/ctm/ctm_input.c#2 integrate .. //depot/projects/ia64_epc/usr.sbin/jail/jail.c#3 integrate .. //depot/projects/ia64_epc/usr.sbin/pppd/lcp.c#2 integrate .. //depot/projects/ia64_epc/usr.sbin/wicontrol/wicontrol.8#4 integrate Differences ... ==== //depot/projects/ia64_epc/bin/cp/cp.1#2 (text+ko) ==== @@ -33,7 +33,7 @@ .\" SUCH DAMAGE. .\" .\" @(#)cp.1 8.3 (Berkeley) 4/18/94 -.\" $FreeBSD: src/bin/cp/cp.1,v 1.25 2002/08/16 03:13:59 johan Exp $ +.\" $FreeBSD: src/bin/cp/cp.1,v 1.26 2003/04/07 11:00:56 mdodd Exp $ .\" .Dd July 23, 2002 .Dt CP 1 @@ -225,6 +225,17 @@ option is specified. In addition, these options override each other and the command's actions are determined by the last one specified. +.Pp +If +.Nm +receives a +.Dv SIGINFO +(see the +.Cm status +argument for +.Xr stty 1 ) +signal, the current input and output file and the percentage complete +will be written to the standard output. .Sh DIAGNOSTICS .Ex -std .Sh COMPATIBILITY ==== //depot/projects/ia64_epc/bin/cp/cp.c#2 (text+ko) ==== @@ -46,7 +46,7 @@ #endif #endif /* not lint */ #include -__FBSDID("$FreeBSD: src/bin/cp/cp.c,v 1.43 2002/10/18 14:44:59 markm Exp $"); +__FBSDID("$FreeBSD: src/bin/cp/cp.c,v 1.45 2003/04/07 12:09:17 mdodd Exp $"); /* * Cp copies source files to target files. @@ -89,6 +89,9 @@ int fflag, iflag, nflag, pflag, vflag; static int Rflag, rflag; +volatile sig_atomic_t info; +static void siginfo (int notused __unused); + enum op { FILE_TO_FILE, FILE_TO_DIR, DIR_TO_DNE }; static int copy(char *[], enum op, int); @@ -173,6 +176,7 @@ fts_options &= ~FTS_PHYSICAL; fts_options |= FTS_LOGICAL | FTS_COMFOLLOW; } + (void)signal(SIGINFO, siginfo); /* Save the target base in "to". */ target = argv[--argc]; @@ -501,3 +505,10 @@ return (1); return (0); } + +static void +siginfo (int notused __unused) +{ + + info = 1; +} ==== //depot/projects/ia64_epc/bin/cp/extern.h#2 (text+ko) ==== @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)extern.h 8.2 (Berkeley) 4/1/94 - * $FreeBSD: src/bin/cp/extern.h,v 1.16 2002/10/18 14:44:59 markm Exp $ + * $FreeBSD: src/bin/cp/extern.h,v 1.18 2003/04/07 12:09:17 mdodd Exp $ */ typedef struct { @@ -42,6 +42,7 @@ extern PATH_T to; extern int fflag, iflag, nflag, pflag, vflag; +extern volatile sig_atomic_t info; __BEGIN_DECLS int copy_fifo(struct stat *, int); ==== //depot/projects/ia64_epc/bin/cp/utils.c#2 (text+ko) ==== @@ -37,7 +37,7 @@ #endif #endif /* not lint */ #include -__FBSDID("$FreeBSD: src/bin/cp/utils.c,v 1.39 2002/10/18 14:45:00 markm Exp $"); +__FBSDID("$FreeBSD: src/bin/cp/utils.c,v 1.40 2003/04/07 11:00:56 mdodd Exp $"); #include #include @@ -56,6 +56,7 @@ #include #include "extern.h" +#define cp_pct(x,y) (int)(100.0 * (double)(x) / (double)(y)) int copy_file(const FTSENT *entp, int dne) @@ -65,6 +66,7 @@ int ch, checkch, from_fd, rcount, rval, to_fd; ssize_t wcount; size_t wresid; + size_t wtotal; char *bufp; #ifdef VM_AND_BUFFER_CACHE_SYNCHRONIZED char *p; @@ -137,9 +139,19 @@ warn("%s", entp->fts_path); rval = 1; } else { + wtotal = 0; for (bufp = p, wresid = fs->st_size; ; bufp += wcount, wresid -= (size_t)wcount) { wcount = write(to_fd, bufp, wresid); + wtotal += wcount; + if (info) { + info = 0; + (void)fprintf(stderr, + "%s -> %s %3d%%\n", + entp->fts_path, to.p_path, + cp_pct(wtotal, fs->st_size)); + + } if (wcount >= (ssize_t)wresid || wcount <= 0) break; } @@ -156,10 +168,20 @@ } else #endif { + wtotal = 0; while ((rcount = read(from_fd, buf, MAXBSIZE)) > 0) { for (bufp = buf, wresid = rcount; ; bufp += wcount, wresid -= wcount) { wcount = write(to_fd, bufp, wresid); + wtotal += wcount; + if (info) { + info = 0; + (void)fprintf(stderr, + "%s -> %s %3d%%\n", + entp->fts_path, to.p_path, + cp_pct(wtotal, fs->st_size)); + + } if (wcount >= (ssize_t)wresid || wcount <= 0) break; } ==== //depot/projects/ia64_epc/etc/Makefile#4 (text+ko) ==== @@ -1,5 +1,5 @@ # from: @(#)Makefile 5.11 (Berkeley) 5/21/91 -# $FreeBSD: src/etc/Makefile,v 1.307 2003/04/02 20:13:59 ru Exp $ +# $FreeBSD: src/etc/Makefile,v 1.308 2003/04/08 16:14:02 des Exp $ .if !defined(NO_SENDMAIL) SUBDIR= sendmail @@ -129,6 +129,8 @@ ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 /dev/null \ ${DESTDIR}/var/log/cron ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 /dev/null \ + ${DESTDIR}/var/log/debug.log + ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 /dev/null \ ${DESTDIR}/var/log/xferlog ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \ ${DESTDIR}/var/log/lpd-errs ==== //depot/projects/ia64_epc/etc/newsyslog.conf#3 (text+ko) ==== @@ -1,5 +1,5 @@ # configuration file for newsyslog -# $FreeBSD: src/etc/newsyslog.conf,v 1.43 2003/02/16 13:07:20 des Exp $ +# $FreeBSD: src/etc/newsyslog.conf,v 1.44 2003/04/08 16:14:02 des Exp $ # # Note: some sites will want to select more restrictive protections than the # defaults. In particular, it may be desirable to switch many of the 644 @@ -14,6 +14,7 @@ /var/log/console.log 600 5 100 * J /var/log/cron 600 3 100 * J /var/log/daily.log 640 7 * @T00 J +/var/log/debug.log 600 7 100 * J /var/log/kerberos.log 600 7 100 * J /var/log/lpd-errs 644 7 100 * J /var/log/maillog 640 7 * @T00 J ==== //depot/projects/ia64_epc/etc/syslog.conf#3 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/etc/syslog.conf,v 1.24 2003/04/03 18:37:49 yar Exp $ +# $FreeBSD: src/etc/syslog.conf,v 1.25 2003/04/08 16:14:02 des Exp $ # # Spaces ARE valid field separators in this file. However, # other *nix-like systems still insist on using tabs as field @@ -13,6 +13,7 @@ lpr.info /var/log/lpd-errs ftp.info /var/log/xferlog cron.* /var/log/cron +*.debug /var/log/debug.log *.emerg * # uncomment this to log all writes to /dev/console to /var/log/console.log #console.info /var/log/console.log ==== //depot/projects/ia64_epc/include/fstab.h#2 (text+ko) ==== @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)fstab.h 8.1 (Berkeley) 6/2/93 - * $FreeBSD: src/include/fstab.h,v 1.3 2002/03/23 17:24:53 imp Exp $ + * $FreeBSD: src/include/fstab.h,v 1.4 2003/04/07 12:54:59 mdodd Exp $ */ #ifndef _FSTAB_H_ @@ -75,6 +75,8 @@ struct fstab *getfsfile(const char *); int setfsent(void); void endfsent(void); +void setfstab(const char *); +const char *getfstab(void); __END_DECLS #endif /* !_FSTAB_H_ */ ==== //depot/projects/ia64_epc/include/paths.h#2 (text+ko) ==== @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)paths.h 8.1 (Berkeley) 6/2/93 - * $FreeBSD: src/include/paths.h,v 1.17 2002/07/14 13:04:15 sobomax Exp $ + * $FreeBSD: src/include/paths.h,v 1.18 2003/04/07 16:21:25 mdodd Exp $ */ #ifndef _PATHS_H_ @@ -60,6 +60,7 @@ #define _PATH_ETC "/etc" #define _PATH_FTPUSERS "/etc/ftpusers" #define _PATH_KMEM "/dev/kmem" +#define _PATH_LIBMAP_CONF "/etc/libmap.conf" #define _PATH_LOGIN "/usr/bin/login" #define _PATH_MAILDIR "/var/mail" #define _PATH_MAN "/usr/share/man" ==== //depot/projects/ia64_epc/lib/libc/gen/Makefile.inc#4 (text+ko) ==== @@ -1,5 +1,5 @@ # @(#)Makefile.inc 8.6 (Berkeley) 5/4/95 -# $FreeBSD: src/lib/libc/gen/Makefile.inc,v 1.104 2003/02/15 10:52:46 phantom Exp $ +# $FreeBSD: src/lib/libc/gen/Makefile.inc,v 1.105 2003/04/07 12:55:00 mdodd Exp $ # machine-independent gen sources .PATH: ${.CURDIR}/${MACHINE_ARCH}/gen ${.CURDIR}/gen @@ -84,7 +84,8 @@ MLINKS+=getcontext.3 setcontext.3 MLINKS+=getdomainname.3 setdomainname.3 MLINKS+=getfsent.3 endfsent.3 getfsent.3 getfsfile.3 getfsent.3 getfsspec.3 \ - getfsent.3 getfstype.3 getfsent.3 setfsent.3 + getfsent.3 getfstype.3 getfsent.3 setfsent.3 \ + getfsent.3 setfstab.3 getfsent.3 getfstab.3 MLINKS+=getgrent.3 endgrent.3 getgrent.3 getgrgid.3 getgrent.3 getgrnam.3 \ getgrent.3 setgrent.3 getgrent.3 setgroupent.3 MLINKS+=gethostname.3 sethostname.3 ==== //depot/projects/ia64_epc/lib/libc/gen/fstab.c#2 (text+ko) ==== @@ -35,7 +35,7 @@ static char sccsid[] = "@(#)fstab.c 8.1 (Berkeley) 6/4/93"; #endif /* LIBC_SCCS and not lint */ #include -__FBSDID("$FreeBSD: src/lib/libc/gen/fstab.c,v 1.13 2002/02/01 01:32:19 obrien Exp $"); +__FBSDID("$FreeBSD: src/lib/libc/gen/fstab.c,v 1.14 2003/04/07 12:55:00 mdodd Exp $"); #include "namespace.h" #include @@ -54,11 +54,40 @@ static FILE *_fs_fp; static struct fstab _fs_fstab; static int LineNo = 0; +static char *path_fstab; +static char fstab_path[PATH_MAX]; +static int fsp_set = 0; static void error(int); static void fixfsfile(void); static int fstabscan(void); +void +setfstab(const char *file) +{ + + if (file == NULL) { + path_fstab = _PATH_FSTAB; + } else { + strncpy(fstab_path, file, PATH_MAX); + fstab_path[PATH_MAX - 1] = '\0'; + path_fstab = fstab_path; + } + fsp_set = 1; + + return; +} + +const char * +getfstab (void) +{ + + if (fsp_set) + return (path_fstab); + else + return (_PATH_FSTAB); +} + static void fixfsfile() { @@ -226,7 +255,13 @@ LineNo = 0; return(1); } - if ((_fs_fp = fopen(_PATH_FSTAB, "r")) != NULL) { + if (fsp_set == 0) { + if (issetugid()) + setfstab(NULL); + else + setfstab(getenv("PATH_FSTAB")); + } + if ((_fs_fp = fopen(path_fstab, "r")) != NULL) { LineNo = 0; return(1); } @@ -241,6 +276,8 @@ (void)fclose(_fs_fp); _fs_fp = NULL; } + + fsp_set = 0; } static void @@ -251,7 +288,7 @@ char num[30]; (void)_write(STDERR_FILENO, "fstab: ", 7); - (void)_write(STDERR_FILENO, _PATH_FSTAB, sizeof(_PATH_FSTAB) - 1); + (void)_write(STDERR_FILENO, path_fstab, strlen(path_fstab)); (void)_write(STDERR_FILENO, ":", 1); sprintf(num, "%d: ", LineNo); (void)_write(STDERR_FILENO, num, strlen(num)); ==== //depot/projects/ia64_epc/lib/libc/gen/getfsent.3#2 (text+ko) ==== @@ -30,9 +30,9 @@ .\" SUCH DAMAGE. .\" .\" @(#)getfsent.3 8.1 (Berkeley) 6/4/93 -.\" $FreeBSD: src/lib/libc/gen/getfsent.3,v 1.9 2001/10/01 16:08:51 ru Exp $ +.\" $FreeBSD: src/lib/libc/gen/getfsent.3,v 1.12 2003/04/07 22:59:12 mdodd Exp $ .\" -.Dd June 4, 1993 +.Dd April 7, 2003 .Dt GETFSENT 3 .Os .Sh NAME @@ -56,6 +56,10 @@ .Fn setfsent void .Ft void .Fn endfsent void +.Ft void +.Fn setfstab "const char *file" +.Ft const char * +.Fn getfstab void .Sh DESCRIPTION The .Fn getfsent , @@ -94,6 +98,18 @@ closes the file. .Pp The +.Fn setfstab +function sets the file to be used by subsequent operations. +The value set by +.Fn setfstab +does not persist across calls to +.Fn endfsent +.Pp +The +.Fn getfstab +function returns the name of the file that that will be used. +.Pp +The .Fn getfsspec and .Fn getfsfile @@ -128,6 +144,20 @@ .Fn endfsent function returns nothing. +.Sh ENVIRONMENT +.Bl -tag -width PATH_FSTAB +.It Pa PATH_FSTAB +If the environment variable +.Pa PATH_FSTAB +is set all operations are performed against the specified file. +.Pa PATH_FSTAB +will not be honored if the process environment or memory address space is +considred +.Dq tainted . +(See +.Fn issetugid +for more information.) +.El .Sh FILES .Bl -tag -width /etc/fstab -compact .It Pa /etc/fstab @@ -146,7 +176,13 @@ and .Fn setfsent functions appeared in -.Bx 4.3 . +.Bx 4.3 ; +the +.Fn setfstab +and +.Fn getfstab +functions appeared in +.Fx 5.1. .Sh BUGS These functions use static data storage; if the data is needed for future use, it should be ==== //depot/projects/ia64_epc/lib/libc/stdio/vfwprintf.c#4 (text+ko) ==== @@ -39,9 +39,9 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)vfprintf.c 8.1 (Berkeley) 6/4/93"; #endif /* LIBC_SCCS and not lint */ -__FBSDID("FreeBSD: src/lib/libc/stdio/vfprintf.c,v 1.52 2003/03/14 04:48:09 das Exp"); +__FBSDID("FreeBSD: src/lib/libc/stdio/vfprintf.c,v 1.57 2003/04/07 03:17:39 ache Exp"); #endif -__FBSDID("$FreeBSD: src/lib/libc/stdio/vfwprintf.c,v 1.9 2003/04/05 22:08:53 das Exp $"); +__FBSDID("$FreeBSD: src/lib/libc/stdio/vfwprintf.c,v 1.10 2003/04/07 06:36:49 tjr Exp $"); /* * Actual wprintf innards. @@ -114,10 +114,10 @@ }; static int __sbprintf(FILE *, const wchar_t *, va_list); -static wchar_t *__ujtoa(uintmax_t, wchar_t *, int, int, wchar_t *, int, char, - const char *); -static wchar_t *__ultoa(u_long, wchar_t *, int, int, wchar_t *, int, char, - const char *); +static wchar_t *__ujtoa(uintmax_t, wchar_t *, int, int, const wchar_t *, int, + char, const char *); +static wchar_t *__ultoa(u_long, wchar_t *, int, int, const wchar_t *, int, + char, const char *); static wchar_t *__mbsconv(char *, int); static void __find_arguments(const wchar_t *, va_list, union arg **); static void __grow_type_table(int, enum typeid **, int *); @@ -169,7 +169,7 @@ * use the given digits. */ static wchar_t * -__ultoa(u_long val, wchar_t *endp, int base, int octzero, wchar_t *xdigs, +__ultoa(u_long val, wchar_t *endp, int base, int octzero, const wchar_t *xdigs, int needgrp, char thousep, const char *grp) { wchar_t *cp = endp; @@ -246,8 +246,8 @@ /* Identical to __ultoa, but for intmax_t. */ static wchar_t * -__ujtoa(uintmax_t val, wchar_t *endp, int base, int octzero, wchar_t *xdigs, - int needgrp, char thousep, const char *grp) +__ujtoa(uintmax_t val, wchar_t *endp, int base, int octzero, + const wchar_t *xdigs, int needgrp, char thousep, const char *grp) { wchar_t *cp = endp; intmax_t sval; @@ -330,6 +330,9 @@ size_t insize, nchars, nconv; mbstate_t mbs; + if (mbsarg == NULL) + return (NULL); + /* * Supplied argument is a multibyte string; convert it to wide * characters first. @@ -400,16 +403,17 @@ } #ifdef FLOATING_POINT + +#define dtoa __dtoa +#define freedtoa __freedtoa + #include #include #include "floatio.h" +#include "gdtoa.h" #define DEFPREC 6 -extern char *__dtoa(double, int, int, int *, int *, char **); -extern void __freedtoa(char *s); - -static wchar_t *cvt(double, int, int, char *, int *, wchar_t, int *); static int exponent(wchar_t *, int, wchar_t); #endif /* FLOATING_POINT */ @@ -429,7 +433,6 @@ * Flags used during conversion. */ #define ALT 0x001 /* alternate form */ -#define HEXPREFIX 0x002 /* add 0x or 0X prefix */ #define LADJUST 0x004 /* left adjustment */ #define LONGDBL 0x008 /* long double */ #define LONGINT 0x010 /* long integer */ @@ -452,24 +455,46 @@ { wchar_t *fmt; /* format string */ wchar_t ch; /* character from fmt */ - int n, n2; /* handy integer (short term usage) */ + int n, n2, n3; /* handy integer (short term usage) */ wchar_t *cp; /* handy char pointer (short term usage) */ int flags; /* flags as above */ int ret; /* return value accumulator */ int width; /* width from format (%8d), or 0 */ - int prec; /* precision from format (%.3d), or -1 */ + int prec; /* precision from format; <0 for N/A */ wchar_t sign; /* sign prefix (' ', '+', '-', or \0) */ char thousands_sep; /* locale specific thousands separator */ const char *grouping; /* locale specific numeric grouping rules */ #ifdef FLOATING_POINT + /* + * We can decompose the printed representation of floating + * point numbers into several parts, some of which may be empty: + * + * [+|-| ] [0x|0X] MMM . NNN [e|E|p|P] [+|-] ZZ + * A B ---C--- D E F + * + * A: 'sign' holds this value if present; '\0' otherwise + * B: ox[1] holds the 'x' or 'X'; '\0' if not hexadecimal + * C: cp points to the string MMMNNN. Leading and trailing + * zeros are not in the string and must be added. + * D: expchar holds this character; '\0' if no exponent, e.g. %f + * F: at least two digits for decimal, at least one digit for hex + */ char *decimal_point; /* locale specific decimal point */ - char softsign; /* temporary negative sign for floats */ - double _double; /* double precision arguments %[eEfgG] */ + int signflag; /* true if float is negative */ + union { /* floating point arguments %[aAeEfFgG] */ + double dbl; + long double ldbl; + } fparg; int expt; /* integer value of exponent */ + char expchar; /* exponent character: [eEpP\0] */ + char *dtoaend; /* pointer to end of converted digits */ int expsize; /* character count for expstr */ - int ndig; /* actual number of digits returned by cvt */ - wchar_t expstr[7]; /* buffer for exponent string */ - wchar_t *dtoaresult; /* buffer allocated by dtoa */ + int lead; /* sig figs before decimal or group sep */ + int ndig; /* actual number of digits returned by dtoa */ + wchar_t expstr[MAXEXPDIG+2]; /* buffer for exponent string: e+ZZZ */ + char *dtoaresult; /* buffer allocated by dtoa */ + int nseps; /* number of group separators with ' */ + int nrepeats; /* number of repeats of the last group */ #endif u_long ulval; /* integer arguments %[diouxX] */ uintmax_t ujval; /* %j, %ll, %q, %t, %z integers */ @@ -478,7 +503,7 @@ int realsz; /* field size expanded by dprec, sign, etc */ int size; /* size of converted field or string */ int prsize; /* max size of printed field */ - wchar_t *xdigs; /* digits for [xX] conversion */ + const wchar_t *xdigs; /* digits for [xX] conversion */ wchar_t buf[BUF]; /* buffer with space for digits of uintmax_t */ wchar_t ox[2]; /* space for 0x hex-prefix */ union arg *argtable; /* args, built due to positional arg */ @@ -498,13 +523,16 @@ static wchar_t zeroes[PADSIZE] = {'0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0'}; + static const wchar_t xdigs_lower[16] = L"0123456789abcdef"; + static const wchar_t xdigs_upper[16] = L"0123456789ABCDEF"; + /* * BEWARE, these `goto error' on error, PRINT uses `n2' and * PAD uses `n'. */ #define PRINT(ptr, len) do { \ - for (n2 = 0; n2 < (len); n2++) \ - __fputwc((ptr)[n2], fp); \ + for (n3 = 0; n3 < (len); n3++) \ + __fputwc((ptr)[n3], fp); \ } while (0) #define PAD(howmany, with) do { \ if ((n = (howmany)) > 0) { \ @@ -515,6 +543,14 @@ PRINT(with, n); \ } \ } while (0) +#define PRINTANDPAD(p, ep, len, with) do { \ + n2 = (ep) - (p); \ + if (n2 > (len)) \ + n2 = (len); \ + if (n2 > 0) \ + PRINT((p), n2); \ + PAD((len) - (n2 > 0 ? n2 : 0), (with)); \ +} while(0) /* * Get the argument indexed by nextarg. If the argument table is @@ -580,7 +616,6 @@ thousands_sep = '\0'; grouping = NULL; #ifdef FLOATING_POINT - dtoaresult = NULL; decimal_point = localeconv()->decimal_point; #endif convbuf = NULL; @@ -622,6 +657,7 @@ width = 0; prec = -1; sign = '\0'; + ox[1] = '\0'; rflag: ch = *fmt++; reswitch: switch (ch) { @@ -662,16 +698,14 @@ goto rflag; case '.': if ((ch = *fmt++) == '*') { - GETASTER (n); - prec = n < 0 ? -1 : n; + GETASTER (prec); goto rflag; } - n = 0; + prec = 0; while (is_digit(ch)) { - n = 10 * n + to_digit(ch); + prec = 10 * prec + to_digit(ch); ch = *fmt++; } - prec = n < 0 ? -1 : n; goto reswitch; case '0': /*- @@ -765,86 +799,128 @@ #ifdef HEXFLOAT case 'a': case 'A': + if (ch == 'a') { + ox[1] = 'x'; + xdigs = xdigs_lower; + expchar = 'p'; + } else { + ox[1] = 'X'; + xdigs = xdigs_upper; + expchar = 'P'; + } + /* + * XXX We don't actually have a conversion + * XXX routine for this yet. + */ + if (flags & LONGDBL) { + fparg.ldbl = (double)GETARG(long double); + dtoaresult = + __hldtoa(fparg.ldbl, xdigs, prec, + &expt, &signflag, &dtoaend); + } else { + fparg.dbl = GETARG(double); + dtoaresult = + __hdtoa(fparg.dbl, xdigs, prec, + &expt, &signflag, &dtoaend); + } + if (convbuf != NULL) + free(convbuf); + cp = convbuf = __mbsconv(dtoaresult, -1); + freedtoa(dtoaresult); + goto fp_begin; #endif case 'e': case 'E': - /*- - * Grouping apply to %i, %d, %u, %f, %F, %g, %G - * conversion specifiers only. For other conversions - * behavior is undefined. - * -- POSIX - */ - flags &= ~GROUPING; - /*FALLTHROUGH*/ + expchar = ch; + if (prec < 0) /* account for digit before decpt */ + prec = DEFPREC + 1; + else + prec++; + goto fp_begin; case 'f': case 'F': + expchar = '\0'; goto fp_begin; case 'g': case 'G': + expchar = ch - ('g' - 'e'); if (prec == 0) prec = 1; -fp_begin: if (prec == -1) +fp_begin: + if (prec < 0) prec = DEFPREC; - if (flags & LONGDBL) - /* XXX this loses precision. */ - _double = (double)GETARG(long double); - else - _double = GETARG(double); - /* do this before tricky precision changes */ - if (isinf(_double)) { - if (_double < 0) - sign = '-'; - if (iswupper(ch)) - cp = L"INF"; - else - cp = L"inf"; - size = 3; - break; + if (convbuf != NULL) + free(convbuf); + if (flags & LONGDBL) { + fparg.ldbl = GETARG(long double); + dtoaresult = + __ldtoa(&fparg.ldbl, expchar ? 2 : 3, prec, + &expt, &signflag, &dtoaend); + } else { + fparg.dbl = GETARG(double); + dtoaresult = + dtoa(fparg.dbl, expchar ? 2 : 3, prec, + &expt, &signflag, &dtoaend); + if (expt == 9999) + expt = INT_MAX; } - if (isnan(_double)) { - if (iswupper(ch)) - cp = L"NAN"; - else - cp = L"nan"; + ndig = dtoaend - dtoaresult; + cp = convbuf = __mbsconv(dtoaresult, -1); + freedtoa(dtoaresult); + if (signflag) + sign = '-'; + if (expt == INT_MAX) { /* inf or nan */ + if (*cp == 'N') { + cp = (ch >= 'a') ? L"nan" : L"NAN"; + sign = '\0'; + } else + cp = (ch >= 'a') ? L"inf" : L"INF"; size = 3; break; } flags |= FPT; - if (dtoaresult != NULL) { - free(dtoaresult); - dtoaresult = NULL; - } - dtoaresult = cp = cvt(_double, prec, flags, &softsign, - &expt, ch, &ndig); if (ch == 'g' || ch == 'G') { - if (expt <= -4 || expt > prec) - ch = (ch == 'g') ? 'e' : 'E'; - else - ch = 'g'; + if (expt > -4 && expt <= prec) { + /* Make %[gG] smell like %[fF] */ + expchar = '\0'; + if (flags & ALT) + prec -= expt; + else + prec = ndig - expt; + if (prec < 0) + prec = 0; + } } - if (ch == 'e' || ch == 'E') { - --expt; - expsize = exponent(expstr, expt, ch); - size = expsize + ndig; - if (ndig > 1 || flags & ALT) + if (expchar) { + expsize = exponent(expstr, expt - 1, expchar); + size = expsize + prec; + if (prec > 1 || flags & ALT) ++size; - } else if (ch == 'f' || ch == 'F') { + } else { if (expt > 0) { size = expt; if (prec || flags & ALT) size += prec + 1; } else /* "0.X" */ size = prec + 2; - } else if (expt >= ndig) { /* fixed g fmt */ - size = expt; - if (flags & ALT) - ++size; - } else - size = ndig + (expt > 0 ? - 1 : 2 - expt); - - if (softsign) - sign = '-'; + if (grouping && expt > 0) { + /* space for thousands' grouping */ + nseps = nrepeats = 0; + lead = expt; + while (*grouping != CHAR_MAX) { + if (lead <= *grouping) + break; + lead -= *grouping; + if (*(grouping+1)) { + nseps++; + grouping++; + } else + nrepeats++; + } + size += nseps + nrepeats; + } else + lead = expt; + } break; #endif /* FLOATING_POINT */ case 'n': @@ -890,9 +966,9 @@ */ ujval = (uintmax_t)(uintptr_t)GETARG(void *); base = 16; - xdigs = L"0123456789abcdef"; - flags = flags | INTMAXT | HEXPREFIX; - ch = 'x'; + xdigs = xdigs_lower; + flags = flags | INTMAXT; + ox[1] = 'x'; goto nosign; case 'S': flags |= LONGINT; @@ -947,10 +1023,10 @@ base = 10; >>> TRUNCATED FOR MAIL (1000 lines) <<< From owner-p4-projects@FreeBSD.ORG Tue Apr 8 17:14:21 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 3503737B405; Tue, 8 Apr 2003 17:14:21 -0700 (PDT) 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 C312037B404 for ; Tue, 8 Apr 2003 17:14:18 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3767F43F93 for ; Tue, 8 Apr 2003 17:14:18 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h390EI0U013283 for ; Tue, 8 Apr 2003 17:14:18 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h390EHZN013280 for perforce@freebsd.org; Tue, 8 Apr 2003 17:14:17 -0700 (PDT) Date: Tue, 8 Apr 2003 17:14:17 -0700 (PDT) Message-Id: <200304090014.h390EHZN013280@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28576 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, 09 Apr 2003 00:14:22 -0000 http://perforce.freebsd.org/chv.cgi?CH=28576 Change 28576 by peter@peter_daintree on 2003/04/08 17:14:13 remove serial_putc hack, sio works now. Affected files ... .. //depot/projects/hammer/sys/kern/tty_cons.c#5 edit Differences ... ==== //depot/projects/hammer/sys/kern/tty_cons.c#5 (text+ko) ==== @@ -116,10 +116,8 @@ static int openflag; /* how /dev/console was opened */ static int cn_is_open; static u_char console_pausing; /* pause after each line during probe */ -#if 0 static char *console_pausestr= ""; -#endif void cndebug(char *); @@ -543,11 +541,6 @@ void cnputc(int c) { -#if 1 - if (c == '\n') - serial_putc('\r'); - serial_putc(c); -#else struct cn_device *cnd; struct consdev *cn; char *cp; @@ -574,7 +567,6 @@ cnputc(' '); cnputc('\r'); } -#endif } void From owner-p4-projects@FreeBSD.ORG Tue Apr 8 17:14:23 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id B0CA137B40E; Tue, 8 Apr 2003 17:14:21 -0700 (PDT) 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 A8D4A37B401 for ; Tue, 8 Apr 2003 17:14:18 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id AFBF743F75 for ; Tue, 8 Apr 2003 17:14:17 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h390EH0U013277 for ; Tue, 8 Apr 2003 17:14:17 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h390EHRo013274 for perforce@freebsd.org; Tue, 8 Apr 2003 17:14:17 -0700 (PDT) Date: Tue, 8 Apr 2003 17:14:17 -0700 (PDT) Message-Id: <200304090014.h390EHRo013274@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28575 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, 09 Apr 2003 00:14:23 -0000 http://perforce.freebsd.org/chv.cgi?CH=28575 Change 28575 by peter@peter_daintree on 2003/04/08 17:13:33 I dont freaking believe it. Work around a compiler bug. gcc was compiling this as p[4294967295] instead of p[-1] Affected files ... .. //depot/projects/hammer/sys/kern/subr_scanf.c#3 edit Differences ... ==== //depot/projects/hammer/sys/kern/subr_scanf.c#3 (text+ko) ==== @@ -498,7 +498,7 @@ } goto match_failure; } - c = ((u_char *)p)[-1]; + c = (((u_char *)p) - 1)[0]; if (c == 'x' || c == 'X') { --p; inp--; From owner-p4-projects@FreeBSD.ORG Tue Apr 8 17:16:22 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 2DC5E37B404; Tue, 8 Apr 2003 17:16:22 -0700 (PDT) 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 C019A37B401 for ; Tue, 8 Apr 2003 17:16:21 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 570C643F3F for ; Tue, 8 Apr 2003 17:16:21 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h390GL0U013406 for ; Tue, 8 Apr 2003 17:16:21 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h390GKCY013403 for perforce@freebsd.org; Tue, 8 Apr 2003 17:16:20 -0700 (PDT) Date: Tue, 8 Apr 2003 17:16:20 -0700 (PDT) Message-Id: <200304090016.h390GKCY013403@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28577 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, 09 Apr 2003 00:16:23 -0000 http://perforce.freebsd.org/chv.cgi?CH=28577 Change 28577 by peter@peter_daintree on 2003/04/08 17:15:21 take the SYSINIT trace back out again... I know I'm going to regret this. Affected files ... .. //depot/projects/hammer/sys/kern/init_main.c#9 edit Differences ... ==== //depot/projects/hammer/sys/kern/init_main.c#9 (text+ko) ==== @@ -210,8 +210,6 @@ if ((*sipp)->subsystem == SI_SUB_DONE) continue; -if (bootverbose) -printf("SYSINIT: 0x%08lx:0x%08lx 0x%08lx(0x%08lx)\n", (long)((*sipp)->subsystem), (long)((*sipp)->order), (long)((*sipp)->func), (long)((*sipp)->udata)); /* Call function */ (*((*sipp)->func))((*sipp)->udata); From owner-p4-projects@FreeBSD.ORG Tue Apr 8 17:22:31 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 6D70D37B409; Tue, 8 Apr 2003 17:22:31 -0700 (PDT) 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 E17F637B408 for ; Tue, 8 Apr 2003 17:22:30 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9102B43FD7 for ; Tue, 8 Apr 2003 17:22:29 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h390MT0U013942 for ; Tue, 8 Apr 2003 17:22:29 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h390MSQL013939 for perforce@freebsd.org; Tue, 8 Apr 2003 17:22:28 -0700 (PDT) Date: Tue, 8 Apr 2003 17:22:28 -0700 (PDT) Message-Id: <200304090022.h390MSQL013939@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28578 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, 09 Apr 2003 00:22:32 -0000 http://perforce.freebsd.org/chv.cgi?CH=28578 Change 28578 by peter@peter_daintree on 2003/04/08 17:21:50 integrate i386_hammer branch Affected files ... .. //depot/projects/hammer/sys/x86_64/include/pmap.h#17 integrate .. //depot/projects/hammer/sys/x86_64/include/vmparam.h#6 integrate .. //depot/projects/hammer/sys/x86_64/x86_64/busdma_machdep.c#5 integrate Differences ... ==== //depot/projects/hammer/sys/x86_64/include/pmap.h#17 (text+ko) ==== @@ -42,7 +42,7 @@ * * from: hp300: @(#)pmap.h 7.2 (Berkeley) 12/16/90 * from: @(#)pmap.h 7.4 (Berkeley) 5/12/91 - * $FreeBSD: src/sys/i386/include/pmap.h,v 1.96 2003/04/04 10:09:44 jake Exp $ + * $FreeBSD: src/sys/i386/include/pmap.h,v 1.98 2003/04/08 18:22:41 jake Exp $ */ #ifndef _MACHINE_PMAP_H_ ==== //depot/projects/hammer/sys/x86_64/include/vmparam.h#6 (text+ko) ==== @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * from: @(#)vmparam.h 5.9 (Berkeley) 5/12/91 - * $FreeBSD: src/sys/i386/include/vmparam.h,v 1.34 2003/02/24 20:29:52 jake Exp $ + * $FreeBSD: src/sys/i386/include/vmparam.h,v 1.35 2003/04/07 14:27:19 jake Exp $ */ @@ -86,7 +86,7 @@ * messy at times, but hey, we'll do anything to save a page :-) */ -#define VM_MAX_KERNEL_ADDRESS VADDR(0, 0, KPTDI+NKPDE, 0) +#define VM_MAX_KERNEL_ADDRESS VADDR(0, 0, KPTDI+NKPDE-1, NPTEPG-1) #define VM_MIN_KERNEL_ADDRESS VADDR(0, 0, PTDPTDI, PTDPTDI) #define KERNBASE VADDR(0, 0, KPTDI, 0) ==== //depot/projects/hammer/sys/x86_64/x86_64/busdma_machdep.c#5 (text+ko) ==== @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/i386/i386/busdma_machdep.c,v 1.38 2003/03/25 00:07:02 jake Exp $ + * $FreeBSD: src/sys/i386/i386/busdma_machdep.c,v 1.39 2003/04/07 16:08:32 jake Exp $ */ #include @@ -46,7 +46,7 @@ #include #include -#define MAX_BPAGES 128 +#define MAX_BPAGES 512 struct bus_dma_tag { bus_dma_tag_t parent; @@ -99,7 +99,8 @@ static void init_bounce_pages(void *dummy); static int alloc_bounce_pages(bus_dma_tag_t dmat, u_int numpages); -static int reserve_bounce_pages(bus_dma_tag_t dmat, bus_dmamap_t map); +static int reserve_bounce_pages(bus_dma_tag_t dmat, bus_dmamap_t map, + int commit); static bus_addr_t add_bounce_page(bus_dma_tag_t dmat, bus_dmamap_t map, vm_offset_t vaddr, bus_size_t size); static void free_bounce_page(bus_dma_tag_t dmat, struct bounce_page *bpage); @@ -294,9 +295,10 @@ panic("bus_dmamap_create: page reallocation " "not implemented"); } - pages = atop(dmat->maxsize); + pages = MAX(atop(dmat->maxsize), 1); pages = MIN(maxpages - total_bpages, pages); - error = alloc_bounce_pages(dmat, pages); + if (alloc_bounce_pages(dmat, pages) < pages) + error = ENOMEM; if ((dmat->flags & BUS_DMA_MIN_ALLOC_COMP) == 0) { if (error == 0) @@ -458,7 +460,7 @@ /* Reserve Necessary Bounce Pages */ if (map->pagesneeded != 0) { mtx_lock(&bounce_lock); - if (reserve_bounce_pages(dmat, map) != 0) { + if (reserve_bounce_pages(dmat, map, 1) != 0) { /* Queue us for resources */ map->dmat = dmat; @@ -531,27 +533,65 @@ */ static int _bus_dmamap_load_buffer(bus_dma_tag_t dmat, + bus_dmamap_t map, bus_dma_segment_t segs[], void *buf, bus_size_t buflen, struct thread *td, int flags, - vm_offset_t *lastaddrp, + bus_addr_t *lastaddrp, int *segp, int first) { bus_size_t sgsize; bus_addr_t curaddr, lastaddr, baddr, bmask; - vm_offset_t vaddr = (vm_offset_t)buf; + vm_offset_t vaddr; + bus_addr_t paddr; + int needbounce = 0; int seg; pmap_t pmap; + if (map == NULL) + map = &nobounce_dmamap; + if (td != NULL) pmap = vmspace_pmap(td->td_proc->p_vmspace); else pmap = NULL; + if (dmat->lowaddr < ptoa((vm_paddr_t)Maxmem)) { + vm_offset_t vendaddr; + + /* + * Count the number of bounce pages + * needed in order to complete this transfer + */ + vaddr = trunc_page((vm_offset_t)buf); + vendaddr = (vm_offset_t)buf + buflen; + + while (vaddr < vendaddr) { + paddr = pmap_kextract(vaddr); + if (run_filter(dmat, paddr) != 0) { + needbounce = 1; + map->pagesneeded++; + } + vaddr += PAGE_SIZE; + } + } + + vaddr = (vm_offset_t)buf; + + /* Reserve Necessary Bounce Pages */ + if (map->pagesneeded != 0) { + mtx_lock(&bounce_lock); + if (reserve_bounce_pages(dmat, map, 0) != 0) { + mtx_unlock(&bounce_lock); + return (ENOMEM); + } + mtx_unlock(&bounce_lock); + } + lastaddr = *lastaddrp; - bmask = ~(dmat->boundary - 1); + bmask = ~(dmat->boundary - 1); for (seg = *segp; buflen > 0 ; ) { /* @@ -578,6 +618,9 @@ sgsize = (baddr - curaddr); } + if (map->pagesneeded != 0 && run_filter(dmat, curaddr)) + curaddr = add_bounce_page(dmat, map, vaddr, sgsize); + /* * Insert chunk into a segment, coalescing with * previous segment if possible. @@ -587,7 +630,7 @@ segs[seg].ds_len = sgsize; first = 0; } else { - if (curaddr == lastaddr && + if (needbounce == 0 && curaddr == lastaddr && (segs[seg].ds_len + sgsize) <= dmat->maxsegsz && (dmat->boundary == 0 || (segs[seg].ds_addr & bmask) == (curaddr & bmask))) @@ -630,8 +673,6 @@ #endif int nsegs, error; - KASSERT(dmat->lowaddr >= ptoa((vm_paddr_t)Maxmem) || map != NULL, - ("bus_dmamap_load_mbuf: No support for bounce pages!")); KASSERT(m0->m_flags & M_PKTHDR, ("bus_dmamap_load_mbuf: no packet header")); @@ -639,12 +680,12 @@ error = 0; if (m0->m_pkthdr.len <= dmat->maxsize) { int first = 1; - vm_offset_t lastaddr = 0; + bus_addr_t lastaddr = 0; struct mbuf *m; for (m = m0; m != NULL && error == 0; m = m->m_next) { if (m->m_len > 0) { - error = _bus_dmamap_load_buffer(dmat, + error = _bus_dmamap_load_buffer(dmat, map, dm_segments, m->m_data, m->m_len, NULL, flags, &lastaddr, @@ -675,7 +716,7 @@ bus_dmamap_callback2_t *callback, void *callback_arg, int flags) { - vm_offset_t lastaddr; + bus_addr_t lastaddr; #ifdef __GNUC__ bus_dma_segment_t dm_segments[dmat->nsegments]; #else @@ -686,9 +727,6 @@ struct iovec *iov; struct thread *td = NULL; - KASSERT(dmat->lowaddr >= ptoa((vm_paddr_t)Maxmem) || map != NULL, - ("bus_dmamap_load_uio: No support for bounce pages!")); - resid = uio->uio_resid; iov = uio->uio_iov; @@ -711,7 +749,7 @@ caddr_t addr = (caddr_t) iov[i].iov_base; if (minlen > 0) { - error = _bus_dmamap_load_buffer(dmat, + error = _bus_dmamap_load_buffer(dmat, map, dm_segments, addr, minlen, td, flags, &lastaddr, &nsegs, first); @@ -836,12 +874,14 @@ } static int -reserve_bounce_pages(bus_dma_tag_t dmat, bus_dmamap_t map) +reserve_bounce_pages(bus_dma_tag_t dmat, bus_dmamap_t map, int commit) { int pages; mtx_assert(&bounce_lock, MA_OWNED); pages = MIN(free_bpages, map->pagesneeded - map->pagesreserved); + if (commit == 0 && map->pagesneeded > (map->pagesreserved + pages)) + return (map->pagesneeded - (map->pagesreserved + pages)); free_bpages -= pages; reserved_bpages += pages; map->pagesreserved += pages; @@ -856,6 +896,9 @@ { struct bounce_page *bpage; + KASSERT(map != NULL && map != &nobounce_dmamap, + ("add_bounce_page: bad map %p", map)); + if (map->pagesneeded == 0) panic("add_bounce_page: map doesn't need any pages"); map->pagesneeded--; @@ -893,7 +936,7 @@ free_bpages++; active_bpages--; if ((map = STAILQ_FIRST(&bounce_map_waitinglist)) != NULL) { - if (reserve_bounce_pages(map->dmat, map) == 0) { + if (reserve_bounce_pages(map->dmat, map, 1) == 0) { STAILQ_REMOVE_HEAD(&bounce_map_waitinglist, links); STAILQ_INSERT_TAIL(&bounce_map_callbacklist, map, links); From owner-p4-projects@FreeBSD.ORG Tue Apr 8 17:23:32 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 3D08037B404; Tue, 8 Apr 2003 17:23:32 -0700 (PDT) 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 D473037B401 for ; Tue, 8 Apr 2003 17:23:31 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6A65443F85 for ; Tue, 8 Apr 2003 17:23:31 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h390NV0U013969 for ; Tue, 8 Apr 2003 17:23:31 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h390NUvI013966 for perforce@freebsd.org; Tue, 8 Apr 2003 17:23:30 -0700 (PDT) Date: Tue, 8 Apr 2003 17:23:30 -0700 (PDT) Message-Id: <200304090023.h390NUvI013966@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28579 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, 09 Apr 2003 00:23:33 -0000 http://perforce.freebsd.org/chv.cgi?CH=28579 Change 28579 by peter@peter_daintree on 2003/04/08 17:23:14 add legacy.c Affected files ... .. //depot/projects/hammer/sys/conf/files.x86_64#12 edit Differences ... ==== //depot/projects/hammer/sys/conf/files.x86_64#12 (text+ko) ==== @@ -37,6 +37,7 @@ x86_64/x86_64/dump_machdep.c standard x86_64/x86_64/elf_machdep.c standard x86_64/x86_64/exception.s standard +x86_64/x86_64/legacy.c standard x86_64/x86_64/locore.s standard no-obj x86_64/x86_64/machdep.c standard x86_64/x86_64/mem.c standard From owner-p4-projects@FreeBSD.ORG Tue Apr 8 17:37:50 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 2E54237B404; Tue, 8 Apr 2003 17:37:50 -0700 (PDT) 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 CFFBD37B401 for ; Tue, 8 Apr 2003 17:37:49 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6518143F93 for ; Tue, 8 Apr 2003 17:37:49 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h390bn0U014767 for ; Tue, 8 Apr 2003 17:37:49 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h390bnWT014764 for perforce@freebsd.org; Tue, 8 Apr 2003 17:37:49 -0700 (PDT) Date: Tue, 8 Apr 2003 17:37:49 -0700 (PDT) Message-Id: <200304090037.h390bnWT014764@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28580 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, 09 Apr 2003 00:37:51 -0000 http://perforce.freebsd.org/chv.cgi?CH=28580 Change 28580 by peter@peter_daintree on 2003/04/08 17:37:03 re-declare the cfgreg mutex. oops. I cut it by accident. Affected files ... .. //depot/projects/hammer/sys/x86_64/pci/pci_cfgreg.c#10 edit Differences ... ==== //depot/projects/hammer/sys/x86_64/pci/pci_cfgreg.c#10 (text+ko) ==== @@ -54,6 +54,8 @@ static void pcireg_cfgwrite(int bus, int slot, int func, int reg, int data, int bytes); static int pcireg_cfgopen(void); +static struct mtx pcicfg_mtx; + /* * Initialise access to PCI configuration space */ From owner-p4-projects@FreeBSD.ORG Tue Apr 8 17:37:51 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 5F95237B405; Tue, 8 Apr 2003 17:37:51 -0700 (PDT) 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 790DF37B414 for ; Tue, 8 Apr 2003 17:37:50 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id DBF5A43F93 for ; Tue, 8 Apr 2003 17:37:49 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h390bn0U014773 for ; Tue, 8 Apr 2003 17:37:49 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h390bnxT014770 for perforce@freebsd.org; Tue, 8 Apr 2003 17:37:49 -0700 (PDT) Date: Tue, 8 Apr 2003 17:37:49 -0700 (PDT) Message-Id: <200304090037.h390bnxT014770@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28581 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, 09 Apr 2003 00:37:52 -0000 http://perforce.freebsd.org/chv.cgi?CH=28581 Change 28581 by peter@peter_daintree on 2003/04/08 17:37:44 add pci_cfgreg stuff. oops. Affected files ... .. //depot/projects/hammer/sys/conf/files.x86_64#13 edit Differences ... ==== //depot/projects/hammer/sys/conf/files.x86_64#13 (text+ko) ==== @@ -57,3 +57,6 @@ x86_64/isa/isa.c standard x86_64/isa/ithread.c standard x86_64/isa/npx.c standard + +x86_64/pci/pci_cfgreg.c optional pci +x86_64/pci/pci_bus.c optional pci From owner-p4-projects@FreeBSD.ORG Tue Apr 8 17:40:55 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 280E837B404; Tue, 8 Apr 2003 17:40:55 -0700 (PDT) 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 BD06837B401 for ; Tue, 8 Apr 2003 17:40:54 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 47C3F43F93 for ; Tue, 8 Apr 2003 17:40:54 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h390es0U015226 for ; Tue, 8 Apr 2003 17:40:54 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h390erik015216 for perforce@freebsd.org; Tue, 8 Apr 2003 17:40:53 -0700 (PDT) Date: Tue, 8 Apr 2003 17:40:53 -0700 (PDT) Message-Id: <200304090040.h390erik015216@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28582 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, 09 Apr 2003 00:40:56 -0000 http://perforce.freebsd.org/chv.cgi?CH=28582 Change 28582 by peter@peter_daintree on 2003/04/08 17:40:07 less chatty Affected files ... .. //depot/projects/hammer/sys/x86_64/x86_64/autoconf.c#8 edit .. //depot/projects/hammer/sys/x86_64/x86_64/machdep.c#56 edit Differences ... ==== //depot/projects/hammer/sys/x86_64/x86_64/autoconf.c#8 (text+ko) ==== @@ -107,7 +107,6 @@ configure(dummy) void *dummy; { -printf("configure\n"); /* * Activate the ICU's. Note that we are explicitly at splhigh() @@ -125,16 +124,12 @@ * * This is all rather inconvenient. */ -printf("enable_intr\n"); enable_intr(); -printf("enable IRQ_SLAVE\n"); INTREN(IRQ_SLAVE); -printf("add nexus\n"); /* nexus0 is the top of the i386 device tree */ device_add_child(root_bus, "nexus", 0); -printf("root bus config\n"); /* initialize new bus architecture */ root_bus_configure(); @@ -143,19 +138,15 @@ * Explicitly probe and attach ISA last. The isa bus saves * it's device node at attach time for us here. */ - if (isa_bus_device) { -printf("isa_probe_children\n"); + if (isa_bus_device) isa_probe_children(isa_bus_device); - } #endif -printf("spl0()\n"); /* * Now we're ready to handle (pending) interrupts. * XXX this is slightly misplaced. */ spl0(); -printf("end configure\n"); } static void ==== //depot/projects/hammer/sys/x86_64/x86_64/machdep.c#56 (text+ko) ==== @@ -737,7 +737,7 @@ */ smapbase = MD_FETCH(kmdp, MODINFOMD_SMAP, struct bios_smap *) + KERNBASE; if (smapbase == 0) { - printf("no bios smap info from loader, winging it\n"); + printf("No BIOS smap info from loader!\n"); goto deep_shit; } printf("smapbase: %p\n", smapbase); @@ -798,7 +798,6 @@ if (basemem == 0) { basemem = rtcin(RTC_BASELO) + (rtcin(RTC_BASEHI) << 8); -printf("rtc says basemem = %d\n", basemem); } if (basemem == 0) { @@ -825,7 +824,6 @@ * Prefer the RTC value for extended memory. */ extmem = rtcin(RTC_EXTLO) + (rtcin(RTC_EXTHI) << 8); -printf("rtc says extmem = %d\n", extmem); /* * Special hack for chipsets that still remap the 384k hole when From owner-p4-projects@FreeBSD.ORG Tue Apr 8 17:43:03 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 6018637B404; Tue, 8 Apr 2003 17:43:02 -0700 (PDT) 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 EE0C037B401 for ; Tue, 8 Apr 2003 17:42:58 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6A21843FAF for ; Tue, 8 Apr 2003 17:42:57 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h390gv0U015310 for ; Tue, 8 Apr 2003 17:42:57 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h390gu9N015307 for perforce@freebsd.org; Tue, 8 Apr 2003 17:42:56 -0700 (PDT) Date: Tue, 8 Apr 2003 17:42:56 -0700 (PDT) Message-Id: <200304090042.h390gu9N015307@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28583 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, 09 Apr 2003 00:43:04 -0000 http://perforce.freebsd.org/chv.cgi?CH=28583 Change 28583 by peter@peter_daintree on 2003/04/08 17:42:27 IFC @28572 Affected files ... .. //depot/projects/hammer/lib/libutil/pw_util.c#4 integrate .. //depot/projects/hammer/sys/dev/adlink/adlink.c#2 integrate .. //depot/projects/hammer/sys/dev/ata/ata-raid.c#7 integrate .. //depot/projects/hammer/sys/dev/fxp/if_fxp.c#11 integrate .. //depot/projects/hammer/sys/i386/include/pmap.h#5 integrate .. //depot/projects/hammer/sys/kern/uipc_cow.c#6 integrate .. //depot/projects/hammer/sys/sparc64/conf/GENERIC#9 integrate Differences ... ==== //depot/projects/hammer/lib/libutil/pw_util.c#4 (text+ko) ==== @@ -43,7 +43,7 @@ static const char sccsid[] = "@(#)pw_util.c 8.3 (Berkeley) 4/2/94"; #endif static const char rcsid[] = - "$FreeBSD: src/lib/libutil/pw_util.c,v 1.28 2003/03/17 02:12:55 das Exp $"; + "$FreeBSD: src/lib/libutil/pw_util.c,v 1.29 2003/04/08 18:04:30 des Exp $"; #endif /* not lint */ /* @@ -290,7 +290,6 @@ struct stat st1, st2; const char *editor; char *editcmd; - int editcmdlen; int pstat; if ((editor = getenv("EDITOR")) == NULL) @@ -306,14 +305,8 @@ (void)setgid(getgid()); (void)setuid(getuid()); } - if ((editcmdlen = sysconf(_SC_ARG_MAX) - 6) <= 0 || - (editcmd = malloc(editcmdlen)) == NULL) - _exit(EXIT_FAILURE); - if (snprintf(editcmd, editcmdlen, "%s %s", - editor, tempname) >= editcmdlen) { - free(editcmd); /* pedantry */ + if (asprintf(&editcmd, "exec %s %s", editor, tempname) == NULL) _exit(EXIT_FAILURE); - } errno = 0; execl(_PATH_BSHELL, "sh", "-c", editcmd, NULL); free(editcmd); @@ -322,13 +315,16 @@ /* parent */ break; } + setpgid(editpid, editpid); + tcsetpgrp(1, editpid); for (;;) { - editpid = waitpid(editpid, &pstat, WUNTRACED); - if (editpid == -1) { + if (waitpid(editpid, &pstat, WUNTRACED) == -1) { unlink(tempname); return (-1); } else if (WIFSTOPPED(pstat)) { raise(WSTOPSIG(pstat)); + tcsetpgrp(1, getpgid(editpid)); + kill(editpid, SIGCONT); } else if (WIFEXITED(pstat) && WEXITSTATUS(pstat) == 0) { editpid = -1; break; ==== //depot/projects/hammer/sys/dev/adlink/adlink.c#2 (text+ko) ==== @@ -26,13 +26,15 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/adlink/adlink.c,v 1.1 2003/04/04 18:53:04 phk Exp $ + * $FreeBSD: src/sys/dev/adlink/adlink.c,v 1.2 2003/04/08 19:12:48 phk Exp $ */ +#ifdef _KERNEL #include #include #include #include +#include #include #include #include @@ -44,17 +46,54 @@ #include #include +#endif /* _KERNEL */ + +#include + +struct wave { + int index; + int period; + int offset; + int length; + int avg; + off_t mapvir; + int flags; + + int npages; + void **virtual; +}; + +#define ADLINK_SETWAVE _IOWR('A', 232, struct wave) +#define ADLINK_GETWAVE _IOWR('A', 233, struct wave) + +#ifdef _KERNEL + +#define INTPERPAGE (PAGE_SIZE / sizeof(int)) +#define I16PERPAGE (PAGE_SIZE / sizeof(int16_t)) + /* - * We sample one channel (= 16 bits) at 1 msps giving 2Mbyte/sec, - * 50 pages will give us about 1/10 second buffering. + * Sample rate + */ +#define SPS 1250000 + +/* + * We sample one channel (= 16 bits) at 1.25 msps giving 2.5Mbyte/sec, + * 100 pages will give us about 1/6 second buffering. */ -#define NRING 50 +#define NRING 100 -#define IN4(sc, offset) bus_space_read_4(sc->t_io, sc->h_io, offset) +/* + * How many waves are we willing to entertain + */ +#define NWAVE 25 struct info { int nring; off_t o_ring; + + int ngri; + int ppgri; + off_t o_gri; }; struct softc { @@ -64,21 +103,145 @@ bus_space_tag_t t0, t1; bus_space_handle_t h0, h1; dev_t dev; + off_t mapvir; + struct proc *procp; + struct info *info; + struct wave *wave[NWAVE]; + int idx; void *ring[NRING]; - vm_paddr_t phys[NRING]; + vm_paddr_t pring[NRING]; int stat[NRING]; + + uint64_t cnt; + + u_char flags[I16PERPAGE]; }; +static void +adlink_wave(struct softc *sc, struct wave *wp, int16_t *sp) +{ + int f, i, k, m, *ip; + + f = 0; + for (i = 0; i < I16PERPAGE; ) { + k = (sc->cnt - wp->offset + i) % wp->period; + if (k >= wp->length) { + i += wp->period - k; + sp += wp->period - k; + continue; + } + m = k % INTPERPAGE; + ip = (int *)(wp->virtual[k / INTPERPAGE]) + m; + while (m < INTPERPAGE && i < I16PERPAGE && k < wp->length) { + if (sc->flags[i] >= wp->index) + *ip += (*sp * 8 - *ip) >> wp->avg; + if (wp->flags & 1) + sc->flags[i] = wp->index; + sp++; + ip++; + m++; + i++; + k++; + } + } +} + +static void +adlink_tickle(struct softc *sc) +{ + + wakeup(sc); + tsleep(&sc->ring, PUSER | PCATCH, "tickle", 1); +} + static int +adlink_new_wave(struct softc *sc, int index, int period, int offset, int length, int avg, int flags) +{ + struct wave *wp; + int l, i; + void **oldvir, **newvir; + + if (index < 0 || index >= NWAVE) + return (EINVAL); + wp = sc->wave[index]; + if (wp == NULL) { + adlink_tickle(sc); + wp = malloc(sizeof *wp, M_DEVBUF, M_WAITOK | M_ZERO); + } + l = howmany(length, INTPERPAGE); + /* Setting a high average here to neuter the realtime bits */ + wp->avg = 31; + if (wp->npages < l) { + oldvir = wp->virtual; + adlink_tickle(sc); + newvir = malloc(sizeof(void *) * l, M_DEVBUF, M_WAITOK | M_ZERO); + if (wp->npages > 0) { + adlink_tickle(sc); + bcopy(oldvir, newvir, wp->npages * sizeof(void *)); + } + for (i = wp->npages; i < l; i++) { + adlink_tickle(sc); + newvir[i] = malloc(PAGE_SIZE, M_DEVBUF, M_WAITOK); + } + wp->virtual = newvir; + wp->npages = l; + wp->mapvir = sc->mapvir; + sc->mapvir += l * PAGE_SIZE; + } else { + oldvir = NULL; + } + wp->index = index; + wp->period = period; + wp->offset = offset; + wp->length = length; + wp->flags = flags; + + for (i = 0; i < l; i++) { + adlink_tickle(sc); + bzero(wp->virtual[i], PAGE_SIZE); + } + wp->avg = avg; + sc->wave[index] = wp; + printf("Wave[%d] {period %d, offset %d, length %d, avg %d, flags %x}\n", + wp->index, wp->period, wp->offset, wp->length, wp->avg, wp->flags); + free(oldvir, M_DEVBUF); + return (0); +} + +static void +adlink_loran(void *arg) +{ + struct softc *sc; + int idx, i; + + sc = arg; + idx = 0; + for (;;) { + while (sc->stat[idx] == 0) + msleep(sc, NULL, PRIBIO, "loran", 1); + memset(sc->flags, NWAVE, sizeof sc->flags); + for (i = 0; i < NWAVE; i++) { + if (sc->wave[i] != NULL) + adlink_wave(sc, sc->wave[i], sc->ring[idx]); + } + sc->cnt += I16PERPAGE; + sc->stat[idx] = 0; + idx++; + idx %= NRING; + } + kthread_exit(0); +} + +static int adlink_open(dev_t dev, int oflags, int devtype, struct thread *td) { static int once; struct softc *sc; - int i; + int i, error; uint32_t u; if (once) @@ -88,49 +251,114 @@ sc = dev->si_drv1; sc->info = malloc(PAGE_SIZE, M_DEVBUF, M_ZERO | M_WAITOK); sc->info->nring = NRING; + sc->info->o_ring = PAGE_SIZE; for (i = 0; i < NRING; i++) { sc->ring[i] = malloc(PAGE_SIZE, M_DEVBUF, M_ZERO | M_WAITOK); - sc->phys[i] = vtophys(sc->ring[i]); + sc->pring[i] = vtophys(sc->ring[i]); } + error = adlink_new_wave(sc, NWAVE - 1, SPS, 0, SPS, 7, 0); + if (error) + return (error); + + error = kthread_create(adlink_loran, sc, &sc->procp, + 0, 0, "adlink%d", device_get_unit(sc->device)); + if (error) + return (error); + + /* Enable interrupts on write complete */ bus_space_write_4(sc->t0, sc->h0, 0x38, 0x00004000); + + /* Sample CH0 only */ bus_space_write_4(sc->t1, sc->h1, 0x00, 1); - bus_space_write_4(sc->t1, sc->h1, 0x04, 10); + + /* Divide clock by ten */ + bus_space_write_4(sc->t1, sc->h1, 0x04, 4); + + /* Software trigger mode: software */ bus_space_write_4(sc->t1, sc->h1, 0x08, 0); + + /* Trigger level zero */ bus_space_write_4(sc->t1, sc->h1, 0x0c, 0); + + /* Trigger source CH0 (not used) */ bus_space_write_4(sc->t1, sc->h1, 0x10, 0); + + /* Fifo control/status: flush */ bus_space_write_4(sc->t1, sc->h1, 0x18, 3); + + /* Clock source: external sine */ bus_space_write_4(sc->t1, sc->h1, 0x20, 2); - bus_space_write_4(sc->t0, sc->h0, 0x24, sc->phys[i]); + /* Set up Write DMA */ + bus_space_write_4(sc->t0, sc->h0, 0x24, sc->pring[i]); bus_space_write_4(sc->t0, sc->h0, 0x28, PAGE_SIZE); - u = bus_space_read_4(sc->t0, sc->h0, 0x3c); bus_space_write_4(sc->t0, sc->h0, 0x3c, u | 0x00000600); + /* Acquisition Enable Register: go! */ bus_space_write_4(sc->t1, sc->h1, 0x1c, 1); return (0); } static int +adlink_ioctl(dev_t dev, u_long cmd, caddr_t data, int fflag, struct thread *td) +{ + struct softc *sc; + struct wave *wp; + int i, error; + + sc = dev->si_drv1; + wp = (struct wave *)data; + i = wp->index; + if (i < 0 || i >= NWAVE) + return (EINVAL); + if (cmd == ADLINK_GETWAVE) { + if (sc->wave[i] == NULL) + return (ENOENT); + bcopy(sc->wave[i], wp, sizeof(*wp)); + return (0); + } + if (cmd == ADLINK_SETWAVE) { + error = adlink_new_wave(sc, + i, + wp->period, + wp->offset, + wp->length, + wp->avg, + wp->flags); + if (error) + return (error); + bcopy(sc->wave[i], wp, sizeof(*wp)); + return (0); + } + return (ENOIOCTL); +} + +static int adlink_mmap(dev_t dev, vm_offset_t offset, vm_paddr_t *paddr, int nprot) { - int i; struct softc *sc; + struct wave *wp; + int i, j; sc = dev->si_drv1; if (nprot != VM_PROT_READ) return (-1); - if (offset == 0) { - *paddr = vtophys(sc->info); + for (i = 0; i < NWAVE; i++) { + if (sc->wave[i] == NULL) + continue; + wp = sc->wave[i]; + if (offset < wp->mapvir) + continue; + j = (offset - wp->mapvir) / PAGE_SIZE; + if (j >= wp->npages) + continue; + *paddr = vtophys(wp->virtual[j]); return (0); } - i = (offset - sc->info->o_ring) / PAGE_SIZE; - if (i >= NRING) - return (-1); - *paddr = vtophys(sc->ring[i]); - return (0); + return (-1); } static void @@ -138,7 +366,7 @@ { struct softc *sc; uint32_t u; - int i; + int i, j; sc = arg; u = bus_space_read_4(sc->t0, sc->h0, 0x38); @@ -146,16 +374,27 @@ return; bus_space_write_4(sc->t0, sc->h0, 0x38, u | 0x003f4000); - sc->stat[sc->idx] = 1; - i = (++sc->idx) % NRING; + j = sc->idx; + sc->stat[j] = 1; + i = (j + 1) % NRING; sc->idx = i; - bus_space_write_4(sc->t0, sc->h0, 0x24, sc->phys[i]); + u = bus_space_read_4(sc->t1, sc->h1, 0x18); + if (u & 1) { + printf("adlink FIFO overrun\n"); + return; + } + bus_space_write_4(sc->t0, sc->h0, 0x24, sc->pring[i]); bus_space_write_4(sc->t0, sc->h0, 0x28, PAGE_SIZE); + wakeup(sc); + if (sc->stat[i]) { + printf("adlink page busy\n"); + } } static struct cdevsw adlink_cdevsw = { .d_open = adlink_open, .d_close = nullclose, + .d_ioctl = adlink_ioctl, .d_mmap = adlink_mmap, .d_name = "adlink", }; @@ -182,6 +421,10 @@ bzero(sc, sizeof *sc); sc->device = self; + /* + * This is the PCI mapped registers of the AMCC 9535 "matchmaker" + * chip. + */ rid = 0x10; sc->r0 = bus_alloc_resource(self, SYS_RES_IOPORT, &rid, 0, ~0, 1, RF_ACTIVE); @@ -191,6 +434,10 @@ sc->h0 = rman_get_bushandle(sc->r0); printf("Res0 %x %x\n", sc->t0, sc->h0); + /* + * This is the PCI mapped registers of the ADC hardware, they + * are described in the manual which comes with the card. + */ rid = 0x14; sc->r1 = bus_alloc_resource(self, SYS_RES_IOPORT, &rid, 0, ~0, 1, RF_ACTIVE); @@ -206,8 +453,13 @@ if (sc->ri == NULL) return (ENODEV); - i = bus_setup_intr(self, sc->ri, INTR_TYPE_MISC, + i = bus_setup_intr(self, sc->ri, INTR_MPSAFE | INTR_TYPE_MISC | INTR_FAST, adlink_intr, sc, &sc->intrhand); + if (i) { + printf("adlink: Couldn't get FAST intr\n"); + i = bus_setup_intr(self, sc->ri, INTR_TYPE_MISC, + adlink_intr, sc, &sc->intrhand); + } if (i) return (ENODEV); @@ -236,3 +488,4 @@ }; DRIVER_MODULE(adlink, pci, adlink_driver, adlink_devclass, 0, 0); +#endif /* _KERNEL */ ==== //depot/projects/hammer/sys/dev/ata/ata-raid.c#7 (text+ko) ==== @@ -25,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/ata/ata-raid.c,v 1.60 2003/04/08 07:48:52 sos Exp $ + * $FreeBSD: src/sys/dev/ata/ata-raid.c,v 1.61 2003/04/08 18:01:30 sos Exp $ */ #include "opt_ata.h" @@ -1457,7 +1457,7 @@ printf("heads %d\n", config->heads); printf("sectors %d\n", config->sectors); printf("cylinders %d\n", config->cylinders); - printf("total_sectors %lld\n", config->total_sectors); + printf("total_sectors %lld\n", (long long)config->total_sectors); printf("interleave %d\n", config->interleave); printf("reserved %d\n", config->reserved); printf("offset %d\n", config->offset); @@ -1465,6 +1465,6 @@ printf("disk %d: flags = 0x%02x %b\n", i, config->disks[i].flags, config->disks[i].flags, "\20\4ONLINE\3SPARE\2ASSIGNED\1PRESENT\n"); if (config->disks[i].device) printf(" %s\n", config->disks[i].device->name); - printf(" sectors %lld\n", config->disks[i].disk_sectors); + printf(" sectors %lld\n", (long long)config->disks[i].disk_sectors); } } ==== //depot/projects/hammer/sys/dev/fxp/if_fxp.c#11 (text+ko) ==== @@ -32,7 +32,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/fxp/if_fxp.c,v 1.164 2003/04/08 17:21:15 mux Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/fxp/if_fxp.c,v 1.166 2003/04/08 18:56:45 mux Exp $"); #include #include @@ -223,8 +223,9 @@ static int sysctl_hw_fxp_int_delay(SYSCTL_HANDLER_ARGS); static __inline void fxp_scb_wait(struct fxp_softc *sc); static __inline void fxp_scb_cmd(struct fxp_softc *sc, int cmd); -static __inline void fxp_dma_wait(volatile u_int16_t *status, - struct fxp_softc *sc); +static __inline void fxp_dma_wait(struct fxp_softc *sc, + volatile u_int16_t *status, bus_dma_tag_t dmat, + bus_dmamap_t map); static device_method_t fxp_methods[] = { /* Device interface */ @@ -288,12 +289,16 @@ } static __inline void -fxp_dma_wait(volatile u_int16_t *status, struct fxp_softc *sc) +fxp_dma_wait(struct fxp_softc *sc, volatile u_int16_t *status, + bus_dma_tag_t dmat, bus_dmamap_t map) { int i = 10000; - while (!(le16toh(*status) & FXP_CB_STATUS_C) && --i) + bus_dmamap_sync(dmat, map, BUS_DMASYNC_POSTREAD); + while (!(le16toh(*status) & FXP_CB_STATUS_C) && --i) { DELAY(2); + bus_dmamap_sync(dmat, map, BUS_DMASYNC_POSTREAD); + } if (i == 0) device_printf(sc->dev, "DMA timeout\n"); } @@ -1383,8 +1388,10 @@ * granularities, we must prevent the card from DMA'ing * up the status while we update the command field. * This could cause us to overwrite the completion status. + * XXX This is probably bogus and we're _not_ looking + * for atomicity here. */ - atomic_clear_short(&sc->fxp_desc.tx_last->tx_cb->cb_command, + atomic_clear_16(&sc->fxp_desc.tx_last->tx_cb->cb_command, htole16(FXP_CB_COMMAND_S)); #else sc->fxp_desc.tx_last->tx_cb->cb_command &= @@ -1902,7 +1909,7 @@ CSR_WRITE_4(sc, FXP_CSR_SCB_GENERAL, sc->mcs_addr); fxp_scb_cmd(sc, FXP_SCB_COMMAND_CU_START); /* ...and wait for it to complete. */ - fxp_dma_wait(&mcsp->cb_status, sc); + fxp_dma_wait(sc, &mcsp->cb_status, sc->mcs_tag, sc->mcs_map); bus_dmamap_sync(sc->mcs_tag, sc->mcs_map, BUS_DMASYNC_POSTWRITE); } @@ -2014,7 +2021,7 @@ CSR_WRITE_4(sc, FXP_CSR_SCB_GENERAL, sc->fxp_desc.cbl_addr); fxp_scb_cmd(sc, FXP_SCB_COMMAND_CU_START); /* ...and wait for it to complete. */ - fxp_dma_wait(&cbp->cb_status, sc); + fxp_dma_wait(sc, &cbp->cb_status, sc->cbl_tag, sc->cbl_map); bus_dmamap_sync(sc->cbl_tag, sc->cbl_map, BUS_DMASYNC_POSTWRITE); /* @@ -2035,7 +2042,7 @@ bus_dmamap_sync(sc->cbl_tag, sc->cbl_map, BUS_DMASYNC_PREWRITE); fxp_scb_cmd(sc, FXP_SCB_COMMAND_CU_START); /* ...and wait for it to complete. */ - fxp_dma_wait(&cb_ias->cb_status, sc); + fxp_dma_wait(sc, &cb_ias->cb_status, sc->cbl_tag, sc->cbl_map); bus_dmamap_sync(sc->cbl_tag, sc->cbl_map, BUS_DMASYNC_POSTWRITE); /* @@ -2553,7 +2560,7 @@ CSR_WRITE_4(sc, FXP_CSR_SCB_GENERAL, sc->fxp_desc.cbl_addr); fxp_scb_cmd(sc, FXP_SCB_COMMAND_CU_START); /* ...and wait for it to complete. */ - fxp_dma_wait(&cbp->cb_status, sc); + fxp_dma_wait(sc, &cbp->cb_status, sc->cbl_tag, sc->cbl_map); bus_dmamap_sync(sc->cbl_tag, sc->cbl_map, BUS_DMASYNC_POSTWRITE); device_printf(sc->dev, "Microcode loaded, int_delay: %d usec bundle_max: %d\n", ==== //depot/projects/hammer/sys/i386/include/pmap.h#5 (text+ko) ==== @@ -42,7 +42,7 @@ * * from: hp300: @(#)pmap.h 7.2 (Berkeley) 12/16/90 * from: @(#)pmap.h 7.4 (Berkeley) 5/12/91 - * $FreeBSD: src/sys/i386/include/pmap.h,v 1.97 2003/04/07 14:27:19 jake Exp $ + * $FreeBSD: src/sys/i386/include/pmap.h,v 1.98 2003/04/08 18:22:41 jake Exp $ */ #ifndef _MACHINE_PMAP_H_ @@ -195,7 +195,7 @@ { vm_paddr_t pa; - if ((pa = (vm_offset_t) PTD[va >> PDRSHIFT]) & PG_PS) { + if ((pa = PTD[va >> PDRSHIFT]) & PG_PS) { pa = (pa & ~(NBPDR - 1)) | (va & (NBPDR - 1)); } else { pa = *vtopte(va); ==== //depot/projects/hammer/sys/kern/uipc_cow.c#6 (text+ko) ==== @@ -29,7 +29,7 @@ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/kern/uipc_cow.c,v 1.12 2003/03/29 06:14:14 alc Exp $ + * $FreeBSD: src/sys/kern/uipc_cow.c,v 1.13 2003/04/08 18:24:28 alc Exp $ */ /* * This is a set of routines for enabling and disabling copy on write @@ -52,13 +52,6 @@ #include #include #include -#if 0 -#include -#include -#include -#include -#include -#endif struct netsend_cow_stats { @@ -111,7 +104,7 @@ vm_offset_t uva; int s; - vmspace = curproc->p_vmspace;; + vmspace = curproc->p_vmspace; map = &vmspace->vm_map; uva = (vm_offset_t) uio->uio_iov->iov_base; ==== //depot/projects/hammer/sys/sparc64/conf/GENERIC#9 (text+ko) ==== @@ -18,7 +18,7 @@ # # For hardware specific information check HARDWARE.TXT # -# $FreeBSD: src/sys/sparc64/conf/GENERIC,v 1.51 2003/03/22 14:18:23 ru Exp $ +# $FreeBSD: src/sys/sparc64/conf/GENERIC,v 1.52 2003/04/08 20:55:30 mux Exp $ machine sparc64 cpu SUN4U @@ -150,7 +150,7 @@ # PCI Ethernet NICs that use the common MII bus controller code. device miibus # MII bus support #device dc # DEC/Intel 21143 and workalikes -#device fxp # Intel EtherExpress PRO/100B (82557, 82558) +device fxp # Intel EtherExpress PRO/100B (82557, 82558) device gem # Sun GEM/Sun ERI/Apple GMAC device hme # Sun HME (Happy Meal Ethernet) #device pcn # AMD Am79C97x PCI 10/100 NICs From owner-p4-projects@FreeBSD.ORG Tue Apr 8 17:51:10 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id E927237B413; Tue, 8 Apr 2003 17:51:09 -0700 (PDT) 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 9EF7337B415 for ; Tue, 8 Apr 2003 17:51:08 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 350EA43F75 for ; Tue, 8 Apr 2003 17:51:08 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h390p70U015975 for ; Tue, 8 Apr 2003 17:51:07 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h390p7Z1015968 for perforce@freebsd.org; Tue, 8 Apr 2003 17:51:07 -0700 (PDT) Date: Tue, 8 Apr 2003 17:51:07 -0700 (PDT) Message-Id: <200304090051.h390p7Z1015968@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28584 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, 09 Apr 2003 00:51:11 -0000 http://perforce.freebsd.org/chv.cgi?CH=28584 Change 28584 by peter@peter_daintree on 2003/04/08 17:51:00 0(%esp) not valid in long mode.. Affected files ... .. //depot/projects/hammer/sys/x86_64/include/bus_at386.h#6 edit Differences ... ==== //depot/projects/hammer/sys/x86_64/include/bus_at386.h#6 (text+ko) ==== @@ -1207,7 +1207,7 @@ { #ifdef __GNUC__ if (flags & BUS_SPACE_BARRIER_READ) - __asm __volatile("lock; addl $0,0(%%esp)" : : : "memory"); + __asm __volatile("lock; addl $0,0(%%rsp)" : : : "memory"); else __asm __volatile("" : : : "memory"); #endif From owner-p4-projects@FreeBSD.ORG Tue Apr 8 18:16:41 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 1A77937B404; Tue, 8 Apr 2003 18:16:41 -0700 (PDT) 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 AEF1237B401 for ; Tue, 8 Apr 2003 18:16:40 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4672843F85 for ; Tue, 8 Apr 2003 18:16:40 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h391Ge0U018505 for ; Tue, 8 Apr 2003 18:16:40 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h391Gd4u018502 for perforce@freebsd.org; Tue, 8 Apr 2003 18:16:39 -0700 (PDT) Date: Tue, 8 Apr 2003 18:16:39 -0700 (PDT) Message-Id: <200304090116.h391Gd4u018502@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28586 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, 09 Apr 2003 01:16:42 -0000 http://perforce.freebsd.org/chv.cgi?CH=28586 Change 28586 by peter@peter_daintree on 2003/04/08 18:15:57 thank goodness for #error. Affected files ... .. //depot/projects/hammer/sys/dev/kbd/atkbdc.c#3 edit Differences ... ==== //depot/projects/hammer/sys/dev/kbd/atkbdc.c#3 (text+ko) ==== @@ -154,7 +154,7 @@ #endif /* XXX: tag should be passed from the caller */ -#if defined(__i386__) +#if defined(__i386__) || defined(__x86_64__) tag = I386_BUS_SPACE_IO; #elif defined(__alpha__) tag = busspace_isa_io; From owner-p4-projects@FreeBSD.ORG Tue Apr 8 18:16:42 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 4DF3D37B401; Tue, 8 Apr 2003 18:16:42 -0700 (PDT) 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 3A15C37B40D for ; Tue, 8 Apr 2003 18:16:41 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id BCE9343F85 for ; Tue, 8 Apr 2003 18:16:40 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h391Ge0U018511 for ; Tue, 8 Apr 2003 18:16:40 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h391GeDk018508 for perforce@freebsd.org; Tue, 8 Apr 2003 18:16:40 -0700 (PDT) Date: Tue, 8 Apr 2003 18:16:40 -0700 (PDT) Message-Id: <200304090116.h391GeDk018508@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28587 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, 09 Apr 2003 01:16:43 -0000 http://perforce.freebsd.org/chv.cgi?CH=28587 Change 28587 by peter@peter_daintree on 2003/04/08 18:16:17 Aim high! Affected files ... .. //depot/projects/hammer/sys/conf/files.x86_64#14 edit .. //depot/projects/hammer/sys/x86_64/conf/GENERIC#3 edit Differences ... ==== //depot/projects/hammer/sys/conf/files.x86_64#14 (text+ko) ==== @@ -60,3 +60,50 @@ x86_64/pci/pci_cfgreg.c optional pci x86_64/pci/pci_bus.c optional pci + + + +# This file tells config what files go into building a kernel, +# files marked standard are always included. +# +dev/fb/fb.c optional fb +dev/fb/fb.c optional vga +dev/fb/splash.c optional splash +dev/fb/vga.c optional vga + +dev/kbd/atkbd.c optional atkbd +dev/kbd/atkbdc.c optional atkbdc +dev/kbd/kbd.c optional atkbd +dev/kbd/kbd.c optional kbd +dev/kbd/kbd.c optional sc +dev/kbd/kbd.c optional ukbd +dev/kbd/kbd.c optional vt + +dev/syscons/schistory.c optional sc +dev/syscons/scmouse.c optional sc +dev/syscons/scterm.c optional sc +dev/syscons/scterm-dumb.c optional sc +dev/syscons/scterm-sc.c optional sc +dev/syscons/scvgarndr.c optional sc vga +dev/syscons/scvidctl.c optional sc +dev/syscons/scvtb.c optional sc +dev/syscons/syscons.c optional sc +dev/syscons/sysmouse.c optional sc +geom/geom_bsd.c standard +geom/geom_mbr.c standard + +#i386/isa/pmtimer.c optional pmtimer +# +isa/atkbd_isa.c optional atkbd +isa/atkbdc_isa.c optional atkbdc +isa/fd.c optional fdc +isa/ppc.c optional ppc +isa/psm.c optional psm +isa/syscons_isa.c optional sc +isa/vga_isa.c optional vga +pci/agp_intel.c optional agp +pci/agp_via.c optional agp +pci/agp_sis.c optional agp +pci/agp_ali.c optional agp +pci/agp_amd.c optional agp +pci/agp_i810.c optional agp ==== //depot/projects/hammer/sys/x86_64/conf/GENERIC#3 (text+ko) ==== @@ -23,5 +23,51 @@ ident GENERIC maxusers 0 -options SCHED_4BSD +options INET +options SCHED_4BSD +options FFS +options SOFTUPDATES device isa +device sio + +device pci +device miibus +device bge +device fxp + +device random # Entropy device +device loop +device ether +device md + +device ata +device atadisk +device atapicd # ATAPI CDROM drives + +# USB support +device uhci # UHCI PCI->USB interface +device ohci # OHCI PCI->USB interface +device usb # USB Bus (required) +device ugen # Generic +device uhid # "Human Interface Devices" +device ukbd # Keyboard + + +# atkbdc0 controls both the keyboard and the PS/2 mouse +device atkbdc # AT keyboard controller +device atkbd # AT keyboard +device psm # PS/2 mouse + +device vga # VGA video card driver + +device splash # Splash screen and screen saver support + +# syscons is the default console driver, resembling an SCO console +device sc + +#device agp # support several AGP chipsets + +# Parallel port +device ppc +device ppbus # Parallel port bus (required) +device lpt # Printer From owner-p4-projects@FreeBSD.ORG Tue Apr 8 18:18:45 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id DAA0037B404; Tue, 8 Apr 2003 18:18:44 -0700 (PDT) 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 4CB6437B401 for ; Tue, 8 Apr 2003 18:18:44 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id D9F4643FAF for ; Tue, 8 Apr 2003 18:18:43 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h391Ih0U018574 for ; Tue, 8 Apr 2003 18:18:43 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h391IhH1018571 for perforce@freebsd.org; Tue, 8 Apr 2003 18:18:43 -0700 (PDT) Date: Tue, 8 Apr 2003 18:18:43 -0700 (PDT) Message-Id: <200304090118.h391IhH1018571@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28588 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, 09 Apr 2003 01:18:45 -0000 http://perforce.freebsd.org/chv.cgi?CH=28588 Change 28588 by peter@peter_daintree on 2003/04/08 18:17:54 joy. Affected files ... .. //depot/projects/hammer/sys/x86_64/include/pc/display.h#1 branch Differences ... From owner-p4-projects@FreeBSD.ORG Tue Apr 8 18:47:20 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 78D0137B404; Tue, 8 Apr 2003 18:47:19 -0700 (PDT) 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 2EC7137B401 for ; Tue, 8 Apr 2003 18:47:19 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id D066243F3F for ; Tue, 8 Apr 2003 18:47:18 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h391lI0U020471 for ; Tue, 8 Apr 2003 18:47:18 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h391lINo020468 for perforce@freebsd.org; Tue, 8 Apr 2003 18:47:18 -0700 (PDT) Date: Tue, 8 Apr 2003 18:47:18 -0700 (PDT) Message-Id: <200304090147.h391lINo020468@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28589 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, 09 Apr 2003 01:47:20 -0000 http://perforce.freebsd.org/chv.cgi?CH=28589 Change 28589 by peter@peter_daintree on 2003/04/08 18:46:54 add fillw() for vga/fb Affected files ... .. //depot/projects/hammer/sys/x86_64/x86_64/support.s#17 edit Differences ... ==== //depot/projects/hammer/sys/x86_64/x86_64/support.s#17 (text+ko) ==== @@ -43,6 +43,17 @@ .text +/* fillw(pat, base, cnt) */ +/* %rdi,%rsi, %rdx */ +ENTRY(fillw) + movq %rdi,%rax + movq %rsi,%rdi + movq %rdx,%rcx + cld + rep + stosw + ret + /*****************************************************************************/ /* copyout and fubyte family */ /*****************************************************************************/ From owner-p4-projects@FreeBSD.ORG Tue Apr 8 18:49:23 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id F23B737B404; Tue, 8 Apr 2003 18:49:22 -0700 (PDT) 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 7BF2B37B401 for ; Tue, 8 Apr 2003 18:49:22 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1734E43F75 for ; Tue, 8 Apr 2003 18:49:22 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h391nL0U020526 for ; Tue, 8 Apr 2003 18:49:21 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h391nLql020523 for perforce@freebsd.org; Tue, 8 Apr 2003 18:49:21 -0700 (PDT) Date: Tue, 8 Apr 2003 18:49:21 -0700 (PDT) Message-Id: <200304090149.h391nLql020523@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28590 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, 09 Apr 2003 01:49:24 -0000 http://perforce.freebsd.org/chv.cgi?CH=28590 Change 28590 by peter@peter_daintree on 2003/04/08 18:48:34 make syscons/fb/vga probe/attach. XXX more work needed. There is some nasty stuff where alpha has a copy of machine/pc/bios.h simply because it describes how to convert a physical address in the isa hole to virtual. I've deliberately left this broken to remind me. Affected files ... .. //depot/projects/hammer/sys/dev/fb/fbreg.h#4 edit .. //depot/projects/hammer/sys/dev/fb/vga.c#7 edit .. //depot/projects/hammer/sys/isa/vga_isa.c#4 edit Differences ... ==== //depot/projects/hammer/sys/dev/fb/fbreg.h#4 (text+ko) ==== @@ -44,6 +44,14 @@ void generic_bcopy(const void *s, void *d, size_t c); void generic_bzero(void *d, size_t c); #else /* !__i386__ */ +#ifdef __x86_64__ +#define bcopy_io(s, d, c) bcopy((void *)(s), (void *)(d), (c)) +#define bcopy_toio(s, d, c) bcopy((void *)(s), (void *)(d), (c)) +#define bcopy_fromio(s, d, c) bcopy((void *)(s), (void *)(d), (c)) +#define bzero_io(d, c) bzero((void *)(d), (c)) +#define fill_io(p, d, c) fill((p), (void *)(d), (c)) +#define fillw_io(p, d, c) fillw((p), (void *)(d), (c)) +#else #define bcopy_io(s, d, c) memcpy_io((d), (s), (c)) #define bcopy_toio(s, d, c) memcpy_toio((d), (void *)(s), (c)) #define bcopy_fromio(s, d, c) memcpy_fromio((void *)(d), (s), (c)) @@ -51,6 +59,7 @@ #define fill_io(p, d, c) memset_io((d), (p), (c)) #define fillw(p, d, c) memsetw((d), (p), (c)) #define fillw_io(p, d, c) memsetw_io((d), (p), (c)) +#endif #endif /* !__i386__ */ /* video function table */ ==== //depot/projects/hammer/sys/dev/fb/vga.c#7 (text+ko) ==== @@ -46,7 +46,9 @@ #include #include +#ifdef __i386__ #include +#endif #include #include @@ -58,6 +60,7 @@ #define VGA_DEBUG 0 #endif +#define BIOS_PADDRTOVADDR(x) (((x) - ISA_HOLE_START) + atdevbase) int vga_probe_unit(int unit, video_adapter_t *buf, int flags) { @@ -143,7 +146,9 @@ /* LOW-LEVEL */ #include +#ifdef __i386__ #include +#endif #define probe_done(adp) ((adp)->va_flags & V_ADP_PROBED) #define init_done(adp) ((adp)->va_flags & V_ADP_INITIALIZED) @@ -163,7 +168,7 @@ #endif /* architecture dependent option */ -#if defined(__alpha__) || defined(__ia64__) +#ifndef __i386__ #define VGA_NO_BIOS 1 #endif @@ -1315,7 +1320,7 @@ return 0; } -#ifdef __i386__ /* XXX */ +#if defined(__i386__) || defined(__x86_64__) /* XXX */ static void fill(int val, void *d, size_t size) { @@ -1820,10 +1825,10 @@ set_font_mode(adp, buf); if (fontsize == 32) { - bcopy_fromio(segment + ch*32, data, fontsize*count); + bcopy_fromio((uintptr_t)segment + ch*32, data, fontsize*count); } else { for (c = ch; count > 0; ++c, --count) { - bcopy_fromio(segment + c*32, data, fontsize); + bcopy_fromio((uintptr_t)segment + c*32, data, fontsize); data += fontsize; } } @@ -1900,10 +1905,10 @@ set_font_mode(adp, buf); if (fontsize == 32) { - bcopy_toio(data, segment + ch*32, fontsize*count); + bcopy_toio(data, (uintptr_t)segment + ch*32, fontsize*count); } else { for (c = ch; count > 0; ++c, --count) { - bcopy_toio(data, segment + c*32, fontsize); + bcopy_toio(data, (uintptr_t)segment + c*32, fontsize); data += fontsize; } } ==== //depot/projects/hammer/sys/isa/vga_isa.c#4 (text+ko) ==== @@ -46,7 +46,9 @@ #include #include +#ifdef __i386__ #include +#endif #include #include From owner-p4-projects@FreeBSD.ORG Tue Apr 8 18:49:25 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 857B137B409; Tue, 8 Apr 2003 18:49:23 -0700 (PDT) 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 018B437B401 for ; Tue, 8 Apr 2003 18:49:23 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8D4D643FA3 for ; Tue, 8 Apr 2003 18:49:22 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h391nM0U020532 for ; Tue, 8 Apr 2003 18:49:22 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h391nMci020529 for perforce@freebsd.org; Tue, 8 Apr 2003 18:49:22 -0700 (PDT) Date: Tue, 8 Apr 2003 18:49:22 -0700 (PDT) Message-Id: <200304090149.h391nMci020529@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28591 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, 09 Apr 2003 01:49:25 -0000 http://perforce.freebsd.org/chv.cgi?CH=28591 Change 28591 by peter@peter_daintree on 2003/04/08 18:48:56 add isa_dma.c (for ppc) Affected files ... .. //depot/projects/hammer/sys/conf/files.x86_64#15 edit Differences ... ==== //depot/projects/hammer/sys/conf/files.x86_64#15 (text+ko) ==== @@ -55,6 +55,7 @@ x86_64/isa/clock.c standard x86_64/isa/intr_machdep.c standard x86_64/isa/isa.c standard +x86_64/isa/isa_dma.c standard x86_64/isa/ithread.c standard x86_64/isa/npx.c standard From owner-p4-projects@FreeBSD.ORG Tue Apr 8 18:49:25 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 4BC4137B411; Tue, 8 Apr 2003 18:49:24 -0700 (PDT) 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 66FA737B41F for ; Tue, 8 Apr 2003 18:49:23 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0E8D943F75 for ; Tue, 8 Apr 2003 18:49:23 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h391nM0U020539 for ; Tue, 8 Apr 2003 18:49:22 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h391nMeO020535 for perforce@freebsd.org; Tue, 8 Apr 2003 18:49:22 -0700 (PDT) Date: Tue, 8 Apr 2003 18:49:22 -0700 (PDT) Message-Id: <200304090149.h391nMeO020535@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28592 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, 09 Apr 2003 01:49:26 -0000 http://perforce.freebsd.org/chv.cgi?CH=28592 Change 28592 by peter@peter_daintree on 2003/04/08 18:49:17 add some more options, remove some OBE ones (VESA) Affected files ... .. //depot/projects/hammer/sys/conf/options.x86_64#6 edit Differences ... ==== //depot/projects/hammer/sys/conf/options.x86_64#6 (text+ko) ==== @@ -32,6 +32,7 @@ SC_RENDER_DEBUG opt_syscons.h SC_TWOBUTTON_MOUSE opt_syscons.h SC_NO_SUSPEND_VTYSWITCH opt_syscons.h +DEV_SPLASH opt_splash.h VGA_ALT_SEQACCESS opt_vga.h VGA_DEBUG opt_vga.h @@ -40,9 +41,6 @@ VGA_SLOW_IOACCESS opt_vga.h VGA_WIDTH90 opt_vga.h -VESA opt_vesa.h -VESA_DEBUG opt_vesa.h - ATKBD_DFLT_KEYMAP opt_atkbd.h KBD_DISABLE_KEYMAP_LOAD opt_kbd.h @@ -58,3 +56,8 @@ CLAWHAMMER opt_cpu.h SLEDGEHAMMER opt_cpu.h HAMMER opt_cpu.h +PPC_PROBE_CHIPSET opt_ppc.h +PPC_DEBUG opt_ppc.h +PSM_HOOKRESUME opt_psm.h +PSM_RESETAFTERSUSPEND opt_psm.h +PSM_DEBUG opt_psm.h From owner-p4-projects@FreeBSD.ORG Tue Apr 8 19:00:39 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 9202537B404; Tue, 8 Apr 2003 19:00:38 -0700 (PDT) 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 4783637B401 for ; Tue, 8 Apr 2003 19:00:38 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id E837F43FAF for ; Tue, 8 Apr 2003 19:00:37 -0700 (PDT) (envelope-from marcel@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h3920b0U021544 for ; Tue, 8 Apr 2003 19:00:37 -0700 (PDT) (envelope-from marcel@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h3920bFj021534 for perforce@freebsd.org; Tue, 8 Apr 2003 19:00:37 -0700 (PDT) Date: Tue, 8 Apr 2003 19:00:37 -0700 (PDT) Message-Id: <200304090200.h3920bFj021534@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 28594 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, 09 Apr 2003 02:00:39 -0000 http://perforce.freebsd.org/chv.cgi?CH=28594 Change 28594 by marcel@marcel_nfs on 2003/04/08 19:00:11 Don't forget to set pc_curthread. Affected files ... .. //depot/projects/ia64_epc/sys/ia64/ia64/machdep.c#8 edit Differences ... ==== //depot/projects/ia64_epc/sys/ia64/ia64/machdep.c#8 (text+ko) ==== @@ -218,6 +218,7 @@ if (!savectx(oldpcb)) { newpcb = new->td_pcb; pmap_install(newpcb->pcb_current_pmap); + PCPU_SET(curthread, new); restorectx(newpcb); } } @@ -229,6 +230,7 @@ newpcb = new->td_pcb; pmap_install(newpcb->pcb_current_pmap); + PCPU_SET(curthread, new); restorectx(newpcb); /* We should not get here. */ panic("cpu_throw: restorectx() returned"); From owner-p4-projects@FreeBSD.ORG Tue Apr 8 19:04:44 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 66B2537B404; Tue, 8 Apr 2003 19:04:44 -0700 (PDT) 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 05BC937B401 for ; Tue, 8 Apr 2003 19:04:44 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 84D8C43F75 for ; Tue, 8 Apr 2003 19:04:43 -0700 (PDT) (envelope-from marcel@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h3924h0U022889 for ; Tue, 8 Apr 2003 19:04:43 -0700 (PDT) (envelope-from marcel@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h3924hlE022885 for perforce@freebsd.org; Tue, 8 Apr 2003 19:04:43 -0700 (PDT) Date: Tue, 8 Apr 2003 19:04:43 -0700 (PDT) Message-Id: <200304090204.h3924hlE022885@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 28595 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, 09 Apr 2003 02:04:45 -0000 http://perforce.freebsd.org/chv.cgi?CH=28595 Change 28595 by marcel@marcel_nfs on 2003/04/08 19:03:47 Move fork_trampoline from context.s to locore.s and break where we used to jump to exception_restore. We cannot go to exception_restore, because fork(2) will have a syscall frame instead of a trap frame. Hence, we must go to user space in a way that works with the EPC syscall path. This has to be determined. Affected files ... .. //depot/projects/ia64_epc/sys/ia64/ia64/context.s#8 edit .. //depot/projects/ia64_epc/sys/ia64/ia64/locore.s#6 edit Differences ... ==== //depot/projects/ia64_epc/sys/ia64/ia64/context.s#8 (text+ko) ==== @@ -302,35 +302,6 @@ END(swapctx) /* - * fork_trampoline() - * - * Arrange for a function to be invoked neatly, after a cpu_switch(). - * - * Invokes fork_exit() passing in three arguments: a callout function, an - * argument to the callout, and a trapframe pointer. For child processes - * returning from fork(2), the argument is a pointer to the child process. - * - * The callout function is in r4, the address to return to after executing - * fork_exit() is in r5, and the argument is in r6. - */ -ENTRY(fork_trampoline, 0) - .prologue - .save rp,r0 - .body - alloc r14=ar.pfs,0,0,3,0 - ;; - mov b0=r5 - mov out0=r4 - mov out1=r6 - add out2=16,sp - ;; - br.call.sptk.few rp=fork_exit - ;; - br.cond.sptk.many exception_restore - ;; -END(fork_trampoline) - -/* * _getcontext(ucontext_t *ucp) */ ENTRY(_getcontext, 1) ==== //depot/projects/ia64_epc/sys/ia64/ia64/locore.s#6 (text+ko) ==== @@ -141,6 +141,38 @@ END(mi_startup_trampoline) +/* + * fork_trampoline() + * + * Arrange for a function to be invoked neatly, after a cpu_switch(). + * + * Invokes fork_exit() passing in three arguments: a callout function, an + * argument to the callout, and a trapframe pointer. For child processes + * returning from fork(2), the argument is a pointer to the child process. + * + * The callout function is in r4 and the argument is in r6. + */ +ENTRY(fork_trampoline, 0) + .prologue + .save rp,r0 + .body +{ .mmi + alloc r14=ar.pfs,0,0,3,0 + mov out0=r4 + mov out1=r6 + ;; +} +{ .mfb + add out2=16,sp + nop 0 + br.call.sptk rp=fork_exit + ;; +} + // If we get back here, it means we're a user space process that's + // the immediate result of fork(2). + break 0 +END(fork_trampoline) + #ifdef SMP /* * AP wake-up entry point. The handoff state is similar as for the BSP, From owner-p4-projects@FreeBSD.ORG Tue Apr 8 19:07:49 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 5CC5D37B404; Tue, 8 Apr 2003 19:07:49 -0700 (PDT) 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 F219637B401 for ; Tue, 8 Apr 2003 19:07:48 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9D2C643FBF for ; Tue, 8 Apr 2003 19:07:48 -0700 (PDT) (envelope-from marcel@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h3927m0U023092 for ; Tue, 8 Apr 2003 19:07:48 -0700 (PDT) (envelope-from marcel@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h3927mdp023089 for perforce@freebsd.org; Tue, 8 Apr 2003 19:07:48 -0700 (PDT) Date: Tue, 8 Apr 2003 19:07:48 -0700 (PDT) Message-Id: <200304090207.h3927mdp023089@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 28597 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, 09 Apr 2003 02:07:50 -0000 http://perforce.freebsd.org/chv.cgi?CH=28597 Change 28597 by marcel@marcel_nfs on 2003/04/08 19:07:43 In cpu_fork(): call cpu_set_fork_handler() to initialize the PCB for the callout function. This centralizes the details and makes it easier to change. As a side-effect, we now don't set r5 anymore. It was not needed anyway. Affected files ... .. //depot/projects/ia64_epc/sys/ia64/ia64/vm_machdep.c#6 edit Differences ... ==== //depot/projects/ia64_epc/sys/ia64/ia64/vm_machdep.c#6 (text+ko) ==== @@ -289,11 +289,9 @@ * ABI - a function can assume that the 16 bytes above sp are * available as scratch space. */ - td2->td_pcb->pcb_special.sp = (u_int64_t)p2tf - 16; - td2->td_pcb->pcb_preserved.gr4 = (u_int64_t)fork_return; - td2->td_pcb->pcb_preserved.gr5 = FDESC_FUNC(exception_restore); - td2->td_pcb->pcb_preserved.gr6 = (u_int64_t)td2; + td2->td_pcb->pcb_special.sp = (u_int64_t)p2tf - 16; td2->td_pcb->pcb_special.rp = FDESC_FUNC(fork_trampoline); + cpu_set_fork_handler(td2, (void (*)(void*))fork_return, td2); } /* From owner-p4-projects@FreeBSD.ORG Tue Apr 8 20:33:36 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 2BC2C37B405; Tue, 8 Apr 2003 20:33:36 -0700 (PDT) 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 BD83737B401 for ; Tue, 8 Apr 2003 20:33:35 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2D97543FBD for ; Tue, 8 Apr 2003 20:33:35 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h393XZ0U029957 for ; Tue, 8 Apr 2003 20:33:35 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h393XYdY029954 for perforce@freebsd.org; Tue, 8 Apr 2003 20:33:34 -0700 (PDT) Date: Tue, 8 Apr 2003 20:33:34 -0700 (PDT) Message-Id: <200304090333.h393XYdY029954@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28602 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, 09 Apr 2003 03:33:37 -0000 http://perforce.freebsd.org/chv.cgi?CH=28602 Change 28602 by peter@peter_daintree on 2003/04/08 20:32:50 find the preload metadata for bios_smap Affected files ... .. //depot/projects/hammer/sys/x86_64/x86_64/machdep.c#57 edit Differences ... ==== //depot/projects/hammer/sys/x86_64/x86_64/machdep.c#57 (text+ko) ==== @@ -735,16 +735,13 @@ * "Consumer may safely assume that size value precedes data." * ie: an int32_t immediately precedes smap. */ - smapbase = MD_FETCH(kmdp, MODINFOMD_SMAP, struct bios_smap *) + KERNBASE; + smapbase = (struct bios_smap *)preload_search_info(kmdp, MODINFO_METADATA | MODINFOMD_SMAP); if (smapbase == 0) { - printf("No BIOS smap info from loader!\n"); + panic("No BIOS smap info from loader!"); goto deep_shit; } -printf("smapbase: %p\n", smapbase); - smapsize = ((u_int32_t *)smapbase)[-1]; -printf("smaplen = 0x%x\n", smapsize); + smapsize = *((u_int32_t *)smapbase - 1); smapend = (struct bios_smap *)((uintptr_t)smapbase + smapsize); -printf("smapend: %p\n", smapend); for (smap = smapbase; smap < smapend; smap++) { if (boothowto & RB_VERBOSE) From owner-p4-projects@FreeBSD.ORG Tue Apr 8 21:15:28 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id C6F7A37B404; Tue, 8 Apr 2003 21:15:27 -0700 (PDT) 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 53C7237B401 for ; Tue, 8 Apr 2003 21:15:27 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id DF6F043FAF for ; Tue, 8 Apr 2003 21:15:26 -0700 (PDT) (envelope-from marcel@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h394FQ0U038709 for ; Tue, 8 Apr 2003 21:15:26 -0700 (PDT) (envelope-from marcel@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h394FQFp038706 for perforce@freebsd.org; Tue, 8 Apr 2003 21:15:26 -0700 (PDT) Date: Tue, 8 Apr 2003 21:15:26 -0700 (PDT) Message-Id: <200304090415.h394FQFp038706@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 28604 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, 09 Apr 2003 04:15:28 -0000 http://perforce.freebsd.org/chv.cgi?CH=28604 Change 28604 by marcel@marcel_nfs on 2003/04/08 21:14:52 Typo: assign r19 to ar.pfs, not 19. Affected files ... .. //depot/projects/ia64_epc/sys/ia64/ia64/context.s#9 edit Differences ... ==== //depot/projects/ia64_epc/sys/ia64/ia64/context.s#9 (text+ko) ==== @@ -68,7 +68,7 @@ { .mmi ld8 r17=[r32],8 // unat (after) mov ar.bspstore=r20 - mov ar.pfs=19 + mov ar.pfs=r19 ;; } { .mmi From owner-p4-projects@FreeBSD.ORG Tue Apr 8 21:30:49 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id E163137B404; Tue, 8 Apr 2003 21:30:48 -0700 (PDT) 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 8078C37B401 for ; Tue, 8 Apr 2003 21:30:48 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0980943F85 for ; Tue, 8 Apr 2003 21:30:48 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h394Ul0U039744 for ; Tue, 8 Apr 2003 21:30:47 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h394UlQ1039738 for perforce@freebsd.org; Tue, 8 Apr 2003 21:30:47 -0700 (PDT) Date: Tue, 8 Apr 2003 21:30:47 -0700 (PDT) Message-Id: <200304090430.h394UlQ1039738@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28606 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, 09 Apr 2003 04:30:50 -0000 http://perforce.freebsd.org/chv.cgi?CH=28606 Change 28606 by peter@peter_daintree on 2003/04/08 21:30:17 export the bios SMAP table to the kernel via MODINFOMD_SMAP Affected files ... .. //depot/projects/hammer/sys/boot/i386/libi386/Makefile#6 edit .. //depot/projects/hammer/sys/boot/i386/libi386/biossmap.c#1 add .. //depot/projects/hammer/sys/boot/i386/libi386/bootinfo32.c#3 edit .. //depot/projects/hammer/sys/boot/i386/libi386/bootinfo64.c#4 edit .. //depot/projects/hammer/sys/boot/i386/libi386/libi386.h#4 edit .. //depot/projects/hammer/sys/boot/i386/loader/main.c#3 edit Differences ... ==== //depot/projects/hammer/sys/boot/i386/libi386/Makefile#6 (text+ko) ==== @@ -4,7 +4,7 @@ INTERNALLIB= true SRCS= biosacpi.c bioscd.c biosdisk.c biosmem.c biospnp.c \ - biospci.c bootinfo.c bootinfo32.c bootinfo64.c \ + biospci.c biossmap.c bootinfo.c bootinfo32.c bootinfo64.c \ comconsole.c devicename.c elf32_freebsd.c \ elf64_freebsd.c gatea20.c \ i386_copy.c i386_module.c nullconsole.c pxe.c pxetramp.s \ ==== //depot/projects/hammer/sys/boot/i386/libi386/bootinfo32.c#3 (text+ko) ==== @@ -218,9 +218,7 @@ file_addmetadata(kfp, MODINFOMD_HOWTO, sizeof howto, &howto); file_addmetadata(kfp, MODINFOMD_ENVP, sizeof envp, &envp); file_addmetadata(kfp, MODINFOMD_KERNEND, sizeof kernend, &kernend); -#ifdef MODINFOMD_SMAPxx - file_addmetadata(kfp, MODINFOMD_SMAP, smapsize, smap); -#endif + bios_addsmapdata(kfp); /* Figure out the size and location of the metadata */ *modulep = addr; ==== //depot/projects/hammer/sys/boot/i386/libi386/bootinfo64.c#4 (text+ko) ==== @@ -188,9 +188,7 @@ file_addmetadata(kfp, MODINFOMD_HOWTO, sizeof howto, &howto); file_addmetadata(kfp, MODINFOMD_ENVP, sizeof envp, &envp); file_addmetadata(kfp, MODINFOMD_KERNEND, sizeof kernend, &kernend); -#ifdef MODINFOMD_SMAPxx - file_addmetadata(kfp, MODINFOMD_SMAP, smapsize, smap); -#endif + bios_addsmapdata(kfp); /* Figure out the size and location of the metadata */ *modulep = addr; ==== //depot/projects/hammer/sys/boot/i386/libi386/libi386.h#4 (text+ko) ==== @@ -84,6 +84,10 @@ ssize_t i386_copyout(const vm_offset_t src, void *dest, const size_t len); ssize_t i386_readin(const int fd, vm_offset_t dest, const size_t len); +struct preloaded_file; +void bios_addsmapdata(struct preloaded_file *); +void bios_getsmap(void); + void bios_getmem(void); extern u_int32_t bios_basemem; /* base memory in bytes */ extern u_int32_t bios_extmem; /* extended memory in bytes */ ==== //depot/projects/hammer/sys/boot/i386/loader/main.c#3 (text+ko) ==== @@ -144,6 +144,8 @@ extract_currdev(); /* set $currdev and $loaddev */ setenv("LINES", "24", 1); /* optional */ + bios_getsmap(); + archsw.arch_autoload = i386_autoload; archsw.arch_getdev = i386_getdev; archsw.arch_copyin = i386_copyin; From owner-p4-projects@FreeBSD.ORG Tue Apr 8 21:33:53 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 3182D37B404; Tue, 8 Apr 2003 21:33:53 -0700 (PDT) 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 C452937B401 for ; Tue, 8 Apr 2003 21:33:52 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6127643F85 for ; Tue, 8 Apr 2003 21:33:52 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h394Xq0U039898 for ; Tue, 8 Apr 2003 21:33:52 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h394Xpl5039893 for perforce@freebsd.org; Tue, 8 Apr 2003 21:33:51 -0700 (PDT) Date: Tue, 8 Apr 2003 21:33:51 -0700 (PDT) Message-Id: <200304090433.h394Xpl5039893@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28607 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, 09 Apr 2003 04:33:54 -0000 http://perforce.freebsd.org/chv.cgi?CH=28607 Change 28607 by peter@peter_daintree on 2003/04/08 21:33:13 do not add empty MODINFOMD_SMAP metadata records. Affected files ... .. //depot/projects/hammer/sys/boot/i386/libi386/biossmap.c#2 edit Differences ... ==== //depot/projects/hammer/sys/boot/i386/libi386/biossmap.c#2 (text+ko) ==== @@ -54,8 +54,9 @@ { int n; + n = 0; + smaplen = 0; /* Count up segments in system memory map */ - n = 0; v86.ebx = 0; do { v86.ctl = V86_FLAGS; @@ -70,11 +71,12 @@ break; n++; } while (v86.ebx != 0); + if (n == 0) + return; n += 10; /* spare room */ smapbase = malloc(n * sizeof(*smapbase)); /* Save system memory map */ - smaplen = 0; v86.ebx = 0; do { v86.ctl = V86_FLAGS; @@ -93,7 +95,10 @@ void bios_addsmapdata(struct preloaded_file *kfp) { + int len; - file_addmetadata(kfp, MODINFOMD_SMAP, - smaplen * sizeof(*smapbase), smapbase); + if (smapbase == 0 || smaplen == 0) + return; + len = smaplen * sizeof(*smapbase); + file_addmetadata(kfp, MODINFOMD_SMAP, len, smapbase); } From owner-p4-projects@FreeBSD.ORG Tue Apr 8 22:01:27 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id C157537B401; Tue, 8 Apr 2003 22:01:26 -0700 (PDT) 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 753D137B404 for ; Tue, 8 Apr 2003 22:01:26 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0C4A043F75 for ; Tue, 8 Apr 2003 22:01:26 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h3951P0U041976 for ; Tue, 8 Apr 2003 22:01:25 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h3951PlS041973 for perforce@freebsd.org; Tue, 8 Apr 2003 22:01:25 -0700 (PDT) Date: Tue, 8 Apr 2003 22:01:25 -0700 (PDT) Message-Id: <200304090501.h3951PlS041973@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28608 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, 09 Apr 2003 05:01:28 -0000 http://perforce.freebsd.org/chv.cgi?CH=28608 Change 28608 by peter@peter_daintree on 2003/04/08 22:00:49 add ramdisk Affected files ... .. //depot/projects/hammer/sys/x86_64/conf/GENERIC#4 edit Differences ... ==== //depot/projects/hammer/sys/x86_64/conf/GENERIC#4 (text+ko) ==== @@ -27,6 +27,7 @@ options SCHED_4BSD options FFS options SOFTUPDATES +options MD_ROOT device isa device sio From owner-p4-projects@FreeBSD.ORG Tue Apr 8 22:03:30 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 043DE37B404; Tue, 8 Apr 2003 22:03:30 -0700 (PDT) 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 965AC37B401 for ; Tue, 8 Apr 2003 22:03:29 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2F12343F3F for ; Tue, 8 Apr 2003 22:03:29 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h3953T0U042999 for ; Tue, 8 Apr 2003 22:03:29 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h3953SKR042996 for perforce@freebsd.org; Tue, 8 Apr 2003 22:03:28 -0700 (PDT) Date: Tue, 8 Apr 2003 22:03:28 -0700 (PDT) Message-Id: <200304090503.h3953SKR042996@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28609 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, 09 Apr 2003 05:03:31 -0000 http://perforce.freebsd.org/chv.cgi?CH=28609 Change 28609 by peter@peter_daintree on 2003/04/08 22:02:55 branch. we need to do something here at least. Affected files ... .. //depot/projects/hammer/sys/x86_64/x86_64/identcpu.c#1 branch .. //depot/projects/hammer/sys/x86_64/x86_64/initcpu.c#1 branch Differences ... From owner-p4-projects@FreeBSD.ORG Tue Apr 8 22:08:38 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id BF76D37B404; Tue, 8 Apr 2003 22:08:37 -0700 (PDT) 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 6B36F37B401 for ; Tue, 8 Apr 2003 22:08:37 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 03BAB43FA3 for ; Tue, 8 Apr 2003 22:08:37 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h3958a0U043238 for ; Tue, 8 Apr 2003 22:08:36 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h3958arH043235 for perforce@freebsd.org; Tue, 8 Apr 2003 22:08:36 -0700 (PDT) Date: Tue, 8 Apr 2003 22:08:36 -0700 (PDT) Message-Id: <200304090508.h3958arH043235@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28611 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, 09 Apr 2003 05:08:38 -0000 http://perforce.freebsd.org/chv.cgi?CH=28611 Change 28611 by peter@peter_daintree on 2003/04/08 22:08:26 Gut. Affected files ... .. //depot/projects/hammer/sys/x86_64/x86_64/identcpu.c#2 edit Differences ... ==== //depot/projects/hammer/sys/x86_64/x86_64/identcpu.c#2 (text+ko) ==== From owner-p4-projects@FreeBSD.ORG Tue Apr 8 22:20:54 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id B01E037B404; Tue, 8 Apr 2003 22:20:53 -0700 (PDT) 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 4A62F37B401 for ; Tue, 8 Apr 2003 22:20:53 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 66B3843FAF for ; Tue, 8 Apr 2003 22:20:52 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h395Kq0U044260 for ; Tue, 8 Apr 2003 22:20:52 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h395KpNH044254 for perforce@freebsd.org; Tue, 8 Apr 2003 22:20:51 -0700 (PDT) Date: Tue, 8 Apr 2003 22:20:51 -0700 (PDT) Message-Id: <200304090520.h395KpNH044254@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28612 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, 09 Apr 2003 05:20:55 -0000 http://perforce.freebsd.org/chv.cgi?CH=28612 Change 28612 by peter@peter_daintree on 2003/04/08 22:20:25 Gut. Affected files ... .. //depot/projects/hammer/sys/x86_64/x86_64/identcpu.c#3 edit .. //depot/projects/hammer/sys/x86_64/x86_64/initcpu.c#2 edit Differences ... ==== //depot/projects/hammer/sys/x86_64/x86_64/identcpu.c#3 (text+ko) ==== @@ -60,34 +60,19 @@ #include #include -#define IDENTBLUE_CYRIX486 0 -#define IDENTBLUE_IBMCPU 1 -#define IDENTBLUE_CYRIXM2 2 - /* XXX - should be in header file: */ void printcpuinfo(void); void finishidentcpu(void); void earlysetcpuclass(void); -#if defined(I586_CPU) && defined(CPU_WT_ALLOC) -void enable_K5_wt_alloc(void); -void enable_K6_wt_alloc(void); -void enable_K6_2_wt_alloc(void); -#endif void panicifcpuunsupported(void); -static void identifycyrix(void); -#if defined(I486_CPU) || defined(I586_CPU) || defined(I686_CPU) static void print_AMD_features(void); -#endif static void print_AMD_info(void); static void print_AMD_assoc(int i); -static void print_transmeta_info(void); -static void setup_tmx86_longrun(void); int cpu_class; u_int cpu_exthigh; /* Highest arg to extended CPUID */ -u_int cyrix_did; /* Device ID of Cyrix CPU */ -char machine[] = "i386"; +char machine[] = "x86_64"; SYSCTL_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD, machine, 0, "Machine class"); @@ -95,24 +80,8 @@ SYSCTL_STRING(_hw, HW_MODEL, model, CTLFLAG_RD, cpu_model, 0, "Machine model"); -#if defined(I486_CPU) || defined(I586_CPU) || defined(I686_CPU) static char cpu_brand[48]; -#define MAX_BRAND_INDEX 8 - -static const char *cpu_brandtable[MAX_BRAND_INDEX + 1] = { - NULL, /* No brand */ - "Intel Celeron", - "Intel Pentium III", - "Intel Pentium III Xeon", - NULL, - NULL, - NULL, - NULL, - "Intel Pentium 4" -}; -#endif - static struct cpu_nameclass i386_cpus[] = { { "Intel 80286", CPUCLASS_286 }, /* CPU_286 */ { "i386SX", CPUCLASS_386 }, /* CPU_386SX */ @@ -133,23 +102,16 @@ { "Pentium 4", CPUCLASS_686 }, /* CPU_P4 */ }; -#if defined(I586_CPU) && !defined(NO_F00F_HACK) -int has_f00f_bug = 0; /* Initialized so that it can be patched. */ -#endif - void printcpuinfo(void) { -#if defined(I486_CPU) || defined(I586_CPU) || defined(I686_CPU) u_int regs[4], i; char *brand; -#endif cpu_class = i386_cpus[cpu].cpu_class; printf("CPU: "); strncpy(cpu_model, i386_cpus[cpu].cpu_name, sizeof (cpu_model)); -#if defined(I486_CPU) || defined(I586_CPU) || defined(I686_CPU) /* Check for extended CPUID information and a processor name. */ if (cpu_high > 0 && (strcmp(cpu_vendor, "GenuineIntel") == 0 || @@ -171,138 +133,8 @@ } if (strcmp(cpu_vendor, "GenuineIntel") == 0) { - if ((cpu_id & 0xf00) > 0x300) { - u_int brand_index; - - cpu_model[0] = '\0'; - - switch (cpu_id & 0x3000) { - case 0x1000: - strcpy(cpu_model, "Overdrive "); - break; - case 0x2000: - strcpy(cpu_model, "Dual "); - break; - } - - switch (cpu_id & 0xf00) { - case 0x400: - strcat(cpu_model, "i486 "); - /* Check the particular flavor of 486 */ - switch (cpu_id & 0xf0) { - case 0x00: - case 0x10: - strcat(cpu_model, "DX"); - break; - case 0x20: - strcat(cpu_model, "SX"); - break; - case 0x30: - strcat(cpu_model, "DX2"); - break; - case 0x40: - strcat(cpu_model, "SL"); - break; - case 0x50: - strcat(cpu_model, "SX2"); - break; - case 0x70: - strcat(cpu_model, - "DX2 Write-Back Enhanced"); - break; - case 0x80: - strcat(cpu_model, "DX4"); - break; - } - break; - case 0x500: - /* Check the particular flavor of 586 */ - strcat(cpu_model, "Pentium"); - switch (cpu_id & 0xf0) { - case 0x00: - strcat(cpu_model, " A-step"); - break; - case 0x10: - strcat(cpu_model, "/P5"); - break; - case 0x20: - strcat(cpu_model, "/P54C"); - break; - case 0x30: - strcat(cpu_model, "/P54T Overdrive"); - break; - case 0x40: - strcat(cpu_model, "/P55C"); - break; - case 0x70: - strcat(cpu_model, "/P54C"); - break; - case 0x80: - strcat(cpu_model, "/P55C (quarter-micron)"); - break; - default: - /* nothing */ - break; - } -#if defined(I586_CPU) && !defined(NO_F00F_HACK) - /* - * XXX - If/when Intel fixes the bug, this - * should also check the version of the - * CPU, not just that it's a Pentium. - */ - has_f00f_bug = 1; -#endif - break; - case 0x600: - /* Check the particular flavor of 686 */ - switch (cpu_id & 0xf0) { - case 0x00: - strcat(cpu_model, "Pentium Pro A-step"); - break; - case 0x10: - strcat(cpu_model, "Pentium Pro"); - break; - case 0x30: - case 0x50: - case 0x60: - strcat(cpu_model, - "Pentium II/Pentium II Xeon/Celeron"); - cpu = CPU_PII; - break; - case 0x70: - case 0x80: - case 0xa0: - case 0xb0: - strcat(cpu_model, - "Pentium III/Pentium III Xeon/Celeron"); - cpu = CPU_PIII; - break; - default: - strcat(cpu_model, "Unknown 80686"); - break; - } - break; - case 0xf00: - strcat(cpu_model, "Pentium 4"); - cpu = CPU_P4; - break; - default: - strcat(cpu_model, "unknown"); - break; - } - - /* - * If we didn't get a brand name from the extended - * CPUID, try to look it up in the brand table. - */ - if (cpu_high > 0 && *cpu_brand == '\0') { - brand_index = cpu_procinfo & CPUID_BRAND_INDEX; - if (brand_index <= MAX_BRAND_INDEX && - cpu_brandtable[brand_index] != NULL) - strcpy(cpu_brand, - cpu_brandtable[brand_index]); - } - } + /* How the hell did you get here?? */ + strcat(cpu_model, "Yamhill?"); } else if (strcmp(cpu_vendor, "AuthenticAMD") == 0) { /* * Values taken from AMD Processor Recognition @@ -311,231 +143,13 @@ */ strcpy(cpu_model, "AMD "); switch (cpu_id & 0xFF0) { - case 0x410: - strcat(cpu_model, "Standard Am486DX"); - break; - case 0x430: - strcat(cpu_model, "Enhanced Am486DX2 Write-Through"); - break; - case 0x470: - strcat(cpu_model, "Enhanced Am486DX2 Write-Back"); - break; - case 0x480: - strcat(cpu_model, "Enhanced Am486DX4/Am5x86 Write-Through"); - break; - case 0x490: - strcat(cpu_model, "Enhanced Am486DX4/Am5x86 Write-Back"); - break; - case 0x4E0: - strcat(cpu_model, "Am5x86 Write-Through"); - break; - case 0x4F0: - strcat(cpu_model, "Am5x86 Write-Back"); - break; - case 0x500: - strcat(cpu_model, "K5 model 0"); - tsc_is_broken = 1; - break; - case 0x510: - strcat(cpu_model, "K5 model 1"); - break; - case 0x520: - strcat(cpu_model, "K5 PR166 (model 2)"); - break; - case 0x530: - strcat(cpu_model, "K5 PR200 (model 3)"); - break; - case 0x560: - strcat(cpu_model, "K6"); - break; - case 0x570: - strcat(cpu_model, "K6 266 (model 1)"); - break; - case 0x580: - strcat(cpu_model, "K6-2"); - break; - case 0x590: - strcat(cpu_model, "K6-III"); - break; - default: - strcat(cpu_model, "Unknown"); - break; - } -#if defined(I586_CPU) && defined(CPU_WT_ALLOC) - if ((cpu_id & 0xf00) == 0x500) { - if (((cpu_id & 0x0f0) > 0) - && ((cpu_id & 0x0f0) < 0x60) - && ((cpu_id & 0x00f) > 3)) - enable_K5_wt_alloc(); - else if (((cpu_id & 0x0f0) > 0x80) - || (((cpu_id & 0x0f0) == 0x80) - && (cpu_id & 0x00f) > 0x07)) - enable_K6_2_wt_alloc(); - else if ((cpu_id & 0x0f0) > 0x50) - enable_K6_wt_alloc(); - } -#endif - } else if (strcmp(cpu_vendor, "CyrixInstead") == 0) { - strcpy(cpu_model, "Cyrix "); - switch (cpu_id & 0xff0) { - case 0x440: - strcat(cpu_model, "MediaGX"); - break; - case 0x520: - strcat(cpu_model, "6x86"); - break; - case 0x540: - cpu_class = CPUCLASS_586; - strcat(cpu_model, "GXm"); - break; - case 0x600: - strcat(cpu_model, "6x86MX"); - break; - default: - /* - * Even though CPU supports the cpuid - * instruction, it can be disabled. - * Therefore, this routine supports all Cyrix - * CPUs. - */ - switch (cyrix_did & 0xf0) { - case 0x00: - switch (cyrix_did & 0x0f) { - case 0x00: - strcat(cpu_model, "486SLC"); - break; - case 0x01: - strcat(cpu_model, "486DLC"); - break; - case 0x02: - strcat(cpu_model, "486SLC2"); - break; - case 0x03: - strcat(cpu_model, "486DLC2"); - break; - case 0x04: - strcat(cpu_model, "486SRx"); - break; - case 0x05: - strcat(cpu_model, "486DRx"); - break; - case 0x06: - strcat(cpu_model, "486SRx2"); - break; - case 0x07: - strcat(cpu_model, "486DRx2"); - break; - case 0x08: - strcat(cpu_model, "486SRu"); - break; - case 0x09: - strcat(cpu_model, "486DRu"); - break; - case 0x0a: - strcat(cpu_model, "486SRu2"); - break; - case 0x0b: - strcat(cpu_model, "486DRu2"); - break; - default: - strcat(cpu_model, "Unknown"); - break; - } - break; - case 0x10: - switch (cyrix_did & 0x0f) { - case 0x00: - strcat(cpu_model, "486S"); - break; - case 0x01: - strcat(cpu_model, "486S2"); - break; - case 0x02: - strcat(cpu_model, "486Se"); - break; - case 0x03: - strcat(cpu_model, "486S2e"); - break; - case 0x0a: - strcat(cpu_model, "486DX"); - break; - case 0x0b: - strcat(cpu_model, "486DX2"); - break; - case 0x0f: - strcat(cpu_model, "486DX4"); - break; - default: - strcat(cpu_model, "Unknown"); - break; - } - break; - case 0x20: - if ((cyrix_did & 0x0f) < 8) - strcat(cpu_model, "6x86"); /* Where did you get it? */ - else - strcat(cpu_model, "5x86"); - break; - case 0x30: - strcat(cpu_model, "6x86"); - break; - case 0x40: - if ((cyrix_did & 0xf000) == 0x3000) { - cpu_class = CPUCLASS_586; - strcat(cpu_model, "GXm"); - } else - strcat(cpu_model, "MediaGX"); - break; - case 0x50: - strcat(cpu_model, "6x86MX"); - break; - case 0xf0: - switch (cyrix_did & 0x0f) { - case 0x0d: - strcat(cpu_model, "Overdrive CPU"); - case 0x0e: - strcpy(cpu_model, "Texas Instruments 486SXL"); - break; - case 0x0f: - strcat(cpu_model, "486SLC/DLC"); - break; - default: - strcat(cpu_model, "Unknown"); - break; - } - break; - default: - strcat(cpu_model, "Unknown"); - break; - } - break; - } - } else if (strcmp(cpu_vendor, "RiseRiseRise") == 0) { - strcpy(cpu_model, "Rise "); - switch (cpu_id & 0xff0) { - case 0x500: - strcat(cpu_model, "mP6"); + case 0xf00: + strcat(cpu_model, "Hammer"); break; default: strcat(cpu_model, "Unknown"); - } - } else if (strcmp(cpu_vendor, "CentaurHauls") == 0) { - switch (cpu_id & 0xff0) { - case 0x540: - strcpy(cpu_model, "IDT WinChip C6"); - tsc_is_broken = 1; break; - case 0x580: - strcpy(cpu_model, "IDT WinChip 2"); - break; - case 0x670: - strcpy(cpu_model, "VIA C3 Samuel 2"); - break; - default: - strcpy(cpu_model, "VIA/IDT Unknown"); } - } else if (strcmp(cpu_vendor, "IBM") == 0) { - strcpy(cpu_model, "Blue Lightning CPU"); } /* @@ -548,59 +162,26 @@ if (*brand != '\0') strcpy(cpu_model, brand); -#endif - printf("%s (", cpu_model); switch(cpu_class) { - case CPUCLASS_286: - printf("286"); - break; -#if defined(I386_CPU) - case CPUCLASS_386: - printf("386"); - break; -#endif -#if defined(I486_CPU) - case CPUCLASS_486: - printf("486"); - bzero_vector = i486_bzero; - break; -#endif -#if defined(I586_CPU) - case CPUCLASS_586: - printf("%jd.%02d-MHz ", - (intmax_t)(tsc_freq + 4999) / 1000000, - (u_int)((tsc_freq + 4999) / 10000) % 100); - printf("586"); - break; -#endif -#if defined(I686_CPU) case CPUCLASS_686: printf("%jd.%02d-MHz ", (intmax_t)(tsc_freq + 4999) / 1000000, (u_int)((tsc_freq + 4999) / 10000) % 100); printf("686"); break; -#endif default: printf("Unknown"); /* will panic below... */ } printf("-class CPU)\n"); -#if defined(I486_CPU) || defined(I586_CPU) || defined(I686_CPU) if(*cpu_vendor) printf(" Origin = \"%s\"",cpu_vendor); if(cpu_id) printf(" Id = 0x%x", cpu_id); if (strcmp(cpu_vendor, "GenuineIntel") == 0 || - strcmp(cpu_vendor, "AuthenticAMD") == 0 || - strcmp(cpu_vendor, "RiseRiseRise") == 0 || - strcmp(cpu_vendor, "CentaurHauls") == 0 || - ((strcmp(cpu_vendor, "CyrixInstead") == 0) && - ((cpu_id & 0xf00) > 0x500))) { + strcmp(cpu_vendor, "AuthenticAMD") == 0) { printf(" Stepping = %u", cpu_id & 0xf); - if (strcmp(cpu_vendor, "CyrixInstead") == 0) - printf(" DIR=0x%04x", cyrix_did); if (cpu_high > 0) { /* * Here we should probably set up flags indicating @@ -659,24 +240,11 @@ cpu_exthigh >= 0x80000001) print_AMD_features(); } else if (strcmp(cpu_vendor, "CyrixInstead") == 0) { - printf(" DIR=0x%04x", cyrix_did); - printf(" Stepping=%u", (cyrix_did & 0xf000) >> 12); - printf(" Revision=%u", (cyrix_did & 0x0f00) >> 8); -#ifndef CYRIX_CACHE_REALLY_WORKS - if (cpu == CPU_M1 && (cyrix_did & 0xff00) < 0x1700) - printf("\n CPU cache: write-through mode"); -#endif } /* Avoid ugly blank lines: only print newline when we have to. */ if (*cpu_vendor || cpu_id) printf("\n"); -#endif - if (strcmp(cpu_vendor, "GenuineTMx86") == 0 || - strcmp(cpu_vendor, "TransmetaCPU") == 0) { - setup_tmx86_longrun(); - } - if (!bootverbose) return; @@ -685,44 +253,22 @@ else if (strcmp(cpu_vendor, "GenuineTMx86") == 0 || strcmp(cpu_vendor, "TransmetaCPU") == 0) print_transmeta_info(); - -#ifdef I686_CPU - /* - * XXX - Do PPro CPUID level=2 stuff here? - * - * No, but maybe in a print_Intel_info() function called from here. - */ -#endif } void panicifcpuunsupported(void) { -#if !defined(I386_CPU) && !defined(I486_CPU) && !defined(I586_CPU) && !defined(I686_CPU) -#error This kernel is not configured for one of the supported CPUs -#endif -#if defined(I386_CPU) && (defined(I486_CPU) || defined(I586_CPU) || defined(I686_CPU)) -#error I386_CPU is mutually exclusive with the other cpu types. -#endif /* * Now that we have told the user what they have, * let them know if that machine type isn't configured. */ switch (cpu_class) { case CPUCLASS_286: /* a 286 should not make it this far, anyway */ -#if !defined(I386_CPU) case CPUCLASS_386: -#endif -#if !defined(I486_CPU) case CPUCLASS_486: -#endif -#if !defined(I586_CPU) case CPUCLASS_586: -#endif -#if !defined(I686_CPU) case CPUCLASS_686: -#endif panic("CPU class not configured"); default: break; @@ -730,227 +276,12 @@ } -static volatile u_int trap_by_rdmsr; - -/* - * Special exception 6 handler. - * The rdmsr instruction generates invalid opcodes fault on 486-class - * Cyrix CPU. Stacked eip register points the rdmsr instruction in the - * function identblue() when this handler is called. Stacked eip should - * be advanced. - */ -inthand_t bluetrap6; -__asm -(" \ - .text; \ - .p2align 2,0x90; \ - .type " __XSTRING(CNAME(bluetrap6)) ",@function; \ -" __XSTRING(CNAME(bluetrap6)) ": \ - ss; \ - movl $0xa8c1d," __XSTRING(CNAME(trap_by_rdmsr)) "; \ - addl $2, (%esp); /* rdmsr is a 2-byte instruction */ \ - iret \ -"); - -/* - * Special exception 13 handler. - * Accessing non-existent MSR generates general protection fault. - */ -inthand_t bluetrap13; -__asm -(" \ - .text; \ - .p2align 2,0x90; \ - .type " __XSTRING(CNAME(bluetrap13)) ",@function; \ -" __XSTRING(CNAME(bluetrap13)) ": \ - ss; \ - movl $0xa89c4," __XSTRING(CNAME(trap_by_rdmsr)) "; \ - popl %eax; /* discard errorcode. */ \ - addl $2, (%esp); /* rdmsr is a 2-bytes instruction. */ \ - iret; \ -"); - -/* - * Distinguish IBM Blue Lightning CPU from Cyrix CPUs that does not - * support cpuid instruction. This function should be called after - * loading interrupt descriptor table register. - * - * I don't like this method that handles fault, but I couldn't get - * information for any other methods. Does blue giant know? - */ -static int -identblue(void) -{ - - trap_by_rdmsr = 0; - - /* - * Cyrix 486-class CPU does not support rdmsr instruction. - * The rdmsr instruction generates invalid opcode fault, and exception - * will be trapped by bluetrap6() on Cyrix 486-class CPU. The - * bluetrap6() set the magic number to trap_by_rdmsr. - */ - setidt(6, bluetrap6, SDT_SYS386TGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL)); - - /* - * Certain BIOS disables cpuid instruction of Cyrix 6x86MX CPU. - * In this case, rdmsr generates general protection fault, and - * exception will be trapped by bluetrap13(). - */ - setidt(13, bluetrap13, SDT_SYS386TGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL)); - - rdmsr(0x1002); /* Cyrix CPU generates fault. */ - - if (trap_by_rdmsr == 0xa8c1d) - return IDENTBLUE_CYRIX486; - else if (trap_by_rdmsr == 0xa89c4) - return IDENTBLUE_CYRIXM2; - return IDENTBLUE_IBMCPU; -} - - -/* - * identifycyrix() set lower 16 bits of cyrix_did as follows: - * - * F E D C B A 9 8 7 6 5 4 3 2 1 0 - * +-------+-------+---------------+ - * | SID | RID | Device ID | - * | (DIR 1) | (DIR 0) | - * +-------+-------+---------------+ - */ -static void -identifycyrix(void) -{ - u_int eflags; - int ccr2_test = 0, dir_test = 0; - u_char ccr2, ccr3; - - eflags = read_eflags(); - disable_intr(); - - ccr2 = read_cyrix_reg(CCR2); - write_cyrix_reg(CCR2, ccr2 ^ CCR2_LOCK_NW); - read_cyrix_reg(CCR2); - if (read_cyrix_reg(CCR2) != ccr2) - ccr2_test = 1; - write_cyrix_reg(CCR2, ccr2); - - ccr3 = read_cyrix_reg(CCR3); - write_cyrix_reg(CCR3, ccr3 ^ CCR3_MAPEN3); - read_cyrix_reg(CCR3); - if (read_cyrix_reg(CCR3) != ccr3) - dir_test = 1; /* CPU supports DIRs. */ - write_cyrix_reg(CCR3, ccr3); - - if (dir_test) { - /* Device ID registers are available. */ - cyrix_did = read_cyrix_reg(DIR1) << 8; - cyrix_did += read_cyrix_reg(DIR0); - } else if (ccr2_test) - cyrix_did = 0x0010; /* 486S A-step */ - else - cyrix_did = 0x00ff; /* Old 486SLC/DLC and TI486SXLC/SXL */ - - write_eflags(eflags); -} - /* * Final stage of CPU identification. -- Should I check TI? */ void finishidentcpu(void) { - int isblue = 0; - u_char ccr3; - u_int regs[4]; - - if (strcmp(cpu_vendor, "CyrixInstead") == 0) { - if (cpu == CPU_486) { - /* - * These conditions are equivalent to: - * - CPU does not support cpuid instruction. - * - Cyrix/IBM CPU is detected. - */ - isblue = identblue(); - if (isblue == IDENTBLUE_IBMCPU) { - strcpy(cpu_vendor, "IBM"); - cpu = CPU_BLUE; - return; - } - } - switch (cpu_id & 0xf00) { - case 0x600: - /* - * Cyrix's datasheet does not describe DIRs. - * Therefor, I assume it does not have them - * and use the result of the cpuid instruction. - * XXX they seem to have it for now at least. -Peter - */ - identifycyrix(); - cpu = CPU_M2; - break; - default: - identifycyrix(); - /* - * This routine contains a trick. - * Don't check (cpu_id & 0x00f0) == 0x50 to detect M2, now. - */ - switch (cyrix_did & 0x00f0) { - case 0x00: - case 0xf0: - cpu = CPU_486DLC; - break; - case 0x10: - cpu = CPU_CY486DX; - break; - case 0x20: - if ((cyrix_did & 0x000f) < 8) - cpu = CPU_M1; - else - cpu = CPU_M1SC; - break; - case 0x30: - cpu = CPU_M1; - break; - case 0x40: - /* MediaGX CPU */ - cpu = CPU_M1SC; - break; - default: - /* M2 and later CPUs are treated as M2. */ - cpu = CPU_M2; - - /* - * enable cpuid instruction. - */ - ccr3 = read_cyrix_reg(CCR3); - write_cyrix_reg(CCR3, CCR3_MAPEN0); - write_cyrix_reg(CCR4, read_cyrix_reg(CCR4) | CCR4_CPUID); - write_cyrix_reg(CCR3, ccr3); - - do_cpuid(0, regs); - cpu_high = regs[0]; /* eax */ - do_cpuid(1, regs); - cpu_id = regs[0]; /* eax */ - cpu_feature = regs[3]; /* edx */ - break; - } - } - } else if (cpu == CPU_486 && *cpu_vendor == '\0') { - /* - * There are BlueLightning CPUs that do not change - * undefined flags by dividing 5 by 2. In this case, - * the CPU identification routine in locore.s leaves - * cpu_vendor null string and puts CPU_486 into the - * cpu. - */ - isblue = identblue(); - if (isblue == IDENTBLUE_IBMCPU) { - strcpy(cpu_vendor, "IBM"); - cpu = CPU_BLUE; - return; - } - } } static void @@ -1022,7 +353,6 @@ } } -#if defined(I486_CPU) || defined(I586_CPU) || defined(I686_CPU) static void print_AMD_features(void) { @@ -1069,297 +399,3 @@ "\0403DNow!" ); } -#endif - -/* - * Transmeta Crusoe LongRun Support by Tamotsu Hattori. - */ - -#define MSR_TMx86_LONGRUN 0x80868010 -#define MSR_TMx86_LONGRUN_FLAGS 0x80868011 - -#define LONGRUN_MODE_MASK(x) ((x) & 0x000000007f) -#define LONGRUN_MODE_RESERVED(x) ((x) & 0xffffff80) -#define LONGRUN_MODE_WRITE(x, y) (LONGRUN_MODE_RESERVED(x) | LONGRUN_MODE_MASK(y)) - -#define LONGRUN_MODE_MINFREQUENCY 0x00 -#define LONGRUN_MODE_ECONOMY 0x01 -#define LONGRUN_MODE_PERFORMANCE 0x02 -#define LONGRUN_MODE_MAXFREQUENCY 0x03 -#define LONGRUN_MODE_UNKNOWN 0x04 -#define LONGRUN_MODE_MAX 0x04 - -union msrinfo { - u_int64_t msr; - u_int32_t regs[2]; -}; - -u_int32_t longrun_modes[LONGRUN_MODE_MAX][3] = { - /* MSR low, MSR high, flags bit0 */ - { 0, 0, 0}, /* LONGRUN_MODE_MINFREQUENCY */ - { 0, 100, 0}, /* LONGRUN_MODE_ECONOMY */ - { 0, 100, 1}, /* LONGRUN_MODE_PERFORMANCE */ - { 100, 100, 1}, /* LONGRUN_MODE_MAXFREQUENCY */ -}; - -static u_int -tmx86_get_longrun_mode(void) -{ - u_long eflags; - union msrinfo msrinfo; - u_int low, high, flags, mode; - - eflags = read_eflags(); - disable_intr(); - - msrinfo.msr = rdmsr(MSR_TMx86_LONGRUN); - low = LONGRUN_MODE_MASK(msrinfo.regs[0]); - high = LONGRUN_MODE_MASK(msrinfo.regs[1]); - flags = rdmsr(MSR_TMx86_LONGRUN_FLAGS) & 0x01; - - for (mode = 0; mode < LONGRUN_MODE_MAX; mode++) { - if (low == longrun_modes[mode][0] && - high == longrun_modes[mode][1] && - flags == longrun_modes[mode][2]) { - goto out; - } - } - mode = LONGRUN_MODE_UNKNOWN; -out: - write_eflags(eflags); - return (mode); -} - -static u_int -tmx86_get_longrun_status(u_int * frequency, u_int * voltage, u_int * percentage) -{ - u_long eflags; - u_int regs[4]; - - eflags = read_eflags(); - disable_intr(); - - do_cpuid(0x80860007, regs); - *frequency = regs[0]; - *voltage = regs[1]; - *percentage = regs[2]; - - write_eflags(eflags); - return (1); -} - -static u_int -tmx86_set_longrun_mode(u_int mode) -{ - u_long eflags; - union msrinfo msrinfo; - - if (mode >= LONGRUN_MODE_UNKNOWN) { - return (0); - } - - eflags = read_eflags(); - disable_intr(); - - /* Write LongRun mode values to Model Specific Register. */ - msrinfo.msr = rdmsr(MSR_TMx86_LONGRUN); - msrinfo.regs[0] = LONGRUN_MODE_WRITE(msrinfo.regs[0], - longrun_modes[mode][0]); - msrinfo.regs[1] = LONGRUN_MODE_WRITE(msrinfo.regs[1], - longrun_modes[mode][1]); - wrmsr(MSR_TMx86_LONGRUN, msrinfo.msr); - - /* Write LongRun mode flags to Model Specific Register. */ - msrinfo.msr = rdmsr(MSR_TMx86_LONGRUN_FLAGS); - msrinfo.regs[0] = (msrinfo.regs[0] & ~0x01) | longrun_modes[mode][2]; - wrmsr(MSR_TMx86_LONGRUN_FLAGS, msrinfo.msr); - - write_eflags(eflags); - return (1); -} - -static u_int crusoe_longrun; -static u_int crusoe_frequency; -static u_int crusoe_voltage; -static u_int crusoe_percentage; -static u_int crusoe_performance_longrun = LONGRUN_MODE_PERFORMANCE; -static u_int crusoe_economy_longrun = LONGRUN_MODE_ECONOMY; -static struct sysctl_ctx_list crusoe_sysctl_ctx; -static struct sysctl_oid *crusoe_sysctl_tree; - -static void -tmx86_longrun_power_profile(void *arg) -{ - int state; - u_int new; - - state = power_profile_get_state(); - if (state != POWER_PROFILE_PERFORMANCE && - state != POWER_PROFILE_ECONOMY) { - return; - } - - switch (state) { - case POWER_PROFILE_PERFORMANCE: - new =crusoe_performance_longrun; - break; - case POWER_PROFILE_ECONOMY: - new = crusoe_economy_longrun; - break; - default: - new = tmx86_get_longrun_mode(); - break; - } - - if (tmx86_get_longrun_mode() != new) { - tmx86_set_longrun_mode(new); - } -} - -static int -tmx86_longrun_sysctl(SYSCTL_HANDLER_ARGS) -{ - u_int mode; - int error; - - crusoe_longrun = tmx86_get_longrun_mode(); - mode = crusoe_longrun; - error = sysctl_handle_int(oidp, &mode, 0, req); >>> TRUNCATED FOR MAIL (1000 lines) <<< From owner-p4-projects@FreeBSD.ORG Tue Apr 8 22:21:55 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id E923E37B404; Tue, 8 Apr 2003 22:21:54 -0700 (PDT) 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 9E7CE37B401 for ; Tue, 8 Apr 2003 22:21:54 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3856943FAF for ; Tue, 8 Apr 2003 22:21:54 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h395Ls0U044336 for ; Tue, 8 Apr 2003 22:21:54 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h395Lrr7044333 for perforce@freebsd.org; Tue, 8 Apr 2003 22:21:53 -0700 (PDT) Date: Tue, 8 Apr 2003 22:21:53 -0700 (PDT) Message-Id: <200304090521.h395Lrr7044333@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28613 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, 09 Apr 2003 05:21:55 -0000 http://perforce.freebsd.org/chv.cgi?CH=28613 Change 28613 by peter@peter_daintree on 2003/04/08 22:21:27 Goodnight Affected files ... .. //depot/projects/hammer/sys/x86_64/x86_64/serial.S#2 delete Differences ... From owner-p4-projects@FreeBSD.ORG Tue Apr 8 22:23:58 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 27E5237B404; Tue, 8 Apr 2003 22:23:58 -0700 (PDT) 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 C8E7A37B405 for ; Tue, 8 Apr 2003 22:23:57 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 54C2E43F3F for ; Tue, 8 Apr 2003 22:23:57 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h395Nv0U044390 for ; Tue, 8 Apr 2003 22:23:57 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h395Nu2U044387 for perforce@freebsd.org; Tue, 8 Apr 2003 22:23:56 -0700 (PDT) Date: Tue, 8 Apr 2003 22:23:56 -0700 (PDT) Message-Id: <200304090523.h395Nu2U044387@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28614 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, 09 Apr 2003 05:23:59 -0000 http://perforce.freebsd.org/chv.cgi?CH=28614 Change 28614 by peter@peter_daintree on 2003/04/08 22:23:46 do not need serial_* anymore, It served well! Affected files ... .. //depot/projects/hammer/sys/x86_64/x86_64/locore.s#32 edit .. //depot/projects/hammer/sys/x86_64/x86_64/machdep.c#58 edit Differences ... ==== //depot/projects/hammer/sys/x86_64/x86_64/locore.s#32 (text+ko) ==== @@ -86,8 +86,6 @@ pushq $PSL_KERNEL popfq - call init_serial - /* Find the metadata pointers before we lose them */ movq %rsp, %rbp xorq %rax, %rax @@ -145,71 +143,3 @@ ret #endif - -/***********************************************************************/ - - -#define COMBRD(x) (1843200 / (16*(x))) -#define COMCONSOLE 0x3f8 -#define CONSPEED 9600 - - .globl serial_putc - .type serial_putc@function -serial_putc: - movl $10000, %ecx # timeout - movl $COMCONSOLE + 5, %edx # line status reg -1: - decl %ecx - je 2f - inb %dx, %al - testb $0x20, %al - je 1b # TX buffer not empty - - movq %rdi, %rax - subl $5, %edx # TX output reg - outb %al, %dx # send this one - -2: - ret - - .globl init_serial - .type init_serial@function -init_serial: - movl $COMCONSOLE + 3, %edx # line control reg - movb $0x80, %al - outb %al, %dx # enable DLAB - - subl $3, %edx # divisor latch, low byte - movb $COMBRD(CONSPEED) & 0xff, %al - outb %al, %dx - incl %edx # divisor latch, high byte - movb $COMBRD(CONSPEED) >> 8, %al - outb %al, %dx - - incl %edx # fifo control register (if any) - xorl %eax,%eax - outb %al, %dx # disable fifo to reduce worst-case busy-wait - - incl %edx # line control reg - movb $0x03, %al - outb %al, %dx # 8N1 - - incl %edx # modem control reg - outb %al, %dx # enable DTR/RTS - - /* Flush the input buffer. */ - incl %edx # line status reg -1: - subl $5, %edx # rx buffer reg - inb %dx, %al # throw away (unconditionally the first time) - addl $5, %edx # line status reg - inb %dx, %al - testb $0x01, %al - jne 1b # more - - ret - - .bss - ALIGN_DATA /* just to be sure */ - .space 0x1000 /* space for bootstack - temporary stack */ -bootstack: ==== //depot/projects/hammer/sys/x86_64/x86_64/machdep.c#58 (text+ko) ==== @@ -1684,16 +1684,3 @@ } return 0; } - -extern void serial_putc(int); -void serial_puts(char *); - -void -serial_puts(char *s) -{ - while (*s) { - if (*s == '\n') - serial_putc('\r'); - serial_putc(*s++); - } -} From owner-p4-projects@FreeBSD.ORG Tue Apr 8 22:29:06 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 00DDA37B404; Tue, 8 Apr 2003 22:29:04 -0700 (PDT) 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 870D537B401 for ; Tue, 8 Apr 2003 22:29:04 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2FE5243F93 for ; Tue, 8 Apr 2003 22:29:04 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h395T40U044595 for ; Tue, 8 Apr 2003 22:29:04 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h395T3Hi044592 for perforce@freebsd.org; Tue, 8 Apr 2003 22:29:03 -0700 (PDT) Date: Tue, 8 Apr 2003 22:29:03 -0700 (PDT) Message-Id: <200304090529.h395T3Hi044592@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28615 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, 09 Apr 2003 05:29:06 -0000 http://perforce.freebsd.org/chv.cgi?CH=28615 Change 28615 by peter@peter_daintree on 2003/04/08 22:28:12 tidy up Affected files ... .. //depot/projects/hammer/sys/x86_64/x86_64/locore.s#33 edit Differences ... ==== //depot/projects/hammer/sys/x86_64/x86_64/locore.s#33 (text+ko) ==== @@ -71,7 +71,7 @@ * This is where the loader trampoline start us, set the ball rolling... * * We are called with the stack looking like this: - * 0(%rsp) = 32 bit return address + * 0(%rsp) = 32 bit return address (cannot be used) * 4(%rsp) = 32 bit modulep * 8(%rsp) = 32 bit kernend * @@ -94,25 +94,10 @@ movl 8(%rbp),%eax /* kernend */ movq %rax,physfree - /* Get onto a stack that we can trust and set up a real frame. */ + /* Get onto a stack that we can trust - there is no going back now. */ movq $bootstack,%rsp - pushq %rbp - movq %rsp, %rbp - -#if 0 - call identify_cpu - - /* set up bootstrap stack */ - movq proc0kstack,%rax /* location of in-kernel stack */ - /* bootstrap stack end location */ - leaq (KSTACK_PAGES*PAGE_SIZE-PCB_SIZE)(%rax),%rsp - - xorq %rbp,%rbp /* mark end of frames */ + xorq %rbp, %rbp - movq IdlePML4,%rsi - movq %rsi,(KSTACK_PAGES*PAGE_SIZE-PCB_SIZE+PCB_CR3)(%rax) -#endif - call hammer_time /* set up cpu for unix operation */ call mi_startup /* autoconfiguration, mountroot etc */ 0: hlt @@ -142,4 +127,3 @@ movl %edx,cpu_feature # store cpu_feature ret #endif - From owner-p4-projects@FreeBSD.ORG Tue Apr 8 22:37:15 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 5D8DB37B404; Tue, 8 Apr 2003 22:37:15 -0700 (PDT) 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 12BE937B401 for ; Tue, 8 Apr 2003 22:37:15 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id B32C243F3F for ; Tue, 8 Apr 2003 22:37:14 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h395bE0U045170 for ; Tue, 8 Apr 2003 22:37:14 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h395bEZV045167 for perforce@freebsd.org; Tue, 8 Apr 2003 22:37:14 -0700 (PDT) Date: Tue, 8 Apr 2003 22:37:14 -0700 (PDT) Message-Id: <200304090537.h395bEZV045167@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28616 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, 09 Apr 2003 05:37:16 -0000 http://perforce.freebsd.org/chv.cgi?CH=28616 Change 28616 by peter@peter_daintree on 2003/04/08 22:36:45 move identify_cpu from locore to here. Affected files ... .. //depot/projects/hammer/sys/x86_64/x86_64/identcpu.c#4 edit Differences ... ==== //depot/projects/hammer/sys/x86_64/x86_64/identcpu.c#4 (text+ko) ==== @@ -62,7 +62,7 @@ /* XXX - should be in header file: */ void printcpuinfo(void); -void finishidentcpu(void); +void identify_cpu(void); void earlysetcpuclass(void); void panicifcpuunsupported(void); @@ -280,8 +280,21 @@ * Final stage of CPU identification. -- Should I check TI? */ void -finishidentcpu(void) +identify_cpu(void) { + u_int regs[4]; + + do_cpuid(0, regs); + cpu_high = regs[0]; + ((u_int *)&cpu_vendor)[0] = regs[1]; + ((u_int *)&cpu_vendor)[1] = regs[2]; + ((u_int *)&cpu_vendor)[2] = regs[3]; + cpu_vendor[12] = '\0'; + + do_cpuid(1, regs); + cpu_id = regs[0]; + cpu_procinfo = regs[1]; + cpu_feature = regs[3]; } static void From owner-p4-projects@FreeBSD.ORG Tue Apr 8 22:38:19 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 5267F37B404; Tue, 8 Apr 2003 22:38:19 -0700 (PDT) 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 F39FB37B401 for ; Tue, 8 Apr 2003 22:38:17 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id ACF5943F75 for ; Tue, 8 Apr 2003 22:38:16 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h395cG0U045235 for ; Tue, 8 Apr 2003 22:38:16 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h395cGTX045232 for perforce@freebsd.org; Tue, 8 Apr 2003 22:38:16 -0700 (PDT) Date: Tue, 8 Apr 2003 22:38:16 -0700 (PDT) Message-Id: <200304090538.h395cGTX045232@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28617 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, 09 Apr 2003 05:38:20 -0000 http://perforce.freebsd.org/chv.cgi?CH=28617 Change 28617 by peter@peter_daintree on 2003/04/08 22:37:49 kill asm version of identify_cpu. Affected files ... .. //depot/projects/hammer/sys/x86_64/x86_64/locore.s#34 edit Differences ... ==== //depot/projects/hammer/sys/x86_64/x86_64/locore.s#34 (text+ko) ==== @@ -102,28 +102,3 @@ call mi_startup /* autoconfiguration, mountroot etc */ 0: hlt jmp 0b - - -#if 0 -/********************************************************************** - * - * Identify the CPU and initialize anything special about it - * - */ -identify_cpu: - - xorl %eax,%eax - cpuid # cpuid 0 - movl %eax,cpu_high # highest capability - movl %ebx,cpu_vendor # store vendor string - movl %edx,cpu_vendor+4 - movl %ecx,cpu_vendor+8 - movb $0,cpu_vendor+12 - - movl $1,%eax - cpuid # cpuid 1 - movl %eax,cpu_id # store cpu_id - movl %ebx,cpu_procinfo # store cpu_procinfo - movl %edx,cpu_feature # store cpu_feature - ret -#endif From owner-p4-projects@FreeBSD.ORG Tue Apr 8 23:08:55 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id E081237B404; Tue, 8 Apr 2003 23:08:54 -0700 (PDT) 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 94E4537B401 for ; Tue, 8 Apr 2003 23:08:54 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2C68043F93 for ; Tue, 8 Apr 2003 23:08:54 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h3968s0U048226 for ; Tue, 8 Apr 2003 23:08:54 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h3968r7M048223 for perforce@freebsd.org; Tue, 8 Apr 2003 23:08:53 -0700 (PDT) Date: Tue, 8 Apr 2003 23:08:53 -0700 (PDT) Message-Id: <200304090608.h3968r7M048223@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28618 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, 09 Apr 2003 06:08:56 -0000 http://perforce.freebsd.org/chv.cgi?CH=28618 Change 28618 by peter@peter_daintree on 2003/04/08 23:07:56 oops. we did need that stack after all. :-] Affected files ... .. //depot/projects/hammer/sys/x86_64/x86_64/locore.s#35 edit Differences ... ==== //depot/projects/hammer/sys/x86_64/x86_64/locore.s#35 (text+ko) ==== @@ -102,3 +102,8 @@ call mi_startup /* autoconfiguration, mountroot etc */ 0: hlt jmp 0b + + .bss + ALIGN_DATA /* just to be sure */ + .space 0x1000 /* space for bootstack - temporary stack */ +bootstack: From owner-p4-projects@FreeBSD.ORG Tue Apr 8 23:18:07 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id DA2C037B404; Tue, 8 Apr 2003 23:18:06 -0700 (PDT) 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 78CC637B401 for ; Tue, 8 Apr 2003 23:18:06 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0116D43F75 for ; Tue, 8 Apr 2003 23:18:06 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h396I50U048986 for ; Tue, 8 Apr 2003 23:18:05 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h396I5Fm048983 for perforce@freebsd.org; Tue, 8 Apr 2003 23:18:05 -0700 (PDT) Date: Tue, 8 Apr 2003 23:18:05 -0700 (PDT) Message-Id: <200304090618.h396I5Fm048983@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28619 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, 09 Apr 2003 06:18:07 -0000 http://perforce.freebsd.org/chv.cgi?CH=28619 Change 28619 by peter@peter_daintree on 2003/04/08 23:17:48 tidy up cpu identification.. there's still more cruft to go. Affected files ... .. //depot/projects/hammer/sys/conf/files.x86_64#16 edit .. //depot/projects/hammer/sys/conf/options.x86_64#7 edit .. //depot/projects/hammer/sys/x86_64/conf/GENERIC#5 edit .. //depot/projects/hammer/sys/x86_64/x86_64/identcpu.c#5 edit .. //depot/projects/hammer/sys/x86_64/x86_64/initcpu.c#3 edit .. //depot/projects/hammer/sys/x86_64/x86_64/machdep.c#59 edit Differences ... ==== //depot/projects/hammer/sys/conf/files.x86_64#16 (text+ko) ==== @@ -37,6 +37,8 @@ x86_64/x86_64/dump_machdep.c standard x86_64/x86_64/elf_machdep.c standard x86_64/x86_64/exception.s standard +x86_64/x86_64/identcpu.c standard +x86_64/x86_64/initcpu.c standard x86_64/x86_64/legacy.c standard x86_64/x86_64/locore.s standard no-obj x86_64/x86_64/machdep.c standard ==== //depot/projects/hammer/sys/conf/options.x86_64#7 (text+ko) ==== @@ -53,9 +53,7 @@ # ------------------------------- # EOF # ------------------------------- -CLAWHAMMER opt_cpu.h -SLEDGEHAMMER opt_cpu.h -HAMMER opt_cpu.h +HAMMER opt_cpu.h PPC_PROBE_CHIPSET opt_ppc.h PPC_DEBUG opt_ppc.h PSM_HOOKRESUME opt_psm.h ==== //depot/projects/hammer/sys/x86_64/conf/GENERIC#5 (text+ko) ==== @@ -19,7 +19,7 @@ # $FreeBSD: src/sys/i386/conf/GENERIC,v 1.368 2002/10/13 16:29:15 mike Exp $ machine x86_64 -cpu CLAWHAMMER +cpu HAMMER ident GENERIC maxusers 0 ==== //depot/projects/hammer/sys/x86_64/x86_64/identcpu.c#5 (text+ko) ==== @@ -57,8 +57,8 @@ #include #include -#include -#include +#include +#include /* XXX - should be in header file: */ void printcpuinfo(void); @@ -82,24 +82,9 @@ static char cpu_brand[48]; -static struct cpu_nameclass i386_cpus[] = { - { "Intel 80286", CPUCLASS_286 }, /* CPU_286 */ - { "i386SX", CPUCLASS_386 }, /* CPU_386SX */ - { "i386DX", CPUCLASS_386 }, /* CPU_386 */ - { "i486SX", CPUCLASS_486 }, /* CPU_486SX */ - { "i486DX", CPUCLASS_486 }, /* CPU_486 */ - { "Pentium", CPUCLASS_586 }, /* CPU_586 */ - { "Cyrix 486", CPUCLASS_486 }, /* CPU_486DLC */ - { "Pentium Pro", CPUCLASS_686 }, /* CPU_686 */ - { "Cyrix 5x86", CPUCLASS_486 }, /* CPU_M1SC */ - { "Cyrix 6x86", CPUCLASS_486 }, /* CPU_M1 */ - { "Blue Lightning", CPUCLASS_486 }, /* CPU_BLUE */ - { "Cyrix 6x86MX", CPUCLASS_686 }, /* CPU_M2 */ - { "NexGen 586", CPUCLASS_386 }, /* CPU_NX586 (XXX) */ - { "Cyrix 486S/DX", CPUCLASS_486 }, /* CPU_CY486DX */ - { "Pentium II", CPUCLASS_686 }, /* CPU_PII */ - { "Pentium III", CPUCLASS_686 }, /* CPU_PIII */ - { "Pentium 4", CPUCLASS_686 }, /* CPU_P4 */ +static struct cpu_nameclass x86_64_cpus[] = { + { "Clawhammer", CPUCLASS_K8 }, /* CPU_CLAWHAMMER */ + { "Sledgehammer", CPUCLASS_K8 }, /* CPU_SLEDGEHAMMER */ }; void @@ -108,9 +93,9 @@ u_int regs[4], i; char *brand; - cpu_class = i386_cpus[cpu].cpu_class; + cpu_class = x86_64_cpus[cpu].cpu_class; printf("CPU: "); - strncpy(cpu_model, i386_cpus[cpu].cpu_name, sizeof (cpu_model)); + strncpy(cpu_model, x86_64_cpus[cpu].cpu_name, sizeof (cpu_model)); /* Check for extended CPUID information and a processor name. */ if (cpu_high > 0 && @@ -164,11 +149,11 @@ printf("%s (", cpu_model); switch(cpu_class) { - case CPUCLASS_686: + case CPUCLASS_K8: printf("%jd.%02d-MHz ", (intmax_t)(tsc_freq + 4999) / 1000000, (u_int)((tsc_freq + 4999) / 10000) % 100); - printf("686"); + printf("Hammer"); break; default: printf("Unknown"); /* will panic below... */ @@ -250,25 +235,24 @@ if (strcmp(cpu_vendor, "AuthenticAMD") == 0) print_AMD_info(); - else if (strcmp(cpu_vendor, "GenuineTMx86") == 0 || - strcmp(cpu_vendor, "TransmetaCPU") == 0) - print_transmeta_info(); } void panicifcpuunsupported(void) { +#ifndef HAMMER +#error "You need to specify a cpu type" +#endif /* * Now that we have told the user what they have, * let them know if that machine type isn't configured. */ switch (cpu_class) { - case CPUCLASS_286: /* a 286 should not make it this far, anyway */ - case CPUCLASS_386: - case CPUCLASS_486: - case CPUCLASS_586: - case CPUCLASS_686: + case CPUCLASS_X86: +#ifndef HAMMER + case CPUCLASS_K8: +#endif panic("CPU class not configured"); default: break; @@ -287,14 +271,17 @@ do_cpuid(0, regs); cpu_high = regs[0]; ((u_int *)&cpu_vendor)[0] = regs[1]; - ((u_int *)&cpu_vendor)[1] = regs[2]; - ((u_int *)&cpu_vendor)[2] = regs[3]; + ((u_int *)&cpu_vendor)[1] = regs[3]; + ((u_int *)&cpu_vendor)[2] = regs[2]; cpu_vendor[12] = '\0'; do_cpuid(1, regs); cpu_id = regs[0]; cpu_procinfo = regs[1]; cpu_feature = regs[3]; + + /* XXX */ + cpu = CPU_CLAWHAMMER; } static void ==== //depot/projects/hammer/sys/x86_64/x86_64/initcpu.c#3 (text+ko) ==== @@ -71,11 +71,6 @@ { switch (cpu) { - case CPU_686: - if (strcmp(cpu_vendor, "GenuineIntel") == 0) { - } else if (strcmp(cpu_vendor, "AuthenticAMD") == 0) { - } - break; default: break; } ==== //depot/projects/hammer/sys/x86_64/x86_64/machdep.c#59 (text+ko) ==== @@ -113,12 +113,10 @@ extern void hammer_time(void); extern void dblfault_handler(void); -#if 0 extern void printcpuinfo(void); /* XXX header file */ -extern void finishidentcpu(void); +extern void identify_cpu(void); extern void panicifcpuunsupported(void); extern void initializecpu(void); -#endif #define CS_SECURE(cs) (ISPL(cs) == SEL_UPL) #define EFL_SECURE(ef, oef) ((((ef) ^ (oef)) & ~PSL_USERCHANGE) == 0) @@ -164,10 +162,8 @@ * Good {morning,afternoon,evening,night}. */ startrtclock(); -#if 0 printcpuinfo(); panicifcpuunsupported(); -#endif #ifdef PERFMON perfmon_init(); #endif @@ -1223,25 +1219,20 @@ Debugger("Boot flags requested debugger"); #endif -#if 0 - finishidentcpu(); /* Final stage of CPU initialization */ -#endif - setidt(6, &IDTVEC(ill), SDT_SYSTGT, 0); - setidt(13, &IDTVEC(prot), SDT_SYSTGT, 0); -#if 0 + identify_cpu(); /* Final stage of CPU initialization */ initializecpu(); /* Initialize CPU registers */ -#endif /* make an initial tss so cpu can get interrupt stack on syscall! */ common_tss.tss.tss_rsp0 = thread0.td_kstack + KSTACK_PAGES * PAGE_SIZE - sizeof(struct pcb); /* XXX we need to update tss_rsp0 in cpu_switch */ + /* XXX maybe not yet, everything is still running in supervisor mode */ + /* doublefault stack space, runs on ist1 */ common_tss.tss.tss_ist1 = (long)&dblfault_stack[sizeof(dblfault_stack)]; gsel_tss = GSEL(GPROC0_SEL, SEL_KPL); ltr(gsel_tss); - getmemsize(kmdp, physfree); init_param2(physmem); @@ -1257,7 +1248,6 @@ thread0.td_pcb->pcb_flags = 0; /* XXXKSE */ thread0.td_pcb->pcb_cr3 = IdlePML4; thread0.td_frame = &proc0_tf; - } void From owner-p4-projects@FreeBSD.ORG Tue Apr 8 23:50:48 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id A400B37B404; Tue, 8 Apr 2003 23:50:47 -0700 (PDT) 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 4E66A37B401 for ; Tue, 8 Apr 2003 23:50:47 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id E095743F85 for ; Tue, 8 Apr 2003 23:50:46 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h396ok0U051255 for ; Tue, 8 Apr 2003 23:50:46 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h396okRT051250 for perforce@freebsd.org; Tue, 8 Apr 2003 23:50:46 -0700 (PDT) Date: Tue, 8 Apr 2003 23:50:46 -0700 (PDT) Message-Id: <200304090650.h396okRT051250@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28621 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, 09 Apr 2003 06:50:48 -0000 http://perforce.freebsd.org/chv.cgi?CH=28621 Change 28621 by peter@peter_daintree on 2003/04/08 23:49:57 Do not auto-load acpi for the hammer kernels. It is(will be) mandatory that it is compiled into the kernel. Affected files ... .. //depot/projects/hammer/sys/boot/i386/libi386/i386_module.c#3 edit Differences ... ==== //depot/projects/hammer/sys/boot/i386/libi386/i386_module.c#3 (text+ko) ==== @@ -50,6 +50,9 @@ /* XXX use PnP to locate stuff here */ /* autoload ACPI support */ + if (file_findfile(NULL, "elf64 kernel") != NULL) + return (0); /* ACPI is mandatory on hammer */ + /* XXX should be in 4th keyed off acpi_load */ disabled = 0; rv = getenv("hint.acpi.0.disabled"); From owner-p4-projects@FreeBSD.ORG Tue Apr 8 23:51:49 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 94DE437B404; Tue, 8 Apr 2003 23:51:49 -0700 (PDT) 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 3463F37B401 for ; Tue, 8 Apr 2003 23:51:49 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id D13D043FBF for ; Tue, 8 Apr 2003 23:51:48 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h396pm0U051483 for ; Tue, 8 Apr 2003 23:51:48 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h396pmFV051480 for perforce@freebsd.org; Tue, 8 Apr 2003 23:51:48 -0700 (PDT) Date: Tue, 8 Apr 2003 23:51:48 -0700 (PDT) Message-Id: <200304090651.h396pmFV051480@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28622 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, 09 Apr 2003 06:51:50 -0000 http://perforce.freebsd.org/chv.cgi?CH=28622 Change 28622 by peter@peter_daintree on 2003/04/08 23:51:44 Fix the 'symbol table is corrupt' stuff. Use Elf_Size instead of 'long', since it just happens to be right for all the cases I can think of, and is what we're actually uploading anyway - sh_size is an Elf_Size.. Affected files ... .. //depot/projects/hammer/sys/boot/common/load_elf.c#9 edit Differences ... ==== //depot/projects/hammer/sys/boot/common/load_elf.c#9 (text+ko) ==== @@ -250,7 +250,7 @@ int ndp; int symstrindex; int symtabindex; - long size; + Elf_Size size; u_int fpcopy; dp = NULL; @@ -421,7 +421,7 @@ size = shdr[i].sh_size; archsw.arch_copyin(&size, lastaddr, sizeof(size)); - lastaddr += sizeof(long); + lastaddr += sizeof(size); #ifdef ELF_VERBOSE printf("\n%s: 0x%lx@0x%lx -> 0x%lx-0x%lx", secname, @@ -430,7 +430,7 @@ #else if (i == symstrindex) printf("+"); - printf("0x%lx+0x%lx", (long)sizeof(size), size); + printf("0x%lx+0x%lx", (long)sizeof(size), (long)size); #endif if (lseek(ef->fd, (off_t)shdr[i].sh_offset, SEEK_SET) == -1) { @@ -448,7 +448,7 @@ } /* Reset offsets relative to ssym */ lastaddr += shdr[i].sh_size; - lastaddr = roundup(lastaddr, sizeof(long)); + lastaddr = roundup(lastaddr, sizeof(size)); if (i == symtabindex) symtabindex = -1; else if (i == symstrindex) From owner-p4-projects@FreeBSD.ORG Wed Apr 9 00:03:04 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id F21AB37B401; Wed, 9 Apr 2003 00:03:03 -0700 (PDT) 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 9819637B404 for ; Wed, 9 Apr 2003 00:03:03 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 00E7343FB1 for ; Wed, 9 Apr 2003 00:03:03 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h397320U052785 for ; Wed, 9 Apr 2003 00:03:02 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h39732Rr052689 for perforce@freebsd.org; Wed, 9 Apr 2003 00:03:02 -0700 (PDT) Date: Wed, 9 Apr 2003 00:03:02 -0700 (PDT) Message-Id: <200304090703.h39732Rr052689@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28623 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, 09 Apr 2003 07:03:05 -0000 http://perforce.freebsd.org/chv.cgi?CH=28623 Change 28623 by peter@peter_daintree on 2003/04/09 00:02:43 tidy up some more loose ends Affected files ... .. //depot/projects/hammer/sys/x86_64/x86_64/identcpu.c#6 edit Differences ... ==== //depot/projects/hammer/sys/x86_64/x86_64/identcpu.c#6 (text+ko) ==== @@ -100,9 +100,7 @@ /* Check for extended CPUID information and a processor name. */ if (cpu_high > 0 && (strcmp(cpu_vendor, "GenuineIntel") == 0 || - strcmp(cpu_vendor, "AuthenticAMD") == 0 || - strcmp(cpu_vendor, "GenuineTMx86") == 0 || - strcmp(cpu_vendor, "TransmetaCPU") == 0)) { + strcmp(cpu_vendor, "AuthenticAMD") == 0)) { do_cpuid(0x80000000, regs); if (regs[0] >= 0x80000000) { cpu_exthigh = regs[0]; @@ -322,35 +320,6 @@ print_AMD_assoc((regs[2] >> 12) & 0x0f); } } - if (((cpu_id & 0xf00) == 0x500) - && (((cpu_id & 0x0f0) > 0x80) - || (((cpu_id & 0x0f0) == 0x80) - && (cpu_id & 0x00f) > 0x07))) { - /* K6-2(new core [Stepping 8-F]), K6-III or later */ - amd_whcr = rdmsr(0xc0000082); - if (!(amd_whcr & (0x3ff << 22))) { - printf("Write Allocate Disable\n"); - } else { - printf("Write Allocate Enable Limit: %dM bytes\n", - (u_int32_t)((amd_whcr & (0x3ff << 22)) >> 22) * 4); - printf("Write Allocate 15-16M bytes: %s\n", - (amd_whcr & (1 << 16)) ? "Enable" : "Disable"); - } - } else if (((cpu_id & 0xf00) == 0x500) - && ((cpu_id & 0x0f0) > 0x50)) { - /* K6, K6-2(old core) */ - amd_whcr = rdmsr(0xc0000082); - if (!(amd_whcr & (0x7f << 1))) { - printf("Write Allocate Disable\n"); - } else { - printf("Write Allocate Enable Limit: %dM bytes\n", - (u_int32_t)((amd_whcr & (0x7f << 1)) >> 1) * 4); - printf("Write Allocate 15-16M bytes: %s\n", - (amd_whcr & 0x0001) ? "Enable" : "Disable"); - printf("Hardware Write Allocate Control: %s\n", - (amd_whcr & 0x0100) ? "Enable" : "Disable"); - } - } } static void From owner-p4-projects@FreeBSD.ORG Wed Apr 9 00:06:08 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 4FF2537B405; Wed, 9 Apr 2003 00:06:08 -0700 (PDT) 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 062D537B401 for ; Wed, 9 Apr 2003 00:06:08 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6944043FB1 for ; Wed, 9 Apr 2003 00:06:07 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h397670U053241 for ; Wed, 9 Apr 2003 00:06:07 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h397662a053238 for perforce@freebsd.org; Wed, 9 Apr 2003 00:06:06 -0700 (PDT) Date: Wed, 9 Apr 2003 00:06:06 -0700 (PDT) Message-Id: <200304090706.h397662a053238@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28624 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, 09 Apr 2003 07:06:09 -0000 http://perforce.freebsd.org/chv.cgi?CH=28624 Change 28624 by peter@peter_daintree on 2003/04/09 00:05:12 ok, this evilness has served its purpose Affected files ... .. //depot/projects/hammer/sys/boot/common/boot.c#3 edit Differences ... ==== //depot/projects/hammer/sys/boot/common/boot.c#3 (text+ko) ==== @@ -190,7 +190,7 @@ when = otime + timeout; /* when to boot */ yes = 0; - printf("%s\n", (prompt == NULL) ? "Hit [Enter] to boot immediately, or any other key for command prompt." : prompt); + printf("%s\n", (prompt == NULL) ? "Hit [Enter] to boot immediately, or any other key for command prompt." : prompt); for (;;) { if (ischar()) { @@ -206,7 +206,7 @@ } if (ntime != otime) { - printf("\rBooting [%s] in %d second%s... ", + printf("\rBooting [%s] in %d second%s... ", kernelname, (int)(when - ntime), (when-ntime)==1?"":"s"); otime = ntime; From owner-p4-projects@FreeBSD.ORG Wed Apr 9 09:00:34 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 79A7437B40E; Wed, 9 Apr 2003 09:00:33 -0700 (PDT) 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 1991B37B405 for ; Wed, 9 Apr 2003 09:00:33 -0700 (PDT) Received: from mail.speakeasy.net (mail14.speakeasy.net [216.254.0.214]) by mx1.FreeBSD.org (Postfix) with ESMTP id DBC7B43FA3 for ; Wed, 9 Apr 2003 09:00:28 -0700 (PDT) (envelope-from jhb@FreeBSD.org) Received: (qmail 5485 invoked from network); 9 Apr 2003 16:00:32 -0000 Received: from unknown (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender )encrypted SMTP for ; 9 Apr 2003 16:00:32 -0000 Received: from laptop.baldwin.cx (gw1.twc.weather.com [216.133.140.1]) by server.baldwin.cx (8.12.8/8.12.8) with ESMTP id h39G0POv049698; Wed, 9 Apr 2003 12:00:25 -0400 (EDT) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.5.4 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <200304090537.h395bEZV045167@repoman.freebsd.org> Date: Wed, 09 Apr 2003 12:00:24 -0400 (EDT) From: John Baldwin To: Peter Wemm cc: Perforce Change Reviews Subject: RE: PERFORCE change 28616 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, 09 Apr 2003 16:00:35 -0000 On 09-Apr-2003 Peter Wemm wrote: > http://perforce.freebsd.org/chv.cgi?CH=28616 > > Change 28616 by peter@peter_daintree on 2003/04/08 22:36:45 > > move identify_cpu from locore to here. Can we do this for i386 as well? > Affected files ... > > .. //depot/projects/hammer/sys/x86_64/x86_64/identcpu.c#4 edit > > Differences ... > > ==== //depot/projects/hammer/sys/x86_64/x86_64/identcpu.c#4 (text+ko) ==== > > @@ -62,7 +62,7 @@ > > /* XXX - should be in header file: */ > void printcpuinfo(void); > -void finishidentcpu(void); > +void identify_cpu(void); > void earlysetcpuclass(void); > void panicifcpuunsupported(void); > > @@ -280,8 +280,21 @@ > * Final stage of CPU identification. -- Should I check TI? > */ > void > -finishidentcpu(void) > +identify_cpu(void) > { > + u_int regs[4]; > + > + do_cpuid(0, regs); > + cpu_high = regs[0]; > + ((u_int *)&cpu_vendor)[0] = regs[1]; > + ((u_int *)&cpu_vendor)[1] = regs[2]; > + ((u_int *)&cpu_vendor)[2] = regs[3]; > + cpu_vendor[12] = '\0'; > + > + do_cpuid(1, regs); > + cpu_id = regs[0]; > + cpu_procinfo = regs[1]; > + cpu_feature = regs[3]; > } > > static void -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ From owner-p4-projects@FreeBSD.ORG Wed Apr 9 09:04:07 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id B871837B404; Wed, 9 Apr 2003 09:04:06 -0700 (PDT) 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 4FE5637B401; Wed, 9 Apr 2003 09:04:06 -0700 (PDT) Received: from dragon.nuxi.com (trang.nuxi.com [66.93.134.19]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7D7F243F3F; Wed, 9 Apr 2003 09:04:05 -0700 (PDT) (envelope-from obrien@NUXI.com) Received: from dragon.nuxi.com (obrien@localhost [127.0.0.1]) by dragon.nuxi.com (8.12.9/8.12.7) with ESMTP id h39G41D0043395; Wed, 9 Apr 2003 09:04:05 -0700 (PDT) (envelope-from obrien@dragon.nuxi.com) Received: (from obrien@localhost) by dragon.nuxi.com (8.12.9/8.12.9/Submit) id h39G41Ph043394; Wed, 9 Apr 2003 09:04:01 -0700 (PDT) Date: Wed, 9 Apr 2003 09:04:01 -0700 From: "David O'Brien" To: John Baldwin Message-ID: <20030409160401.GA43342@dragon.nuxi.com> References: <200304072336.h37Na3xa048094@repoman.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4i X-Operating-System: FreeBSD 5.0-CURRENT Organization: The NUXI BSD Group X-Pgp-Rsa-Fingerprint: B7 4D 3E E9 11 39 5F A3 90 76 5D 69 58 D9 98 7A X-Pgp-Rsa-Keyid: 1024/34F9F9D5 cc: Perforce Change Reviews cc: Peter Wemm Subject: Re: PERFORCE change 28461 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: obrien@FreeBSD.org List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Apr 2003 16:04:07 -0000 On Tue, Apr 08, 2003 at 10:23:56AM -0400, John Baldwin wrote: > > On 07-Apr-2003 Peter Wemm wrote: > > http://perforce.freebsd.org/chv.cgi?CH=28461 > > > > Change 28461 by peter@peter_daintree on 2003/04/07 16:35:32 > > > > use -mcmodel=medium for hammer. Otherwise it generates > > 32 bit instructions for things like invltlb(). kernel model > > comes later. > > Side topic: are we going to call it amd64 some day instead of x86-64? This gets hairy... if the toolchain calls it one thing and we call it another. AMD marketing is trying to squash the "x86-64" name in favaor of "AMD64". Note that "AMD64" is what M$ has always called it... so one has to wonder... From owner-p4-projects@FreeBSD.ORG Wed Apr 9 09:08:40 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 70BB637B404; Wed, 9 Apr 2003 09:08:40 -0700 (PDT) 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 067C337B401; Wed, 9 Apr 2003 09:08:40 -0700 (PDT) Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id C8A1F43FB1; Wed, 9 Apr 2003 09:08:38 -0700 (PDT) (envelope-from arr@watson.org) Received: from fledge.watson.org (localhost [127.0.0.1]) by fledge.watson.org (8.12.9/8.12.9) with ESMTP id h39G8wYX027161; Wed, 9 Apr 2003 12:08:58 -0400 (EDT) (envelope-from arr@watson.org) Received: from localhost (arr@localhost)h39G8vfG027158; Wed, 9 Apr 2003 12:08:58 -0400 (EDT) X-Authentication-Warning: fledge.watson.org: arr owned process doing -bs Date: Wed, 9 Apr 2003 12:08:57 -0400 (EDT) From: "Andrew R. Reiter" To: "David O'Brien" In-Reply-To: <20030409160401.GA43342@dragon.nuxi.com> Message-ID: <20030409120732.O26090@fledge.watson.org> References: <200304072336.h37Na3xa048094@repoman.freebsd.org> <20030409160401.GA43342@dragon.nuxi.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: Perforce Change Reviews cc: Peter Wemm cc: John Baldwin Subject: Re: PERFORCE change 28461 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, 09 Apr 2003 16:08:41 -0000 On Wed, 9 Apr 2003, David O'Brien wrote: :On Tue, Apr 08, 2003 at 10:23:56AM -0400, John Baldwin wrote: :> :> On 07-Apr-2003 Peter Wemm wrote: :> > http://perforce.freebsd.org/chv.cgi?CH=28461 :> > :> > Change 28461 by peter@peter_daintree on 2003/04/07 16:35:32 :> > :> > use -mcmodel=medium for hammer. Otherwise it generates :> > 32 bit instructions for things like invltlb(). kernel model :> > comes later. :> :> Side topic: are we going to call it amd64 some day instead of x86-64? : :This gets hairy... if the toolchain calls it one thing and we call it :another. AMD marketing is trying to squash the "x86-64" name in favaor :of "AMD64". Note that "AMD64" is what M$ has always called it... so one :has to wonder... http://news.com.com/2008-1082-995885.html mentions about AMD receiving a warmer welcome from M$ than they (AMD) initially thought they were going to get (atleast wrt opteron) Cheers, Andrew -- Andrew R. Reiter arr@watson.org arr@FreeBSD.org From owner-p4-projects@FreeBSD.ORG Wed Apr 9 10:38:33 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 9B22E37B404; Wed, 9 Apr 2003 10:38:32 -0700 (PDT) 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 34ED337B401; Wed, 9 Apr 2003 10:38:32 -0700 (PDT) Received: from ns1.xcllnt.net (209-128-86-226.BAYAREA.NET [209.128.86.226]) by mx1.FreeBSD.org (Postfix) with ESMTP id B861543FA3; Wed, 9 Apr 2003 10:38:30 -0700 (PDT) (envelope-from marcel@xcllnt.net) Received: from dhcp01.pn.xcllnt.net (dhcp01.pn.xcllnt.net [192.168.4.201]) by ns1.xcllnt.net (8.12.9/8.12.9) with ESMTP id h39HcUwk007517; Wed, 9 Apr 2003 10:38:30 -0700 (PDT) (envelope-from marcel@piii.pn.xcllnt.net) Received: from dhcp01.pn.xcllnt.net (localhost [127.0.0.1]) by dhcp01.pn.xcllnt.net (8.12.9/8.12.9) with ESMTP id h39HcUNm000736; Wed, 9 Apr 2003 10:38:30 -0700 (PDT) (envelope-from marcel@dhcp01.pn.xcllnt.net) Received: (from marcel@localhost) by dhcp01.pn.xcllnt.net (8.12.9/8.12.9/Submit) id h39HcUfk000735; Wed, 9 Apr 2003 10:38:30 -0700 (PDT) Date: Wed, 9 Apr 2003 10:38:30 -0700 From: Marcel Moolenaar To: "David O'Brien" Message-ID: <20030409173830.GA549@dhcp01.pn.xcllnt.net> References: <200304072336.h37Na3xa048094@repoman.freebsd.org> <20030409160401.GA43342@dragon.nuxi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030409160401.GA43342@dragon.nuxi.com> User-Agent: Mutt/1.5.3i cc: Perforce Change Reviews cc: Peter Wemm cc: John Baldwin Subject: Re: PERFORCE change 28461 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, 09 Apr 2003 17:38:33 -0000 On Wed, Apr 09, 2003 at 09:04:01AM -0700, David O'Brien wrote: > On Tue, Apr 08, 2003 at 10:23:56AM -0400, John Baldwin wrote: > > > > On 07-Apr-2003 Peter Wemm wrote: > > > http://perforce.freebsd.org/chv.cgi?CH=28461 > > > > > > Change 28461 by peter@peter_daintree on 2003/04/07 16:35:32 > > > > > > use -mcmodel=medium for hammer. Otherwise it generates > > > 32 bit instructions for things like invltlb(). kernel model > > > comes later. > > > > Side topic: are we going to call it amd64 some day instead of x86-64? > > This gets hairy... if the toolchain calls it one thing and we call it > another. AMD marketing is trying to squash the "x86-64" name in favaor > of "AMD64". Note that "AMD64" is what M$ has always called it... so one > has to wonder... I agree with the concerns, but x86-64 is a particularly ugly name and uncomfortable to use in general that I'm inclined to prefer a name change in spite of the drawbacks. Think about all the scripts and makefiles containing x86_64... *shiver* BTW: To what extend is the actual name important? Is it only 'uname -m' that really matters (toolchain bordercases aside)? -- Marcel Moolenaar USPA: A-39004 marcel@xcllnt.net From owner-p4-projects@FreeBSD.ORG Wed Apr 9 10:42:36 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 6686037B404; Wed, 9 Apr 2003 10:42:36 -0700 (PDT) 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 02A0837B401; Wed, 9 Apr 2003 10:42:36 -0700 (PDT) Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8D6F543FA3; Wed, 9 Apr 2003 10:42:34 -0700 (PDT) (envelope-from phk@phk.freebsd.dk) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.12.9/8.12.9) with ESMTP id h39HgVZq035467; Wed, 9 Apr 2003 19:42:32 +0200 (CEST) (envelope-from phk@phk.freebsd.dk) To: Marcel Moolenaar From: "Poul-Henning Kamp" In-Reply-To: Your message of "Wed, 09 Apr 2003 10:38:30 PDT." <20030409173830.GA549@dhcp01.pn.xcllnt.net> Date: Wed, 09 Apr 2003 19:42:31 +0200 Message-ID: <35466.1049910151@critter.freebsd.dk> cc: Peter Wemm cc: Perforce Change Reviews cc: John Baldwin cc: David O'Brien Subject: Re: PERFORCE change 28461 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, 09 Apr 2003 17:42:37 -0000 In message <20030409173830.GA549@dhcp01.pn.xcllnt.net>, Marcel Moolenaar writes : >> This gets hairy... if the toolchain calls it one thing and we call it >> another. AMD marketing is trying to squash the "x86-64" name in favaor >> of "AMD64". Note that "AMD64" is what M$ has always called it... so one >> has to wonder... > >BTW: To what extend is the actual name important? Is it only >'uname -m' that really matters (toolchain bordercases aside)? Considering that AMD64 seems to be the only thing to prevent Intel from ramming Itanics down our throats with it's near monopoly, I think it is important to respect AMD's naming. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. From owner-p4-projects@FreeBSD.ORG Wed Apr 9 10:59:21 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 6961A37B404; Wed, 9 Apr 2003 10:59:21 -0700 (PDT) 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 03F9037B401; Wed, 9 Apr 2003 10:59:21 -0700 (PDT) Received: from canning.wemm.org (canning.wemm.org [192.203.228.65]) by mx1.FreeBSD.org (Postfix) with ESMTP id 954D543F93; Wed, 9 Apr 2003 10:59:20 -0700 (PDT) (envelope-from peter@wemm.org) Received: from wemm.org (localhost [127.0.0.1]) by canning.wemm.org (Postfix) with ESMTP id 7D5A32A8A8; Wed, 9 Apr 2003 10:59:20 -0700 (PDT) (envelope-from peter@wemm.org) X-Mailer: exmh version 2.5 07/13/2001 with nmh-1.0.4 To: John Baldwin In-Reply-To: Date: Wed, 09 Apr 2003 10:59:20 -0700 From: Peter Wemm Message-Id: <20030409175920.7D5A32A8A8@canning.wemm.org> cc: Perforce Change Reviews Subject: Re: PERFORCE change 28149 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, 09 Apr 2003 17:59:22 -0000 John Baldwin wrote: > > On 05-Apr-2003 Peter Wemm wrote: > > http://perforce.freebsd.org/chv.cgi?CH=28149 > > > > Change 28149 by peter@peter_overcee on 2003/04/04 19:32:58 > > > > oops. s/l/q/ in write_rflags() > > > > Affected files ... > > > > .. //depot/projects/hammer/sys/x86_64/include/cpufunc.h#7 edit > > > > Differences ... > > > > ==== //depot/projects/hammer/sys/x86_64/include/cpufunc.h#7 (text+ko) ==== > > > > @@ -357,7 +357,7 @@ > > static __inline void > > write_rflags(u_long ef) > > On an unrelated topic: > > A lot of these cpufunc things should use register_t rather than int > or long. This would have slightly simplified porting them to hammer > and reduce the diffs. Yes, I agree. I intended to backport many of these things. However, a caveat.. Some of these entities are actually only 32 bits long, eg: the cpuid stuff and some of the crX registers.. although you can read/write them with a 64 bit register, they only have 32 valid bits. I'll keep the register_t in mind, I note that the critical* stuff uses it. Cheers, -Peter -- Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com "All of this is for nothing if we don't go to the stars" - JMS/B5 From owner-p4-projects@FreeBSD.ORG Wed Apr 9 11:00:56 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id E07BB37B405; Wed, 9 Apr 2003 11:00:55 -0700 (PDT) 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 7B74E37B401; Wed, 9 Apr 2003 11:00:55 -0700 (PDT) Received: from canning.wemm.org (canning.wemm.org [192.203.228.65]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0D51743FA3; Wed, 9 Apr 2003 11:00:55 -0700 (PDT) (envelope-from peter@wemm.org) Received: from wemm.org (localhost [127.0.0.1]) by canning.wemm.org (Postfix) with ESMTP id F02C72A8A9; Wed, 9 Apr 2003 11:00:54 -0700 (PDT) (envelope-from peter@wemm.org) X-Mailer: exmh version 2.5 07/13/2001 with nmh-1.0.4 To: John Baldwin In-Reply-To: Date: Wed, 09 Apr 2003 11:00:54 -0700 From: Peter Wemm Message-Id: <20030409180054.F02C72A8A9@canning.wemm.org> cc: Perforce Change Reviews Subject: Re: PERFORCE change 28541 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, 09 Apr 2003 18:00:56 -0000 John Baldwin wrote: > > On 08-Apr-2003 Peter Wemm wrote: > > http://perforce.freebsd.org/chv.cgi?CH=28541 > > > > Change 28541 by peter@peter_daintree on 2003/04/08 11:58:30 > > > > 64 bit counters. > > More crap that should be redesigned and done in C. Perhaps in some > sort of MI way maybe called from MD code. Yes, I have a pretty large list of note of things to fix in this.. I've done some already, and some have turned out less than spectacular. Naturally, all this is subject to another good reread before anything is committed. > > .globl intrcnt, eintrcnt > > intrcnt: > > - .space INTRCNT_COUNT * 4 > > + .space INTRCNT_COUNT * 8 > > eintrcnt: > > > > .globl intrnames, eintrnames > > intrnames: > > - .space INTRCNT_COUNT * 16 > > + .space INTRCNT_COUNT * 32 > > eintrnames: > > .text > > > > -- > > John Baldwin <>< http://www.FreeBSD.org/~jhb/ > "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ > Cheers, -Peter -- Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com "All of this is for nothing if we don't go to the stars" - JMS/B5 From owner-p4-projects@FreeBSD.ORG Wed Apr 9 11:04:32 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id AB5B637B404; Wed, 9 Apr 2003 11:04:31 -0700 (PDT) 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 47E3437B401; Wed, 9 Apr 2003 11:04:31 -0700 (PDT) Received: from canning.wemm.org (canning.wemm.org [192.203.228.65]) by mx1.FreeBSD.org (Postfix) with ESMTP id CDB7743FBD; Wed, 9 Apr 2003 11:04:30 -0700 (PDT) (envelope-from peter@wemm.org) Received: from wemm.org (localhost [127.0.0.1]) by canning.wemm.org (Postfix) with ESMTP id B88372A7EA; Wed, 9 Apr 2003 11:04:30 -0700 (PDT) (envelope-from peter@wemm.org) X-Mailer: exmh version 2.5 07/13/2001 with nmh-1.0.4 To: John Baldwin In-Reply-To: Date: Wed, 09 Apr 2003 11:04:30 -0700 From: Peter Wemm Message-Id: <20030409180430.B88372A7EA@canning.wemm.org> cc: Perforce Change Reviews Subject: Re: PERFORCE change 28616 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, 09 Apr 2003 18:04:32 -0000 John Baldwin wrote: > > On 09-Apr-2003 Peter Wemm wrote: > > http://perforce.freebsd.org/chv.cgi?CH=28616 > > > > Change 28616 by peter@peter_daintree on 2003/04/08 22:36:45 > > > > move identify_cpu from locore to here. > > Can we do this for i386 as well? Maybe.. the problem is that we have lots of nasty stuff in locore to determine the basic feature set. The hammer stuff is nice in that it has a respectable minimum feature set and we simply do not need to worry about figuring out page table page layouts etc. Also, locore is really really small because I've got the loader doing a long mode entry with PSE paging enabled.. there's 1GB direct mapped at address zero, and 1GB starting from kernbase. That is more than enough to set up real page tables. I'm going to move this from machdep.c to pmap_bootstrap() at some point, since that seems to be the canonical place to do this sort of thing. It simplifies a lot of things. I'd really like to do this for the i386 kernel too, but it would be nice to get it done before RELENG_5 starts. Cheers, -Peter -- Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com "All of this is for nothing if we don't go to the stars" - JMS/B5 From owner-p4-projects@FreeBSD.ORG Wed Apr 9 11:10:07 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id C68CA37B401; Wed, 9 Apr 2003 11:10:06 -0700 (PDT) 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 59A2C37B401; Wed, 9 Apr 2003 11:10:06 -0700 (PDT) Received: from canning.wemm.org (canning.wemm.org [192.203.228.65]) by mx1.FreeBSD.org (Postfix) with ESMTP id BF76943F3F; Wed, 9 Apr 2003 11:10:05 -0700 (PDT) (envelope-from peter@wemm.org) Received: from wemm.org (localhost [127.0.0.1]) by canning.wemm.org (Postfix) with ESMTP id A975B2A7EA; Wed, 9 Apr 2003 11:10:05 -0700 (PDT) (envelope-from peter@wemm.org) X-Mailer: exmh version 2.5 07/13/2001 with nmh-1.0.4 To: Marcel Moolenaar In-Reply-To: <20030409173830.GA549@dhcp01.pn.xcllnt.net> Date: Wed, 09 Apr 2003 11:10:05 -0700 From: Peter Wemm Message-Id: <20030409181005.A975B2A7EA@canning.wemm.org> cc: Perforce Change Reviews cc: John Baldwin cc: David O'Brien Subject: Re: PERFORCE change 28461 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, 09 Apr 2003 18:10:08 -0000 Marcel Moolenaar wrote: > On Wed, Apr 09, 2003 at 09:04:01AM -0700, David O'Brien wrote: > > On Tue, Apr 08, 2003 at 10:23:56AM -0400, John Baldwin wrote: > > > > > > On 07-Apr-2003 Peter Wemm wrote: > > > > http://perforce.freebsd.org/chv.cgi?CH=28461 > > > > > > > > Change 28461 by peter@peter_daintree on 2003/04/07 16:35:32 > > > > > > > > use -mcmodel=medium for hammer. Otherwise it generates > > > > 32 bit instructions for things like invltlb(). kernel model > > > > comes later. > > > > > > Side topic: are we going to call it amd64 some day instead of x86-64? > > > > This gets hairy... if the toolchain calls it one thing and we call it > > another. AMD marketing is trying to squash the "x86-64" name in favaor > > of "AMD64". Note that "AMD64" is what M$ has always called it... so one > > has to wonder... > > I agree with the concerns, but x86-64 is a particularly ugly name > and uncomfortable to use in general that I'm inclined to prefer a > name change in spite of the drawbacks. Think about all the scripts > and makefiles containing x86_64... *shiver* Could we live with a slightly modified toolchain that defines both __x86_64__ and __amd64__ ? I'd be more than happy to rename everything so that it was #ifdef __amd64__ and have MACHINE_ARCH=amd64 for $dir/amd64/* etc. But we can't stop defining __x86_64__ since thats what linux and the FSF camp appear to use. Lots of third party stuff will have __x86_64__ ifdefs. > BTW: To what extend is the actual name important? Is it only > 'uname -m' that really matters (toolchain bordercases aside)? Having $MACHINE_ARCH different to #ifdef __$MACHINE_ARCH__ would be an ongoing problem I think. Cheers, -Peter -- Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com "All of this is for nothing if we don't go to the stars" - JMS/B5 From owner-p4-projects@FreeBSD.ORG Wed Apr 9 12:10:34 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 1794837B407; Wed, 9 Apr 2003 12:10:34 -0700 (PDT) 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 A155237B405; Wed, 9 Apr 2003 12:10:33 -0700 (PDT) Received: from ns1.xcllnt.net (209-128-86-226.BAYAREA.NET [209.128.86.226]) by mx1.FreeBSD.org (Postfix) with ESMTP id 19F7A43F3F; Wed, 9 Apr 2003 12:10:32 -0700 (PDT) (envelope-from marcel@xcllnt.net) Received: from athlon.pn.xcllnt.net (athlon.pn.xcllnt.net [192.168.4.3]) by ns1.xcllnt.net (8.12.9/8.12.9) with ESMTP id h39JAVwk008001; Wed, 9 Apr 2003 12:10:31 -0700 (PDT) (envelope-from marcel@piii.pn.xcllnt.net) Received: from athlon.pn.xcllnt.net (localhost [127.0.0.1]) by athlon.pn.xcllnt.net (8.12.9/8.12.9) with ESMTP id h39JAVKd000789; Wed, 9 Apr 2003 12:10:31 -0700 (PDT) (envelope-from marcel@athlon.pn.xcllnt.net) Received: (from marcel@localhost) by athlon.pn.xcllnt.net (8.12.9/8.12.9/Submit) id h39JAV7c000788; Wed, 9 Apr 2003 12:10:31 -0700 (PDT) Date: Wed, 9 Apr 2003 12:10:31 -0700 From: Marcel Moolenaar To: Peter Wemm Message-ID: <20030409191031.GA672@athlon.pn.xcllnt.net> References: <20030409173830.GA549@dhcp01.pn.xcllnt.net> <20030409181005.A975B2A7EA@canning.wemm.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030409181005.A975B2A7EA@canning.wemm.org> User-Agent: Mutt/1.5.3i cc: Perforce Change Reviews cc: John Baldwin cc: David O'Brien Subject: Re: PERFORCE change 28461 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, 09 Apr 2003 19:10:35 -0000 On Wed, Apr 09, 2003 at 11:10:05AM -0700, Peter Wemm wrote: > > > > > > This gets hairy... if the toolchain calls it one thing and we call it > > > another. AMD marketing is trying to squash the "x86-64" name in favaor > > > of "AMD64". Note that "AMD64" is what M$ has always called it... so one > > > has to wonder... > > > > I agree with the concerns, but x86-64 is a particularly ugly name > > and uncomfortable to use in general that I'm inclined to prefer a > > name change in spite of the drawbacks. Think about all the scripts > > and makefiles containing x86_64... *shiver* > > Could we live with a slightly modified toolchain that defines both > __x86_64__ and __amd64__ ? That should be trivial to do. Inherently nonportable code can safely use __amd64__. In fact, for kernel builds you can also add -D__amd64__ on the compile commandline and not have a modified toolchain (not that we should do it that way). > I'd be more than happy to rename everything > so that it was #ifdef __amd64__ and have MACHINE_ARCH=amd64 for > $dir/amd64/* etc. But we can't stop defining __x86_64__ since thats what > linux and the FSF camp appear to use. Lots of third party stuff will have > __x86_64__ ifdefs. Our toolchain makefiles will probably have added complexity to map our name to the name used for targets and platforms. This may add just enough complexity to better drop the whole idea. Just as food for thought: Linux managed to replace i386 with i686. I think there are only very few cases where you really care that i686==i386. In all other cases it's just another platform. The same applies to x86_64 and amd64. > > BTW: To what extend is the actual name important? Is it only > > 'uname -m' that really matters (toolchain bordercases aside)? > > Having $MACHINE_ARCH different to #ifdef __$MACHINE_ARCH__ would be an > ongoing problem I think. True, but aliasing is simple in the preprocessor. You just define as many symbols as you want. I think most of the pain ends up being in configure scripts, makefiles and wrappers. Anyway: It's just preference of someone standing on the sideline here, so feel free to ignore me while moving forward... -- Marcel Moolenaar USPA: A-39004 marcel@xcllnt.net From owner-p4-projects@FreeBSD.ORG Wed Apr 9 12:23:27 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 7481B37B404; Wed, 9 Apr 2003 12:23:27 -0700 (PDT) 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 15BE837B401 for ; Wed, 9 Apr 2003 12:23:27 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id A090743F85 for ; Wed, 9 Apr 2003 12:23:26 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h39JNQ0U035976 for ; Wed, 9 Apr 2003 12:23:26 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h39JNQo7035973 for perforce@freebsd.org; Wed, 9 Apr 2003 12:23:26 -0700 (PDT) Date: Wed, 9 Apr 2003 12:23:26 -0700 (PDT) Message-Id: <200304091923.h39JNQo7035973@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28660 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, 09 Apr 2003 19:23:28 -0000 http://perforce.freebsd.org/chv.cgi?CH=28660 Change 28660 by peter@peter_daintree on 2003/04/09 12:23:12 make this compile Affected files ... .. //depot/projects/hammer/lib/csu/x86_64/crt1.c#6 edit Differences ... ==== //depot/projects/hammer/lib/csu/x86_64/crt1.c#6 (text+ko) ==== @@ -61,7 +61,7 @@ fptr retval; #ifdef __GNUC__ - __asm__("movl %%rdx,%0" : "=rm"(retval)); + __asm__("movq %%rdx,%0" : "=rm"(retval)); #else retval = (fptr)0; /* XXXX Fix this for other compilers */ #endif From owner-p4-projects@FreeBSD.ORG Wed Apr 9 12:37:46 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 90EEF37B404; Wed, 9 Apr 2003 12:37:45 -0700 (PDT) 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 3093837B401 for ; Wed, 9 Apr 2003 12:37:45 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id B919043F93 for ; Wed, 9 Apr 2003 12:37:44 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h39Jbi0U036899 for ; Wed, 9 Apr 2003 12:37:44 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h39JbiDw036896 for perforce@freebsd.org; Wed, 9 Apr 2003 12:37:44 -0700 (PDT) Date: Wed, 9 Apr 2003 12:37:44 -0700 (PDT) Message-Id: <200304091937.h39JbiDw036896@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28661 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, 09 Apr 2003 19:37:46 -0000 http://perforce.freebsd.org/chv.cgi?CH=28661 Change 28661 by peter@peter_daintree on 2003/04/09 12:37:15 I'm going to regret this, I'm sure. Affected files ... .. //depot/projects/hammer/lib/libc/x86_64/_fpmath.h#1 branch .. //depot/projects/hammer/lib/libc/x86_64/arith.h#1 branch .. //depot/projects/hammer/lib/libc/x86_64/gen/Makefile.inc#1 branch .. //depot/projects/hammer/lib/libc/x86_64/gen/_ctx_start.S#1 branch .. //depot/projects/hammer/lib/libc/x86_64/gen/_setjmp.S#1 branch .. //depot/projects/hammer/lib/libc/x86_64/gen/alloca.S#1 branch .. //depot/projects/hammer/lib/libc/x86_64/gen/fabs.S#1 branch .. //depot/projects/hammer/lib/libc/x86_64/gen/frexp.c#1 branch .. //depot/projects/hammer/lib/libc/x86_64/gen/infinity.c#1 branch .. //depot/projects/hammer/lib/libc/x86_64/gen/isinf.c#1 branch .. //depot/projects/hammer/lib/libc/x86_64/gen/ldexp.c#1 branch .. //depot/projects/hammer/lib/libc/x86_64/gen/makecontext.c#1 branch .. //depot/projects/hammer/lib/libc/x86_64/gen/modf.S#1 branch .. //depot/projects/hammer/lib/libc/x86_64/gen/rfork_thread.S#1 branch .. //depot/projects/hammer/lib/libc/x86_64/gen/setjmp.S#1 branch .. //depot/projects/hammer/lib/libc/x86_64/gen/signalcontext.c#1 branch .. //depot/projects/hammer/lib/libc/x86_64/gen/sigsetjmp.S#1 branch .. //depot/projects/hammer/lib/libc/x86_64/net/Makefile.inc#1 branch .. //depot/projects/hammer/lib/libc/x86_64/net/htonl.S#1 branch .. //depot/projects/hammer/lib/libc/x86_64/net/htons.S#1 branch .. //depot/projects/hammer/lib/libc/x86_64/net/ntohl.S#1 branch .. //depot/projects/hammer/lib/libc/x86_64/net/ntohs.S#1 branch .. //depot/projects/hammer/lib/libc/x86_64/stdlib/Makefile.inc#1 branch .. //depot/projects/hammer/lib/libc/x86_64/stdlib/abs.S#1 branch .. //depot/projects/hammer/lib/libc/x86_64/stdlib/div.S#1 branch .. //depot/projects/hammer/lib/libc/x86_64/stdlib/gdtoa.mk#1 branch .. //depot/projects/hammer/lib/libc/x86_64/stdlib/labs.S#1 branch .. //depot/projects/hammer/lib/libc/x86_64/stdlib/ldiv.S#1 branch .. //depot/projects/hammer/lib/libc/x86_64/string/Makefile.inc#1 branch .. //depot/projects/hammer/lib/libc/x86_64/string/bcmp.S#1 branch .. //depot/projects/hammer/lib/libc/x86_64/string/bcopy.S#1 branch .. //depot/projects/hammer/lib/libc/x86_64/string/bzero.S#1 branch .. //depot/projects/hammer/lib/libc/x86_64/string/ffs.S#1 branch .. //depot/projects/hammer/lib/libc/x86_64/string/index.S#1 branch .. //depot/projects/hammer/lib/libc/x86_64/string/memchr.S#1 branch .. //depot/projects/hammer/lib/libc/x86_64/string/memcmp.S#1 branch .. //depot/projects/hammer/lib/libc/x86_64/string/memcpy.S#1 branch .. //depot/projects/hammer/lib/libc/x86_64/string/memmove.S#1 branch .. //depot/projects/hammer/lib/libc/x86_64/string/memset.S#1 branch .. //depot/projects/hammer/lib/libc/x86_64/string/rindex.S#1 branch .. //depot/projects/hammer/lib/libc/x86_64/string/strcat.S#1 branch .. //depot/projects/hammer/lib/libc/x86_64/string/strchr.S#1 branch .. //depot/projects/hammer/lib/libc/x86_64/string/strcmp.S#1 branch .. //depot/projects/hammer/lib/libc/x86_64/string/strcpy.S#1 branch .. //depot/projects/hammer/lib/libc/x86_64/string/strlen.S#1 branch .. //depot/projects/hammer/lib/libc/x86_64/string/strncmp.S#1 branch .. //depot/projects/hammer/lib/libc/x86_64/string/strrchr.S#1 branch .. //depot/projects/hammer/lib/libc/x86_64/string/swab.S#1 branch .. //depot/projects/hammer/lib/libc/x86_64/string/wcschr.S#1 branch .. //depot/projects/hammer/lib/libc/x86_64/string/wcscmp.S#1 branch .. //depot/projects/hammer/lib/libc/x86_64/string/wcslen.S#1 branch .. //depot/projects/hammer/lib/libc/x86_64/string/wmemchr.S#1 branch .. //depot/projects/hammer/lib/libc/x86_64/sys/Makefile.inc#1 branch .. //depot/projects/hammer/lib/libc/x86_64/sys/Ovfork.S#1 branch .. //depot/projects/hammer/lib/libc/x86_64/sys/brk.S#1 branch .. //depot/projects/hammer/lib/libc/x86_64/sys/cerror.S#1 branch .. //depot/projects/hammer/lib/libc/x86_64/sys/exect.S#1 branch .. //depot/projects/hammer/lib/libc/x86_64/sys/pipe.S#1 branch .. //depot/projects/hammer/lib/libc/x86_64/sys/ptrace.S#1 branch .. //depot/projects/hammer/lib/libc/x86_64/sys/reboot.S#1 branch .. //depot/projects/hammer/lib/libc/x86_64/sys/sbrk.S#1 branch .. //depot/projects/hammer/lib/libc/x86_64/sys/setlogin.S#1 branch .. //depot/projects/hammer/lib/libc/x86_64/sys/sigreturn.S#1 branch .. //depot/projects/hammer/lib/libc/x86_64/sys/syscall.S#1 branch Differences ... From owner-p4-projects@FreeBSD.ORG Wed Apr 9 12:38:47 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 6331537B404; Wed, 9 Apr 2003 12:38:47 -0700 (PDT) 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 0372237B401 for ; Wed, 9 Apr 2003 12:38:47 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id A203643FB1 for ; Wed, 9 Apr 2003 12:38:46 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h39Jck0U036977 for ; Wed, 9 Apr 2003 12:38:46 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h39JckNZ036974 for perforce@freebsd.org; Wed, 9 Apr 2003 12:38:46 -0700 (PDT) Date: Wed, 9 Apr 2003 12:38:46 -0700 (PDT) Message-Id: <200304091938.h39JckNZ036974@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28662 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, 09 Apr 2003 19:38:48 -0000 http://perforce.freebsd.org/chv.cgi?CH=28662 Change 28662 by peter@peter_daintree on 2003/04/09 12:38:11 drop un-branched i386-specific stuff Affected files ... .. //depot/projects/hammer/lib/libc/x86_64/sys/Makefile.inc#2 edit Differences ... ==== //depot/projects/hammer/lib/libc/x86_64/sys/Makefile.inc#2 (text+ko) ==== @@ -1,9 +1,6 @@ # from: Makefile.inc,v 1.1 1993/09/03 19:04:23 jtc Exp # $FreeBSD: src/lib/libc/i386/sys/Makefile.inc,v 1.25 2002/11/18 09:50:55 ru Exp $ -SRCS+= i386_clr_watch.c i386_get_ioperm.c i386_get_ldt.c i386_set_ioperm.c \ - i386_set_ldt.c i386_set_watch.c i386_vm86.c - MDASM= Ovfork.S brk.S cerror.S exect.S pipe.S ptrace.S reboot.S sbrk.S \ setlogin.S sigreturn.S syscall.S @@ -13,10 +10,3 @@ pwrite.o setdomainname.o sstk.o truncate.o uname.o vfork.o yield.o PSEUDO= _getlogin.o _exit.o - -MAN+= i386_get_ioperm.2 i386_get_ldt.2 i386_vm86.2 -MAN+= i386_set_watch.3 - -MLINKS+=i386_get_ioperm.2 i386_set_ioperm.2 -MLINKS+=i386_get_ldt.2 i386_set_ldt.2 -MLINKS+=i386_set_watch.3 i386_clr_watch.3 From owner-p4-projects@FreeBSD.ORG Wed Apr 9 12:46:58 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 07C4E37B404; Wed, 9 Apr 2003 12:46:58 -0700 (PDT) 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 9C45137B401 for ; Wed, 9 Apr 2003 12:46:57 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 260DD43FA3 for ; Wed, 9 Apr 2003 12:46:57 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h39Jku0U037736 for ; Wed, 9 Apr 2003 12:46:56 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h39Jkusb037733 for perforce@freebsd.org; Wed, 9 Apr 2003 12:46:56 -0700 (PDT) Date: Wed, 9 Apr 2003 12:46:56 -0700 (PDT) Message-Id: <200304091946.h39Jkusb037733@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28663 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, 09 Apr 2003 19:46:58 -0000 http://perforce.freebsd.org/chv.cgi?CH=28663 Change 28663 by peter@peter_daintree on 2003/04/09 12:46:56 OK, I regret the last integrate already. Affected files ... .. //depot/projects/hammer/lib/libc/x86_64/gen/Makefile.inc#2 edit .. //depot/projects/hammer/lib/libc/x86_64/net/Makefile.inc#2 edit .. //depot/projects/hammer/lib/libc/x86_64/stdlib/Makefile.inc#2 edit .. //depot/projects/hammer/lib/libc/x86_64/string/Makefile.inc#2 edit .. //depot/projects/hammer/lib/libc/x86_64/sys/Makefile.inc#3 edit Differences ... ==== //depot/projects/hammer/lib/libc/x86_64/gen/Makefile.inc#2 (text+ko) ==== @@ -1,6 +1,4 @@ # @(#)Makefile.inc 8.1 (Berkeley) 6/4/93 # $FreeBSD: src/lib/libc/i386/gen/Makefile.inc,v 1.18 2002/11/16 06:39:11 deischen Exp $ -SRCS+= _ctx_start.S _setjmp.S alloca.S fabs.S frexp.c \ - infinity.c isinf.c ldexp.c makecontext.c modf.S \ - rfork_thread.S setjmp.S signalcontext.c sigsetjmp.S +SRCS+= frexp.c infinity.c isinf.c ==== //depot/projects/hammer/lib/libc/x86_64/net/Makefile.inc#2 (text+ko) ==== @@ -1,4 +1,2 @@ # @(#)Makefile.inc 8.1 (Berkeley) 6/4/93 # $FreeBSD: src/lib/libc/i386/net/Makefile.inc,v 1.6 1999/08/27 23:59:24 peter Exp $ - -SRCS+= htonl.S htons.S ntohl.S ntohs.S ==== //depot/projects/hammer/lib/libc/x86_64/stdlib/Makefile.inc#2 (text+ko) ==== @@ -1,4 +1,3 @@ # @(#)Makefile.inc 8.1 (Berkeley) 6/4/93 # $FreeBSD: src/lib/libc/i386/stdlib/Makefile.inc,v 1.7 1999/08/27 23:59:26 peter Exp $ -MDSRCS+=abs.S div.S labs.S ldiv.S ==== //depot/projects/hammer/lib/libc/x86_64/string/Makefile.inc#2 (text+ko) ==== @@ -1,7 +1,2 @@ # @(#)Makefile.inc 8.1 (Berkeley) 6/4/93 # $FreeBSD: src/lib/libc/i386/string/Makefile.inc,v 1.13 2003/04/05 04:17:05 tjr Exp $ - -MDSRCS+=bcmp.S bcopy.S bzero.S ffs.S index.S memchr.S memcmp.S memcpy.S \ - memmove.S memset.S rindex.S strcat.S strchr.S strcmp.S strcpy.S \ - strlen.S strncmp.S strrchr.S swab.S wcschr.S wcscmp.S wcslen.S \ - wmemchr.S ==== //depot/projects/hammer/lib/libc/x86_64/sys/Makefile.inc#3 (text+ko) ==== @@ -1,12 +1,3 @@ # from: Makefile.inc,v 1.1 1993/09/03 19:04:23 jtc Exp # $FreeBSD: src/lib/libc/i386/sys/Makefile.inc,v 1.25 2002/11/18 09:50:55 ru Exp $ -MDASM= Ovfork.S brk.S cerror.S exect.S pipe.S ptrace.S reboot.S sbrk.S \ - setlogin.S sigreturn.S syscall.S - -# Don't generate default code for these syscalls: -NOASM= break.o exit.o ftruncate.o getdomainname.o getlogin.o \ - lseek.o mlockall.o mmap.o munlockall.o openbsd_poll.o pread.o \ - pwrite.o setdomainname.o sstk.o truncate.o uname.o vfork.o yield.o - -PSEUDO= _getlogin.o _exit.o From owner-p4-projects@FreeBSD.ORG Wed Apr 9 12:48:00 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id D81E537B404; Wed, 9 Apr 2003 12:47:59 -0700 (PDT) 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 75B1237B401 for ; Wed, 9 Apr 2003 12:47:59 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0F10743F3F for ; Wed, 9 Apr 2003 12:47:59 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h39Jlw0U042900 for ; Wed, 9 Apr 2003 12:47:58 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h39Jlw20042897 for perforce@freebsd.org; Wed, 9 Apr 2003 12:47:58 -0700 (PDT) Date: Wed, 9 Apr 2003 12:47:58 -0700 (PDT) Message-Id: <200304091947.h39Jlw20042897@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28664 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, 09 Apr 2003 19:48:00 -0000 http://perforce.freebsd.org/chv.cgi?CH=28664 Change 28664 by peter@peter_daintree on 2003/04/09 12:47:44 pull in i386 version, only minimal mods are needed Affected files ... .. //depot/projects/hammer/sys/x86_64/include/profile.h#1 branch Differences ... From owner-p4-projects@FreeBSD.ORG Wed Apr 9 12:51:08 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id E36DA37B407; Wed, 9 Apr 2003 12:51:07 -0700 (PDT) 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 7640E37B401 for ; Wed, 9 Apr 2003 12:51:07 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3AA8543F93 for ; Wed, 9 Apr 2003 12:51:05 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h39Jp40U043489 for ; Wed, 9 Apr 2003 12:51:04 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h39Jp20S043469 for perforce@freebsd.org; Wed, 9 Apr 2003 12:51:02 -0700 (PDT) Date: Wed, 9 Apr 2003 12:51:02 -0700 (PDT) Message-Id: <200304091951.h39Jp20S043469@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28665 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, 09 Apr 2003 19:51:09 -0000 http://perforce.freebsd.org/chv.cgi?CH=28665 Change 28665 by peter@peter_daintree on 2003/04/09 12:50:05 Update. this might be sufficient for now. Affected files ... .. //depot/projects/hammer/sys/x86_64/include/profile.h#2 edit Differences ... ==== //depot/projects/hammer/sys/x86_64/include/profile.h#2 (text+ko) ==== @@ -65,14 +65,14 @@ #define MCOUNT_DECL(s) u_long s; #ifdef SMP extern int mcount_lock; -#define MCOUNT_ENTER(s) { s = read_eflags(); disable_intr(); \ +#define MCOUNT_ENTER(s) { s = read_rflags(); disable_intr(); \ while (!atomic_cmpset_acq_int(&mcount_lock, 0, 1)) \ /* nothing */ ; } #define MCOUNT_EXIT(s) { atomic_store_rel_int(&mcount_lock, 0); \ - write_eflags(s); } + write_rflags(s); } #else -#define MCOUNT_ENTER(s) { s = read_eflags(); disable_intr(); } -#define MCOUNT_EXIT(s) (write_eflags(s)) +#define MCOUNT_ENTER(s) { s = read_rflags(); disable_intr(); } +#define MCOUNT_EXIT(s) (write_rflags(s)) #endif #endif /* GUPROF */ @@ -94,14 +94,14 @@ * \ * selfpc = pc pushed by call to mcount \ */ \ - asm("movl 4(%%ebp),%0" : "=r" (selfpc)); \ + asm("movq 8(%%rbp),%0" : "=r" (selfpc)); \ /* \ * frompc = pc pushed by call to mcount's caller. \ * The caller's stack frame has already been built, so %ebp is \ * the caller's frame pointer. The caller's raddr is in the \ * caller's frame following the caller's caller's frame pointer.\ */ \ - asm("movl (%%ebp),%0" : "=r" (frompc)); \ + asm("movq (%%rbp),%0" : "=r" (frompc)); \ frompc = ((uintfptr_t *)frompc)[1]; \ _mcount(frompc, selfpc); \ } From owner-p4-projects@FreeBSD.ORG Wed Apr 9 12:58:15 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 63A0337B404; Wed, 9 Apr 2003 12:58:15 -0700 (PDT) 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 04B3437B401 for ; Wed, 9 Apr 2003 12:58:15 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8FC9443F3F for ; Wed, 9 Apr 2003 12:58:14 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h39JwE0U044162 for ; Wed, 9 Apr 2003 12:58:14 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h39JwEpO044159 for perforce@freebsd.org; Wed, 9 Apr 2003 12:58:14 -0700 (PDT) Date: Wed, 9 Apr 2003 12:58:14 -0700 (PDT) Message-Id: <200304091958.h39JwEpO044159@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28666 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, 09 Apr 2003 19:58:16 -0000 http://perforce.freebsd.org/chv.cgi?CH=28666 Change 28666 by peter@peter_daintree on 2003/04/09 12:58:06 It seems _types.h is supposed to have grown __double_t and __float_t Affected files ... .. //depot/projects/hammer/sys/x86_64/include/_types.h#4 edit Differences ... ==== //depot/projects/hammer/sys/x86_64/include/_types.h#4 (text+ko) ==== @@ -56,6 +56,8 @@ */ typedef __int32_t __clock_t; /* clock()... */ typedef __int64_t __critical_t; +typedef double __double_t; +typedef double __float_t; typedef __int64_t __intfptr_t; typedef __int64_t __intmax_t; typedef __int64_t __intptr_t; From owner-p4-projects@FreeBSD.ORG Wed Apr 9 13:16:38 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 34DA537B404; Wed, 9 Apr 2003 13:16:38 -0700 (PDT) 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 C3FB037B401 for ; Wed, 9 Apr 2003 13:16:37 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5A87043F93 for ; Wed, 9 Apr 2003 13:16:37 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h39KGb0U047128 for ; Wed, 9 Apr 2003 13:16:37 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h39KGa0C047125 for perforce@freebsd.org; Wed, 9 Apr 2003 13:16:36 -0700 (PDT) Date: Wed, 9 Apr 2003 13:16:36 -0700 (PDT) Message-Id: <200304092016.h39KGa0C047125@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28667 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, 09 Apr 2003 20:16:39 -0000 http://perforce.freebsd.org/chv.cgi?CH=28667 Change 28667 by peter@peter_daintree on 2003/04/09 13:15:49 function pointers are long, oops. Affected files ... .. //depot/projects/hammer/sys/x86_64/include/profile.h#3 edit Differences ... ==== //depot/projects/hammer/sys/x86_64/include/profile.h#3 (text+ko) ==== @@ -113,7 +113,7 @@ } #endif /* __GNUC__ */ -typedef unsigned int uintfptr_t; +typedef unsigned long uintfptr_t; #endif /* _KERNEL */ From owner-p4-projects@FreeBSD.ORG Wed Apr 9 13:39:20 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id E09B537B404; Wed, 9 Apr 2003 13:39:19 -0700 (PDT) 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 894A037B401; Wed, 9 Apr 2003 13:39:19 -0700 (PDT) Received: from dragon.nuxi.com (trang.nuxi.com [66.93.134.19]) by mx1.FreeBSD.org (Postfix) with ESMTP id C369443FAF; Wed, 9 Apr 2003 13:39:18 -0700 (PDT) (envelope-from obrien@NUXI.com) Received: from dragon.nuxi.com (obrien@localhost [127.0.0.1]) by dragon.nuxi.com (8.12.9/8.12.7) with ESMTP id h39KcwD0045413; Wed, 9 Apr 2003 13:39:02 -0700 (PDT) (envelope-from obrien@dragon.nuxi.com) Received: (from obrien@localhost) by dragon.nuxi.com (8.12.9/8.12.9/Submit) id h39Kcuhl045412; Wed, 9 Apr 2003 13:38:56 -0700 (PDT) Date: Wed, 9 Apr 2003 13:38:56 -0700 From: "David O'Brien" To: Peter Wemm Message-ID: <20030409203856.GA45368@dragon.nuxi.com> References: <20030409173830.GA549@dhcp01.pn.xcllnt.net> <20030409181005.A975B2A7EA@canning.wemm.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030409181005.A975B2A7EA@canning.wemm.org> User-Agent: Mutt/1.4i X-Operating-System: FreeBSD 5.0-CURRENT Organization: The NUXI BSD Group X-Pgp-Rsa-Fingerprint: B7 4D 3E E9 11 39 5F A3 90 76 5D 69 58 D9 98 7A X-Pgp-Rsa-Keyid: 1024/34F9F9D5 cc: Perforce Change Reviews cc: John Baldwin cc: Marcel Moolenaar Subject: Re: PERFORCE change 28461 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: obrien@freebsd.org List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Apr 2003 20:39:21 -0000 On Wed, Apr 09, 2003 at 11:10:05AM -0700, Peter Wemm wrote: > > > This gets hairy... if the toolchain calls it one thing and we call it > > > another. AMD marketing is trying to squash the "x86-64" name in favaor > > > of "AMD64". Note that "AMD64" is what M$ has always called it... so one > > > has to wonder... > > > > I agree with the concerns, but x86-64 is a particularly ugly name > > and uncomfortable to use in general that I'm inclined to prefer a > > name change in spite of the drawbacks. Think about all the scripts > > and makefiles containing x86_64... *shiver* I fail to see what is so ugly about x86-64. I think it is a perfect name that totally indicates what the platform is all about. > Could we live with a slightly modified toolchain that defines both > __x86_64__ and __amd64__ ? I'd be more than happy to rename everything > so that it was #ifdef __amd64__ and have MACHINE_ARCH=amd64 for > $dir/amd64/* etc. But we can't stop defining __x86_64__ since thats what > linux and the FSF camp appear to use. Lots of third party stuff will have > __x86_64__ ifdefs. As many of you know, I'm very close to the name "issue"... perhaps we can just ignore the issue for now, and let me see if I can get our BSD bretheren and toolchain and Linux people to go along with such a name change. I'd really prefer to not be the odd-man out. From owner-p4-projects@FreeBSD.ORG Wed Apr 9 14:40:48 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 31EC937B405; Wed, 9 Apr 2003 14:40:48 -0700 (PDT) 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 C34F837B404 for ; Wed, 9 Apr 2003 14:40:47 -0700 (PDT) Received: from mail.speakeasy.net (mail12.speakeasy.net [216.254.0.212]) by mx1.FreeBSD.org (Postfix) with ESMTP id 70FCA43F93 for ; Wed, 9 Apr 2003 14:40:46 -0700 (PDT) (envelope-from jhb@FreeBSD.org) Received: (qmail 2398 invoked from network); 9 Apr 2003 21:40:54 -0000 Received: from unknown (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender )encrypted SMTP for ; 9 Apr 2003 21:40:54 -0000 Received: from laptop.baldwin.cx (gw1.twc.weather.com [216.133.140.1]) by server.baldwin.cx (8.12.8/8.12.8) with ESMTP id h39LehOv050538; Wed, 9 Apr 2003 17:40:43 -0400 (EDT) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.5.4 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <20030409181005.A975B2A7EA@canning.wemm.org> Date: Wed, 09 Apr 2003 17:40:42 -0400 (EDT) From: John Baldwin To: Peter Wemm cc: Perforce Change Reviews cc: David O'Brien cc: Marcel Moolenaar Subject: Re: PERFORCE change 28461 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, 09 Apr 2003 21:40:49 -0000 On 09-Apr-2003 Peter Wemm wrote: > Marcel Moolenaar wrote: >> On Wed, Apr 09, 2003 at 09:04:01AM -0700, David O'Brien wrote: >> > On Tue, Apr 08, 2003 at 10:23:56AM -0400, John Baldwin wrote: >> > > >> > > On 07-Apr-2003 Peter Wemm wrote: >> > > > http://perforce.freebsd.org/chv.cgi?CH=28461 >> > > > >> > > > Change 28461 by peter@peter_daintree on 2003/04/07 16:35:32 >> > > > >> > > > use -mcmodel=medium for hammer. Otherwise it generates >> > > > 32 bit instructions for things like invltlb(). kernel model >> > > > comes later. >> > > >> > > Side topic: are we going to call it amd64 some day instead of x86-64? >> > >> > This gets hairy... if the toolchain calls it one thing and we call it >> > another. AMD marketing is trying to squash the "x86-64" name in favaor >> > of "AMD64". Note that "AMD64" is what M$ has always called it... so one >> > has to wonder... >> >> I agree with the concerns, but x86-64 is a particularly ugly name >> and uncomfortable to use in general that I'm inclined to prefer a >> name change in spite of the drawbacks. Think about all the scripts >> and makefiles containing x86_64... *shiver* > > Could we live with a slightly modified toolchain that defines both > __x86_64__ and __amd64__ ? I'd be more than happy to rename everything > so that it was #ifdef __amd64__ and have MACHINE_ARCH=amd64 for > $dir/amd64/* etc. But we can't stop defining __x86_64__ since thats what > linux and the FSF camp appear to use. Lots of third party stuff will have > __x86_64__ ifdefs. This would work for me. This is similar to how sparc64 defines both __sparc64__ and __sparc_v9__, etc. >> BTW: To what extend is the actual name important? Is it only >> 'uname -m' that really matters (toolchain bordercases aside)? > > Having $MACHINE_ARCH different to #ifdef __$MACHINE_ARCH__ would be an > ongoing problem I think. Yes, we would need to make it consistent across the board as far as FreeBSD sources are concerned. I prefer amd64 personally as x86-64 is indeed an ugly name. :) -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ From owner-p4-projects@FreeBSD.ORG Wed Apr 9 14:55:43 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id ECBA637B404; Wed, 9 Apr 2003 14:55:42 -0700 (PDT) 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 8AE5437B401; Wed, 9 Apr 2003 14:55:42 -0700 (PDT) Received: from canning.wemm.org (canning.wemm.org [192.203.228.65]) by mx1.FreeBSD.org (Postfix) with ESMTP id E1F4F43FCB; Wed, 9 Apr 2003 14:55:41 -0700 (PDT) (envelope-from peter@wemm.org) Received: from wemm.org (localhost [127.0.0.1]) by canning.wemm.org (Postfix) with ESMTP id CB4192A8A7; Wed, 9 Apr 2003 14:55:41 -0700 (PDT) (envelope-from peter@wemm.org) X-Mailer: exmh version 2.5 07/13/2001 with nmh-1.0.4 To: obrien@freebsd.org In-Reply-To: <20030409203856.GA45368@dragon.nuxi.com> Date: Wed, 09 Apr 2003 14:55:41 -0700 From: Peter Wemm Message-Id: <20030409215541.CB4192A8A7@canning.wemm.org> cc: Perforce Change Reviews cc: John Baldwin cc: Marcel Moolenaar Subject: Re: PERFORCE change 28461 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, 09 Apr 2003 21:55:44 -0000 "David O'Brien" wrote: > On Wed, Apr 09, 2003 at 11:10:05AM -0700, Peter Wemm wrote: > > > > This gets hairy... if the toolchain calls it one thing and we call it > > > > another. AMD marketing is trying to squash the "x86-64" name in favaor > > > > of "AMD64". Note that "AMD64" is what M$ has always called it... so on e > > > > has to wonder... > > > > > > I agree with the concerns, but x86-64 is a particularly ugly name > > > and uncomfortable to use in general that I'm inclined to prefer a > > > name change in spite of the drawbacks. Think about all the scripts > > > and makefiles containing x86_64... *shiver* > > I fail to see what is so ugly about x86-64. I think it is a perfect name > that totally indicates what the platform is all about. Except that "x86-64" (correct name) is parseable as a mathematical expression. "x86_64" isn't technically correct and looks nasty in things like "x86_64-unknown-freebsd". I prefer amd64, but I dont really want to change this in the p4 stuff I'm working on yet. I'd rather that we made the final choice at commit time. As a mailing list, for example, I prefer "freebsd-amd64@freebsd.org" over "freebsd-x86_64@freebsd.org". Speaking of which, its probably about time to create one. Cheers, -Peter -- Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com "All of this is for nothing if we don't go to the stars" - JMS/B5 From owner-p4-projects@FreeBSD.ORG Wed Apr 9 14:58:42 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 0BABE37B401; Wed, 9 Apr 2003 14:58:42 -0700 (PDT) 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 9EBF737B401 for ; Wed, 9 Apr 2003 14:58:41 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4C0DE43F93 for ; Wed, 9 Apr 2003 14:58:41 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h39Lwf0U056436 for ; Wed, 9 Apr 2003 14:58:41 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h39LweA5056433 for perforce@freebsd.org; Wed, 9 Apr 2003 14:58:40 -0700 (PDT) Date: Wed, 9 Apr 2003 14:58:40 -0700 (PDT) Message-Id: <200304092158.h39LweA5056433@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28669 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, 09 Apr 2003 21:58:43 -0000 http://perforce.freebsd.org/chv.cgi?CH=28669 Change 28669 by peter@peter_daintree on 2003/04/09 14:58:10 Join in the fun. Affected files ... .. //depot/projects/hammer/lib/libc/xdr/xdr_float.c#2 edit Differences ... ==== //depot/projects/hammer/lib/libc/xdr/xdr_float.c#2 (text+ko) ==== @@ -64,7 +64,7 @@ #if defined(__m68k__) || defined(__sparc__) || defined(__i386__) || \ defined(__mips__) || defined(__ns32k__) || defined(__alpha__) || \ defined(__arm32__) || defined(__ppc__) || defined(__ia64__) || \ - defined(__arm26__) || defined(__sparc64__) + defined(__arm26__) || defined(__sparc64__) || defined(__x86_64__) #include #define IEEEFP #endif From owner-p4-projects@FreeBSD.ORG Wed Apr 9 14:59:44 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id E7E6837B404; Wed, 9 Apr 2003 14:59:43 -0700 (PDT) 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 83E3E37B401 for ; Wed, 9 Apr 2003 14:59:43 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2FDFD43FBD for ; Wed, 9 Apr 2003 14:59:43 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h39Lxh0U056464 for ; Wed, 9 Apr 2003 14:59:43 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h39Lxgg7056461 for perforce@freebsd.org; Wed, 9 Apr 2003 14:59:42 -0700 (PDT) Date: Wed, 9 Apr 2003 14:59:42 -0700 (PDT) Message-Id: <200304092159.h39Lxgg7056461@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28670 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, 09 Apr 2003 21:59:44 -0000 http://perforce.freebsd.org/chv.cgi?CH=28670 Change 28670 by peter@peter_daintree on 2003/04/09 14:59:37 Join in the fun here too. Affected files ... .. //depot/projects/hammer/lib/libc/gmon/gmon.c#3 edit .. //depot/projects/hammer/lib/libc/stdlib/malloc.c#4 edit Differences ... ==== //depot/projects/hammer/lib/libc/gmon/gmon.c#3 (text+ko) ==== @@ -53,7 +53,7 @@ #include "libc_private.h" -#if defined(__i386__) || defined(__sparc64__) +#if defined(__i386__) || defined(__sparc64__) || defined(__x86_64__) extern char *minbrk asm (".minbrk"); #else extern char *minbrk asm ("minbrk"); ==== //depot/projects/hammer/lib/libc/stdlib/malloc.c#4 (text+ko) ==== @@ -62,6 +62,10 @@ # define malloc_pageshift 13U # define malloc_minsize 16U # endif +# if defined(__x86_64__) +# define malloc_pageshift 13U +# define malloc_minsize 16U +# endif # if !defined(__NETBSD_SYSCALLS) # define HAS_UTRACE # endif From owner-p4-projects@FreeBSD.ORG Wed Apr 9 15:20:16 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 17A2137B404; Wed, 9 Apr 2003 15:20:16 -0700 (PDT) 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 BF4EC37B401; Wed, 9 Apr 2003 15:20:15 -0700 (PDT) Received: from dragon.nuxi.com (trang.nuxi.com [66.93.134.19]) by mx1.FreeBSD.org (Postfix) with ESMTP id F3DA643F85; Wed, 9 Apr 2003 15:20:14 -0700 (PDT) (envelope-from obrien@NUXI.com) Received: from dragon.nuxi.com (obrien@localhost [127.0.0.1]) by dragon.nuxi.com (8.12.9/8.12.7) with ESMTP id h39MJxD0046171; Wed, 9 Apr 2003 15:19:59 -0700 (PDT) (envelope-from obrien@dragon.nuxi.com) Received: (from obrien@localhost) by dragon.nuxi.com (8.12.9/8.12.9/Submit) id h39MJttv046166; Wed, 9 Apr 2003 15:19:55 -0700 (PDT) Date: Wed, 9 Apr 2003 15:19:55 -0700 From: "David O'Brien" To: John Baldwin Message-ID: <20030409221955.GA46148@dragon.nuxi.com> References: <20030409181005.A975B2A7EA@canning.wemm.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4i X-Operating-System: FreeBSD 5.0-CURRENT Organization: The NUXI BSD Group X-Pgp-Rsa-Fingerprint: B7 4D 3E E9 11 39 5F A3 90 76 5D 69 58 D9 98 7A X-Pgp-Rsa-Keyid: 1024/34F9F9D5 cc: Perforce Change Reviews cc: Peter Wemm cc: Marcel Moolenaar Subject: Re: PERFORCE change 28461 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: obrien@FreeBSD.org List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Apr 2003 22:20:17 -0000 On Wed, Apr 09, 2003 at 05:40:42PM -0400, John Baldwin wrote: > This would work for me. This is similar to how sparc64 defines both > __sparc64__ and __sparc_v9__, etc. These two are not synomous. From owner-p4-projects@FreeBSD.ORG Wed Apr 9 17:25:44 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 31E1837B404; Wed, 9 Apr 2003 17:25:44 -0700 (PDT) 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 C588337B401 for ; Wed, 9 Apr 2003 17:25:43 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5B8CC43F93 for ; Wed, 9 Apr 2003 17:25:43 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h3A0Ph0U076280 for ; Wed, 9 Apr 2003 17:25:43 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h3A0PgAR076277 for perforce@freebsd.org; Wed, 9 Apr 2003 17:25:42 -0700 (PDT) Date: Wed, 9 Apr 2003 17:25:42 -0700 (PDT) Message-Id: <200304100025.h3A0PgAR076277@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28676 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, 10 Apr 2003 00:25:45 -0000 http://perforce.freebsd.org/chv.cgi?CH=28676 Change 28676 by peter@peter_daintree on 2003/04/09 17:24:59 permit direct isa attachment to legacy for x86-64 for now. Affected files ... .. //depot/projects/hammer/sys/isa/isa_common.c#5 edit Differences ... ==== //depot/projects/hammer/sys/isa/isa_common.c#5 (text+ko) ==== @@ -1112,6 +1112,6 @@ */ DRIVER_MODULE(isa, isab, isa_driver, isa_devclass, 0, 0); DRIVER_MODULE(isa, eisab, isa_driver, isa_devclass, 0, 0); -#ifdef __i386__ +#if defined(__i386__) || defined(__x86_64__) DRIVER_MODULE(isa, legacy, isa_driver, isa_devclass, 0, 0); #endif From owner-p4-projects@FreeBSD.ORG Wed Apr 9 17:52:18 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 17B4637B404; Wed, 9 Apr 2003 17:52:17 -0700 (PDT) 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 B0EA137B401 for ; Wed, 9 Apr 2003 17:52:16 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 497E243F75 for ; Wed, 9 Apr 2003 17:52:16 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h3A0qG0U079007 for ; Wed, 9 Apr 2003 17:52:16 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h3A0qF9F079004 for perforce@freebsd.org; Wed, 9 Apr 2003 17:52:15 -0700 (PDT) Date: Wed, 9 Apr 2003 17:52:15 -0700 (PDT) Message-Id: <200304100052.h3A0qF9F079004@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28677 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, 10 Apr 2003 00:52:18 -0000 http://perforce.freebsd.org/chv.cgi?CH=28677 Change 28677 by peter@peter_daintree on 2003/04/09 17:52:04 unused variable Affected files ... .. //depot/projects/hammer/sys/x86_64/x86_64/identcpu.c#7 edit Differences ... ==== //depot/projects/hammer/sys/x86_64/x86_64/identcpu.c#7 (text+ko) ==== @@ -294,7 +294,6 @@ static void print_AMD_info(void) { - quad_t amd_whcr; if (cpu_exthigh >= 0x80000005) { u_int regs[4]; From owner-p4-projects@FreeBSD.ORG Wed Apr 9 19:30:16 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 2314737B404; Wed, 9 Apr 2003 19:30:16 -0700 (PDT) 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 C846F37B401 for ; Wed, 9 Apr 2003 19:30:15 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7149443FB1 for ; Wed, 9 Apr 2003 19:30:15 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h3A2UF0U088578 for ; Wed, 9 Apr 2003 19:30:15 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h3A2UFIv088550 for perforce@freebsd.org; Wed, 9 Apr 2003 19:30:15 -0700 (PDT) Date: Wed, 9 Apr 2003 19:30:15 -0700 (PDT) Message-Id: <200304100230.h3A2UFIv088550@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28679 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, 10 Apr 2003 02:30:17 -0000 http://perforce.freebsd.org/chv.cgi?CH=28679 Change 28679 by peter@peter_daintree on 2003/04/09 19:29:36 disable AST processing. THe frame stuff isn't right. fix the interrupt enable state after fork. Hopefully this will fix the startup races I've had. Affected files ... .. //depot/projects/hammer/sys/x86_64/x86_64/critical.c#6 edit .. //depot/projects/hammer/sys/x86_64/x86_64/exception.s#18 edit Differences ... ==== //depot/projects/hammer/sys/x86_64/x86_64/critical.c#6 (text+ko) ==== @@ -28,7 +28,7 @@ td = curthread; td->td_critnest = 1; - td->td_md.md_savecrit = read_rflags() & PSL_I; + td->td_md.md_savecrit = read_rflags() | PSL_I; } /* ==== //depot/projects/hammer/sys/x86_64/x86_64/exception.s#18 (text+ko) ==== @@ -195,9 +195,6 @@ movq %r12, %rdi /* function */ movq %rbx, %rsi /* arg1 */ movq %rsp, %rdx /* trapframe pointer */ - movq PCPU(CURTHREAD),%rbx /* setup critnest */ - movl $1,TD_CRITNEST(%rbx) - sti /* enable interrupts */ call fork_exit MEXITCOUNT jmp doreti /* Handle any ASTs */ @@ -227,6 +224,7 @@ /* * Check if ASTs can be handled now. */ +#if 0 testb $SEL_RPL_MASK,TF_CS(%rsp) /* are we returning to user mode? */ jz doreti_exit /* can't handle ASTs now if not */ @@ -253,6 +251,7 @@ * registers. The fault is handled in trap.c. */ doreti_exit: +#endif MEXITCOUNT popq %r15 From owner-p4-projects@FreeBSD.ORG Wed Apr 9 19:31:18 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 3340337B404; Wed, 9 Apr 2003 19:31:18 -0700 (PDT) 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 C5F6E37B401 for ; Wed, 9 Apr 2003 19:31:17 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5E06D43FB1 for ; Wed, 9 Apr 2003 19:31:17 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h3A2VH0U089057 for ; Wed, 9 Apr 2003 19:31:17 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h3A2VGMG089054 for perforce@freebsd.org; Wed, 9 Apr 2003 19:31:16 -0700 (PDT) Date: Wed, 9 Apr 2003 19:31:16 -0700 (PDT) Message-Id: <200304100231.h3A2VGMG089054@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28680 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, 10 Apr 2003 02:31:19 -0000 http://perforce.freebsd.org/chv.cgi?CH=28680 Change 28680 by peter@peter_daintree on 2003/04/09 19:30:40 something is trashing %cr3 in the pcb.. take the easy way out for the moment. Affected files ... .. //depot/projects/hammer/sys/x86_64/include/pcb.h#10 edit Differences ... ==== //depot/projects/hammer/sys/x86_64/include/pcb.h#10 (text+ko) ==== @@ -46,6 +46,7 @@ #include struct pcb { + long padxx[8]; long pcb_cr3; long pcb_r15; long pcb_r14; From owner-p4-projects@FreeBSD.ORG Wed Apr 9 20:43:47 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id C55DD37B404; Wed, 9 Apr 2003 20:43:46 -0700 (PDT) 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 7667B37B401 for ; Wed, 9 Apr 2003 20:43:46 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 06FBE43F75 for ; Wed, 9 Apr 2003 20:43:46 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h3A3hj0U095000 for ; Wed, 9 Apr 2003 20:43:45 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h3A3hjAw094997 for perforce@freebsd.org; Wed, 9 Apr 2003 20:43:45 -0700 (PDT) Date: Wed, 9 Apr 2003 20:43:45 -0700 (PDT) Message-Id: <200304100343.h3A3hjAw094997@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28682 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, 10 Apr 2003 03:43:47 -0000 http://perforce.freebsd.org/chv.cgi?CH=28682 Change 28682 by peter@peter_daintree on 2003/04/09 20:43:16 use some strategic register_t's Affected files ... .. //depot/projects/hammer/sys/x86_64/include/pcb.h#11 edit .. //depot/projects/hammer/sys/x86_64/include/ucontext.h#9 edit Differences ... ==== //depot/projects/hammer/sys/x86_64/include/pcb.h#11 (text+ko) ==== @@ -46,16 +46,16 @@ #include struct pcb { - long padxx[8]; - long pcb_cr3; - long pcb_r15; - long pcb_r14; - long pcb_r13; - long pcb_r12; - long pcb_rbp; - long pcb_rsp; - long pcb_rbx; - long pcb_rip; + register_t padxx[8]; + register_t pcb_cr3; + register_t pcb_r15; + register_t pcb_r14; + register_t pcb_r13; + register_t pcb_r12; + register_t pcb_rbp; + register_t pcb_rsp; + register_t pcb_rbx; + register_t pcb_rip; struct savefpu pcb_save; u_long pcb_flags; @@ -63,8 +63,8 @@ #define PCB_NPXINITDONE 0x08 /* fpu state is initialized */ caddr_t pcb_onfault; /* copyin/out fault recovery */ - long pcb_gs; - long pcb_psl; /* process status long */ + register_t pcb_gs; + register_t pcb_psl;/* process status long */ }; #ifdef _KERNEL ==== //depot/projects/hammer/sys/x86_64/include/ucontext.h#9 (text+ko) ==== @@ -37,25 +37,25 @@ * sigcontext. So that we can support sigcontext * and ucontext_t at the same time. */ - long mc_onstack; /* XXX - sigcontext compat. */ - long mc_gs; /* machine state (struct trapframe) */ - long mc_fs; - long mc_es; - long mc_ds; - long mc_rdi; - long mc_rsi; - long mc_rbp; - long mc_rbx; - long mc_rdx; - long mc_rcx; - long mc_rax; - long mc_trapno; - long mc_err; - long mc_rip; - long mc_cs; - long mc_rflags; - long mc_rsp; - long mc_ss; + register_t mc_onstack; /* XXX - sigcontext compat. */ + register_t mc_gs; /* machine state (struct trapframe) */ + register_t mc_fs; + register_t mc_es; + register_t mc_ds; + register_t mc_rdi; + register_t mc_rsi; + register_t mc_rbp; + register_t mc_rbx; + register_t mc_rdx; + register_t mc_rcx; + register_t mc_rax; + register_t mc_trapno; + register_t mc_err; + register_t mc_rip; + register_t mc_cs; + register_t mc_rflags; + register_t mc_rsp; + register_t mc_ss; long mc_len; /* sizeof(mcontext_t) */ #define _MC_FPFMT_NODEV 0x10000 /* device not present or configured */ From owner-p4-projects@FreeBSD.ORG Wed Apr 9 20:44:49 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id AB70F37B404; Wed, 9 Apr 2003 20:44:48 -0700 (PDT) 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 4B39A37B401 for ; Wed, 9 Apr 2003 20:44:48 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id EA96443FAF for ; Wed, 9 Apr 2003 20:44:47 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h3A3il0U095030 for ; Wed, 9 Apr 2003 20:44:47 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h3A3ilI7095027 for perforce@freebsd.org; Wed, 9 Apr 2003 20:44:47 -0700 (PDT) Date: Wed, 9 Apr 2003 20:44:47 -0700 (PDT) Message-Id: <200304100344.h3A3ilI7095027@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28683 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, 10 Apr 2003 03:44:49 -0000 http://perforce.freebsd.org/chv.cgi?CH=28683 Change 28683 by peter@peter_daintree on 2003/04/09 20:44:30 register_t stuff Affected files ... .. //depot/projects/hammer/sys/x86_64/include/signal.h#9 edit Differences ... ==== //depot/projects/hammer/sys/x86_64/include/signal.h#9 (text+ko) ==== @@ -73,35 +73,35 @@ */ struct sigcontext { struct __sigset sc_mask; /* signal mask to restore */ - int sc_onstack; /* sigstack state to restore */ - int sc_gs; /* machine state (struct trapframe) */ - int sc_fs; - int sc_es; - int sc_ds; - int sc_edi; - int sc_esi; - int sc_ebp; - int sc_ebx; - int sc_edx; - int sc_ecx; - int sc_eax; - int sc_trapno; - int sc_err; - int sc_eip; - int sc_cs; - int sc_efl; - int sc_esp; - int sc_ss; - int sc_len; /* sizeof(mcontext_t) */ + register_t sc_onstack; /* sigstack state to restore */ + register_t sc_gs; /* machine state (struct trapframe) */ + register_t sc_fs; + register_t sc_es; + register_t sc_ds; + register_t sc_edi; + register_t sc_esi; + register_t sc_ebp; + register_t sc_ebx; + register_t sc_edx; + register_t sc_ecx; + register_t sc_eax; + register_t sc_trapno; + register_t sc_err; + register_t sc_eip; + register_t sc_cs; + register_t sc_efl; + register_t sc_esp; + register_t sc_ss; + long sc_len; /* sizeof(mcontext_t) */ /* * XXX - See and for * the following fields. */ - int sc_fpformat; - int sc_ownedfp; - int sc_spare1[1]; - int sc_fpstate[128] __aligned(16); - int sc_spare2[8]; + long sc_fpformat; + long sc_ownedfp; + long sc_spare1[1]; + long sc_fpstate[128] __aligned(16); + long sc_spare2[8]; }; #define sc_sp sc_esp From owner-p4-projects@FreeBSD.ORG Wed Apr 9 20:45:51 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 93B2837B404; Wed, 9 Apr 2003 20:45:50 -0700 (PDT) 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 375B337B401 for ; Wed, 9 Apr 2003 20:45:50 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id D661143FAF for ; Wed, 9 Apr 2003 20:45:49 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h3A3jn0U095121 for ; Wed, 9 Apr 2003 20:45:49 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h3A3jnkU095118 for perforce@freebsd.org; Wed, 9 Apr 2003 20:45:49 -0700 (PDT) Date: Wed, 9 Apr 2003 20:45:49 -0700 (PDT) Message-Id: <200304100345.h3A3jnkU095118@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28684 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, 10 Apr 2003 03:45:51 -0000 http://perforce.freebsd.org/chv.cgi?CH=28684 Change 28684 by peter@peter_daintree on 2003/04/09 20:45:18 use register_t (i386 can use it too, to keep the diffs down) Affected files ... .. //depot/projects/hammer/sys/x86_64/x86_64/vm_machdep.c#19 edit Differences ... ==== //depot/projects/hammer/sys/x86_64/x86_64/vm_machdep.c#19 (text+ko) ==== @@ -135,11 +135,11 @@ * return address on stack. These are the kernel mode register values. */ pcb2->pcb_cr3 = vtophys(vmspace_pmap(p2->p_vmspace)->pm_pml4); - pcb2->pcb_r12 = (int)fork_return; /* fork_trampoline argument */ + pcb2->pcb_r12 = (register_t)fork_return; /* fork_trampoline argument */ pcb2->pcb_rbp = 0; - pcb2->pcb_rsp = (long)td2->td_frame - sizeof(void *); - pcb2->pcb_rbx = (long)td2; /* fork_trampoline argument */ - pcb2->pcb_rip = (long)fork_trampoline; + pcb2->pcb_rsp = (register_t)td2->td_frame - sizeof(void *); + pcb2->pcb_rbx = (register_t)td2; /* fork_trampoline argument */ + pcb2->pcb_rip = (register_t)fork_trampoline; pcb2->pcb_psl = td2->td_frame->tf_rflags & ~PSL_I; /* ints disabled */ /*- * pcb2->pcb_savefpu: cloned above. From owner-p4-projects@FreeBSD.ORG Wed Apr 9 20:45:52 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id CFDF137B404; Wed, 9 Apr 2003 20:45:51 -0700 (PDT) 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 D134837B407 for ; Wed, 9 Apr 2003 20:45:50 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5C3CB43FAF for ; Wed, 9 Apr 2003 20:45:50 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h3A3jo0U095127 for ; Wed, 9 Apr 2003 20:45:50 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h3A3jns8095124 for perforce@freebsd.org; Wed, 9 Apr 2003 20:45:49 -0700 (PDT) Date: Wed, 9 Apr 2003 20:45:49 -0700 (PDT) Message-Id: <200304100345.h3A3jns8095124@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28685 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, 10 Apr 2003 03:45:52 -0000 http://perforce.freebsd.org/chv.cgi?CH=28685 Change 28685 by peter@peter_daintree on 2003/04/09 20:45:45 ok, that was fun, now lets get on with real work Affected files ... .. //depot/projects/hammer/sys/x86_64/conf/GENERIC#6 edit Differences ... ==== //depot/projects/hammer/sys/x86_64/conf/GENERIC#6 (text+ko) ==== @@ -23,7 +23,7 @@ ident GENERIC maxusers 0 -options INET +#options INET options SCHED_4BSD options FFS options SOFTUPDATES @@ -31,44 +31,47 @@ device isa device sio -device pci -device miibus -device bge -device fxp +options INVARIANTS +options INVARIANT_SUPPORT + +#device pci +#device miibus +#device bge +#device fxp -device random # Entropy device -device loop -device ether +#device random # Entropy device +#device loop +#device ether device md -device ata -device atadisk -device atapicd # ATAPI CDROM drives +#device ata +#device atadisk +#device atapicd # ATAPI CDROM drives # USB support -device uhci # UHCI PCI->USB interface -device ohci # OHCI PCI->USB interface -device usb # USB Bus (required) -device ugen # Generic -device uhid # "Human Interface Devices" -device ukbd # Keyboard +#device uhci # UHCI PCI->USB interface +#device ohci # OHCI PCI->USB interface +#device usb # USB Bus (required) +#device ugen # Generic +#device uhid # "Human Interface Devices" +#device ukbd # Keyboard # atkbdc0 controls both the keyboard and the PS/2 mouse -device atkbdc # AT keyboard controller -device atkbd # AT keyboard -device psm # PS/2 mouse +#device atkbdc # AT keyboard controller +#device atkbd # AT keyboard +#device psm # PS/2 mouse -device vga # VGA video card driver +#device vga # VGA video card driver -device splash # Splash screen and screen saver support +#device splash # Splash screen and screen saver support # syscons is the default console driver, resembling an SCO console -device sc +#device sc #device agp # support several AGP chipsets # Parallel port -device ppc -device ppbus # Parallel port bus (required) -device lpt # Printer +#device ppc +#device ppbus # Parallel port bus (required) +#device lpt # Printer From owner-p4-projects@FreeBSD.ORG Wed Apr 9 20:56:04 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 2426337B404; Wed, 9 Apr 2003 20:56:04 -0700 (PDT) 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 CD99137B401 for ; Wed, 9 Apr 2003 20:56:03 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 58C1D43F93 for ; Wed, 9 Apr 2003 20:56:03 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h3A3u30U001238 for ; Wed, 9 Apr 2003 20:56:03 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h3A3u2Xi001235 for perforce@freebsd.org; Wed, 9 Apr 2003 20:56:02 -0700 (PDT) Date: Wed, 9 Apr 2003 20:56:02 -0700 (PDT) Message-Id: <200304100356.h3A3u2Xi001235@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28686 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, 10 Apr 2003 03:56:05 -0000 http://perforce.freebsd.org/chv.cgi?CH=28686 Change 28686 by peter@peter_daintree on 2003/04/09 20:55:38 create a %cs for userland Affected files ... .. //depot/projects/hammer/sys/x86_64/include/segments.h#14 edit .. //depot/projects/hammer/sys/x86_64/x86_64/machdep.c#60 edit Differences ... ==== //depot/projects/hammer/sys/x86_64/include/segments.h#14 (text+ko) ==== @@ -178,7 +178,8 @@ #define GDATA_SEL 2 /* Kernel Data Descriptor */ #define GPROC0_SEL 3 /* Task state process slot zero and up */ /* slot 4 is second half of GPROC0_SEL */ -#define NGDT 5 +#define GUCODE_SEL 5 /* Kernel Code Descriptor */ +#define NGDT 6 #ifdef _KERNEL extern struct user_segment_descriptor gdt[]; ==== //depot/projects/hammer/sys/x86_64/x86_64/machdep.c#60 (text+ko) ==== @@ -573,7 +573,7 @@ { 0x0, /* segment base address */ 0xfffff, /* length - all address space */ SDT_MEMERA, /* segment type */ - 0, /* segment descriptor priority level */ + SEL_KPL, /* segment descriptor priority level */ 1, /* segment descriptor present */ 1, /* long */ 0, /* default 32 vs 16 bit size */ @@ -582,7 +582,7 @@ { 0x0, /* segment base address */ 0xfffff, /* length - all address space */ SDT_MEMRWA, /* segment type */ - 0, /* segment descriptor priority level */ + SEL_KPL, /* segment descriptor priority level */ 1, /* segment descriptor present */ 1, /* long */ 1, /* default 32 vs 16 bit size */ @@ -592,7 +592,7 @@ 0x0, /* segment base address */ sizeof(struct x86_64tss)-1,/* length - all address space */ SDT_SYSTSS, /* segment type */ - 0, /* segment descriptor priority level */ + SEL_KPL, /* segment descriptor priority level */ 1, /* segment descriptor present */ 0, /* long */ 0, /* unused - default 32 vs 16 bit size */ @@ -606,6 +606,15 @@ 0, /* long */ 0, /* default 32 vs 16 bit size */ 0 /* limit granularity (byte/page units)*/ }, +/* GUCODE_SEL 5 Code Descriptor for user */ +{ 0x0, /* segment base address */ + 0xfffff, /* length - all address space */ + SDT_MEMERA, /* segment type */ + SEL_UPL, /* segment descriptor priority level */ + 1, /* segment descriptor present */ + 1, /* long */ + 0, /* default 32 vs 16 bit size */ + 1 /* limit granularity (byte/page units)*/ }, }; void From owner-p4-projects@FreeBSD.ORG Wed Apr 9 21:13:26 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id B2E4637B404; Wed, 9 Apr 2003 21:13:25 -0700 (PDT) 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 6A16337B401 for ; Wed, 9 Apr 2003 21:13:25 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 123F643F75 for ; Wed, 9 Apr 2003 21:13:25 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h3A4DO0U003564 for ; Wed, 9 Apr 2003 21:13:24 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h3A4DOXF003555 for perforce@freebsd.org; Wed, 9 Apr 2003 21:13:24 -0700 (PDT) Date: Wed, 9 Apr 2003 21:13:24 -0700 (PDT) Message-Id: <200304100413.h3A4DOXF003555@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28687 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, 10 Apr 2003 04:13:26 -0000 http://perforce.freebsd.org/chv.cgi?CH=28687 Change 28687 by peter@peter_daintree on 2003/04/09 21:13:03 have a seperate selector for user data, not that it appears to matter Affected files ... .. //depot/projects/hammer/sys/x86_64/include/segments.h#15 edit .. //depot/projects/hammer/sys/x86_64/x86_64/machdep.c#61 edit Differences ... ==== //depot/projects/hammer/sys/x86_64/include/segments.h#15 (text+ko) ==== @@ -178,8 +178,9 @@ #define GDATA_SEL 2 /* Kernel Data Descriptor */ #define GPROC0_SEL 3 /* Task state process slot zero and up */ /* slot 4 is second half of GPROC0_SEL */ -#define GUCODE_SEL 5 /* Kernel Code Descriptor */ -#define NGDT 6 +#define GUCODE_SEL 5 /* User Code Descriptor */ +#define GUDATA_SEL 6 /* User Data Descriptor */ +#define NGDT 7 #ifdef _KERNEL extern struct user_segment_descriptor gdt[]; ==== //depot/projects/hammer/sys/x86_64/x86_64/machdep.c#61 (text+ko) ==== @@ -615,6 +615,15 @@ 1, /* long */ 0, /* default 32 vs 16 bit size */ 1 /* limit granularity (byte/page units)*/ }, +/* GUDATA_SEL 6 Code Descriptor for user */ +{ 0x0, /* segment base address */ + 0xfffff, /* length - all address space */ + SDT_MEMRWA, /* segment type */ + SEL_UPL, /* segment descriptor priority level */ + 1, /* segment descriptor present */ + 1, /* long */ + 0, /* default 32 vs 16 bit size */ + 1 /* limit granularity (byte/page units)*/ }, }; void @@ -1253,6 +1262,11 @@ msgbufinit(msgbufp, MSGBUF_SIZE); + /* transfer to user mode */ + + _ucodesel = GSEL(LUCODE_SEL, SEL_UPL); + _udatasel = GSEL(LUDATA_SEL, SEL_UPL); + /* setup proc 0's pcb */ thread0.td_pcb->pcb_flags = 0; /* XXXKSE */ thread0.td_pcb->pcb_cr3 = IdlePML4; From owner-p4-projects@FreeBSD.ORG Wed Apr 9 21:33:52 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id D21F237B404; Wed, 9 Apr 2003 21:33:51 -0700 (PDT) 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 6D31337B401 for ; Wed, 9 Apr 2003 21:33:51 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 157CE43FA3 for ; Wed, 9 Apr 2003 21:33:51 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h3A4Xo0U005143 for ; Wed, 9 Apr 2003 21:33:50 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h3A4XoXr005140 for perforce@freebsd.org; Wed, 9 Apr 2003 21:33:50 -0700 (PDT) Date: Wed, 9 Apr 2003 21:33:50 -0700 (PDT) Message-Id: <200304100433.h3A4XoXr005140@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28689 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, 10 Apr 2003 04:33:53 -0000 http://perforce.freebsd.org/chv.cgi?CH=28689 Change 28689 by peter@peter_daintree on 2003/04/09 21:33:18 do not mess with %gs. Use the right symbols for the user code/data segs. set %cs. Entering userland with a null descriptor isn't a good idea. Affected files ... .. //depot/projects/hammer/sys/x86_64/x86_64/machdep.c#62 edit Differences ... ==== //depot/projects/hammer/sys/x86_64/x86_64/machdep.c#62 (text+ko) ==== @@ -463,17 +463,20 @@ u_long ps_strings; { struct trapframe *regs = td->td_frame; +#if 0 struct pcb *pcb = td->td_pcb; /* Reset pc->pcb_gs and %gs before possibly invalidating it. */ pcb->pcb_gs = _udatasel; load_gs(_udatasel); +#endif bzero((char *)regs, sizeof(struct trapframe)); regs->tf_rip = entry; regs->tf_rsp = stack; regs->tf_rflags = PSL_USER | (regs->tf_rflags & PSL_T); regs->tf_ss = _udatasel; + regs->tf_cs = _ucodesel; /* * Arrange to trap the next npx or `fwait' instruction (see npx.c @@ -511,7 +514,9 @@ cr0 |= CR0_MP | CR0_TS; /* Done at every execve() too. */ cr0 |= CR0_WP | CR0_AM; load_cr0(cr0); +#if 0 load_gs(_udatasel); +#endif } static int @@ -1264,8 +1269,8 @@ /* transfer to user mode */ - _ucodesel = GSEL(LUCODE_SEL, SEL_UPL); - _udatasel = GSEL(LUDATA_SEL, SEL_UPL); + _ucodesel = GSEL(GUCODE_SEL, SEL_UPL); + _udatasel = GSEL(GUDATA_SEL, SEL_UPL); /* setup proc 0's pcb */ thread0.td_pcb->pcb_flags = 0; /* XXXKSE */ From owner-p4-projects@FreeBSD.ORG Thu Apr 10 08:19:59 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id B854137B40B; Thu, 10 Apr 2003 08:19:58 -0700 (PDT) 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 33C0637B40E for ; Thu, 10 Apr 2003 08:19:58 -0700 (PDT) Received: from mail.speakeasy.net (mail12.speakeasy.net [216.254.0.212]) by mx1.FreeBSD.org (Postfix) with ESMTP id 01C2443FE1 for ; Thu, 10 Apr 2003 08:19:57 -0700 (PDT) (envelope-from jhb@FreeBSD.org) Received: (qmail 1331 invoked from network); 10 Apr 2003 15:20:00 -0000 Received: from unknown (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender )encrypted SMTP for ; 10 Apr 2003 15:20:00 -0000 Received: from laptop.baldwin.cx (gw1.twc.weather.com [216.133.140.1]) by server.baldwin.cx (8.12.8/8.12.8) with ESMTP id h3AFJsOv052801; Thu, 10 Apr 2003 11:19:55 -0400 (EDT) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.5.4 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <20030409221955.GA46148@dragon.nuxi.com> Date: Thu, 10 Apr 2003 11:19:54 -0400 (EDT) From: John Baldwin To: "David O'Brien" cc: Perforce Change Reviews cc: Peter Wemm cc: Marcel Moolenaar Subject: Re: PERFORCE change 28461 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, 10 Apr 2003 15:20:00 -0000 On 09-Apr-2003 David O'Brien wrote: > On Wed, Apr 09, 2003 at 05:40:42PM -0400, John Baldwin wrote: >> This would work for me. This is similar to how sparc64 defines both >> __sparc64__ and __sparc_v9__, etc. > > These two are not synomous. I realize they aren't exactly, but IIRC, the "clean" versions of the toolchain only define the v9 macro and there are FreeBSD modifications to define __sparc64__ since sparc64 is a FreeBSD name for the arch. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ From owner-p4-projects@FreeBSD.ORG Thu Apr 10 10:07:23 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 4C8EE37B405; Thu, 10 Apr 2003 10:07:20 -0700 (PDT) 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 D0C9E37B404 for ; Thu, 10 Apr 2003 10:07:19 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8CCD643F75 for ; Thu, 10 Apr 2003 10:07:18 -0700 (PDT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h3AH7I0U093398 for ; Thu, 10 Apr 2003 10:07:18 -0700 (PDT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h3AH7HB8093395 for perforce@freebsd.org; Thu, 10 Apr 2003 10:07:17 -0700 (PDT) Date: Thu, 10 Apr 2003 10:07:17 -0700 (PDT) Message-Id: <200304101707.h3AH7HB8093395@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Subject: PERFORCE change 28709 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, 10 Apr 2003 17:07:23 -0000 http://perforce.freebsd.org/chv.cgi?CH=28709 Change 28709 by rwatson@rwatson_tislabs on 2003/04/10 10:07:11 Move MAC label storage for mbufs into m_tags from the m_pkthdr structure, returning some additional room in the first mbuf in a chain, and avoiding feature-specific contents in the mbuf header. To do this: - Add a helper function mbuf_to_label(), which extracts the m_tag holding a label from the mbuf header m_tag chain, and casts as appropriate to a label. NULL is returned if no m_tag is found. - Introduce mac_init_mbuf_tag() which does most of the work mac_init_mbuf() used to do, except on an m_tag rather than an mbuf. - Scale back mac_init_mbuf() to perform m_tag allocation and invoke mac_init_mbuf_tag(). - Replace mac_destroy_mbuf() with mac_destroy_mbuf_tag(), since m_tag's are now GC'd deep in the m_tag/mbuf code rather than at a higher level when mbufs are directly free()'d. - Add mac_copy_mbuf_tag() to support m_copy_pkthdr() and related notions. - Generally change all references to mbuf labels so that they use mbuf_to_label() rather than &mbuf->m_pkthdr.label. This required no changes in the MAC policies (yay!). - Tweak mbuf release routines to not call mac_destroy_mbuf(). - Remove MAC magic from m_copy_pkthdr() and m_move_pkthdr() -- the existing m_tag support does all this for us. Note that we can no longer just zero the m_tag list on the target mbuf, rather, we have to delete the chain because m_tag's will already be hung off freshly allocated mbuf's. - Tweak m_tag copying routines so that if we're copying a MAC m_tag, we don't do a binary copy, rather, we initialize the new storage and do a deep copy of the label. - Remove use of MAC_FLAG_INITIALIZED in a few bizarre places having to do with mbuf header copies previously. - When an mbuf is copied in ip_input(), we no longer need to explicitly copy the label because it will get handled by the m_tag code now. - Add MPC_LOADTIME_FLAG_LABELMBUFS flag to Biba, MLS, mac_test. In mac_test, handle the label==NULL case, since it can be dynamically loaded. In order to improve performance with this change, introduce the notion of "lazy MAC label allocation" -- only allocate m_tag storage for MAC labels if we're running with a policy that uses MAC labels on mbufs. Policies declare this intent by setting the MPC_LOADTIME_FLAG_LABELMBUFS flag in their load-time flags field during declaration. Note: this opens up the possibility of post-boot policy modules getting back NULL slot entries even though they have policy invariants of non-NULL slot entries, as the policy might have been loaded after the mbuf was allocated, leaving the mbuf without label storage. Policies that cannot handle this case must be declared as NOTLATE, or must be modified. - mac_labelmbufs holds the current cumulative status as to whether any policies require mbuf labeling or not. This is updated whenever the active policy set changes by the function mac_policy_updateflags(). The function iterates the list and checks whether any have the flag set. Write access to this variable is protected by the policy list; read access is currently not protected for performance reasons. This might change if it causes problems. - Add MAC_POLICY_LIST_ASSERT_EXCLUSIVE() to permit the flags update function to assert appropriate locks. - This makes allocation in mac_init_mbuf() conditional on the flag. Affected files ... .. //depot/projects/trustedbsd/mac/sys/conf/options#47 integrate .. //depot/projects/trustedbsd/mac/sys/kern/kern_mac.c#379 integrate .. //depot/projects/trustedbsd/mac/sys/kern/subr_mbuf.c#31 integrate .. //depot/projects/trustedbsd/mac/sys/kern/uipc_mbuf.c#20 edit .. //depot/projects/trustedbsd/mac/sys/kern/uipc_mbuf2.c#11 integrate .. //depot/projects/trustedbsd/mac/sys/net/if_loop.c#19 integrate .. //depot/projects/trustedbsd/mac/sys/netinet/ip_input.c#29 integrate .. //depot/projects/trustedbsd/mac/sys/security/mac_biba/mac_biba.c#203 integrate .. //depot/projects/trustedbsd/mac/sys/security/mac_lomac/mac_lomac.c#57 integrate .. //depot/projects/trustedbsd/mac/sys/security/mac_mls/mac_mls.c#162 integrate .. //depot/projects/trustedbsd/mac/sys/security/mac_test/mac_test.c#98 integrate .. //depot/projects/trustedbsd/mac/sys/sys/mac.h#233 integrate .. //depot/projects/trustedbsd/mac/sys/sys/mac_policy.h#185 integrate .. //depot/projects/trustedbsd/mac/sys/sys/mbuf.h#27 integrate Differences ... ==== //depot/projects/trustedbsd/mac/sys/conf/options#47 (text+ko) ==== @@ -154,6 +154,7 @@ # Support for Mandatory Access Control (MAC) MAC opt_mac.h +MAC_ALWAYS_LABEL_MBUF opt_mac.h MAC_BIBA opt_dontuse.h MAC_BSDEXTENDED opt_dontuse.h MAC_DEBUG opt_mac.h ==== //depot/projects/trustedbsd/mac/sys/kern/kern_mac.c#379 (text+ko) ==== @@ -120,6 +120,21 @@ */ static int ea_warn_once = 0; +#ifndef MAC_ALWAYS_LABEL_MBUF +/* + * Flag to indicate whether or not we should allocate label storage for + * new mbufs. Since most dynamic policies we currently work with don't + * rely on mbuf labeling, try to avoid paying the cost of mtag allocation + * unless specifically notified of interest. One result of this is + * that if a dynamically loaded policy requests mbuf labels, it must + * be able to deal with a NULL label being returned on any mbufs that + * were already in flight when the policy was loaded. Since the policy + * already has to deal with uninitialized labels, this probably won't + * be a problem. Note: currently no locking. Will this be a problem? + */ +static int mac_labelmbufs = 0; +#endif + static int mac_enforce_fs = 1; SYSCTL_INT(_security_mac, OID_AUTO, enforce_fs, CTLFLAG_RW, &mac_enforce_fs, 0, "Enforce MAC policy on file system objects"); @@ -281,6 +296,12 @@ &mac_policy_list_lock); \ } while (0) +#define MAC_POLICY_LIST_ASSERT_EXCLUSIVE() do { \ + mtx_assert(&mac_policy_list_lock, MA_OWNED); \ + KASSERT(mac_policy_list_busy == 0, \ + ("MAC_POLICY_LIST_ASSERT_EXCLUSIVE()")); \ +} while (0) + #define MAC_POLICY_LIST_BUSY() do { \ MAC_POLICY_LIST_LOCK(); \ mac_policy_list_busy++; \ @@ -464,6 +485,35 @@ } /* + * After the policy list has changed, walk the list to update any global + * flags. + */ +static void +mac_policy_updateflags(void) +{ + struct mac_policy_conf *tmpc; +#ifndef MAC_ALWAYS_LABEL_MBUF + int labelmbufs; +#endif + + MAC_POLICY_LIST_ASSERT_EXCLUSIVE(); + +#ifndef MAC_ALWAYS_LABEL_MBUF + labelmbufs = 0; +#endif + LIST_FOREACH(tmpc, &mac_policy_list, mpc_list) { +#ifndef MAC_ALWAYS_LABEL_MBUF + if (tmpc->mpc_loadtime_flags & MPC_LOADTIME_FLAG_LABELMBUFS) + labelmbufs++; +#endif + } + +#ifndef MAC_ALWAYS_LABEL_MBUF + mac_labelmbufs = (labelmbufs != 0); +#endif +} + +/* * Allow MAC policy modules to register during boot, etc. */ int @@ -530,6 +580,7 @@ /* Per-policy initialization. */ if (mpc->mpc_ops->mpo_init != NULL) (*(mpc->mpc_ops->mpo_init))(mpc); + mac_policy_updateflags(); MAC_POLICY_LIST_UNLOCK(); printf("Security policy loaded: %s (%s)\n", mpc->mpc_fullname, @@ -574,7 +625,7 @@ LIST_REMOVE(mpc, mpc_list); mpc->mpc_runtime_flags &= ~MPC_RUNTIME_FLAG_REGISTERED; - + mac_policy_updateflags(); MAC_POLICY_LIST_UNLOCK(); printf("Security policy unload: %s (%s)\n", mpc->mpc_fullname, @@ -620,6 +671,18 @@ return (error2); } +static struct label * +mbuf_to_label(struct mbuf *mbuf) +{ + struct m_tag *tag; + struct label *label; + + tag = m_tag_find(mbuf, PACKET_TAG_MACLABEL, NULL); + label = (struct label *)(tag+1); + + return (label); +} + static void mac_init_label(struct label *label) { @@ -717,20 +780,20 @@ } int -mac_init_mbuf(struct mbuf *m, int flag) +mac_init_mbuf_tag(struct m_tag *tag, int flag) { - int error; + struct label *label; + int error, trflag; - KASSERT(m->m_flags & M_PKTHDR, ("mac_init_mbuf on non-header mbuf")); + label = (struct label *) (tag + 1); + mac_init_label(label); - mac_init_label(&m->m_pkthdr.label); - - MAC_CHECK(init_mbuf_label, &m->m_pkthdr.label, flag); + trflag = (flag == M_DONTWAIT ? M_NOWAIT : M_WAITOK); + MAC_CHECK(init_mbuf_label, label, trflag); if (error) { - MAC_PERFORM(destroy_mbuf_label, &m->m_pkthdr.label); - mac_destroy_label(&m->m_pkthdr.label); + MAC_PERFORM(destroy_mbuf_label, label); + mac_destroy_label(label); } - #ifdef MAC_DEBUG if (error == 0) atomic_add_int(&nmacmbufs, 1); @@ -738,6 +801,35 @@ return (error); } +int +mac_init_mbuf(struct mbuf *m, int flag) +{ + struct m_tag *tag; + int error; + +#ifndef MAC_ALWAYS_LABEL_MBUF + /* + * Don't reserve space for labels on mbufs unless we have a policy + * that uses the labels. + */ + if (mac_labelmbufs) { +#endif + tag = m_tag_get(PACKET_TAG_MACLABEL, sizeof(struct label), + flag); + if (tag == NULL) + return (ENOMEM); + error = mac_init_mbuf_tag(tag, flag); + if (error) { + m_tag_free(tag); + return (error); + } + m_tag_prepend(m, tag); +#ifndef MAC_ALWAYS_LABEL_MBUF + } +#endif + return (0); +} + void mac_init_mount(struct mount *mp) { @@ -925,11 +1017,14 @@ } void -mac_destroy_mbuf(struct mbuf *m) +mac_destroy_mbuf_tag(struct m_tag *tag) { + struct label *label; - MAC_PERFORM(destroy_mbuf_label, &m->m_pkthdr.label); - mac_destroy_label(&m->m_pkthdr.label); + label = (struct label *)(tag+1); + + MAC_PERFORM(destroy_mbuf_label, label); + mac_destroy_label(label); #ifdef MAC_DEBUG atomic_subtract_int(&nmacmbufs, 1); #endif @@ -1023,6 +1118,23 @@ mac_destroy_vnode_label(&vp->v_label); } +void +mac_copy_mbuf_tag(struct m_tag *src, struct m_tag *dest) +{ + struct label *src_label, *dest_label; + + src_label = (struct label *)(src+1); + dest_label = (struct label *)(dest+1); + +#if 0 + /* + * XXXMAC: init here? */ + */ + mac_init_m...? +#endif + MAC_PERFORM(copy_mbuf_label, src_label, dest_label); +} + static void mac_copy_pipe_label(struct label *src, struct label *dest) { @@ -2093,9 +2205,12 @@ void mac_set_socket_peer_from_mbuf(struct mbuf *mbuf, struct socket *socket) { + struct label *label; + + label = mbuf_to_label(mbuf); - MAC_PERFORM(set_socket_peer_from_mbuf, mbuf, &mbuf->m_pkthdr.label, - socket, &socket->so_peerlabel); + MAC_PERFORM(set_socket_peer_from_mbuf, mbuf, label, socket, + &socket->so_peerlabel); } void @@ -2110,85 +2225,117 @@ void mac_create_datagram_from_ipq(struct ipq *ipq, struct mbuf *datagram) { + struct label *label; + + label = mbuf_to_label(datagram); MAC_PERFORM(create_datagram_from_ipq, ipq, &ipq->ipq_label, - datagram, &datagram->m_pkthdr.label); + datagram, label); } void mac_create_fragment(struct mbuf *datagram, struct mbuf *fragment) { + struct label *datagramlabel, *fragmentlabel; + + datagramlabel = mbuf_to_label(datagram); + fragmentlabel = mbuf_to_label(fragment); - MAC_PERFORM(create_fragment, datagram, &datagram->m_pkthdr.label, - fragment, &fragment->m_pkthdr.label); + MAC_PERFORM(create_fragment, datagram, datagramlabel, fragment, + fragmentlabel); } void mac_create_ipq(struct mbuf *fragment, struct ipq *ipq) { + struct label *label; - MAC_PERFORM(create_ipq, fragment, &fragment->m_pkthdr.label, ipq, - &ipq->ipq_label); + label = mbuf_to_label(fragment); + + MAC_PERFORM(create_ipq, fragment, label, ipq, &ipq->ipq_label); } void mac_create_mbuf_from_mbuf(struct mbuf *oldmbuf, struct mbuf *newmbuf) { + struct label *oldmbuflabel, *newmbuflabel; - MAC_PERFORM(create_mbuf_from_mbuf, oldmbuf, &oldmbuf->m_pkthdr.label, - newmbuf, &newmbuf->m_pkthdr.label); + oldmbuflabel = mbuf_to_label(oldmbuf); + newmbuflabel = mbuf_to_label(newmbuf); + + MAC_PERFORM(create_mbuf_from_mbuf, oldmbuf, oldmbuflabel, newmbuf, + newmbuflabel); } void mac_create_mbuf_from_bpfdesc(struct bpf_d *bpf_d, struct mbuf *mbuf) { + struct label *label; + label = mbuf_to_label(mbuf); + MAC_PERFORM(create_mbuf_from_bpfdesc, bpf_d, &bpf_d->bd_label, mbuf, - &mbuf->m_pkthdr.label); + label); } void mac_create_mbuf_linklayer(struct ifnet *ifnet, struct mbuf *mbuf) { + struct label *label; + + label = mbuf_to_label(mbuf); MAC_PERFORM(create_mbuf_linklayer, ifnet, &ifnet->if_label, mbuf, - &mbuf->m_pkthdr.label); + label); } void mac_create_mbuf_from_ifnet(struct ifnet *ifnet, struct mbuf *mbuf) { + struct label *label; + + label = mbuf_to_label(mbuf); MAC_PERFORM(create_mbuf_from_ifnet, ifnet, &ifnet->if_label, mbuf, - &mbuf->m_pkthdr.label); + label); } void mac_create_mbuf_multicast_encap(struct mbuf *oldmbuf, struct ifnet *ifnet, struct mbuf *newmbuf) { + struct label *oldmbuflabel, *newmbuflabel; - MAC_PERFORM(create_mbuf_multicast_encap, oldmbuf, - &oldmbuf->m_pkthdr.label, ifnet, &ifnet->if_label, newmbuf, - &newmbuf->m_pkthdr.label); + oldmbuflabel = mbuf_to_label(oldmbuf); + newmbuflabel = mbuf_to_label(newmbuf); + + MAC_PERFORM(create_mbuf_multicast_encap, oldmbuf, oldmbuflabel, + ifnet, &ifnet->if_label, newmbuf, newmbuflabel); } void mac_create_mbuf_netlayer(struct mbuf *oldmbuf, struct mbuf *newmbuf) { + struct label *oldmbuflabel, *newmbuflabel; + + oldmbuflabel = mbuf_to_label(oldmbuf); + newmbuflabel = mbuf_to_label(newmbuf); - MAC_PERFORM(create_mbuf_netlayer, oldmbuf, &oldmbuf->m_pkthdr.label, - newmbuf, &newmbuf->m_pkthdr.label); + MAC_PERFORM(create_mbuf_netlayer, oldmbuf, oldmbuflabel, newmbuf, + newmbuflabel); } int mac_fragment_match(struct mbuf *fragment, struct ipq *ipq) { + struct label *label; int result; + label = mbuf_to_label(fragment); + result = 1; - MAC_BOOLEAN(fragment_match, &&, fragment, &fragment->m_pkthdr.label, - ipq, &ipq->ipq_label); + MAC_BOOLEAN(fragment_match, &&, fragment, label, ipq, + &ipq->ipq_label); return (result); } @@ -2196,17 +2343,22 @@ void mac_update_ipq(struct mbuf *fragment, struct ipq *ipq) { + struct label *label; + + label = mbuf_to_label(fragment); - MAC_PERFORM(update_ipq, fragment, &fragment->m_pkthdr.label, ipq, - &ipq->ipq_label); + MAC_PERFORM(update_ipq, fragment, label, ipq, &ipq->ipq_label); } void mac_create_mbuf_from_socket(struct socket *socket, struct mbuf *mbuf) { + struct label *label; + label = mbuf_to_label(mbuf); + MAC_PERFORM(create_mbuf_from_socket, socket, &socket->so_label, mbuf, - &mbuf->m_pkthdr.label); + label); } void @@ -2265,17 +2417,18 @@ int mac_check_ifnet_transmit(struct ifnet *ifnet, struct mbuf *mbuf) { + struct label *label; int error; + KASSERT(mbuf->m_flags & M_PKTHDR, ("packet has no pkthdr")); + if (!mac_enforce_network) return (0); - KASSERT(mbuf->m_flags & M_PKTHDR, ("packet has no pkthdr")); - if (!(mbuf->m_pkthdr.label.l_flags & MAC_FLAG_INITIALIZED)) - if_printf(ifnet, "not initialized\n"); + label = mbuf_to_label(mbuf); MAC_CHECK(check_ifnet_transmit, ifnet, &ifnet->if_label, mbuf, - &mbuf->m_pkthdr.label); + label); return (error); } @@ -2571,13 +2724,16 @@ int mac_check_socket_deliver(struct socket *socket, struct mbuf *mbuf) { + struct label *label; int error; if (!mac_enforce_socket) return (0); + label = mbuf_to_label(mbuf); + MAC_CHECK(check_socket_deliver, socket, &socket->so_label, mbuf, - &mbuf->m_pkthdr.label); + label); return (error); } ==== //depot/projects/trustedbsd/mac/sys/kern/subr_mbuf.c#31 (text+ko) ==== @@ -1301,14 +1301,18 @@ m_gethdr(int how, short type) { struct mbuf *mb; +#ifdef MAC + int error; +#endif mb = (struct mbuf *)mb_alloc(&mb_list_mbuf, how, type, 0, NULL); if (mb != NULL) { _mbhdr_setup(mb, type); #ifdef MAC - if (mac_init_mbuf(mb, MBTOM(how)) != 0) { + error = mac_init_mbuf(mb, MBTOM(how)); + if (error) { m_free(mb); - return NULL; + return (NULL); } #endif } @@ -1347,17 +1351,21 @@ * - type: the type of the mbuf being allocated. */ struct mbuf * -m_gethdr_clrd(int how, short type) +m_gethdr_clrd(int how, short type) { struct mbuf *mb; +#ifdef MAC + int error; +#endif mb = (struct mbuf *)mb_alloc(&mb_list_mbuf, how, type, 0, NULL); if (mb != NULL) { _mbhdr_setup(mb, type); #ifdef MAC - if (mac_init_mbuf(mb, MBTOM(how)) != 0) { + error = mac_init_mbuf(mb, MBTOM(how)); + if (error) { m_free(mb); - return NULL; + return (NULL); } #endif bzero(mtod(mb, caddr_t), MHLEN); @@ -1383,11 +1391,6 @@ if ((mb->m_flags & M_PKTHDR) != 0) m_tag_delete_chain(mb, NULL); -#ifdef MAC - if ((mb->m_flags & M_PKTHDR) && - (mb->m_pkthdr.label.l_flags & MAC_FLAG_INITIALIZED)) - mac_destroy_mbuf(mb); -#endif nb = mb->m_next; if ((mb->m_flags & M_EXT) != 0) { MEXT_REM_REF(mb); @@ -1430,11 +1433,6 @@ while (mb != NULL) { if ((mb->m_flags & M_PKTHDR) != 0) m_tag_delete_chain(mb, NULL); -#ifdef MAC - if ((mb->m_flags & M_PKTHDR) && - (mb->m_pkthdr.label.l_flags & MAC_FLAG_INITIALIZED)) - mac_destroy_mbuf(mb); -#endif persist = 0; m = mb; mb = mb->m_next; @@ -1476,6 +1474,9 @@ m_getcl(int how, short type, int flags) { struct mbuf *mb; +#ifdef MAC + int error; +#endif int cchnum; mb = (struct mbuf *)mb_alloc(&mb_list_mbuf, how, type, @@ -1502,10 +1503,12 @@ _mext_init_ref(mb, &cl_refcntmap[cl2ref(mb->m_ext.ext_buf)]); } #ifdef MAC - if ((flags & M_PKTHDR) && (mac_init_mbuf(mb, MBTOM(how)) - != 0)) { - m_free(mb); - return NULL; + if (flags & M_PKTHDR) { + error = mac_init_mbuf(mb, MBTOM(how)); + if (error) { + m_free(mb); + return (NULL); + } } #endif return (mb); ==== //depot/projects/trustedbsd/mac/sys/kern/uipc_mbuf.c#20 (text+ko) ==== @@ -77,21 +77,21 @@ /* see below for why these are not enabled */ KASSERT(to->m_flags & M_PKTHDR, ("m_move_pkthdr: called on non-header")); + /* Note: with MAC, this may not be a good assertion. */ KASSERT(SLIST_EMPTY(&to->m_pkthdr.tags), ("m_move_pkthdr: to has tags")); #endif KASSERT((to->m_flags & M_EXT) == 0, ("m_move_pkthdr: to has cluster")); #ifdef MAC + /* + * XXXMAC: It could be this should also occur for non-MAC? + */ if (to->m_flags & M_PKTHDR) - mac_destroy_mbuf(to); + m_tag_delete_chain(to, NULL); #endif to->m_flags = from->m_flags & M_COPYFLAGS; to->m_data = to->m_pktdat; to->m_pkthdr = from->m_pkthdr; /* especially tags */ -#ifdef MAC - mac_init_mbuf(to, M_WAITOK); /* XXXMAC no way to fail */ - mac_create_mbuf_from_mbuf(from, to); -#endif SLIST_INIT(&from->m_pkthdr.tags); /* purge tags from src */ from->m_flags &= ~M_PKTHDR; } @@ -114,23 +114,19 @@ * assertions to trip. For now just disable them. */ KASSERT(to->m_flags & M_PKTHDR, ("m_dup_pkthdr: called on non-header")); + /* Note: with MAC, this may not be a good assertion. */ KASSERT(SLIST_EMPTY(&to->m_pkthdr.tags), ("m_dup_pkthdr: to has tags")); #endif - KASSERT((to->m_flags & M_EXT) == 0, ("m_dup_pkthdr: to has cluster")); #ifdef MAC if (to->m_flags & M_PKTHDR) - mac_destroy_mbuf(to); + m_tag_delete_chain(to, NULL); #endif - to->m_flags = from->m_flags & M_COPYFLAGS; - to->m_data = to->m_pktdat; + to->m_flags = (from->m_flags & M_COPYFLAGS) | (to->m_flags & M_EXT); + if ((to->m_flags & M_EXT) == 0) + to->m_data = to->m_pktdat; to->m_pkthdr = from->m_pkthdr; -#ifdef MAC - mac_init_mbuf(to, M_WAITOK); /* XXXMAC no way to fail */ - mac_create_mbuf_from_mbuf(from, to); -#endif SLIST_INIT(&to->m_pkthdr.tags); - return (m_tag_copy_chain(to, from, (how & M_TRYWAIT) ? M_WAITOK : - M_NOWAIT)); + return (m_tag_copy_chain(to, from, MBTOM(how))); } /* @@ -148,12 +144,8 @@ m_freem(m); return (NULL); } - if (m->m_flags & M_PKTHDR) { + if (m->m_flags & M_PKTHDR) M_MOVE_PKTHDR(mn, m); -#ifdef MAC - mac_destroy_mbuf(m); -#endif - } mn->m_next = m; m = mn; if (len < MHLEN) ==== //depot/projects/trustedbsd/mac/sys/kern/uipc_mbuf2.c#11 (text+ko) ==== @@ -68,10 +68,13 @@ /*#define PULLDOWN_DEBUG*/ +#include "opt_mac.h" + #include #include #include #include +#include #include #include #include @@ -327,6 +330,10 @@ void m_tag_free(struct m_tag *t) { +#ifdef MAC + if (t->m_tag_id == PACKET_TAG_MACLABEL) + mac_destroy_mbuf_tag(t); +#endif free(t, M_PACKET_TAGS); } @@ -402,7 +409,21 @@ p = m_tag_alloc(t->m_tag_cookie, t->m_tag_id, t->m_tag_len, how); if (p == NULL) return (NULL); - bcopy(t + 1, p + 1, t->m_tag_len); /* Copy the data */ +#ifdef MAC + /* + * XXXMAC: we should probably pass off the initialization, and + * copying here? can we hide that PACKET_TAG_MACLABEL is + * special from the mbuf code? + */ + if (t->m_tag_id == PACKET_TAG_MACLABEL) { + if (mac_init_mbuf_tag(p, how) != 0) { + m_tag_free(p); + return (NULL); + } + mac_copy_mbuf_tag(t, p); + } else +#endif + bcopy(t + 1, p + 1, t->m_tag_len); /* Copy the data */ return p; } ==== //depot/projects/trustedbsd/mac/sys/net/if_loop.c#19 (text+ko) ==== @@ -214,14 +214,6 @@ if (!n) goto contiguousfail; M_MOVE_PKTHDR(n, m); -#ifdef MAC - /* - * XXXMAC: Once we put labels in tags and proper - * primitives are used for relocating mbuf header - * data, this will no longer be required. - */ - m->m_pkthdr.label.l_flags &= ~MAC_FLAG_INITIALIZED; -#endif MCLGET(n, M_DONTWAIT); if (! (n->m_flags & M_EXT)) { m_freem(n); ==== //depot/projects/trustedbsd/mac/sys/netinet/ip_input.c#29 (text+ko) ==== @@ -1798,13 +1798,10 @@ mcopy->m_len = imin((ip->ip_hl << 2) + 8, (int)ip->ip_len); m_copydata(m, 0, mcopy->m_len, mtod(mcopy, caddr_t)); -#ifdef MAC /* - * XXXMAC: This will eventually become an explicit - * labeling point. + * XXXMAC: Eventually, we may have an explicit labeling + * point here. */ - mac_create_mbuf_from_mbuf(m, mcopy); -#endif } #ifdef IPSTEALTH ==== //depot/projects/trustedbsd/mac/sys/security/mac_biba/mac_biba.c#203 (text+ko) ==== @@ -2770,4 +2770,4 @@ }; MAC_POLICY_SET(&mac_biba_ops, mac_biba, "TrustedBSD MAC/Biba", - MPC_LOADTIME_FLAG_NOTLATE, &mac_biba_slot); + MPC_LOADTIME_FLAG_NOTLATE | MPC_LOADTIME_FLAG_LABELMBUFS, &mac_biba_slot); ==== //depot/projects/trustedbsd/mac/sys/security/mac_lomac/mac_lomac.c#57 (text+ko) ==== @@ -2767,4 +2767,5 @@ }; MAC_POLICY_SET(&mac_lomac_ops, mac_lomac, "TrustedBSD MAC/LOMAC", - MPC_LOADTIME_FLAG_NOTLATE, &mac_lomac_slot); + MPC_LOADTIME_FLAG_NOTLATE | MPC_LOADTIME_FLAG_LABELMBUFS, + &mac_lomac_slot); ==== //depot/projects/trustedbsd/mac/sys/security/mac_mls/mac_mls.c#162 (text+ko) ==== @@ -2536,4 +2536,4 @@ }; MAC_POLICY_SET(&mac_mls_ops, mac_mls, "TrustedBSD MAC/MLS", - MPC_LOADTIME_FLAG_NOTLATE, &mac_mls_slot); + MPC_LOADTIME_FLAG_NOTLATE | MPC_LOADTIME_FLAG_LABELMBUFS, &mac_mls_slot); ==== //depot/projects/trustedbsd/mac/sys/security/mac_test/mac_test.c#98 (text+ko) ==== @@ -392,6 +392,14 @@ mac_test_destroy_mbuf_label(struct label *label) { + /* + * If we're loaded dynamically, there may be mbufs in flight that + * didn't have label storage allocated for them. Handle this + * gracefully. + */ + if (label == NULL) + return; + if (SLOT(label) == MBUFMAGIC || SLOT(label) == 0) { atomic_add_int(&destroy_count_mbuf, 1); SLOT(label) = EXMAGIC; @@ -1515,4 +1523,4 @@ }; MAC_POLICY_SET(&mac_test_ops, mac_test, "TrustedBSD MAC/Test", - MPC_LOADTIME_FLAG_UNLOADOK, &test_slot); + MPC_LOADTIME_FLAG_UNLOADOK | MPC_LOADTIME_FLAG_LABELMBUFS, &test_slot); ==== //depot/projects/trustedbsd/mac/sys/sys/mac.h#233 (text+ko) ==== @@ -109,6 +109,7 @@ struct ifreq; struct image_params; struct ipq; +struct m_tag; struct mbuf; struct mount; struct proc; @@ -136,11 +137,13 @@ int mac_init_ipq(struct ipq *, int flag); int mac_init_socket(struct socket *, int flag); void mac_init_pipe(struct pipe *); -int mac_init_mbuf(struct mbuf *m, int flag); +int mac_init_mbuf(struct mbuf *mbuf, int flag); +int mac_init_mbuf_tag(struct m_tag *, int flag); void mac_init_mount(struct mount *); void mac_init_proc(struct proc *); void mac_init_vnode(struct vnode *); void mac_init_vnode_label(struct label *); +void mac_copy_mbuf_tag(struct m_tag *, struct m_tag *); void mac_copy_vnode_label(struct label *, struct label *label); void mac_destroy_bpfdesc(struct bpf_d *); void mac_destroy_cred(struct ucred *); @@ -150,7 +153,7 @@ void mac_destroy_socket(struct socket *); void mac_destroy_pipe(struct pipe *); void mac_destroy_proc(struct proc *); -void mac_destroy_mbuf(struct mbuf *); +void mac_destroy_mbuf_tag(struct m_tag *); void mac_destroy_mount(struct mount *); void mac_destroy_vnode(struct vnode *); void mac_destroy_vnode_label(struct label *); ==== //depot/projects/trustedbsd/mac/sys/sys/mac_policy.h#185 (text+ko) ==== @@ -95,6 +95,8 @@ void (*mpo_destroy_pipe_label)(struct label *label); void (*mpo_destroy_proc_label)(struct label *label); void (*mpo_destroy_vnode_label)(struct label *label); + void (*mpo_copy_mbuf_label)(struct label *src, + struct label *dest); void (*mpo_copy_pipe_label)(struct label *src, struct label *dest); void (*mpo_copy_vnode_label)(struct label *src, @@ -434,6 +436,7 @@ /* Flags for the mpc_loadtime_flags field. */ #define MPC_LOADTIME_FLAG_NOTLATE 0x00000001 #define MPC_LOADTIME_FLAG_UNLOADOK 0x00000002 +#define MPC_LOADTIME_FLAG_LABELMBUFS 0x00000004 /* Flags for the mpc_runtime_flags field. */ #define MPC_RUNTIME_FLAG_REGISTERED 0x00000001 ==== //depot/projects/trustedbsd/mac/sys/sys/mbuf.h#27 (text+ko) ==== @@ -37,7 +37,6 @@ #ifndef _SYS_MBUF_H_ #define _SYS_MBUF_H_ -#include #include /* @@ -98,7 +97,6 @@ int csum_flags; /* flags regarding checksum */ int csum_data; /* data field used by csum routines */ SLIST_HEAD(packet_tags, m_tag) tags; /* list of packet tags */ - struct label label; /* MAC label of data in packet */ }; /* @@ -527,6 +525,7 @@ #define PACKET_TAG_IPFW 16 /* ipfw classification */ #define PACKET_TAG_DIVERT 17 /* divert info */ #define PACKET_TAG_IPFORWARD 18 /* ipforward info */ +#define PACKET_TAG_MACLABEL 19 /* MAC label */ /* Packet tag routines */ struct m_tag *m_tag_alloc(u_int32_t, int, int, int); From owner-p4-projects@FreeBSD.ORG Thu Apr 10 11:30:33 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 3351A37B404; Thu, 10 Apr 2003 11:30:33 -0700 (PDT) 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 C5BE337B401 for ; Thu, 10 Apr 2003 11:30:32 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6F2F243F93 for ; Thu, 10 Apr 2003 11:30:32 -0700 (PDT) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h3AIUW0U001364 for ; Thu, 10 Apr 2003 11:30:32 -0700 (PDT) (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h3AIUVD0001358 for perforce@freebsd.org; Thu, 10 Apr 2003 11:30:31 -0700 (PDT) Date: Thu, 10 Apr 2003 11:30:31 -0700 (PDT) Message-Id: <200304101830.h3AIUVD0001358@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jhb@freebsd.org using -f From: John Baldwin To: Perforce Change Reviews Subject: PERFORCE change 28719 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, 10 Apr 2003 18:30:34 -0000 http://perforce.freebsd.org/chv.cgi?CH=28719 Change 28719 by jhb@jhb_laptop on 2003/04/10 11:30:00 pmap_page_is_free() doesn't do anything on alpha anymore and is an alpha-only function, so kill it entirely. Affected files ... .. //depot/projects/smpng/sys/alpha/alpha/pmap.c#43 edit .. //depot/projects/smpng/sys/vm/pmap.h#16 edit .. //depot/projects/smpng/sys/vm/vm_page.c#33 edit Differences ... ==== //depot/projects/smpng/sys/alpha/alpha/pmap.c#43 (text+ko) ==== @@ -2901,20 +2901,6 @@ } /* - * pmap_page_is_free: - * - * Called when a page is freed to allow pmap to clean up - * any extra state associated with the page. In this case - * clear modified/referenced bits. - */ -void -pmap_page_is_free(vm_page_t m) -{ - - /* XXX: Do we have any PV entries left to set FO[ERW] on? */ -} - -/* * pmap_clear_reference: * * Clear the reference bit on the specified physical page. ==== //depot/projects/smpng/sys/vm/pmap.h#16 (text+ko) ==== @@ -96,9 +96,6 @@ extern int pmap_pagedaemon_waken; -#ifdef __alpha__ -void pmap_page_is_free(vm_page_t m); -#endif void pmap_change_wiring(pmap_t, vm_offset_t, boolean_t); void pmap_clear_modify(vm_page_t m); void pmap_clear_reference(vm_page_t m); ==== //depot/projects/smpng/sys/vm/vm_page.c#33 (text+ko) ==== @@ -1098,10 +1098,6 @@ */ if (m->flags & PG_UNMANAGED) { m->flags &= ~PG_UNMANAGED; - } else { -#ifdef __alpha__ - pmap_page_is_free(m); -#endif } if (m->hold_count != 0) { From owner-p4-projects@FreeBSD.ORG Thu Apr 10 11:44:52 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id D353D37B404; Thu, 10 Apr 2003 11:44:51 -0700 (PDT) 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 6CDFA37B401 for ; Thu, 10 Apr 2003 11:44:51 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 046D643FA3 for ; Thu, 10 Apr 2003 11:44:51 -0700 (PDT) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h3AIio0U002651 for ; Thu, 10 Apr 2003 11:44:50 -0700 (PDT) (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h3AIioEx002648 for perforce@freebsd.org; Thu, 10 Apr 2003 11:44:50 -0700 (PDT) Date: Thu, 10 Apr 2003 11:44:50 -0700 (PDT) Message-Id: <200304101844.h3AIioEx002648@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jhb@freebsd.org using -f From: John Baldwin To: Perforce Change Reviews Subject: PERFORCE change 28721 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, 10 Apr 2003 18:44:52 -0000 http://perforce.freebsd.org/chv.cgi?CH=28721 Change 28721 by jhb@jhb_laptop on 2003/04/10 11:44:16 Add an eerie assertion that if it proves true will justify the removal of sched_lock around the TDF_DEADLKTREAT flag. Affected files ... .. //depot/projects/smpng/sys/kern/kern_lock.c#24 edit Differences ... ==== //depot/projects/smpng/sys/kern/kern_lock.c#24 (text+ko) ==== @@ -229,8 +229,10 @@ error = 0; if (td == NULL) thr = LK_KERNPROC; - else + else { + MPASS(td == curthread); thr = td; + } if ((flags & LK_INTERNAL) == 0) mtx_lock(lkp->lk_interlock); From owner-p4-projects@FreeBSD.ORG Thu Apr 10 14:05:53 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 5AF5037B404; Thu, 10 Apr 2003 14:05:53 -0700 (PDT) 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 0E7AA37B401 for ; Thu, 10 Apr 2003 14:05:53 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id AA07443FAF for ; Thu, 10 Apr 2003 14:05:52 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h3AL5q0U021748 for ; Thu, 10 Apr 2003 14:05:52 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h3AL5qIq021745 for perforce@freebsd.org; Thu, 10 Apr 2003 14:05:52 -0700 (PDT) Date: Thu, 10 Apr 2003 14:05:52 -0700 (PDT) Message-Id: <200304102105.h3AL5qIq021745@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28737 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, 10 Apr 2003 21:05:54 -0000 http://perforce.freebsd.org/chv.cgi?CH=28737 Change 28737 by peter@peter_daintree on 2003/04/10 14:05:24 update common_tss.tss.tss_rsp0 on context switch so that we arrive on the correct stack when entering the kernel from userland. Affected files ... .. //depot/projects/hammer/sys/x86_64/include/tss.h#7 edit .. //depot/projects/hammer/sys/x86_64/x86_64/genassym.c#16 edit .. //depot/projects/hammer/sys/x86_64/x86_64/swtch.s#17 edit Differences ... ==== //depot/projects/hammer/sys/x86_64/include/tss.h#7 (text+ko) ==== @@ -70,4 +70,16 @@ }; #pragma pack() +#ifdef _KERNEL +/* + * Nasty hack to arrange internal alignment. + * What were they thinking?? + */ +struct aligned_tss { + u_int32_t pad; + struct x86_64tss tss __packed; +}; +extern struct aligned_tss common_tss; +#endif + #endif /* _MACHINE_TSS_H_ */ ==== //depot/projects/hammer/sys/x86_64/x86_64/genassym.c#16 (text+ko) ==== @@ -133,6 +133,8 @@ ASSYM(PCB_SIZE, sizeof(struct pcb)); +ASSYM(COMMON_TSS_RSP0, offsetof(struct aligned_tss, tss.tss_rsp0)); + ASSYM(TF_TRAPNO, offsetof(struct trapframe, tf_trapno)); ASSYM(TF_ERR, offsetof(struct trapframe, tf_err)); ASSYM(TF_CS, offsetof(struct trapframe, tf_cs)); ==== //depot/projects/hammer/sys/x86_64/x86_64/swtch.s#17 (text+ko) ==== @@ -147,6 +147,11 @@ * to load up the rest of the next context. */ movq TD_PCB(%rsi),%rdx + + /* Update the TSS_RSP0 pointer for the next interrupt */ + leaq -16(%rdx), %rbx + movq %rbx, common_tss + COMMON_TSS_RSP0 + /* Restore context. */ movq PCB_RBX(%rdx),%rbx movq PCB_RSP(%rdx),%rsp From owner-p4-projects@FreeBSD.ORG Thu Apr 10 14:07:57 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 93EF637B404; Thu, 10 Apr 2003 14:07:56 -0700 (PDT) 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 2DE2937B401 for ; Thu, 10 Apr 2003 14:07:56 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id CD3CA43F85 for ; Thu, 10 Apr 2003 14:07:55 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h3AL7t0U021802 for ; Thu, 10 Apr 2003 14:07:55 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h3AL7ttG021799 for perforce@freebsd.org; Thu, 10 Apr 2003 14:07:55 -0700 (PDT) Date: Thu, 10 Apr 2003 14:07:55 -0700 (PDT) Message-Id: <200304102107.h3AL7ttG021799@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28738 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, 10 Apr 2003 21:07:57 -0000 http://perforce.freebsd.org/chv.cgi?CH=28738 Change 28738 by peter@peter_daintree on 2003/04/10 14:07:23 Update for aligned_tss changes. (moved declaration back to tss.h so that genassym and swtch.s can see it). Dont truncate any %cr0 upper bits in cpu_setregs() (not that any exist) Affected files ... .. //depot/projects/hammer/sys/x86_64/x86_64/machdep.c#63 edit Differences ... ==== //depot/projects/hammer/sys/x86_64/x86_64/machdep.c#63 (text+ko) ==== @@ -507,7 +507,7 @@ void cpu_setregs(void) { - unsigned int cr0; + register_t cr0; cr0 = rcr0(); cr0 |= CR0_NE; /* Done by npxinit() */ @@ -553,15 +553,7 @@ static char dblfault_stack[PAGE_SIZE]; -/* - * Nasty hack to arrange internal longword alignment. - * What were they thinking?? - */ -static struct { - u_int32_t pad; - struct x86_64tss tss __packed; -} common_tss; - +struct aligned_tss common_tss; /* software prototypes -- in more palatable form */ struct soft_segment_descriptor gdt_segs[] = { From owner-p4-projects@FreeBSD.ORG Thu Apr 10 23:33:31 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 7DA5F37B404; Thu, 10 Apr 2003 23:33:30 -0700 (PDT) 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 1B6ED37B401 for ; Thu, 10 Apr 2003 23:33:30 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id BCC8843FA3 for ; Thu, 10 Apr 2003 23:33:29 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h3B6XT0U085793 for ; Thu, 10 Apr 2003 23:33:29 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h3B6XTJw085790 for perforce@freebsd.org; Thu, 10 Apr 2003 23:33:29 -0700 (PDT) Date: Thu, 10 Apr 2003 23:33:29 -0700 (PDT) Message-Id: <200304110633.h3B6XTJw085790@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28754 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, 11 Apr 2003 06:33:31 -0000 http://perforce.freebsd.org/chv.cgi?CH=28754 Change 28754 by peter@peter_daintree on 2003/04/10 23:32:49 OK, I have to laugh about this one. keep gcc-3.3 happy where long > int (speed_t is unsigned int) Affected files ... .. //depot/projects/hammer/sys/dev/sio/sio.c#9 edit Differences ... ==== //depot/projects/hammer/sys/dev/sio/sio.c#9 (text+ko) ==== @@ -1542,8 +1542,12 @@ u_int divisor; int error; - if (speed == 0 || speed > (ULONG_MAX - 1) / 8) + if (speed == 0) + return (0); +#if UINT_MAX > (ULONG_MAX - 1) / 8 + if (speed > (ULONG_MAX - 1) / 8) return (0); +#endif divisor = (rclk / (8UL * speed) + 1) / 2; if (divisor == 0 || divisor >= 65536) return (0); From owner-p4-projects@FreeBSD.ORG Fri Apr 11 11:42:51 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id D9AA637B401; Fri, 11 Apr 2003 11:42:50 -0700 (PDT) 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 6A71B37B405 for ; Fri, 11 Apr 2003 11:42:50 -0700 (PDT) Received: from mail.speakeasy.net (mail16.speakeasy.net [216.254.0.216]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5F65C43F93 for ; Fri, 11 Apr 2003 11:42:49 -0700 (PDT) (envelope-from jhb@FreeBSD.org) Received: (qmail 18295 invoked from network); 11 Apr 2003 18:42:55 -0000 Received: from unknown (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender )encrypted SMTP for ; 11 Apr 2003 18:42:55 -0000 Received: from laptop.baldwin.cx (gw1.twc.weather.com [216.133.140.1]) by server.baldwin.cx (8.12.8/8.12.8) with ESMTP id h3BIglOv056078; Fri, 11 Apr 2003 14:42:47 -0400 (EDT) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.5.4 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <200304110633.h3B6XTJw085790@repoman.freebsd.org> Date: Fri, 11 Apr 2003 14:42:47 -0400 (EDT) From: John Baldwin To: Peter Wemm cc: Perforce Change Reviews Subject: RE: PERFORCE change 28754 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, 11 Apr 2003 18:42:51 -0000 On 11-Apr-2003 Peter Wemm wrote: > http://perforce.freebsd.org/chv.cgi?CH=28754 > > Change 28754 by peter@peter_daintree on 2003/04/10 23:32:49 > > OK, I have to laugh about this one. > keep gcc-3.3 happy where long > int (speed_t is > unsigned int) Why not use UINTMAX? if speed_t is an int? Or perhaps speed_t should be a long instead? > Affected files ... > > .. //depot/projects/hammer/sys/dev/sio/sio.c#9 edit > > Differences ... > > ==== //depot/projects/hammer/sys/dev/sio/sio.c#9 (text+ko) ==== > > @@ -1542,8 +1542,12 @@ > u_int divisor; > int error; > > - if (speed == 0 || speed > (ULONG_MAX - 1) / 8) > + if (speed == 0) > + return (0); > +#if UINT_MAX > (ULONG_MAX - 1) / 8 > + if (speed > (ULONG_MAX - 1) / 8) > return (0); > +#endif > divisor = (rclk / (8UL * speed) + 1) / 2; > if (divisor == 0 || divisor >= 65536) > return (0); -- 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 Apr 11 13:55:47 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 473CC37B404; Fri, 11 Apr 2003 13:55:47 -0700 (PDT) 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 D5CF337B401 for ; Fri, 11 Apr 2003 13:55:46 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 839FC43F3F for ; Fri, 11 Apr 2003 13:55:46 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h3BKtk0U086884 for ; Fri, 11 Apr 2003 13:55:46 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h3BKtkwN086881 for perforce@freebsd.org; Fri, 11 Apr 2003 13:55:46 -0700 (PDT) Date: Fri, 11 Apr 2003 13:55:46 -0700 (PDT) Message-Id: <200304112055.h3BKtkwN086881@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28771 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, 11 Apr 2003 20:55:48 -0000 http://perforce.freebsd.org/chv.cgi?CH=28771 Change 28771 by peter@peter_daintree on 2003/04/11 13:55:11 I think I'm going to cry. Affected files ... .. //depot/projects/hammer/sys/x86_64/x86_64/support.s#18 edit Differences ... ==== //depot/projects/hammer/sys/x86_64/x86_64/support.s#18 (text+ko) ==== @@ -372,11 +372,11 @@ * return the actual length in *lencopied. */ ENTRY(copyinstr) - movq PCPU(CURPCB),%rcx - movq $cpystrflt,PCB_ONFAULT(%rcx) movq %rdx, %r8 /* %r8 = maxlen */ movq %rcx, %r9 /* %r9 = *len */ xchgq %rdi, %rsi /* %rdi = from, %rsi = to */ + movq PCPU(CURPCB),%rcx + movq $cpystrflt,PCB_ONFAULT(%rcx) movq $VM_MAXUSER_ADDRESS,%rax From owner-p4-projects@FreeBSD.ORG Fri Apr 11 16:38:07 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id BD78937B404; Fri, 11 Apr 2003 16:38:06 -0700 (PDT) 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 6B1E337B401 for ; Fri, 11 Apr 2003 16:38:06 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 023DB43F3F for ; Fri, 11 Apr 2003 16:38:06 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h3BNc50U001800 for ; Fri, 11 Apr 2003 16:38:05 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h3BNc5Ot001797 for perforce@freebsd.org; Fri, 11 Apr 2003 16:38:05 -0700 (PDT) Date: Fri, 11 Apr 2003 16:38:05 -0700 (PDT) Message-Id: <200304112338.h3BNc5Ot001797@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28777 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, 11 Apr 2003 23:38:07 -0000 http://perforce.freebsd.org/chv.cgi?CH=28777 Change 28777 by peter@peter_overcee on 2003/04/11 16:37:10 I really should have stolen some known working bcopy code (or at least tested it). This is highly embarresing. *blush* Affected files ... .. //depot/projects/hammer/sys/x86_64/x86_64/machdep.c#64 edit Differences ... ==== //depot/projects/hammer/sys/x86_64/x86_64/machdep.c#64 (text+ko) ==== @@ -1643,7 +1643,7 @@ csrc = (const char *)src; cdest = (char *)dest; - if (src > dest) { + if (src < dest) { for (i = len - 1; i != (size_t)-1; i--) cdest[i] = csrc[i]; } else { From owner-p4-projects@FreeBSD.ORG Fri Apr 11 19:06:08 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 4541937B407; Fri, 11 Apr 2003 19:06:07 -0700 (PDT) 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 E9E1137B407 for ; Fri, 11 Apr 2003 19:06:06 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9415143FA3 for ; Fri, 11 Apr 2003 19:06:06 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h3C2660U020846 for ; Fri, 11 Apr 2003 19:06:06 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h3C265cY020842 for perforce@freebsd.org; Fri, 11 Apr 2003 19:06:05 -0700 (PDT) Date: Fri, 11 Apr 2003 19:06:05 -0700 (PDT) Message-Id: <200304120206.h3C265cY020842@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28781 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, 12 Apr 2003 02:06:08 -0000 http://perforce.freebsd.org/chv.cgi?CH=28781 Change 28781 by peter@peter_daintree on 2003/04/11 19:05:42 -Wno-signed-compare is now our friend for gcc-3.3 Affected files ... .. //depot/projects/hammer/sys/conf/Makefile.x86_64#9 edit Differences ... ==== //depot/projects/hammer/sys/conf/Makefile.x86_64#9 (text+ko) ==== @@ -20,7 +20,7 @@ # The FSF cross tools don't understand -fformat-extensions CWARNFLAGS= -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes \ -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual \ - -ffreestanding -Wno-format + -ffreestanding -Wno-format -Wno-sign-compare CC= x86_64-unknown-freebsd5.0-gcc LD= x86_64-unknown-freebsd5.0-ld NM= x86_64-unknown-freebsd5.0-nm From owner-p4-projects@FreeBSD.ORG Fri Apr 11 22:28:18 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 85D4D37B404; Fri, 11 Apr 2003 22:28:17 -0700 (PDT) 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 38CD737B401 for ; Fri, 11 Apr 2003 22:28:17 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id EB9B543FB1 for ; Fri, 11 Apr 2003 22:28:15 -0700 (PDT) (envelope-from marcel@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h3C5SF0U043089 for ; Fri, 11 Apr 2003 22:28:15 -0700 (PDT) (envelope-from marcel@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h3C5SEj0043085 for perforce@freebsd.org; Fri, 11 Apr 2003 22:28:14 -0700 (PDT) Date: Fri, 11 Apr 2003 22:28:14 -0700 (PDT) Message-Id: <200304120528.h3C5SEj0043085@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 28787 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, 12 Apr 2003 05:28:18 -0000 http://perforce.freebsd.org/chv.cgi?CH=28787 Change 28787 by marcel@marcel_pluto1 on 2003/04/11 22:27:28 IFC @28784 Affected files ... .. //depot/projects/ia64/Makefile.inc1#54 integrate .. //depot/projects/ia64/bin/echo/echo.1#2 integrate .. //depot/projects/ia64/bin/pwd/pwd.1#6 integrate .. //depot/projects/ia64/bin/sh/sh.1#20 integrate .. //depot/projects/ia64/contrib/gdtoa/gdtoaimp.h#4 integrate .. //depot/projects/ia64/etc/defaults/pccard.conf#20 integrate .. //depot/projects/ia64/gnu/usr.bin/binutils/addr2line/Makefile#4 integrate .. //depot/projects/ia64/gnu/usr.bin/binutils/ar/Makefile#3 integrate .. //depot/projects/ia64/gnu/usr.bin/binutils/as/Makefile.inc0#8 integrate .. //depot/projects/ia64/gnu/usr.bin/binutils/ld/Makefile#7 integrate .. //depot/projects/ia64/gnu/usr.bin/binutils/nm/Makefile#5 integrate .. //depot/projects/ia64/gnu/usr.bin/binutils/objcopy/Makefile#4 integrate .. //depot/projects/ia64/gnu/usr.bin/binutils/objdump/Makefile#5 integrate .. //depot/projects/ia64/gnu/usr.bin/binutils/ranlib/Makefile#3 integrate .. //depot/projects/ia64/gnu/usr.bin/binutils/readelf/Makefile#4 integrate .. //depot/projects/ia64/gnu/usr.bin/binutils/size/Makefile#4 integrate .. //depot/projects/ia64/gnu/usr.bin/binutils/strings/Makefile#4 integrate .. //depot/projects/ia64/gnu/usr.bin/binutils/strip/Makefile#5 integrate .. //depot/projects/ia64/lib/libc/gdtoa/machdep_ldisQ.c#2 integrate .. //depot/projects/ia64/lib/libc/gdtoa/machdep_ldisx.c#2 integrate .. //depot/projects/ia64/lib/libc/gen/getbootfile.c#3 integrate .. //depot/projects/ia64/lib/libc/locale/wcrtomb.c#4 integrate .. //depot/projects/ia64/lib/libc/sys/Makefile.inc#12 integrate .. //depot/projects/ia64/lib/libc/sys/jail.2#4 integrate .. //depot/projects/ia64/lib/libdevstat/devstat.c#5 integrate .. //depot/projects/ia64/lib/libkvm/kvm_proc.c#16 integrate .. //depot/projects/ia64/lib/libusbhid/Makefile#3 integrate .. //depot/projects/ia64/lib/libusbhid/data.c#2 integrate .. //depot/projects/ia64/lib/libusbhid/descr.c#2 integrate .. //depot/projects/ia64/lib/libusbhid/libusbhid.h#3 delete .. //depot/projects/ia64/lib/libusbhid/parse.c#3 integrate .. //depot/projects/ia64/lib/libusbhid/usage.c#3 integrate .. //depot/projects/ia64/lib/libusbhid/usbhid.3#3 integrate .. //depot/projects/ia64/lib/libusbhid/usbhid.h#2 integrate .. //depot/projects/ia64/lib/libutil/pw_util.c#7 integrate .. //depot/projects/ia64/libexec/rtld-elf/libmap.c#2 integrate .. //depot/projects/ia64/release/doc/en_US.ISO8859-1/hardware/common/dev.sgml#40 integrate .. //depot/projects/ia64/release/doc/en_US.ISO8859-1/relnotes/common/new.sgml#77 integrate .. //depot/projects/ia64/sbin/mdconfig/mdconfig.c#10 integrate .. //depot/projects/ia64/share/examples/ppp/ppp.conf.isdn#3 integrate .. //depot/projects/ia64/share/examples/ppp/ppp.conf.sample#5 integrate .. //depot/projects/ia64/share/examples/ppp/ppp.conf.span-isp#2 integrate .. //depot/projects/ia64/share/examples/ppp/ppp.conf.span-isp.working#3 integrate .. //depot/projects/ia64/share/man/man4/man4.i386/Makefile#8 integrate .. //depot/projects/ia64/share/man/man4/man4.i386/pae.4#1 branch .. //depot/projects/ia64/share/man/man4/wi.4#19 integrate .. //depot/projects/ia64/share/man/man9/malloc.9#9 integrate .. //depot/projects/ia64/share/mk/bsd.cpu.mk#12 integrate .. //depot/projects/ia64/sys/alpha/alpha/busdma_machdep.c#13 integrate .. //depot/projects/ia64/sys/alpha/alpha/pmap.c#28 integrate .. //depot/projects/ia64/sys/alpha/include/bus.h#8 integrate .. //depot/projects/ia64/sys/alpha/include/pmap.h#9 integrate .. //depot/projects/ia64/sys/alpha/isa/isa.c#3 integrate .. //depot/projects/ia64/sys/conf/NOTES#46 integrate .. //depot/projects/ia64/sys/conf/options.i386#15 integrate .. //depot/projects/ia64/sys/ddb/db_ps.c#16 integrate .. //depot/projects/ia64/sys/dev/acpica/acpi.c#30 integrate .. //depot/projects/ia64/sys/dev/advansys/advansys.c#4 integrate .. //depot/projects/ia64/sys/dev/advansys/adwcam.c#4 integrate .. //depot/projects/ia64/sys/dev/aha/aha.c#7 integrate .. //depot/projects/ia64/sys/dev/ahb/ahb.c#5 integrate .. //depot/projects/ia64/sys/dev/aic/aic_pccard.c#5 integrate .. //depot/projects/ia64/sys/dev/aic7xxx/aic79xx_osm.c#8 integrate .. //depot/projects/ia64/sys/dev/aic7xxx/aic7xxx_osm.c#8 integrate .. //depot/projects/ia64/sys/dev/amd/amd.c#2 integrate .. //depot/projects/ia64/sys/dev/an/if_an.c#21 integrate .. //depot/projects/ia64/sys/dev/an/if_an_isa.c#6 integrate .. //depot/projects/ia64/sys/dev/an/if_an_pccard.c#7 integrate .. //depot/projects/ia64/sys/dev/an/if_an_pci.c#8 integrate .. //depot/projects/ia64/sys/dev/ata/ata-chipset.c#9 integrate .. //depot/projects/ia64/sys/dev/ata/ata-pci.h#6 integrate .. //depot/projects/ia64/sys/dev/awi/if_awi_pccard.c#6 integrate .. //depot/projects/ia64/sys/dev/buslogic/bt.c#7 integrate .. //depot/projects/ia64/sys/dev/cs/if_cs_pccard.c#4 integrate .. //depot/projects/ia64/sys/dev/dpt/dpt_scsi.c#7 integrate .. //depot/projects/ia64/sys/dev/ed/if_ed_pccard.c#12 integrate .. //depot/projects/ia64/sys/dev/ep/if_ep_pccard.c#7 integrate .. //depot/projects/ia64/sys/dev/fe/if_fe_pccard.c#5 integrate .. //depot/projects/ia64/sys/dev/fxp/if_fxp.c#25 integrate .. //depot/projects/ia64/sys/dev/ida/ida.c#9 integrate .. //depot/projects/ia64/sys/dev/iir/iir.c#5 integrate .. //depot/projects/ia64/sys/dev/md/md.c#26 integrate .. //depot/projects/ia64/sys/dev/mpt/mpt_freebsd.c#6 integrate .. //depot/projects/ia64/sys/dev/ncv/ncr53c500_pccard.c#8 integrate .. //depot/projects/ia64/sys/dev/pccard/pccard.c#19 integrate .. //depot/projects/ia64/sys/dev/pccard/pccarddevs#22 integrate .. //depot/projects/ia64/sys/dev/pccard/pccarddevs.h#22 integrate .. //depot/projects/ia64/sys/dev/pccard/pccardvar.h#9 integrate .. //depot/projects/ia64/sys/dev/sn/if_sn_pccard.c#6 integrate .. //depot/projects/ia64/sys/dev/stg/tmc18c30_pccard.c#8 integrate .. //depot/projects/ia64/sys/dev/sym/sym_hipd.c#10 integrate .. //depot/projects/ia64/sys/dev/trm/trm.c#6 integrate .. //depot/projects/ia64/sys/dev/usb/uhid.c#10 integrate .. //depot/projects/ia64/sys/dev/usb/usb_quirks.c#6 integrate .. //depot/projects/ia64/sys/dev/usb/usbdevs#31 integrate .. //depot/projects/ia64/sys/dev/usb/usbdevs.h#30 integrate .. //depot/projects/ia64/sys/dev/usb/usbdevs_data.h#30 integrate .. //depot/projects/ia64/sys/dev/wi/if_wi.c#36 integrate .. //depot/projects/ia64/sys/dev/wi/if_wi_pccard.c#17 integrate .. //depot/projects/ia64/sys/dev/xe/if_xe_pccard.c#7 integrate .. //depot/projects/ia64/sys/fs/msdosfs/msdosfs_denode.c#11 integrate .. //depot/projects/ia64/sys/geom/geom_apple.c#4 integrate .. //depot/projects/ia64/sys/geom/geom_mbr.c#25 integrate .. //depot/projects/ia64/sys/geom/geom_pc98.c#19 integrate .. //depot/projects/ia64/sys/geom/geom_sunlabel.c#16 integrate .. //depot/projects/ia64/sys/i386/conf/NOTES#37 integrate .. //depot/projects/ia64/sys/i386/conf/PAE#2 integrate .. //depot/projects/ia64/sys/i386/i386/busdma_machdep.c#15 integrate .. //depot/projects/ia64/sys/i386/i386/genassym.c#14 integrate .. //depot/projects/ia64/sys/i386/i386/identcpu.c#18 integrate .. //depot/projects/ia64/sys/i386/i386/sys_machdep.c#13 integrate .. //depot/projects/ia64/sys/i386/i386/tsc.c#4 integrate .. //depot/projects/ia64/sys/i386/i386/vm_machdep.c#22 integrate .. //depot/projects/ia64/sys/i386/include/bus_dma.h#4 integrate .. //depot/projects/ia64/sys/ia64/ia32/syscalls.master#15 integrate .. //depot/projects/ia64/sys/ia64/ia64/busdma_machdep.c#12 integrate .. //depot/projects/ia64/sys/ia64/include/bus.h#9 integrate .. //depot/projects/ia64/sys/kern/init_main.c#29 integrate .. //depot/projects/ia64/sys/kern/init_sysent.c#26 integrate .. //depot/projects/ia64/sys/kern/kern_clock.c#19 integrate .. //depot/projects/ia64/sys/kern/kern_event.c#16 integrate .. //depot/projects/ia64/sys/kern/kern_exit.c#39 integrate .. //depot/projects/ia64/sys/kern/kern_fork.c#33 integrate .. //depot/projects/ia64/sys/kern/kern_jail.c#14 integrate .. //depot/projects/ia64/sys/kern/kern_mutex.c#23 integrate .. //depot/projects/ia64/sys/kern/kern_proc.c#35 integrate .. //depot/projects/ia64/sys/kern/kern_resource.c#21 integrate .. //depot/projects/ia64/sys/kern/kern_sig.c#42 integrate .. //depot/projects/ia64/sys/kern/kern_thr.c#3 integrate .. //depot/projects/ia64/sys/kern/kern_thread.c#36 integrate .. //depot/projects/ia64/sys/kern/sched_4bsd.c#9 integrate .. //depot/projects/ia64/sys/kern/sched_ule.c#10 integrate .. //depot/projects/ia64/sys/kern/subr_smp.c#13 integrate .. //depot/projects/ia64/sys/kern/subr_witness.c#33 integrate .. //depot/projects/ia64/sys/kern/syscalls.c#27 integrate .. //depot/projects/ia64/sys/kern/syscalls.master#28 integrate .. //depot/projects/ia64/sys/kern/uipc_cow.c#10 integrate .. //depot/projects/ia64/sys/kern/vfs_syscalls.c#39 integrate .. //depot/projects/ia64/sys/netinet/tcp_subr.c#30 integrate .. //depot/projects/ia64/sys/pci/if_vr.c#17 integrate .. //depot/projects/ia64/sys/pci/if_xl.c#28 integrate .. //depot/projects/ia64/sys/powerpc/include/bus.h#8 integrate .. //depot/projects/ia64/sys/powerpc/powerpc/busdma_machdep.c#11 integrate .. //depot/projects/ia64/sys/sparc64/include/bus.h#12 integrate .. //depot/projects/ia64/sys/sparc64/include/iommuvar.h#9 integrate .. //depot/projects/ia64/sys/sparc64/pci/psycho.c#20 integrate .. //depot/projects/ia64/sys/sparc64/sbus/sbus.c#10 integrate .. //depot/projects/ia64/sys/sparc64/sparc64/bus_machdep.c#15 integrate .. //depot/projects/ia64/sys/sparc64/sparc64/iommu.c#14 integrate .. //depot/projects/ia64/sys/sparc64/sparc64/machdep.c#34 integrate .. //depot/projects/ia64/sys/sys/jail.h#6 integrate .. //depot/projects/ia64/sys/sys/mbuf.h#20 integrate .. //depot/projects/ia64/sys/sys/mdioctl.h#5 integrate .. //depot/projects/ia64/sys/sys/param.h#30 integrate .. //depot/projects/ia64/sys/sys/proc.h#54 integrate .. //depot/projects/ia64/sys/sys/sched.h#3 integrate .. //depot/projects/ia64/sys/sys/syscall.h#26 integrate .. //depot/projects/ia64/sys/sys/syscall.mk#26 integrate .. //depot/projects/ia64/sys/sys/sysproto.h#29 integrate .. //depot/projects/ia64/sys/sys/timetc.h#9 integrate .. //depot/projects/ia64/sys/sys/vnode.h#28 integrate .. //depot/projects/ia64/sys/ufs/ffs/ffs_snapshot.c#26 integrate .. //depot/projects/ia64/sys/vm/pmap.h#16 integrate .. //depot/projects/ia64/sys/vm/vm_page.c#42 integrate .. //depot/projects/ia64/tools/build/Makefile#2 integrate .. //depot/projects/ia64/tools/regression/geom/MdLoad/Makefile#1 branch .. //depot/projects/ia64/tools/regression/geom/MdLoad/MdLoad.c#1 branch .. //depot/projects/ia64/tools/regression/geom/Ref/disk.alpha.da0.xml#1 branch .. //depot/projects/ia64/tools/regression/geom/Ref/disk.alpha2.da0.xml#1 branch .. //depot/projects/ia64/tools/regression/geom/Ref/disk.apple.xml#1 branch .. //depot/projects/ia64/tools/regression/geom/Ref/disk.beast.da0.xml#1 branch .. //depot/projects/ia64/tools/regression/geom/Ref/disk.critter.ad0.xml#1 branch .. //depot/projects/ia64/tools/regression/geom/Ref/disk.empty.flp.xml#1 branch .. //depot/projects/ia64/tools/regression/geom/Ref/disk.far.ad0.xml#1 branch .. //depot/projects/ia64/tools/regression/geom/Ref/disk.flat.da1.xml#1 branch .. //depot/projects/ia64/tools/regression/geom/Ref/disk.kern.flp.xml#1 branch .. //depot/projects/ia64/tools/regression/geom/Ref/disk.msdos.ext.xml#1 branch .. //depot/projects/ia64/tools/regression/geom/Ref/disk.msdos.flp.xml#1 branch .. //depot/projects/ia64/tools/regression/geom/Ref/disk.pc98.wdc0.xml#1 branch .. //depot/projects/ia64/tools/regression/geom/Ref/disk.sun.da0.xml#1 branch .. //depot/projects/ia64/tools/regression/geom/Ref/disk.sun.da1.xml#1 branch .. //depot/projects/ia64/tools/regression/geom/Ref/disk.typo.ad0.xml#1 branch .. //depot/projects/ia64/tools/regression/geom/RunTest.sh#1 branch .. //depot/projects/ia64/usr.bin/Makefile#42 integrate .. //depot/projects/ia64/usr.bin/chpass/edit.c#5 integrate .. //depot/projects/ia64/usr.bin/killall/killall.1#7 integrate .. //depot/projects/ia64/usr.bin/killall/killall.c#7 integrate .. //depot/projects/ia64/usr.bin/systat/vmstat.c#9 integrate .. //depot/projects/ia64/usr.bin/uniq/uniq.1#7 integrate .. //depot/projects/ia64/usr.bin/usbhidaction/Makefile#1 branch .. //depot/projects/ia64/usr.bin/usbhidaction/usbhidaction.1#1 branch .. //depot/projects/ia64/usr.bin/usbhidaction/usbhidaction.c#1 branch .. //depot/projects/ia64/usr.bin/usbhidctl/usbhid.c#5 integrate .. //depot/projects/ia64/usr.bin/vmstat/vmstat.c#13 integrate .. //depot/projects/ia64/usr.sbin/Makefile#35 integrate .. //depot/projects/ia64/usr.sbin/diskinfo/Makefile#1 branch .. //depot/projects/ia64/usr.sbin/diskinfo/diskinfo.8#1 branch .. //depot/projects/ia64/usr.sbin/diskinfo/diskinfo.c#1 branch .. //depot/projects/ia64/usr.sbin/jail/jail.8#10 integrate .. //depot/projects/ia64/usr.sbin/jail/jail.c#5 integrate .. //depot/projects/ia64/usr.sbin/jexec/Makefile#1 branch .. //depot/projects/ia64/usr.sbin/jexec/jexec.8#1 branch .. //depot/projects/ia64/usr.sbin/jexec/jexec.c#1 branch .. //depot/projects/ia64/usr.sbin/jls/Makefile#1 branch .. //depot/projects/ia64/usr.sbin/jls/jls.8#1 branch .. //depot/projects/ia64/usr.sbin/jls/jls.c#1 branch .. //depot/projects/ia64/usr.sbin/mixer/mixer.8#3 integrate .. //depot/projects/ia64/usr.sbin/mixer/mixer.c#3 integrate .. //depot/projects/ia64/usr.sbin/rtadvd/config.c#7 integrate Differences ... ==== //depot/projects/ia64/Makefile.inc1#54 (text+ko) ==== @@ -1,5 +1,5 @@ # -# $FreeBSD: src/Makefile.inc1,v 1.339 2003/04/07 00:01:33 ru Exp $ +# $FreeBSD: src/Makefile.inc1,v 1.340 2003/04/11 17:58:17 ru Exp $ # # Make command line options: # -DMAKE_KERBEROS5 to build Kerberos5 @@ -625,6 +625,7 @@ @${ECHODIR} "===> ${_tool}"; \ cd ${.CURDIR}/${_tool}; \ ${MAKE} DIRPRFX=${_tool}/ obj; \ + ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy includes; \ ${MAKE} DIRPRFX=${_tool}/ depend; \ ${MAKE} DIRPRFX=${_tool}/ all; \ ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy install ==== //depot/projects/ia64/bin/echo/echo.1#2 (text+ko) ==== @@ -33,9 +33,9 @@ .\" SUCH DAMAGE. .\" .\" @(#)echo.1 8.1 (Berkeley) 7/22/93 -.\" $FreeBSD: src/bin/echo/echo.1,v 1.13 2001/08/15 09:09:35 ru Exp $ +.\" $FreeBSD: src/bin/echo/echo.1,v 1.14 2003/04/12 03:49:28 tjr Exp $ .\" -.Dd July 22, 1993 +.Dd April 12, 2003 .Dt ECHO 1 .Os .Sh NAME @@ -81,6 +81,6 @@ .Sh STANDARDS The .Nm -utility is expected to be -.St -p1003.2 -compatible. +utility conforms to +.St -p1003.1-2001 +as amended by Cor. 1-2002. ==== //depot/projects/ia64/bin/pwd/pwd.1#6 (text+ko) ==== @@ -33,9 +33,9 @@ .\" SUCH DAMAGE. .\" .\" @(#)pwd.1 8.2 (Berkeley) 4/28/95 -.\" $FreeBSD: src/bin/pwd/pwd.1,v 1.20 2002/05/18 13:52:07 tjr Exp $ +.\" $FreeBSD: src/bin/pwd/pwd.1,v 1.21 2003/04/12 03:22:54 tjr Exp $ .\" -.Dd February 4, 2002 +.Dd April 12, 2003 .Dt PWD 1 .Os .Sh NAME @@ -43,7 +43,7 @@ .Nd return working directory name .Sh SYNOPSIS .Nm -.Op Fl LP +.Oo Fl L | Fl P Oc .Sh DESCRIPTION The .Nm ==== //depot/projects/ia64/bin/sh/sh.1#20 (text+ko) ==== @@ -33,9 +33,9 @@ .\" SUCH DAMAGE. .\" .\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95 -.\" $FreeBSD: src/bin/sh/sh.1,v 1.84 2003/02/03 23:03:05 fanf Exp $ +.\" $FreeBSD: src/bin/sh/sh.1,v 1.85 2003/04/12 03:20:28 tjr Exp $ .\" -.Dd May 5, 1995 +.Dd April 12, 2003 .Dt SH 1 .Os .Sh NAME @@ -1296,7 +1296,7 @@ List or alter key bindings for the line editor. This command is documented in .Xr editrc 5 . -.It Ic cd Oo Fl LP Oc Op Ar directory +.It Ic cd Oo Fl L | Fl P Oc Op Ar directory Switch to the specified .Ar directory , or to the directory specified in the @@ -1627,7 +1627,7 @@ If the .Fl s option is specified, only the PIDs of the jobs are printed, one per line. -.It Ic pwd Op Fl LP +.It Ic pwd Oo Fl L | Fl P Oc Print the path of the current directory. The built-in command may differ from the program of the same name because the built-in command remembers what the current directory ==== //depot/projects/ia64/contrib/gdtoa/gdtoaimp.h#4 (text+ko) ==== @@ -26,7 +26,7 @@ ****************************************************************/ -/* $FreeBSD: src/contrib/gdtoa/gdtoaimp.h,v 1.4 2003/04/05 22:09:26 das Exp $ */ +/* $FreeBSD: src/contrib/gdtoa/gdtoaimp.h,v 1.5 2003/04/09 06:04:35 das Exp $ */ /* This is a variation on dtoa.c that converts arbitary binary floating-point formats to and from decimal notation. It uses @@ -600,6 +600,7 @@ extern Bigint *diff ANSI((Bigint*, Bigint*)); extern char *dtoa ANSI((double d, int mode, int ndigits, int *decpt, int *sign, char **rve)); + extern void freedtoa ANSI((char*)); extern char *gdtoa ANSI((FPI *fpi, int be, ULong *bits, int *kindp, int mode, int ndigits, int *decpt, char **rve)); extern char *g__fmt ANSI((char*, char*, char*, int, ULong)); @@ -623,8 +624,28 @@ extern Bigint *s2b ANSI((CONST char*, int, int, ULong)); extern Bigint *set_ones ANSI((Bigint*, int)); extern char *strcp ANSI((char*, const char*)); + extern int strtodg ANSI((CONST char*, char**, FPI*, Long*, ULong*)); + + extern int strtoId ANSI((CONST char *, char **, double *, double *)); + extern int strtoIdd ANSI((CONST char *, char **, double *, double *)); + extern int strtoIf ANSI((CONST char *, char **, float *, float *)); extern int strtoIg ANSI((CONST char*, char**, FPI*, Long*, Bigint**, int*)); + extern int strtoIQ ANSI((CONST char *, char **, void *, void *)); + extern int strtoIx ANSI((CONST char *, char **, void *, void *)); + extern int strtoIxL ANSI((CONST char *, char **, void *, void *)); extern double strtod ANSI((const char *s00, char **se)); + extern int strtopQ ANSI((CONST char *, char **, Void *)); + extern int strtopf ANSI((CONST char *, char **, float *)); + extern int strtopd ANSI((CONST char *, char **, double *)); + extern int strtopdd ANSI((CONST char *, char **, double *)); + extern int strtopx ANSI((CONST char *, char **, Void *)); + extern int strtopxL ANSI((CONST char *, char **, Void *)); + extern int strtord ANSI((CONST char *, char **, int, double *)); + extern int strtordd ANSI((CONST char *, char **, int, double *)); + extern int strtorf ANSI((CONST char *, char **, int, float *)); + extern int strtorQ ANSI((CONST char *, char **, int, void *)); + extern int strtorx ANSI((CONST char *, char **, int, void *)); + extern int strtorxL ANSI((CONST char *, char **, int, void *)); extern Bigint *sum ANSI((Bigint*, Bigint*)); extern int trailz ANSI((Bigint*)); extern double ulp ANSI((double)); ==== //depot/projects/ia64/etc/defaults/pccard.conf#20 (text+ko) ==== @@ -1,7 +1,7 @@ # # Default PCCARD configuration file # -# $FreeBSD: src/etc/defaults/pccard.conf,v 1.259 2003/03/28 11:12:52 sobomax Exp $ +# $FreeBSD: src/etc/defaults/pccard.conf,v 1.260 2003/04/10 17:16:01 shiba Exp $ # # Please send new entries for this file to imp@freebsd.org. He likes to # review them before they are committed to make sure they are correct for @@ -2081,6 +2081,12 @@ insert /etc/pccard_ether $device start remove /etc/pccard_ether $device stop +# NTT-ME SS-LAN CARD MN128 +card "NTT-ME" "11Mbps Wireless LAN PC Card" + config auto "wi" ? + insert /etc/pccard_ether $device start + remove /etc/pccard_ether $device stop + # Generic PRISM2.5 card card "PCMCIA" "11M WLAN Card v2.5" config auto "wi" ? ==== //depot/projects/ia64/gnu/usr.bin/binutils/addr2line/Makefile#4 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/gnu/usr.bin/binutils/addr2line/Makefile,v 1.7 2002/03/20 23:05:09 obrien Exp $ +# $FreeBSD: src/gnu/usr.bin/binutils/addr2line/Makefile,v 1.8 2003/04/11 18:02:09 ru Exp $ .include "../Makefile.inc0" @@ -9,9 +9,10 @@ WARNS= 2 CFLAGS+= -I${.CURDIR}/${RELTOP}/libbinutils CFLAGS+= -I${SRCDIR}/binutils -DPADD= ${RELTOP}/libbinutils/libbinutils.a -DPADD+= ${RELTOP}/libbfd/libbfd.a -DPADD+= ${RELTOP}/libiberty/libiberty.a +DPADD:= ${RELTOP}/libbinutils/libbinutils.a \ + ${RELTOP}/libbfd/libbfd.a \ + ${RELTOP}/libiberty/libiberty.a \ + ${DPADD} LDADD= ${DPADD} .include ==== //depot/projects/ia64/gnu/usr.bin/binutils/ar/Makefile#3 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/gnu/usr.bin/binutils/ar/Makefile,v 1.9 2002/03/20 23:05:09 obrien Exp $ +# $FreeBSD: src/gnu/usr.bin/binutils/ar/Makefile,v 1.10 2003/04/11 18:02:09 ru Exp $ .include "../Makefile.inc0" @@ -10,9 +10,10 @@ CFLAGS+= -I${SRCDIR}/binutils CFLAGS+= -I${SRCDIR}/bfd NOSHARED?= yes -DPADD= ${RELTOP}/libbinutils/libbinutils.a -DPADD+= ${RELTOP}/libbfd/libbfd.a -DPADD+= ${RELTOP}/libiberty/libiberty.a +DPADD:= ${RELTOP}/libbinutils/libbinutils.a \ + ${RELTOP}/libbfd/libbfd.a \ + ${RELTOP}/libiberty/libiberty.a \ + ${DPADD} LDADD= ${DPADD} .include ==== //depot/projects/ia64/gnu/usr.bin/binutils/as/Makefile.inc0#8 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/gnu/usr.bin/binutils/as/Makefile.inc0,v 1.21 2002/12/02 09:41:35 obrien Exp $ +# $FreeBSD: src/gnu/usr.bin/binutils/as/Makefile.inc0,v 1.22 2003/04/11 18:02:09 ru Exp $ .include "${.CURDIR}/../../Makefile.inc0" @@ -20,9 +20,10 @@ CFLAGS+= -DVERSION=\"${VERSION:C/[ ]?${VERSION_DATE}[ ]?//g}\" CFLAGS+= -DBFD_VERSION_STRING=\"${VERSION}\" NOSHARED?= yes -DPADD= ${RELTOP}/libbfd/libbfd.a -DPADD+= ${RELTOP}/libiberty/libiberty.a -DPADD+= ${RELTOP}/libopcodes/libopcodes.a +DPADD:= ${RELTOP}/libbfd/libbfd.a \ + ${RELTOP}/libiberty/libiberty.a \ + ${RELTOP}/libopcodes/libopcodes.a \ + ${DPADD} LDADD= ${DPADD} # If set, BINUTILSDISTDIR is the path to a directory containing the full GNU ==== //depot/projects/ia64/gnu/usr.bin/binutils/ld/Makefile#7 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/gnu/usr.bin/binutils/ld/Makefile,v 1.24 2003/04/05 20:30:29 imp Exp $ +# $FreeBSD: src/gnu/usr.bin/binutils/ld/Makefile,v 1.25 2003/04/11 18:02:09 ru Exp $ .include "../Makefile.inc0" @@ -15,8 +15,9 @@ CFLAGS+= -DBFD_VERSION_STRING=\"${VERSION}\" CFLAGS+= -I${SRCDIR}/ld -I${SRCDIR}/bfd NOSHARED?= yes -DPADD+= ${RELTOP}/libbfd/libbfd.a -DPADD+= ${RELTOP}/libiberty/libiberty.a +DPADD:= ${RELTOP}/libbfd/libbfd.a \ + ${RELTOP}/libiberty/libiberty.a \ + ${DPADD} LDADD= ${DPADD} CLEANDIRS+= ldscripts CLEANFILES+= ldemul-list.h stringify.sed ==== //depot/projects/ia64/gnu/usr.bin/binutils/nm/Makefile#5 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/gnu/usr.bin/binutils/nm/Makefile,v 1.9 2002/10/11 06:28:05 obrien Exp $ +# $FreeBSD: src/gnu/usr.bin/binutils/nm/Makefile,v 1.10 2003/04/11 18:02:09 ru Exp $ .include "../Makefile.inc0" @@ -10,9 +10,10 @@ CFLAGS+= -I${.CURDIR}/${RELTOP}/libbinutils CFLAGS+= -I${SRCDIR}/bfd CFLAGS+= -I${SRCDIR}/binutils -DPADD= ${RELTOP}/libbinutils/libbinutils.a -DPADD+= ${RELTOP}/libbfd/libbfd.a -DPADD+= ${RELTOP}/libiberty/libiberty.a +DPADD:= ${RELTOP}/libbinutils/libbinutils.a \ + ${RELTOP}/libbfd/libbfd.a \ + ${RELTOP}/libiberty/libiberty.a \ + ${DPADD} LDADD= ${DPADD} .include ==== //depot/projects/ia64/gnu/usr.bin/binutils/objcopy/Makefile#4 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/gnu/usr.bin/binutils/objcopy/Makefile,v 1.8 2002/03/20 23:05:18 obrien Exp $ +# $FreeBSD: src/gnu/usr.bin/binutils/objcopy/Makefile,v 1.9 2003/04/11 18:02:09 ru Exp $ .include "../Makefile.inc0" @@ -9,9 +9,10 @@ WARNS= 2 CFLAGS+= -I${.CURDIR}/${RELTOP}/libbinutils CFLAGS+= -I${SRCDIR}/binutils -DPADD= ${RELTOP}/libbinutils/libbinutils.a -DPADD+= ${RELTOP}/libbfd/libbfd.a -DPADD+= ${RELTOP}/libiberty/libiberty.a +DPADD:= ${RELTOP}/libbinutils/libbinutils.a \ + ${RELTOP}/libbfd/libbfd.a \ + ${RELTOP}/libiberty/libiberty.a \ + ${DPADD} LDADD= ${DPADD} .include ==== //depot/projects/ia64/gnu/usr.bin/binutils/objdump/Makefile#5 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/gnu/usr.bin/binutils/objdump/Makefile,v 1.10 2002/03/20 23:05:18 obrien Exp $ +# $FreeBSD: src/gnu/usr.bin/binutils/objdump/Makefile,v 1.11 2003/04/11 18:02:09 ru Exp $ .include "../Makefile.inc0" @@ -10,10 +10,11 @@ CFLAGS+= -I${.CURDIR}/${RELTOP}/libbinutils CFLAGS+= -I${SRCDIR}/binutils CFLAGS+= -DBFD_VERSION_STRING=\"${VERSION}\" -DPADD= ${RELTOP}/libbinutils/libbinutils.a -DPADD+= ${RELTOP}/libopcodes/libopcodes.a -DPADD+= ${RELTOP}/libbfd/libbfd.a -DPADD+= ${RELTOP}/libiberty/libiberty.a +DPADD:= ${RELTOP}/libbinutils/libbinutils.a \ + ${RELTOP}/libopcodes/libopcodes.a \ + ${RELTOP}/libbfd/libbfd.a \ + ${RELTOP}/libiberty/libiberty.a \ + ${DPADD} LDADD= ${DPADD} .include ==== //depot/projects/ia64/gnu/usr.bin/binutils/ranlib/Makefile#3 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/gnu/usr.bin/binutils/ranlib/Makefile,v 1.9 2002/03/20 23:05:18 obrien Exp $ +# $FreeBSD: src/gnu/usr.bin/binutils/ranlib/Makefile,v 1.10 2003/04/11 18:02:09 ru Exp $ .include "../Makefile.inc0" @@ -10,9 +10,10 @@ CFLAGS+= -I${SRCDIR}/binutils CFLAGS+= -I${SRCDIR}/bfd NOSHARED?= yes -DPADD= ${RELTOP}/libbinutils/libbinutils.a -DPADD+= ${RELTOP}/libbfd/libbfd.a -DPADD+= ${RELTOP}/libiberty/libiberty.a +DPADD:= ${RELTOP}/libbinutils/libbinutils.a \ + ${RELTOP}/libbfd/libbfd.a \ + ${RELTOP}/libiberty/libiberty.a \ + ${DPADD} LDADD= ${DPADD} .include ==== //depot/projects/ia64/gnu/usr.bin/binutils/readelf/Makefile#4 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/gnu/usr.bin/binutils/readelf/Makefile,v 1.5 2002/03/20 23:05:19 obrien Exp $ +# $FreeBSD: src/gnu/usr.bin/binutils/readelf/Makefile,v 1.6 2003/04/11 18:02:10 ru Exp $ .include "../Makefile.inc0" @@ -12,9 +12,10 @@ WARNS= 2 CFLAGS+= -I${.CURDIR}/${RELTOP}/libbinutils -I${SRCDIR}/binutils -DPADD= ${RELTOP}/libbinutils/libbinutils.a -DPADD+= ${RELTOP}/libbfd/libbfd.a -DPADD+= ${RELTOP}/libiberty/libiberty.a +DPADD:= ${RELTOP}/libbinutils/libbinutils.a \ + ${RELTOP}/libbfd/libbfd.a \ + ${RELTOP}/libiberty/libiberty.a \ + ${DPADD} LDADD= ${DPADD} .include ==== //depot/projects/ia64/gnu/usr.bin/binutils/size/Makefile#4 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/gnu/usr.bin/binutils/size/Makefile,v 1.8 2002/03/20 23:05:19 obrien Exp $ +# $FreeBSD: src/gnu/usr.bin/binutils/size/Makefile,v 1.9 2003/04/11 18:02:10 ru Exp $ .include "../Makefile.inc0" @@ -9,9 +9,10 @@ WARNS= 2 CFLAGS+= -I${.CURDIR}/${RELTOP}/libbinutils CFLAGS+= -I${SRCDIR}/binutils -DPADD= ${RELTOP}/libbinutils/libbinutils.a -DPADD+= ${RELTOP}/libbfd/libbfd.a -DPADD+= ${RELTOP}/libiberty/libiberty.a +DPADD:= ${RELTOP}/libbinutils/libbinutils.a \ + ${RELTOP}/libbfd/libbfd.a \ + ${RELTOP}/libiberty/libiberty.a \ + ${DPADD} LDADD= ${DPADD} .include ==== //depot/projects/ia64/gnu/usr.bin/binutils/strings/Makefile#4 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/gnu/usr.bin/binutils/strings/Makefile,v 1.8 2002/03/20 23:05:19 obrien Exp $ +# $FreeBSD: src/gnu/usr.bin/binutils/strings/Makefile,v 1.9 2003/04/11 18:02:10 ru Exp $ .include "../Makefile.inc0" @@ -9,9 +9,10 @@ WARNS= 2 CFLAGS+= -I${.CURDIR}/${RELTOP}/libbinutils CFLAGS+= -I${SRCDIR}/binutils -DPADD= ${RELTOP}/libbinutils/libbinutils.a -DPADD+= ${RELTOP}/libbfd/libbfd.a -DPADD+= ${RELTOP}/libiberty/libiberty.a +DPADD:= ${RELTOP}/libbinutils/libbinutils.a \ + ${RELTOP}/libbfd/libbfd.a \ + ${RELTOP}/libiberty/libiberty.a \ + ${DPADD} LDADD= ${DPADD} .include ==== //depot/projects/ia64/gnu/usr.bin/binutils/strip/Makefile#5 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/gnu/usr.bin/binutils/strip/Makefile,v 1.11 2002/07/29 09:40:08 ru Exp $ +# $FreeBSD: src/gnu/usr.bin/binutils/strip/Makefile,v 1.12 2003/04/11 18:02:10 ru Exp $ .include "../Makefile.inc0" @@ -9,9 +9,10 @@ WARNS= 2 CFLAGS+= -I${.CURDIR}/${RELTOP}/libbinutils CFLAGS+= -I${SRCDIR}/binutils -DPADD= ${RELTOP}/libbinutils/libbinutils.a -DPADD+= ${RELTOP}/libbfd/libbfd.a -DPADD+= ${RELTOP}/libiberty/libiberty.a +DPADD:= ${RELTOP}/libbinutils/libbinutils.a \ + ${RELTOP}/libbfd/libbfd.a \ + ${RELTOP}/libiberty/libiberty.a \ + ${DPADD} LDADD= ${DPADD} CLEANFILES+= maybe_stripped ==== //depot/projects/ia64/lib/libc/gdtoa/machdep_ldisQ.c#2 (text+ko) ==== @@ -31,7 +31,7 @@ */ #include -__FBSDID("$FreeBSD: src/lib/libc/gdtoa/machdep_ldisQ.c,v 1.1 2003/03/12 20:29:58 das Exp $"); +__FBSDID("$FreeBSD: src/lib/libc/gdtoa/machdep_ldisQ.c,v 1.2 2003/04/09 05:58:43 das Exp $"); #include "gdtoaimp.h" @@ -40,6 +40,6 @@ { long double result; - strtopQ(s, sp, result); + strtopQ(s, sp, &result); return result; } ==== //depot/projects/ia64/lib/libc/gdtoa/machdep_ldisx.c#2 (text+ko) ==== @@ -31,7 +31,7 @@ */ #include -__FBSDID("$FreeBSD: src/lib/libc/gdtoa/machdep_ldisx.c,v 1.1 2003/03/12 20:29:58 das Exp $"); +__FBSDID("$FreeBSD: src/lib/libc/gdtoa/machdep_ldisx.c,v 1.2 2003/04/09 05:58:43 das Exp $"); #include "gdtoaimp.h" @@ -40,6 +40,6 @@ { long double result; - strtopx(s, sp, result); + strtopx(s, sp, &result); return result; } ==== //depot/projects/ia64/lib/libc/gen/getbootfile.c#3 (text+ko) ==== @@ -35,7 +35,7 @@ static char sccsid[] = "From: @(#)gethostname.c 8.1 (Berkeley) 6/4/93"; #endif /* LIBC_SCCS and not lint */ #include -__FBSDID("$FreeBSD: src/lib/libc/gen/getbootfile.c,v 1.6 2002/02/01 00:57:29 obrien Exp $"); +__FBSDID("$FreeBSD: src/lib/libc/gen/getbootfile.c,v 1.7 2003/04/11 13:54:28 tjr Exp $"); #include #include @@ -50,6 +50,6 @@ mib[0] = CTL_KERN; mib[1] = KERN_BOOTFILE; if (sysctl(mib, 2, name, &size, NULL, 0) == -1) - return ("/kernel"); + return ("/boot/kernel/kernel"); return (name); } ==== //depot/projects/ia64/lib/libc/locale/wcrtomb.c#4 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/lib/libc/locale/wcrtomb.c,v 1.3 2002/10/25 13:24:45 tjr Exp $"); +__FBSDID("$FreeBSD: src/lib/libc/locale/wcrtomb.c,v 1.4 2003/04/10 09:20:38 tjr Exp $"); #include #include @@ -39,8 +39,10 @@ char *e; char buf[MB_LEN_MAX]; - if (s == NULL) + if (s == NULL) { s = buf; + wc = L'\0'; + } sputrune(wc, s, MB_CUR_MAX, &e); if (e == NULL) { errno = EILSEQ; ==== //depot/projects/ia64/lib/libc/sys/Makefile.inc#12 (text+ko) ==== @@ -1,5 +1,5 @@ # @(#)Makefile.inc 8.3 (Berkeley) 10/24/94 -# $FreeBSD: src/lib/libc/sys/Makefile.inc,v 1.100 2003/01/12 09:28:16 tjr Exp $ +# $FreeBSD: src/lib/libc/sys/Makefile.inc,v 1.101 2003/04/09 02:55:17 mike Exp $ # sys sources .PATH: ${.CURDIR}/${MACHINE_ARCH}/sys ${.CURDIR}/sys @@ -115,6 +115,7 @@ MLINKS+=gettimeofday.2 settimeofday.2 MLINKS+=getuid.2 geteuid.2 MLINKS+=intro.2 errno.2 +MLINKS+=jail.2 jail_attach.2 MLINKS+=kqueue.2 kevent.2 MLINKS+=kse.2 kse_create.2 kse.2 kse_exit.2 kse.2 kse_release.2 \ kse.2 kse_wakeup.2 kse.2 kse_thr_interrupt.2 ==== //depot/projects/ia64/lib/libc/sys/jail.2#4 (text+ko) ==== @@ -6,9 +6,9 @@ .\"this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp .\"---------------------------------------------------------------------------- .\" -.\"$FreeBSD: src/lib/libc/sys/jail.2,v 1.22 2002/12/18 09:22:30 ru Exp $ +.\"$FreeBSD: src/lib/libc/sys/jail.2,v 1.23 2003/04/09 02:55:17 mike Exp $ .\" -.Dd April 28, 1999 +.Dd April 8, 2003 .Dt JAIL 2 .Os .Sh NAME @@ -17,10 +17,12 @@ .Sh LIBRARY .Lb libc .Sh SYNOPSIS -.In sys/types.h +.In sys/param.h .In sys/jail.h .Ft int .Fn jail "struct jail *jail" +.Ft int +.Fn jail_attach "int jid" .Sh DESCRIPTION The .Fn jail @@ -52,9 +54,29 @@ The .Dq Li ip_number can be set to the IP number assigned to the prison. +.Pp +The +.Fn jail_attach +system call attaches the current process to an existing jail, +identified by +.Va jid . +.Sh RETURN VALUES +If successful, +.Fn jail +returns a non-negative integer, termed the jail identifier (JID). +It returns -1 on failure, and sets +.Va errno +to indicate the error. +.Pp +If successful, +.Fn jail_attach +returns 0. +It returns -1 on failure, and sets +.Va errno +to indicate the error. .Sh PRISON? Once a process has been put in a prison, it and its decendants cannot escape -the prison. It is not possible to add a process to a preexisting prison. +the prison. .Pp Inside the prison, the concept of "superuser" is very diluted. In general, it can be assumed that nothing can be mangled from inside a prison which @@ -100,6 +122,10 @@ .Fn jail system call appeared in .Fx 4.0 . +The +.Fn jail_attach +system call appeared in +.Fx 5.1 . .Sh AUTHORS The jail feature was written by .An Poul-Henning Kamp ==== //depot/projects/ia64/lib/libdevstat/devstat.c#5 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include -__FBSDID("$FreeBSD: src/lib/libdevstat/devstat.c,v 1.21 2003/03/19 14:15:32 phk Exp $"); +__FBSDID("$FreeBSD: src/lib/libdevstat/devstat.c,v 1.22 2003/04/09 07:49:15 phk Exp $"); #include #include @@ -1512,6 +1512,8 @@ *destld = 0; *destld /= etime; *destld *= 100; + if (*destld < 0) + *destld = 0; break; case DSM_QUEUE_LENGTH: *destu64 = current->start_count - current->end_count; ==== //depot/projects/ia64/lib/libkvm/kvm_proc.c#16 (text+ko) ==== @@ -42,7 +42,7 @@ #endif #include -__FBSDID("$FreeBSD: src/lib/libkvm/kvm_proc.c,v 1.65 2003/04/01 04:49:12 jeff Exp $"); +__FBSDID("$FreeBSD: src/lib/libkvm/kvm_proc.c,v 1.66 2003/04/10 17:41:40 julian Exp $"); /* * Proc traversal interface for kvm. ps and w are (probably) the exclusive @@ -364,6 +364,7 @@ kp->ki_pri.pri_native = mtd.td_base_pri; kp->ki_lastcpu = mtd.td_lastcpu; kp->ki_wchan = mtd.td_wchan; + kp->ki_oncpu = mtd.td_oncpu; if (!(proc.p_flag & P_THREADED)) { /* stuff from the ksegrp */ @@ -376,10 +377,7 @@ /* Stuff from the kse */ kp->ki_pctcpu = mke.ke_pctcpu; kp->ki_rqindex = mke.ke_rqindex; - kp->ki_oncpu = mke.ke_oncpu; } else { - kp->ki_oncpu = -1; - kp->ki_lastcpu = -1; kp->ki_tdflags = -1; /* All the rest are 0 for now */ } ==== //depot/projects/ia64/lib/libusbhid/Makefile#3 (text+ko) ==== @@ -1,12 +1,12 @@ # $NetBSD: Makefile,v 1.5 1999/07/23 09:44:38 mrg Exp $ -# $FreeBSD: src/lib/libusbhid/Makefile,v 1.7 2002/09/28 00:25:31 peter Exp $ +# $FreeBSD: src/lib/libusbhid/Makefile,v 1.8 2003/04/09 01:52:48 mdodd Exp $ MAINTAINER= n_hibma@FreeBSD.ORG LIB= usbhid MAN= usbhid.3 -SHLIB_MAJOR= 0 +SHLIB_MAJOR= 1 MLINKS= usbhid.3 libusbhid.3 usbhid.3 hid_get_report_desc.3 \ usbhid.3 hid_dispose_report_desc.3 \ @@ -19,7 +19,6 @@ SRCS= descr.c parse.c usage.c data.c -INCS= libusbhid.h +INCS= usbhid.h .include - ==== //depot/projects/ia64/lib/libusbhid/data.c#2 (text+ko) ==== @@ -27,11 +27,11 @@ */ #include -__FBSDID("$FreeBSD: src/lib/libusbhid/data.c,v 1.5 2002/03/28 11:42:45 joe Exp $"); +__FBSDID("$FreeBSD: src/lib/libusbhid/data.c,v 1.6 2003/04/09 01:52:48 mdodd Exp $"); #include #include -#include "libusbhid.h" +#include "usbhid.h" int hid_get_data(const void *p, const hid_item_t *h) ==== //depot/projects/ia64/lib/libusbhid/descr.c#2 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include -__FBSDID("$FreeBSD: src/lib/libusbhid/descr.c,v 1.7 2002/03/28 11:42:45 joe Exp $"); +__FBSDID("$FreeBSD: src/lib/libusbhid/descr.c,v 1.8 2003/04/09 01:52:48 mdodd Exp $"); #include @@ -37,13 +37,11 @@ #include #include #include -#if defined(__FreeBSD__) #include -#endif #include -#include "libusbhid.h" +#include "usbhid.h" #include "usbvar.h" report_desc_t ==== //depot/projects/ia64/lib/libusbhid/parse.c#3 (text+ko) ==== @@ -1,7 +1,7 @@ /* $NetBSD: parse.c,v 1.11 2000/09/24 02:19:54 augustss Exp $ */ /* - * Copyright (c) 1999 Lennart Augustsson + * Copyright (c) 1999, 2001 Lennart Augustsson * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -27,7 +27,7 @@ */ #include -__FBSDID("$FreeBSD: src/lib/libusbhid/parse.c,v 1.7 2003/04/07 00:49:53 mdodd Exp $"); +__FBSDID("$FreeBSD: src/lib/libusbhid/parse.c,v 1.8 2003/04/09 01:52:48 mdodd Exp $"); #include #include @@ -37,7 +37,7 @@ #include #include -#include "libusbhid.h" +#include "usbhid.h" #include "usbvar.h" #define MAXUSAGE 100 @@ -49,18 +49,30 @@ unsigned int usages[MAXUSAGE]; int nusage; int minset; + int logminsize; int multi; int multimax; >>> TRUNCATED FOR MAIL (1000 lines) <<< From owner-p4-projects@FreeBSD.ORG Fri Apr 11 22:30:23 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id AC24937B404; Fri, 11 Apr 2003 22:30:22 -0700 (PDT) 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 9243C37B401 for ; Fri, 11 Apr 2003 22:30:21 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4D57B43F3F for ; Fri, 11 Apr 2003 22:30:20 -0700 (PDT) (envelope-from marcel@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h3C5UK0U043920 for ; Fri, 11 Apr 2003 22:30:20 -0700 (PDT) (envelope-from marcel@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h3C5UIjs043880 for perforce@freebsd.org; Fri, 11 Apr 2003 22:30:18 -0700 (PDT) Date: Fri, 11 Apr 2003 22:30:18 -0700 (PDT) Message-Id: <200304120530.h3C5UIjs043880@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 28788 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, 12 Apr 2003 05:30:24 -0000 http://perforce.freebsd.org/chv.cgi?CH=28788 Change 28788 by marcel@marcel_pluto1 on 2003/04/11 22:29:39 IFia64 Affected files ... .. //depot/projects/ia64_epc/Makefile.inc1#8 integrate .. //depot/projects/ia64_epc/bin/echo/echo.1#2 integrate .. //depot/projects/ia64_epc/bin/pwd/pwd.1#2 integrate .. //depot/projects/ia64_epc/bin/sh/sh.1#2 integrate .. //depot/projects/ia64_epc/contrib/gdtoa/gdtoaimp.h#3 integrate .. //depot/projects/ia64_epc/etc/defaults/pccard.conf#4 integrate .. //depot/projects/ia64_epc/gnu/usr.bin/binutils/addr2line/Makefile#2 integrate .. //depot/projects/ia64_epc/gnu/usr.bin/binutils/ar/Makefile#2 integrate .. //depot/projects/ia64_epc/gnu/usr.bin/binutils/as/Makefile.inc0#2 integrate .. //depot/projects/ia64_epc/gnu/usr.bin/binutils/ld/Makefile#3 integrate .. //depot/projects/ia64_epc/gnu/usr.bin/binutils/nm/Makefile#2 integrate .. //depot/projects/ia64_epc/gnu/usr.bin/binutils/objcopy/Makefile#2 integrate .. //depot/projects/ia64_epc/gnu/usr.bin/binutils/objdump/Makefile#2 integrate .. //depot/projects/ia64_epc/gnu/usr.bin/binutils/ranlib/Makefile#2 integrate .. //depot/projects/ia64_epc/gnu/usr.bin/binutils/readelf/Makefile#2 integrate .. //depot/projects/ia64_epc/gnu/usr.bin/binutils/size/Makefile#2 integrate .. //depot/projects/ia64_epc/gnu/usr.bin/binutils/strings/Makefile#2 integrate .. //depot/projects/ia64_epc/gnu/usr.bin/binutils/strip/Makefile#2 integrate .. //depot/projects/ia64_epc/lib/libc/gdtoa/machdep_ldisQ.c#2 integrate .. //depot/projects/ia64_epc/lib/libc/gdtoa/machdep_ldisx.c#2 integrate .. //depot/projects/ia64_epc/lib/libc/gen/getbootfile.c#2 integrate .. //depot/projects/ia64_epc/lib/libc/locale/wcrtomb.c#2 integrate .. //depot/projects/ia64_epc/lib/libc/sys/Makefile.inc#2 integrate .. //depot/projects/ia64_epc/lib/libc/sys/jail.2#2 integrate .. //depot/projects/ia64_epc/lib/libdevstat/devstat.c#4 integrate .. //depot/projects/ia64_epc/lib/libkvm/kvm_proc.c#5 integrate .. //depot/projects/ia64_epc/lib/libusbhid/Makefile#2 integrate .. //depot/projects/ia64_epc/lib/libusbhid/data.c#2 integrate .. //depot/projects/ia64_epc/lib/libusbhid/descr.c#2 integrate .. //depot/projects/ia64_epc/lib/libusbhid/libusbhid.h#3 delete .. //depot/projects/ia64_epc/lib/libusbhid/parse.c#3 integrate .. //depot/projects/ia64_epc/lib/libusbhid/usage.c#3 integrate .. //depot/projects/ia64_epc/lib/libusbhid/usbhid.3#2 integrate .. //depot/projects/ia64_epc/lib/libusbhid/usbhid.h#2 integrate .. //depot/projects/ia64_epc/lib/libutil/pw_util.c#4 integrate .. //depot/projects/ia64_epc/libexec/rtld-elf/libmap.c#2 integrate .. //depot/projects/ia64_epc/release/doc/en_US.ISO8859-1/hardware/common/dev.sgml#4 integrate .. //depot/projects/ia64_epc/release/doc/en_US.ISO8859-1/relnotes/common/new.sgml#8 integrate .. //depot/projects/ia64_epc/sbin/mdconfig/mdconfig.c#4 integrate .. //depot/projects/ia64_epc/share/examples/ppp/ppp.conf.isdn#2 integrate .. //depot/projects/ia64_epc/share/examples/ppp/ppp.conf.sample#3 integrate .. //depot/projects/ia64_epc/share/examples/ppp/ppp.conf.span-isp#2 integrate .. //depot/projects/ia64_epc/share/examples/ppp/ppp.conf.span-isp.working#2 integrate .. //depot/projects/ia64_epc/share/man/man4/man4.i386/Makefile#4 integrate .. //depot/projects/ia64_epc/share/man/man4/man4.i386/pae.4#1 branch .. //depot/projects/ia64_epc/share/man/man4/wi.4#6 integrate .. //depot/projects/ia64_epc/share/man/man9/malloc.9#3 integrate .. //depot/projects/ia64_epc/share/mk/bsd.cpu.mk#3 integrate .. //depot/projects/ia64_epc/sys/alpha/alpha/busdma_machdep.c#5 integrate .. //depot/projects/ia64_epc/sys/alpha/alpha/pmap.c#4 integrate .. //depot/projects/ia64_epc/sys/alpha/include/bus.h#3 integrate .. //depot/projects/ia64_epc/sys/alpha/include/pmap.h#5 integrate .. //depot/projects/ia64_epc/sys/alpha/isa/isa.c#2 integrate .. //depot/projects/ia64_epc/sys/conf/NOTES#8 integrate .. //depot/projects/ia64_epc/sys/conf/options.i386#5 integrate .. //depot/projects/ia64_epc/sys/ddb/db_ps.c#3 integrate .. //depot/projects/ia64_epc/sys/dev/acpica/acpi.c#4 integrate .. //depot/projects/ia64_epc/sys/dev/advansys/advansys.c#3 integrate .. //depot/projects/ia64_epc/sys/dev/advansys/adwcam.c#3 integrate .. //depot/projects/ia64_epc/sys/dev/aha/aha.c#3 integrate .. //depot/projects/ia64_epc/sys/dev/ahb/ahb.c#3 integrate .. //depot/projects/ia64_epc/sys/dev/aic/aic_pccard.c#2 integrate .. //depot/projects/ia64_epc/sys/dev/aic7xxx/aic79xx_osm.c#3 integrate .. //depot/projects/ia64_epc/sys/dev/aic7xxx/aic7xxx_osm.c#3 integrate .. //depot/projects/ia64_epc/sys/dev/amd/amd.c#2 integrate .. //depot/projects/ia64_epc/sys/dev/an/if_an.c#4 integrate .. //depot/projects/ia64_epc/sys/dev/an/if_an_isa.c#4 integrate .. //depot/projects/ia64_epc/sys/dev/an/if_an_pccard.c#4 integrate .. //depot/projects/ia64_epc/sys/dev/an/if_an_pci.c#4 integrate .. //depot/projects/ia64_epc/sys/dev/ata/ata-chipset.c#6 integrate .. //depot/projects/ia64_epc/sys/dev/ata/ata-pci.h#5 integrate .. //depot/projects/ia64_epc/sys/dev/awi/if_awi_pccard.c#3 integrate .. //depot/projects/ia64_epc/sys/dev/buslogic/bt.c#3 integrate .. //depot/projects/ia64_epc/sys/dev/cs/if_cs_pccard.c#2 integrate .. //depot/projects/ia64_epc/sys/dev/dpt/dpt_scsi.c#4 integrate .. //depot/projects/ia64_epc/sys/dev/ed/if_ed_pccard.c#3 integrate .. //depot/projects/ia64_epc/sys/dev/ep/if_ep_pccard.c#3 integrate .. //depot/projects/ia64_epc/sys/dev/fe/if_fe_pccard.c#2 integrate .. //depot/projects/ia64_epc/sys/dev/fxp/if_fxp.c#8 integrate .. //depot/projects/ia64_epc/sys/dev/ida/ida.c#7 integrate .. //depot/projects/ia64_epc/sys/dev/iir/iir.c#2 integrate .. //depot/projects/ia64_epc/sys/dev/md/md.c#7 integrate .. //depot/projects/ia64_epc/sys/dev/mpt/mpt_freebsd.c#2 integrate .. //depot/projects/ia64_epc/sys/dev/ncv/ncr53c500_pccard.c#2 integrate .. //depot/projects/ia64_epc/sys/dev/pccard/pccard.c#6 integrate .. //depot/projects/ia64_epc/sys/dev/pccard/pccarddevs#4 integrate .. //depot/projects/ia64_epc/sys/dev/pccard/pccarddevs.h#4 integrate .. //depot/projects/ia64_epc/sys/dev/pccard/pccardvar.h#3 integrate .. //depot/projects/ia64_epc/sys/dev/sn/if_sn_pccard.c#2 integrate .. //depot/projects/ia64_epc/sys/dev/stg/tmc18c30_pccard.c#3 integrate .. //depot/projects/ia64_epc/sys/dev/sym/sym_hipd.c#2 integrate .. //depot/projects/ia64_epc/sys/dev/trm/trm.c#3 integrate .. //depot/projects/ia64_epc/sys/dev/usb/uhid.c#4 integrate .. //depot/projects/ia64_epc/sys/dev/usb/usb_quirks.c#2 integrate .. //depot/projects/ia64_epc/sys/dev/usb/usbdevs#6 integrate .. //depot/projects/ia64_epc/sys/dev/usb/usbdevs.h#6 integrate .. //depot/projects/ia64_epc/sys/dev/usb/usbdevs_data.h#6 integrate .. //depot/projects/ia64_epc/sys/dev/wi/if_wi.c#5 integrate .. //depot/projects/ia64_epc/sys/dev/wi/if_wi_pccard.c#6 integrate .. //depot/projects/ia64_epc/sys/dev/xe/if_xe_pccard.c#2 integrate .. //depot/projects/ia64_epc/sys/fs/msdosfs/msdosfs_denode.c#3 integrate .. //depot/projects/ia64_epc/sys/geom/geom_apple.c#4 integrate .. //depot/projects/ia64_epc/sys/geom/geom_mbr.c#3 integrate .. //depot/projects/ia64_epc/sys/geom/geom_pc98.c#3 integrate .. //depot/projects/ia64_epc/sys/geom/geom_sunlabel.c#3 integrate .. //depot/projects/ia64_epc/sys/i386/conf/NOTES#8 integrate .. //depot/projects/ia64_epc/sys/i386/conf/PAE#2 integrate .. //depot/projects/ia64_epc/sys/i386/i386/busdma_machdep.c#6 integrate .. //depot/projects/ia64_epc/sys/i386/i386/genassym.c#3 integrate .. //depot/projects/ia64_epc/sys/i386/i386/identcpu.c#5 integrate .. //depot/projects/ia64_epc/sys/i386/i386/sys_machdep.c#4 integrate .. //depot/projects/ia64_epc/sys/i386/i386/tsc.c#4 integrate .. //depot/projects/ia64_epc/sys/i386/i386/vm_machdep.c#4 integrate .. //depot/projects/ia64_epc/sys/i386/include/bus_dma.h#2 integrate .. //depot/projects/ia64_epc/sys/ia64/ia32/syscalls.master#3 integrate .. //depot/projects/ia64_epc/sys/ia64/ia64/busdma_machdep.c#5 integrate .. //depot/projects/ia64_epc/sys/ia64/include/bus.h#3 integrate .. //depot/projects/ia64_epc/sys/kern/init_main.c#4 integrate .. //depot/projects/ia64_epc/sys/kern/init_sysent.c#4 integrate .. //depot/projects/ia64_epc/sys/kern/kern_clock.c#4 integrate .. //depot/projects/ia64_epc/sys/kern/kern_event.c#3 integrate .. //depot/projects/ia64_epc/sys/kern/kern_exit.c#5 integrate .. //depot/projects/ia64_epc/sys/kern/kern_fork.c#5 integrate .. //depot/projects/ia64_epc/sys/kern/kern_jail.c#3 integrate .. //depot/projects/ia64_epc/sys/kern/kern_mutex.c#6 integrate .. //depot/projects/ia64_epc/sys/kern/kern_proc.c#5 integrate .. //depot/projects/ia64_epc/sys/kern/kern_resource.c#5 integrate .. //depot/projects/ia64_epc/sys/kern/kern_sig.c#7 integrate .. //depot/projects/ia64_epc/sys/kern/kern_thr.c#4 integrate .. //depot/projects/ia64_epc/sys/kern/kern_thread.c#9 integrate .. //depot/projects/ia64_epc/sys/kern/sched_4bsd.c#4 integrate .. //depot/projects/ia64_epc/sys/kern/sched_ule.c#5 integrate .. //depot/projects/ia64_epc/sys/kern/subr_smp.c#4 integrate .. //depot/projects/ia64_epc/sys/kern/subr_witness.c#7 integrate .. //depot/projects/ia64_epc/sys/kern/syscalls.c#4 integrate .. //depot/projects/ia64_epc/sys/kern/syscalls.master#4 integrate .. //depot/projects/ia64_epc/sys/kern/uipc_cow.c#6 integrate .. //depot/projects/ia64_epc/sys/kern/vfs_syscalls.c#4 integrate .. //depot/projects/ia64_epc/sys/netinet/tcp_subr.c#5 integrate .. //depot/projects/ia64_epc/sys/pci/if_vr.c#4 integrate .. //depot/projects/ia64_epc/sys/pci/if_xl.c#8 integrate .. //depot/projects/ia64_epc/sys/powerpc/include/bus.h#3 integrate .. //depot/projects/ia64_epc/sys/powerpc/powerpc/busdma_machdep.c#6 integrate .. //depot/projects/ia64_epc/sys/sparc64/include/bus.h#3 integrate .. //depot/projects/ia64_epc/sys/sparc64/include/iommuvar.h#3 integrate .. //depot/projects/ia64_epc/sys/sparc64/pci/psycho.c#4 integrate .. //depot/projects/ia64_epc/sys/sparc64/sbus/sbus.c#3 integrate .. //depot/projects/ia64_epc/sys/sparc64/sparc64/bus_machdep.c#5 integrate .. //depot/projects/ia64_epc/sys/sparc64/sparc64/iommu.c#4 integrate .. //depot/projects/ia64_epc/sys/sparc64/sparc64/machdep.c#6 integrate .. //depot/projects/ia64_epc/sys/sys/jail.h#2 integrate .. //depot/projects/ia64_epc/sys/sys/mbuf.h#6 integrate .. //depot/projects/ia64_epc/sys/sys/mdioctl.h#3 integrate .. //depot/projects/ia64_epc/sys/sys/param.h#7 integrate .. //depot/projects/ia64_epc/sys/sys/proc.h#6 integrate .. //depot/projects/ia64_epc/sys/sys/sched.h#2 integrate .. //depot/projects/ia64_epc/sys/sys/syscall.h#4 integrate .. //depot/projects/ia64_epc/sys/sys/syscall.mk#4 integrate .. //depot/projects/ia64_epc/sys/sys/sysproto.h#4 integrate .. //depot/projects/ia64_epc/sys/sys/timetc.h#2 integrate .. //depot/projects/ia64_epc/sys/sys/vnode.h#3 integrate .. //depot/projects/ia64_epc/sys/ufs/ffs/ffs_snapshot.c#6 integrate .. //depot/projects/ia64_epc/sys/vm/pmap.h#5 integrate .. //depot/projects/ia64_epc/sys/vm/vm_page.c#6 integrate .. //depot/projects/ia64_epc/tools/build/Makefile#2 integrate .. //depot/projects/ia64_epc/tools/regression/geom/MdLoad/Makefile#1 branch .. //depot/projects/ia64_epc/tools/regression/geom/MdLoad/MdLoad.c#1 branch .. //depot/projects/ia64_epc/tools/regression/geom/Ref/disk.alpha.da0.xml#1 branch .. //depot/projects/ia64_epc/tools/regression/geom/Ref/disk.alpha2.da0.xml#1 branch .. //depot/projects/ia64_epc/tools/regression/geom/Ref/disk.apple.xml#1 branch .. //depot/projects/ia64_epc/tools/regression/geom/Ref/disk.beast.da0.xml#1 branch .. //depot/projects/ia64_epc/tools/regression/geom/Ref/disk.critter.ad0.xml#1 branch .. //depot/projects/ia64_epc/tools/regression/geom/Ref/disk.empty.flp.xml#1 branch .. //depot/projects/ia64_epc/tools/regression/geom/Ref/disk.far.ad0.xml#1 branch .. //depot/projects/ia64_epc/tools/regression/geom/Ref/disk.flat.da1.xml#1 branch .. //depot/projects/ia64_epc/tools/regression/geom/Ref/disk.kern.flp.xml#1 branch .. //depot/projects/ia64_epc/tools/regression/geom/Ref/disk.msdos.ext.xml#1 branch .. //depot/projects/ia64_epc/tools/regression/geom/Ref/disk.msdos.flp.xml#1 branch .. //depot/projects/ia64_epc/tools/regression/geom/Ref/disk.pc98.wdc0.xml#1 branch .. //depot/projects/ia64_epc/tools/regression/geom/Ref/disk.sun.da0.xml#1 branch .. //depot/projects/ia64_epc/tools/regression/geom/Ref/disk.sun.da1.xml#1 branch .. //depot/projects/ia64_epc/tools/regression/geom/Ref/disk.typo.ad0.xml#1 branch .. //depot/projects/ia64_epc/tools/regression/geom/RunTest.sh#1 branch .. //depot/projects/ia64_epc/usr.bin/Makefile#4 integrate .. //depot/projects/ia64_epc/usr.bin/chpass/edit.c#2 integrate .. //depot/projects/ia64_epc/usr.bin/killall/killall.1#2 integrate .. //depot/projects/ia64_epc/usr.bin/killall/killall.c#2 integrate .. //depot/projects/ia64_epc/usr.bin/systat/vmstat.c#4 integrate .. //depot/projects/ia64_epc/usr.bin/uniq/uniq.1#2 integrate .. //depot/projects/ia64_epc/usr.bin/usbhidaction/Makefile#1 branch .. //depot/projects/ia64_epc/usr.bin/usbhidaction/usbhidaction.1#1 branch .. //depot/projects/ia64_epc/usr.bin/usbhidaction/usbhidaction.c#1 branch .. //depot/projects/ia64_epc/usr.bin/usbhidctl/usbhid.c#2 integrate .. //depot/projects/ia64_epc/usr.bin/vmstat/vmstat.c#4 integrate .. //depot/projects/ia64_epc/usr.sbin/Makefile#4 integrate .. //depot/projects/ia64_epc/usr.sbin/diskinfo/Makefile#1 branch .. //depot/projects/ia64_epc/usr.sbin/diskinfo/diskinfo.8#1 branch .. //depot/projects/ia64_epc/usr.sbin/diskinfo/diskinfo.c#1 branch .. //depot/projects/ia64_epc/usr.sbin/jail/jail.8#5 integrate .. //depot/projects/ia64_epc/usr.sbin/jail/jail.c#4 integrate .. //depot/projects/ia64_epc/usr.sbin/jexec/Makefile#1 branch .. //depot/projects/ia64_epc/usr.sbin/jexec/jexec.8#1 branch .. //depot/projects/ia64_epc/usr.sbin/jexec/jexec.c#1 branch .. //depot/projects/ia64_epc/usr.sbin/jls/Makefile#1 branch .. //depot/projects/ia64_epc/usr.sbin/jls/jls.8#1 branch .. //depot/projects/ia64_epc/usr.sbin/jls/jls.c#1 branch .. //depot/projects/ia64_epc/usr.sbin/mixer/mixer.8#2 integrate .. //depot/projects/ia64_epc/usr.sbin/mixer/mixer.c#2 integrate .. //depot/projects/ia64_epc/usr.sbin/rtadvd/config.c#4 integrate Differences ... ==== //depot/projects/ia64_epc/Makefile.inc1#8 (text+ko) ==== @@ -1,5 +1,5 @@ # -# $FreeBSD: src/Makefile.inc1,v 1.339 2003/04/07 00:01:33 ru Exp $ +# $FreeBSD: src/Makefile.inc1,v 1.340 2003/04/11 17:58:17 ru Exp $ # # Make command line options: # -DMAKE_KERBEROS5 to build Kerberos5 @@ -625,6 +625,7 @@ @${ECHODIR} "===> ${_tool}"; \ cd ${.CURDIR}/${_tool}; \ ${MAKE} DIRPRFX=${_tool}/ obj; \ + ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy includes; \ ${MAKE} DIRPRFX=${_tool}/ depend; \ ${MAKE} DIRPRFX=${_tool}/ all; \ ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy install ==== //depot/projects/ia64_epc/bin/echo/echo.1#2 (text+ko) ==== @@ -33,9 +33,9 @@ .\" SUCH DAMAGE. .\" .\" @(#)echo.1 8.1 (Berkeley) 7/22/93 -.\" $FreeBSD: src/bin/echo/echo.1,v 1.13 2001/08/15 09:09:35 ru Exp $ +.\" $FreeBSD: src/bin/echo/echo.1,v 1.14 2003/04/12 03:49:28 tjr Exp $ .\" -.Dd July 22, 1993 +.Dd April 12, 2003 .Dt ECHO 1 .Os .Sh NAME @@ -81,6 +81,6 @@ .Sh STANDARDS The .Nm -utility is expected to be -.St -p1003.2 -compatible. +utility conforms to +.St -p1003.1-2001 +as amended by Cor. 1-2002. ==== //depot/projects/ia64_epc/bin/pwd/pwd.1#2 (text+ko) ==== @@ -33,9 +33,9 @@ .\" SUCH DAMAGE. .\" .\" @(#)pwd.1 8.2 (Berkeley) 4/28/95 -.\" $FreeBSD: src/bin/pwd/pwd.1,v 1.20 2002/05/18 13:52:07 tjr Exp $ +.\" $FreeBSD: src/bin/pwd/pwd.1,v 1.21 2003/04/12 03:22:54 tjr Exp $ .\" -.Dd February 4, 2002 +.Dd April 12, 2003 .Dt PWD 1 .Os .Sh NAME @@ -43,7 +43,7 @@ .Nd return working directory name .Sh SYNOPSIS .Nm -.Op Fl LP +.Oo Fl L | Fl P Oc .Sh DESCRIPTION The .Nm ==== //depot/projects/ia64_epc/bin/sh/sh.1#2 (text+ko) ==== @@ -33,9 +33,9 @@ .\" SUCH DAMAGE. .\" .\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95 -.\" $FreeBSD: src/bin/sh/sh.1,v 1.84 2003/02/03 23:03:05 fanf Exp $ +.\" $FreeBSD: src/bin/sh/sh.1,v 1.85 2003/04/12 03:20:28 tjr Exp $ .\" -.Dd May 5, 1995 +.Dd April 12, 2003 .Dt SH 1 .Os .Sh NAME @@ -1296,7 +1296,7 @@ List or alter key bindings for the line editor. This command is documented in .Xr editrc 5 . -.It Ic cd Oo Fl LP Oc Op Ar directory +.It Ic cd Oo Fl L | Fl P Oc Op Ar directory Switch to the specified .Ar directory , or to the directory specified in the @@ -1627,7 +1627,7 @@ If the .Fl s option is specified, only the PIDs of the jobs are printed, one per line. -.It Ic pwd Op Fl LP +.It Ic pwd Oo Fl L | Fl P Oc Print the path of the current directory. The built-in command may differ from the program of the same name because the built-in command remembers what the current directory ==== //depot/projects/ia64_epc/contrib/gdtoa/gdtoaimp.h#3 (text+ko) ==== @@ -26,7 +26,7 @@ ****************************************************************/ -/* $FreeBSD: src/contrib/gdtoa/gdtoaimp.h,v 1.4 2003/04/05 22:09:26 das Exp $ */ +/* $FreeBSD: src/contrib/gdtoa/gdtoaimp.h,v 1.5 2003/04/09 06:04:35 das Exp $ */ /* This is a variation on dtoa.c that converts arbitary binary floating-point formats to and from decimal notation. It uses @@ -600,6 +600,7 @@ extern Bigint *diff ANSI((Bigint*, Bigint*)); extern char *dtoa ANSI((double d, int mode, int ndigits, int *decpt, int *sign, char **rve)); + extern void freedtoa ANSI((char*)); extern char *gdtoa ANSI((FPI *fpi, int be, ULong *bits, int *kindp, int mode, int ndigits, int *decpt, char **rve)); extern char *g__fmt ANSI((char*, char*, char*, int, ULong)); @@ -623,8 +624,28 @@ extern Bigint *s2b ANSI((CONST char*, int, int, ULong)); extern Bigint *set_ones ANSI((Bigint*, int)); extern char *strcp ANSI((char*, const char*)); + extern int strtodg ANSI((CONST char*, char**, FPI*, Long*, ULong*)); + + extern int strtoId ANSI((CONST char *, char **, double *, double *)); + extern int strtoIdd ANSI((CONST char *, char **, double *, double *)); + extern int strtoIf ANSI((CONST char *, char **, float *, float *)); extern int strtoIg ANSI((CONST char*, char**, FPI*, Long*, Bigint**, int*)); + extern int strtoIQ ANSI((CONST char *, char **, void *, void *)); + extern int strtoIx ANSI((CONST char *, char **, void *, void *)); + extern int strtoIxL ANSI((CONST char *, char **, void *, void *)); extern double strtod ANSI((const char *s00, char **se)); + extern int strtopQ ANSI((CONST char *, char **, Void *)); + extern int strtopf ANSI((CONST char *, char **, float *)); + extern int strtopd ANSI((CONST char *, char **, double *)); + extern int strtopdd ANSI((CONST char *, char **, double *)); + extern int strtopx ANSI((CONST char *, char **, Void *)); + extern int strtopxL ANSI((CONST char *, char **, Void *)); + extern int strtord ANSI((CONST char *, char **, int, double *)); + extern int strtordd ANSI((CONST char *, char **, int, double *)); + extern int strtorf ANSI((CONST char *, char **, int, float *)); + extern int strtorQ ANSI((CONST char *, char **, int, void *)); + extern int strtorx ANSI((CONST char *, char **, int, void *)); + extern int strtorxL ANSI((CONST char *, char **, int, void *)); extern Bigint *sum ANSI((Bigint*, Bigint*)); extern int trailz ANSI((Bigint*)); extern double ulp ANSI((double)); ==== //depot/projects/ia64_epc/etc/defaults/pccard.conf#4 (text+ko) ==== @@ -1,7 +1,7 @@ # # Default PCCARD configuration file # -# $FreeBSD: src/etc/defaults/pccard.conf,v 1.259 2003/03/28 11:12:52 sobomax Exp $ +# $FreeBSD: src/etc/defaults/pccard.conf,v 1.260 2003/04/10 17:16:01 shiba Exp $ # # Please send new entries for this file to imp@freebsd.org. He likes to # review them before they are committed to make sure they are correct for @@ -2081,6 +2081,12 @@ insert /etc/pccard_ether $device start remove /etc/pccard_ether $device stop +# NTT-ME SS-LAN CARD MN128 +card "NTT-ME" "11Mbps Wireless LAN PC Card" + config auto "wi" ? + insert /etc/pccard_ether $device start + remove /etc/pccard_ether $device stop + # Generic PRISM2.5 card card "PCMCIA" "11M WLAN Card v2.5" config auto "wi" ? ==== //depot/projects/ia64_epc/gnu/usr.bin/binutils/addr2line/Makefile#2 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/gnu/usr.bin/binutils/addr2line/Makefile,v 1.7 2002/03/20 23:05:09 obrien Exp $ +# $FreeBSD: src/gnu/usr.bin/binutils/addr2line/Makefile,v 1.8 2003/04/11 18:02:09 ru Exp $ .include "../Makefile.inc0" @@ -9,9 +9,10 @@ WARNS= 2 CFLAGS+= -I${.CURDIR}/${RELTOP}/libbinutils CFLAGS+= -I${SRCDIR}/binutils -DPADD= ${RELTOP}/libbinutils/libbinutils.a -DPADD+= ${RELTOP}/libbfd/libbfd.a -DPADD+= ${RELTOP}/libiberty/libiberty.a +DPADD:= ${RELTOP}/libbinutils/libbinutils.a \ + ${RELTOP}/libbfd/libbfd.a \ + ${RELTOP}/libiberty/libiberty.a \ + ${DPADD} LDADD= ${DPADD} .include ==== //depot/projects/ia64_epc/gnu/usr.bin/binutils/ar/Makefile#2 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/gnu/usr.bin/binutils/ar/Makefile,v 1.9 2002/03/20 23:05:09 obrien Exp $ +# $FreeBSD: src/gnu/usr.bin/binutils/ar/Makefile,v 1.10 2003/04/11 18:02:09 ru Exp $ .include "../Makefile.inc0" @@ -10,9 +10,10 @@ CFLAGS+= -I${SRCDIR}/binutils CFLAGS+= -I${SRCDIR}/bfd NOSHARED?= yes -DPADD= ${RELTOP}/libbinutils/libbinutils.a -DPADD+= ${RELTOP}/libbfd/libbfd.a -DPADD+= ${RELTOP}/libiberty/libiberty.a +DPADD:= ${RELTOP}/libbinutils/libbinutils.a \ + ${RELTOP}/libbfd/libbfd.a \ + ${RELTOP}/libiberty/libiberty.a \ + ${DPADD} LDADD= ${DPADD} .include ==== //depot/projects/ia64_epc/gnu/usr.bin/binutils/as/Makefile.inc0#2 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/gnu/usr.bin/binutils/as/Makefile.inc0,v 1.21 2002/12/02 09:41:35 obrien Exp $ +# $FreeBSD: src/gnu/usr.bin/binutils/as/Makefile.inc0,v 1.22 2003/04/11 18:02:09 ru Exp $ .include "${.CURDIR}/../../Makefile.inc0" @@ -20,9 +20,10 @@ CFLAGS+= -DVERSION=\"${VERSION:C/[ ]?${VERSION_DATE}[ ]?//g}\" CFLAGS+= -DBFD_VERSION_STRING=\"${VERSION}\" NOSHARED?= yes -DPADD= ${RELTOP}/libbfd/libbfd.a -DPADD+= ${RELTOP}/libiberty/libiberty.a -DPADD+= ${RELTOP}/libopcodes/libopcodes.a +DPADD:= ${RELTOP}/libbfd/libbfd.a \ + ${RELTOP}/libiberty/libiberty.a \ + ${RELTOP}/libopcodes/libopcodes.a \ + ${DPADD} LDADD= ${DPADD} # If set, BINUTILSDISTDIR is the path to a directory containing the full GNU ==== //depot/projects/ia64_epc/gnu/usr.bin/binutils/ld/Makefile#3 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/gnu/usr.bin/binutils/ld/Makefile,v 1.24 2003/04/05 20:30:29 imp Exp $ +# $FreeBSD: src/gnu/usr.bin/binutils/ld/Makefile,v 1.25 2003/04/11 18:02:09 ru Exp $ .include "../Makefile.inc0" @@ -15,8 +15,9 @@ CFLAGS+= -DBFD_VERSION_STRING=\"${VERSION}\" CFLAGS+= -I${SRCDIR}/ld -I${SRCDIR}/bfd NOSHARED?= yes -DPADD+= ${RELTOP}/libbfd/libbfd.a -DPADD+= ${RELTOP}/libiberty/libiberty.a +DPADD:= ${RELTOP}/libbfd/libbfd.a \ + ${RELTOP}/libiberty/libiberty.a \ + ${DPADD} LDADD= ${DPADD} CLEANDIRS+= ldscripts CLEANFILES+= ldemul-list.h stringify.sed ==== //depot/projects/ia64_epc/gnu/usr.bin/binutils/nm/Makefile#2 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/gnu/usr.bin/binutils/nm/Makefile,v 1.9 2002/10/11 06:28:05 obrien Exp $ +# $FreeBSD: src/gnu/usr.bin/binutils/nm/Makefile,v 1.10 2003/04/11 18:02:09 ru Exp $ .include "../Makefile.inc0" @@ -10,9 +10,10 @@ CFLAGS+= -I${.CURDIR}/${RELTOP}/libbinutils CFLAGS+= -I${SRCDIR}/bfd CFLAGS+= -I${SRCDIR}/binutils -DPADD= ${RELTOP}/libbinutils/libbinutils.a -DPADD+= ${RELTOP}/libbfd/libbfd.a -DPADD+= ${RELTOP}/libiberty/libiberty.a +DPADD:= ${RELTOP}/libbinutils/libbinutils.a \ + ${RELTOP}/libbfd/libbfd.a \ + ${RELTOP}/libiberty/libiberty.a \ + ${DPADD} LDADD= ${DPADD} .include ==== //depot/projects/ia64_epc/gnu/usr.bin/binutils/objcopy/Makefile#2 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/gnu/usr.bin/binutils/objcopy/Makefile,v 1.8 2002/03/20 23:05:18 obrien Exp $ +# $FreeBSD: src/gnu/usr.bin/binutils/objcopy/Makefile,v 1.9 2003/04/11 18:02:09 ru Exp $ .include "../Makefile.inc0" @@ -9,9 +9,10 @@ WARNS= 2 CFLAGS+= -I${.CURDIR}/${RELTOP}/libbinutils CFLAGS+= -I${SRCDIR}/binutils -DPADD= ${RELTOP}/libbinutils/libbinutils.a -DPADD+= ${RELTOP}/libbfd/libbfd.a -DPADD+= ${RELTOP}/libiberty/libiberty.a +DPADD:= ${RELTOP}/libbinutils/libbinutils.a \ + ${RELTOP}/libbfd/libbfd.a \ + ${RELTOP}/libiberty/libiberty.a \ + ${DPADD} LDADD= ${DPADD} .include ==== //depot/projects/ia64_epc/gnu/usr.bin/binutils/objdump/Makefile#2 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/gnu/usr.bin/binutils/objdump/Makefile,v 1.10 2002/03/20 23:05:18 obrien Exp $ +# $FreeBSD: src/gnu/usr.bin/binutils/objdump/Makefile,v 1.11 2003/04/11 18:02:09 ru Exp $ .include "../Makefile.inc0" @@ -10,10 +10,11 @@ CFLAGS+= -I${.CURDIR}/${RELTOP}/libbinutils CFLAGS+= -I${SRCDIR}/binutils CFLAGS+= -DBFD_VERSION_STRING=\"${VERSION}\" -DPADD= ${RELTOP}/libbinutils/libbinutils.a -DPADD+= ${RELTOP}/libopcodes/libopcodes.a -DPADD+= ${RELTOP}/libbfd/libbfd.a -DPADD+= ${RELTOP}/libiberty/libiberty.a +DPADD:= ${RELTOP}/libbinutils/libbinutils.a \ + ${RELTOP}/libopcodes/libopcodes.a \ + ${RELTOP}/libbfd/libbfd.a \ + ${RELTOP}/libiberty/libiberty.a \ + ${DPADD} LDADD= ${DPADD} .include ==== //depot/projects/ia64_epc/gnu/usr.bin/binutils/ranlib/Makefile#2 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/gnu/usr.bin/binutils/ranlib/Makefile,v 1.9 2002/03/20 23:05:18 obrien Exp $ +# $FreeBSD: src/gnu/usr.bin/binutils/ranlib/Makefile,v 1.10 2003/04/11 18:02:09 ru Exp $ .include "../Makefile.inc0" @@ -10,9 +10,10 @@ CFLAGS+= -I${SRCDIR}/binutils CFLAGS+= -I${SRCDIR}/bfd NOSHARED?= yes -DPADD= ${RELTOP}/libbinutils/libbinutils.a -DPADD+= ${RELTOP}/libbfd/libbfd.a -DPADD+= ${RELTOP}/libiberty/libiberty.a +DPADD:= ${RELTOP}/libbinutils/libbinutils.a \ + ${RELTOP}/libbfd/libbfd.a \ + ${RELTOP}/libiberty/libiberty.a \ + ${DPADD} LDADD= ${DPADD} .include ==== //depot/projects/ia64_epc/gnu/usr.bin/binutils/readelf/Makefile#2 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/gnu/usr.bin/binutils/readelf/Makefile,v 1.5 2002/03/20 23:05:19 obrien Exp $ +# $FreeBSD: src/gnu/usr.bin/binutils/readelf/Makefile,v 1.6 2003/04/11 18:02:10 ru Exp $ .include "../Makefile.inc0" @@ -12,9 +12,10 @@ WARNS= 2 CFLAGS+= -I${.CURDIR}/${RELTOP}/libbinutils -I${SRCDIR}/binutils -DPADD= ${RELTOP}/libbinutils/libbinutils.a -DPADD+= ${RELTOP}/libbfd/libbfd.a -DPADD+= ${RELTOP}/libiberty/libiberty.a +DPADD:= ${RELTOP}/libbinutils/libbinutils.a \ + ${RELTOP}/libbfd/libbfd.a \ + ${RELTOP}/libiberty/libiberty.a \ + ${DPADD} LDADD= ${DPADD} .include ==== //depot/projects/ia64_epc/gnu/usr.bin/binutils/size/Makefile#2 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/gnu/usr.bin/binutils/size/Makefile,v 1.8 2002/03/20 23:05:19 obrien Exp $ +# $FreeBSD: src/gnu/usr.bin/binutils/size/Makefile,v 1.9 2003/04/11 18:02:10 ru Exp $ .include "../Makefile.inc0" @@ -9,9 +9,10 @@ WARNS= 2 CFLAGS+= -I${.CURDIR}/${RELTOP}/libbinutils CFLAGS+= -I${SRCDIR}/binutils -DPADD= ${RELTOP}/libbinutils/libbinutils.a -DPADD+= ${RELTOP}/libbfd/libbfd.a -DPADD+= ${RELTOP}/libiberty/libiberty.a +DPADD:= ${RELTOP}/libbinutils/libbinutils.a \ + ${RELTOP}/libbfd/libbfd.a \ + ${RELTOP}/libiberty/libiberty.a \ + ${DPADD} LDADD= ${DPADD} .include ==== //depot/projects/ia64_epc/gnu/usr.bin/binutils/strings/Makefile#2 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/gnu/usr.bin/binutils/strings/Makefile,v 1.8 2002/03/20 23:05:19 obrien Exp $ +# $FreeBSD: src/gnu/usr.bin/binutils/strings/Makefile,v 1.9 2003/04/11 18:02:10 ru Exp $ .include "../Makefile.inc0" @@ -9,9 +9,10 @@ WARNS= 2 CFLAGS+= -I${.CURDIR}/${RELTOP}/libbinutils CFLAGS+= -I${SRCDIR}/binutils -DPADD= ${RELTOP}/libbinutils/libbinutils.a -DPADD+= ${RELTOP}/libbfd/libbfd.a -DPADD+= ${RELTOP}/libiberty/libiberty.a +DPADD:= ${RELTOP}/libbinutils/libbinutils.a \ + ${RELTOP}/libbfd/libbfd.a \ + ${RELTOP}/libiberty/libiberty.a \ + ${DPADD} LDADD= ${DPADD} .include ==== //depot/projects/ia64_epc/gnu/usr.bin/binutils/strip/Makefile#2 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/gnu/usr.bin/binutils/strip/Makefile,v 1.11 2002/07/29 09:40:08 ru Exp $ +# $FreeBSD: src/gnu/usr.bin/binutils/strip/Makefile,v 1.12 2003/04/11 18:02:10 ru Exp $ .include "../Makefile.inc0" @@ -9,9 +9,10 @@ WARNS= 2 CFLAGS+= -I${.CURDIR}/${RELTOP}/libbinutils CFLAGS+= -I${SRCDIR}/binutils -DPADD= ${RELTOP}/libbinutils/libbinutils.a -DPADD+= ${RELTOP}/libbfd/libbfd.a -DPADD+= ${RELTOP}/libiberty/libiberty.a +DPADD:= ${RELTOP}/libbinutils/libbinutils.a \ + ${RELTOP}/libbfd/libbfd.a \ + ${RELTOP}/libiberty/libiberty.a \ + ${DPADD} LDADD= ${DPADD} CLEANFILES+= maybe_stripped ==== //depot/projects/ia64_epc/lib/libc/gdtoa/machdep_ldisQ.c#2 (text+ko) ==== @@ -31,7 +31,7 @@ */ #include -__FBSDID("$FreeBSD: src/lib/libc/gdtoa/machdep_ldisQ.c,v 1.1 2003/03/12 20:29:58 das Exp $"); +__FBSDID("$FreeBSD: src/lib/libc/gdtoa/machdep_ldisQ.c,v 1.2 2003/04/09 05:58:43 das Exp $"); #include "gdtoaimp.h" @@ -40,6 +40,6 @@ { long double result; - strtopQ(s, sp, result); + strtopQ(s, sp, &result); return result; } ==== //depot/projects/ia64_epc/lib/libc/gdtoa/machdep_ldisx.c#2 (text+ko) ==== @@ -31,7 +31,7 @@ */ #include -__FBSDID("$FreeBSD: src/lib/libc/gdtoa/machdep_ldisx.c,v 1.1 2003/03/12 20:29:58 das Exp $"); +__FBSDID("$FreeBSD: src/lib/libc/gdtoa/machdep_ldisx.c,v 1.2 2003/04/09 05:58:43 das Exp $"); #include "gdtoaimp.h" @@ -40,6 +40,6 @@ { long double result; - strtopx(s, sp, result); + strtopx(s, sp, &result); return result; } ==== //depot/projects/ia64_epc/lib/libc/gen/getbootfile.c#2 (text+ko) ==== @@ -35,7 +35,7 @@ static char sccsid[] = "From: @(#)gethostname.c 8.1 (Berkeley) 6/4/93"; #endif /* LIBC_SCCS and not lint */ #include -__FBSDID("$FreeBSD: src/lib/libc/gen/getbootfile.c,v 1.6 2002/02/01 00:57:29 obrien Exp $"); +__FBSDID("$FreeBSD: src/lib/libc/gen/getbootfile.c,v 1.7 2003/04/11 13:54:28 tjr Exp $"); #include #include @@ -50,6 +50,6 @@ mib[0] = CTL_KERN; mib[1] = KERN_BOOTFILE; if (sysctl(mib, 2, name, &size, NULL, 0) == -1) - return ("/kernel"); + return ("/boot/kernel/kernel"); return (name); } ==== //depot/projects/ia64_epc/lib/libc/locale/wcrtomb.c#2 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/lib/libc/locale/wcrtomb.c,v 1.3 2002/10/25 13:24:45 tjr Exp $"); +__FBSDID("$FreeBSD: src/lib/libc/locale/wcrtomb.c,v 1.4 2003/04/10 09:20:38 tjr Exp $"); #include #include @@ -39,8 +39,10 @@ char *e; char buf[MB_LEN_MAX]; - if (s == NULL) + if (s == NULL) { s = buf; + wc = L'\0'; + } sputrune(wc, s, MB_CUR_MAX, &e); if (e == NULL) { errno = EILSEQ; ==== //depot/projects/ia64_epc/lib/libc/sys/Makefile.inc#2 (text+ko) ==== @@ -1,5 +1,5 @@ # @(#)Makefile.inc 8.3 (Berkeley) 10/24/94 -# $FreeBSD: src/lib/libc/sys/Makefile.inc,v 1.100 2003/01/12 09:28:16 tjr Exp $ +# $FreeBSD: src/lib/libc/sys/Makefile.inc,v 1.101 2003/04/09 02:55:17 mike Exp $ # sys sources .PATH: ${.CURDIR}/${MACHINE_ARCH}/sys ${.CURDIR}/sys @@ -115,6 +115,7 @@ MLINKS+=gettimeofday.2 settimeofday.2 MLINKS+=getuid.2 geteuid.2 MLINKS+=intro.2 errno.2 +MLINKS+=jail.2 jail_attach.2 MLINKS+=kqueue.2 kevent.2 MLINKS+=kse.2 kse_create.2 kse.2 kse_exit.2 kse.2 kse_release.2 \ kse.2 kse_wakeup.2 kse.2 kse_thr_interrupt.2 ==== //depot/projects/ia64_epc/lib/libc/sys/jail.2#2 (text+ko) ==== @@ -6,9 +6,9 @@ .\"this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp .\"---------------------------------------------------------------------------- .\" -.\"$FreeBSD: src/lib/libc/sys/jail.2,v 1.22 2002/12/18 09:22:30 ru Exp $ +.\"$FreeBSD: src/lib/libc/sys/jail.2,v 1.23 2003/04/09 02:55:17 mike Exp $ .\" -.Dd April 28, 1999 +.Dd April 8, 2003 .Dt JAIL 2 .Os .Sh NAME @@ -17,10 +17,12 @@ .Sh LIBRARY .Lb libc .Sh SYNOPSIS -.In sys/types.h +.In sys/param.h .In sys/jail.h .Ft int .Fn jail "struct jail *jail" +.Ft int +.Fn jail_attach "int jid" .Sh DESCRIPTION The .Fn jail @@ -52,9 +54,29 @@ The .Dq Li ip_number can be set to the IP number assigned to the prison. +.Pp +The +.Fn jail_attach +system call attaches the current process to an existing jail, +identified by +.Va jid . +.Sh RETURN VALUES +If successful, +.Fn jail +returns a non-negative integer, termed the jail identifier (JID). +It returns -1 on failure, and sets +.Va errno +to indicate the error. +.Pp +If successful, +.Fn jail_attach +returns 0. +It returns -1 on failure, and sets +.Va errno +to indicate the error. .Sh PRISON? Once a process has been put in a prison, it and its decendants cannot escape -the prison. It is not possible to add a process to a preexisting prison. +the prison. .Pp Inside the prison, the concept of "superuser" is very diluted. In general, it can be assumed that nothing can be mangled from inside a prison which @@ -100,6 +122,10 @@ .Fn jail system call appeared in .Fx 4.0 . +The +.Fn jail_attach +system call appeared in +.Fx 5.1 . .Sh AUTHORS The jail feature was written by .An Poul-Henning Kamp ==== //depot/projects/ia64_epc/lib/libdevstat/devstat.c#4 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include -__FBSDID("$FreeBSD: src/lib/libdevstat/devstat.c,v 1.21 2003/03/19 14:15:32 phk Exp $"); +__FBSDID("$FreeBSD: src/lib/libdevstat/devstat.c,v 1.22 2003/04/09 07:49:15 phk Exp $"); #include #include @@ -1512,6 +1512,8 @@ *destld = 0; *destld /= etime; *destld *= 100; + if (*destld < 0) + *destld = 0; break; case DSM_QUEUE_LENGTH: *destu64 = current->start_count - current->end_count; ==== //depot/projects/ia64_epc/lib/libkvm/kvm_proc.c#5 (text+ko) ==== @@ -42,7 +42,7 @@ #endif #include -__FBSDID("$FreeBSD: src/lib/libkvm/kvm_proc.c,v 1.65 2003/04/01 04:49:12 jeff Exp $"); +__FBSDID("$FreeBSD: src/lib/libkvm/kvm_proc.c,v 1.66 2003/04/10 17:41:40 julian Exp $"); /* * Proc traversal interface for kvm. ps and w are (probably) the exclusive @@ -364,6 +364,7 @@ kp->ki_pri.pri_native = mtd.td_base_pri; kp->ki_lastcpu = mtd.td_lastcpu; kp->ki_wchan = mtd.td_wchan; + kp->ki_oncpu = mtd.td_oncpu; if (!(proc.p_flag & P_THREADED)) { /* stuff from the ksegrp */ @@ -376,10 +377,7 @@ /* Stuff from the kse */ kp->ki_pctcpu = mke.ke_pctcpu; kp->ki_rqindex = mke.ke_rqindex; - kp->ki_oncpu = mke.ke_oncpu; } else { - kp->ki_oncpu = -1; - kp->ki_lastcpu = -1; kp->ki_tdflags = -1; /* All the rest are 0 for now */ } ==== //depot/projects/ia64_epc/lib/libusbhid/Makefile#2 (text+ko) ==== @@ -1,12 +1,12 @@ # $NetBSD: Makefile,v 1.5 1999/07/23 09:44:38 mrg Exp $ -# $FreeBSD: src/lib/libusbhid/Makefile,v 1.7 2002/09/28 00:25:31 peter Exp $ +# $FreeBSD: src/lib/libusbhid/Makefile,v 1.8 2003/04/09 01:52:48 mdodd Exp $ MAINTAINER= n_hibma@FreeBSD.ORG LIB= usbhid MAN= usbhid.3 -SHLIB_MAJOR= 0 +SHLIB_MAJOR= 1 MLINKS= usbhid.3 libusbhid.3 usbhid.3 hid_get_report_desc.3 \ usbhid.3 hid_dispose_report_desc.3 \ @@ -19,7 +19,6 @@ SRCS= descr.c parse.c usage.c data.c -INCS= libusbhid.h +INCS= usbhid.h .include - ==== //depot/projects/ia64_epc/lib/libusbhid/data.c#2 (text+ko) ==== @@ -27,11 +27,11 @@ */ #include -__FBSDID("$FreeBSD: src/lib/libusbhid/data.c,v 1.5 2002/03/28 11:42:45 joe Exp $"); +__FBSDID("$FreeBSD: src/lib/libusbhid/data.c,v 1.6 2003/04/09 01:52:48 mdodd Exp $"); #include #include -#include "libusbhid.h" +#include "usbhid.h" int hid_get_data(const void *p, const hid_item_t *h) ==== //depot/projects/ia64_epc/lib/libusbhid/descr.c#2 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include -__FBSDID("$FreeBSD: src/lib/libusbhid/descr.c,v 1.7 2002/03/28 11:42:45 joe Exp $"); +__FBSDID("$FreeBSD: src/lib/libusbhid/descr.c,v 1.8 2003/04/09 01:52:48 mdodd Exp $"); #include @@ -37,13 +37,11 @@ #include #include #include -#if defined(__FreeBSD__) #include -#endif #include -#include "libusbhid.h" +#include "usbhid.h" #include "usbvar.h" report_desc_t ==== //depot/projects/ia64_epc/lib/libusbhid/parse.c#3 (text+ko) ==== @@ -1,7 +1,7 @@ /* $NetBSD: parse.c,v 1.11 2000/09/24 02:19:54 augustss Exp $ */ /* - * Copyright (c) 1999 Lennart Augustsson + * Copyright (c) 1999, 2001 Lennart Augustsson * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -27,7 +27,7 @@ */ #include -__FBSDID("$FreeBSD: src/lib/libusbhid/parse.c,v 1.7 2003/04/07 00:49:53 mdodd Exp $"); +__FBSDID("$FreeBSD: src/lib/libusbhid/parse.c,v 1.8 2003/04/09 01:52:48 mdodd Exp $"); #include #include @@ -37,7 +37,7 @@ #include #include -#include "libusbhid.h" +#include "usbhid.h" #include "usbvar.h" #define MAXUSAGE 100 @@ -49,18 +49,30 @@ unsigned int usages[MAXUSAGE]; int nusage; int minset; + int logminsize; int multi; int multimax; >>> TRUNCATED FOR MAIL (1000 lines) <<< From owner-p4-projects@FreeBSD.ORG Sat Apr 12 08:35:14 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id C917537B404; Sat, 12 Apr 2003 08:35:13 -0700 (PDT) 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 8159537B401 for ; Sat, 12 Apr 2003 08:35:13 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 29C8543F93 for ; Sat, 12 Apr 2003 08:35:13 -0700 (PDT) (envelope-from robert@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h3CFZC0U013684 for ; Sat, 12 Apr 2003 08:35:12 -0700 (PDT) (envelope-from robert@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h3CFZC6X013681 for perforce@freebsd.org; Sat, 12 Apr 2003 08:35:12 -0700 (PDT) Date: Sat, 12 Apr 2003 08:35:12 -0700 (PDT) Message-Id: <200304121535.h3CFZC6X013681@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to robert@freebsd.org using -f From: Robert Drehmel To: Perforce Change Reviews Subject: PERFORCE change 28817 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, 12 Apr 2003 15:35:14 -0000 http://perforce.freebsd.org/chv.cgi?CH=28817 Change 28817 by robert@robert_spes on 2003/04/12 08:35:07 Add type definitions for TARGET_ARCH __mips__. Affected files ... .. //depot/projects/mips/lib/libstand/zalloc_defs.h#2 edit Differences ... ==== //depot/projects/mips/lib/libstand/zalloc_defs.h#2 (text+ko) ==== @@ -48,21 +48,25 @@ typedef int saddr_t; /* signed int same size as pointer */ #endif #ifdef __alpha__ -typedef unsigned long iaddr_t; /* unsigned int same size as pointer */ -typedef long saddr_t; /* signed int same size as pointer */ +typedef unsigned long iaddr_t; /* unsigned long same size as pointer */ +typedef long saddr_t; /* signed long same size as pointer */ #endif #ifdef __powerpc__ typedef unsigned int iaddr_t; /* unsigned int same size as pointer */ typedef int saddr_t; /* signed int same size as pointer */ #endif #ifdef __ia64__ -typedef unsigned long iaddr_t; /* unsigned int same size as pointer */ -typedef long saddr_t; /* signed int same size as pointer */ +typedef unsigned long iaddr_t; /* unsigned long same size as pointer */ +typedef long saddr_t; /* signed long same size as pointer */ #endif #ifdef __sparc64__ typedef unsigned long iaddr_t; /* unsigned long same size as pointer */ typedef long saddr_t; /* signed long same size as pointer */ #endif +#ifdef __mips__ +typedef unsigned long iaddr_t; /* unsigned long same size as pointer */ +typedef long saddr_t; /* signed long same size as pointer */ +#endif #include "zalloc_mem.h" From owner-p4-projects@FreeBSD.ORG Sat Apr 12 08:37:18 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 5F62937B401; Sat, 12 Apr 2003 08:37:18 -0700 (PDT) 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 BB8C237B404 for ; Sat, 12 Apr 2003 08:37:17 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id E071E43FCB for ; Sat, 12 Apr 2003 08:37:16 -0700 (PDT) (envelope-from robert@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h3CFbG0U013863 for ; Sat, 12 Apr 2003 08:37:16 -0700 (PDT) (envelope-from robert@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h3CFbGL5013860 for perforce@freebsd.org; Sat, 12 Apr 2003 08:37:16 -0700 (PDT) Date: Sat, 12 Apr 2003 08:37:16 -0700 (PDT) Message-Id: <200304121537.h3CFbGL5013860@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to robert@freebsd.org using -f From: Robert Drehmel To: Perforce Change Reviews Subject: PERFORCE change 28819 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, 12 Apr 2003 15:37:19 -0000 http://perforce.freebsd.org/chv.cgi?CH=28819 Change 28819 by robert@robert_spes on 2003/04/12 08:37:07 Fix warnings which occurred if sizeof(long) > sizeof(int). Affected files ... .. //depot/projects/mips/lib/libstand/quad.h#2 edit Differences ... ==== //depot/projects/mips/lib/libstand/quad.h#2 (text+ko) ==== @@ -94,7 +94,7 @@ * (sizeof(long)*CHAR_BIT/2). */ #define HHALF(x) ((x) >> HALF_BITS) -#define LHALF(x) ((x) & ((1 << HALF_BITS) - 1)) +#define LHALF(x) ((x) & ((1UL << HALF_BITS) - 1)) #define LHUP(x) ((x) << HALF_BITS) quad_t __divdi3(quad_t a, quad_t b); From owner-p4-projects@FreeBSD.ORG Sat Apr 12 08:41:23 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 259CD37B404; Sat, 12 Apr 2003 08:41:23 -0700 (PDT) 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 D0BA537B401 for ; Sat, 12 Apr 2003 08:41:22 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7C2D243F93 for ; Sat, 12 Apr 2003 08:41:22 -0700 (PDT) (envelope-from robert@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h3CFfM0U014427 for ; Sat, 12 Apr 2003 08:41:22 -0700 (PDT) (envelope-from robert@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h3CFfMXZ014424 for perforce@freebsd.org; Sat, 12 Apr 2003 08:41:22 -0700 (PDT) Date: Sat, 12 Apr 2003 08:41:22 -0700 (PDT) Message-Id: <200304121541.h3CFfMXZ014424@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to robert@freebsd.org using -f From: Robert Drehmel To: Perforce Change Reviews Subject: PERFORCE change 28820 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, 12 Apr 2003 15:41:23 -0000 http://perforce.freebsd.org/chv.cgi?CH=28820 Change 28820 by robert@robert_spes on 2003/04/12 08:40:57 Silenced two warning emissions by casting the const type-qualifier away. Affected files ... .. //depot/projects/mips/lib/libstand/environment.c#2 edit Differences ... ==== //depot/projects/mips/lib/libstand/environment.c#2 (text+ko) ==== @@ -75,7 +75,7 @@ * for one already. */ if ((ev->ev_sethook != NULL) && !(flags & EV_NOHOOK)) - return(ev->ev_sethook(ev, flags, value)); + return(ev->ev_sethook(ev, flags, (void *)value)); } else { /* @@ -126,7 +126,7 @@ if (flags & EV_VOLATILE) { ev->ev_value = strdup(value); } else { - ev->ev_value = value; + ev->ev_value = (void *)value; } /* Keep the flag components that are relevant */ From owner-p4-projects@FreeBSD.ORG Sat Apr 12 08:43:27 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id BF93737B415; Sat, 12 Apr 2003 08:43:26 -0700 (PDT) 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 457F237B40D for ; Sat, 12 Apr 2003 08:43:26 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 99FAF43FB1 for ; Sat, 12 Apr 2003 08:43:25 -0700 (PDT) (envelope-from robert@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h3CFhP0U014574 for ; Sat, 12 Apr 2003 08:43:25 -0700 (PDT) (envelope-from robert@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h3CFhP3k014565 for perforce@freebsd.org; Sat, 12 Apr 2003 08:43:25 -0700 (PDT) Date: Sat, 12 Apr 2003 08:43:25 -0700 (PDT) Message-Id: <200304121543.h3CFhP3k014565@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to robert@freebsd.org using -f From: Robert Drehmel To: Perforce Change Reviews Subject: PERFORCE change 28821 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, 12 Apr 2003 15:43:27 -0000 http://perforce.freebsd.org/chv.cgi?CH=28821 Change 28821 by robert@robert_spes on 2003/04/12 08:42:57 Compile this for TARGET_ARCH "mips". Even with -Werror ;-). Affected files ... .. //depot/projects/mips/lib/libstand/Makefile#4 edit Differences ... ==== //depot/projects/mips/lib/libstand/Makefile#4 (text+ko) ==== @@ -25,6 +25,11 @@ CFLAGS+= -msoft-float .endif +# XXX mips anything special needed? +.if ${MACHINE_ARCH} == "mips" +CFLAGS+= -Werror +.endif + # standalone components and stuff we have modified locally SRCS+= zutil.h __main.c assert.c bcd.c bswap.c environment.c getopt.c gets.c \ globals.c pager.c printf.c strdup.c strerror.c strtol.c random.c \ @@ -35,12 +40,14 @@ # byte order functions from libc .PATH: ${.CURDIR}/../libc/${MACHINE_ARCH}/net +.if ${MACHINE_ARCH} != "mips" SRCS+= htons.S ntohs.S htonl.S ntohl.S +.endif # string functions from libc .PATH: ${.CURDIR}/../libc/string .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "powerpc" || \ - ${MACHINE_ARCH} == "sparc64" + ${MACHINE_ARCH} == "sparc64" || ${MACHINE_ARCH} == "mips" SRCS+= bcmp.c bcopy.c bzero.c ffs.c index.c memccpy.c memchr.c memcmp.c \ memcpy.c memmove.c memset.c qdivrem.c rindex.c strcat.c strchr.c \ strcmp.c strcpy.c strcspn.c strlen.c strncat.c strncmp.c strncpy.c \ @@ -108,7 +115,9 @@ # _setjmp/_longjmp .PATH: ${.CURDIR}/${MACHINE_ARCH} +.if ${MACHINE_ARCH} != "mips" SRCS+= _setjmp.S +.endif # decompression functionality from libbz2 .PATH: ${.CURDIR}/../../contrib/bzip2 From owner-p4-projects@FreeBSD.ORG Sat Apr 12 08:49:35 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 9752137B404; Sat, 12 Apr 2003 08:49:34 -0700 (PDT) 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 3793537B401 for ; Sat, 12 Apr 2003 08:49:34 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id C1A7743F85 for ; Sat, 12 Apr 2003 08:49:33 -0700 (PDT) (envelope-from robert@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h3CFnX0U019889 for ; Sat, 12 Apr 2003 08:49:33 -0700 (PDT) (envelope-from robert@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h3CFnXXn019886 for perforce@freebsd.org; Sat, 12 Apr 2003 08:49:33 -0700 (PDT) Date: Sat, 12 Apr 2003 08:49:33 -0700 (PDT) Message-Id: <200304121549.h3CFnXXn019886@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to robert@freebsd.org using -f From: Robert Drehmel To: Perforce Change Reviews Subject: PERFORCE change 28822 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, 12 Apr 2003 15:49:36 -0000 http://perforce.freebsd.org/chv.cgi?CH=28822 Change 28822 by robert@robert_spes on 2003/04/12 08:48:50 Forced submit to note that I in the last change description for this file, I meant TARGET_ARCH "mips", for which __mips__ should be defined by the preprocessor (and whose definition is actually checked in this header). Affected files ... .. //depot/projects/mips/lib/libstand/zalloc_defs.h#3 edit Differences ... ==== //depot/projects/mips/lib/libstand/zalloc_defs.h#3 (text+ko) ==== From owner-p4-projects@FreeBSD.ORG Sat Apr 12 08:50:37 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id E8C3337B404; Sat, 12 Apr 2003 08:50:36 -0700 (PDT) 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 92B0037B401 for ; Sat, 12 Apr 2003 08:50:36 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id EEB8D43FAF for ; Sat, 12 Apr 2003 08:50:35 -0700 (PDT) (envelope-from robert@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h3CFoZ0U020082 for ; Sat, 12 Apr 2003 08:50:35 -0700 (PDT) (envelope-from robert@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h3CFoZKf020076 for perforce@freebsd.org; Sat, 12 Apr 2003 08:50:35 -0700 (PDT) Date: Sat, 12 Apr 2003 08:50:35 -0700 (PDT) Message-Id: <200304121550.h3CFoZKf020076@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to robert@freebsd.org using -f From: Robert Drehmel To: Perforce Change Reviews Subject: PERFORCE change 28823 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, 12 Apr 2003 15:50:37 -0000 http://perforce.freebsd.org/chv.cgi?CH=28823 Change 28823 by robert@robert_spes on 2003/04/12 08:50:32 Use exact (and more) casts to be able to compile this with GCC 3.3 without warnings, which in turn enables compilation of libstand with -Werror. Affected files ... .. //depot/projects/mips/lib/libc/string/bcopy.c#2 edit Differences ... ==== //depot/projects/mips/lib/libc/string/bcopy.c#2 (text+ko) ==== @@ -40,6 +40,8 @@ #include __FBSDID("$FreeBSD: src/lib/libc/string/bcopy.c,v 1.5 2002/09/01 21:53:46 robert Exp $"); +#include + /* * sizeof(word) MUST BE A POWER OF TWO * SO THAT wmask BELOW IS ALL ONES @@ -88,13 +90,13 @@ /* * Copy forward. */ - t = (int)src; /* only need low bits */ - if ((t | (int)dst) & wmask) { + t = (uint32_t)(uintptr_t)src; /* only need low bits */ + if ((t | (uint32_t)(uintptr_t)dst) & wmask) { /* * Try to align operands. This cannot be done * unless the low bits match. */ - if ((t ^ (int)dst) & wmask || length < wsize) + if ((t ^ (uint32_t)(uintptr_t)dst) & wmask || length < wsize) t = length; else t = wsize - (t & wmask); @@ -116,9 +118,9 @@ */ src += length; dst += length; - t = (int)src; - if ((t | (int)dst) & wmask) { - if ((t ^ (int)dst) & wmask || length <= wsize) + t = (uint32_t)(uintptr_t)src; + if ((t | (uint32_t)(uintptr_t)dst) & wmask) { + if ((t ^ (uint32_t)(uintptr_t)dst) & wmask || length <= wsize) t = length; else t &= wmask; From owner-p4-projects@FreeBSD.ORG Sat Apr 12 08:52:40 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id ECAB437B404; Sat, 12 Apr 2003 08:52:39 -0700 (PDT) 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 7232B37B401 for ; Sat, 12 Apr 2003 08:52:39 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 08CBC43F75 for ; Sat, 12 Apr 2003 08:52:39 -0700 (PDT) (envelope-from robert@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h3CFqc0U020472 for ; Sat, 12 Apr 2003 08:52:38 -0700 (PDT) (envelope-from robert@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h3CFqcc3020467 for perforce@freebsd.org; Sat, 12 Apr 2003 08:52:38 -0700 (PDT) Date: Sat, 12 Apr 2003 08:52:38 -0700 (PDT) Message-Id: <200304121552.h3CFqcc3020467@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to robert@freebsd.org using -f From: Robert Drehmel To: Perforce Change Reviews Subject: PERFORCE change 28824 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, 12 Apr 2003 15:52:40 -0000 http://perforce.freebsd.org/chv.cgi?CH=28824 Change 28824 by robert@robert_spes on 2003/04/12 08:51:58 Add the loader directory to the SUBDIR variable. Affected files ... .. //depot/projects/mips/sys/boot/sgimips/Makefile#2 edit Differences ... ==== //depot/projects/mips/sys/boot/sgimips/Makefile#2 (text+ko) ==== @@ -1,5 +1,5 @@ # $FreeBSD$ -SUBDIR= +SUBDIR= loader .include From owner-p4-projects@FreeBSD.ORG Sat Apr 12 09:04:56 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id D90E137B404; Sat, 12 Apr 2003 09:04:55 -0700 (PDT) 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 18A6D37B404 for ; Sat, 12 Apr 2003 09:04:55 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6529743FAF for ; Sat, 12 Apr 2003 09:04:54 -0700 (PDT) (envelope-from robert@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h3CG4s0U022136 for ; Sat, 12 Apr 2003 09:04:54 -0700 (PDT) (envelope-from robert@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h3CG4rng022133 for perforce@freebsd.org; Sat, 12 Apr 2003 09:04:53 -0700 (PDT) Date: Sat, 12 Apr 2003 09:04:53 -0700 (PDT) Message-Id: <200304121604.h3CG4rng022133@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to robert@freebsd.org using -f From: Robert Drehmel To: Perforce Change Reviews Subject: PERFORCE change 28825 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, 12 Apr 2003 16:04:58 -0000 http://perforce.freebsd.org/chv.cgi?CH=28825 Change 28825 by robert@robert_spes on 2003/04/12 09:04:38 - Add `-mno-fp-regs' only for Alpha to the CFLAGS. - Add the current directory (.CURDIR) to the include search path. - Remove copy.c from the source files holding variable. (Should be added for alpha only...) - If the MACHINE_ARCH is "mips", define a preprocessor macro with the same name as the value of the PLATFORM variable. - If PLATFORM is defined, add a symbolic link from its source directory to `platform' in the current directory (like the `machine' link). Affected files ... .. //depot/projects/mips/sys/boot/arc/lib/Makefile#2 edit Differences ... ==== //depot/projects/mips/sys/boot/arc/lib/Makefile#2 (text+ko) ==== @@ -11,24 +11,36 @@ CFLAGS+= -DDEBUG # Pick up the bootstrap header for some interface items -CFLAGS+= -I${.CURDIR}/../../common -mno-fp-regs \ +CFLAGS+= -I${.CURDIR}/../../common \ -I${.CURDIR}/../../.. -I${.CURDIR}/../include +CFLAGS+= -I${.CURDIR} #CFLAGS+= -DDISK_DEBUG #CPPFLAGS+= -DNO_DISKLABEL #CPPFLAGS+= -DSAVE_MEMORY -SRCS= delay.c time.c abort.c setjmperr.c copy.c devicename.c module.c \ +SRCS= delay.c time.c abort.c setjmperr.c devicename.c module.c \ arcconsole.c arcdisk.c elf_freebsd.c bootinfo.c .if ${MACHINE_ARCH} == "alpha" +CFLAGS+= -mno-fp-regs SRCS+= rpb.c .endif +.if ${MACHINE_ARCH} == "mips" +CFLAGS+= -D${PLATFORM} +.endif CLEANFILES+= machine +.ifdef PLATFORM +CLEANFILES+= platform +platform: + ln -sf ${.CURDIR}/../../../${MACHINE_ARCH}/${PLATFORM} platform +machine: platform +.else machine: - ln -sf ${.CURDIR}/../../../alpha/include machine +.endif + ln -sf ${.CURDIR}/../../../${MACHINE_ARCH}/include machine .include From owner-p4-projects@FreeBSD.ORG Sat Apr 12 09:07:01 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 704B437B426; Sat, 12 Apr 2003 09:07:01 -0700 (PDT) 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 14BB537B41D for ; Sat, 12 Apr 2003 09:07:01 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 88D3443FDD for ; Sat, 12 Apr 2003 09:06:57 -0700 (PDT) (envelope-from robert@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h3CG6v0U022272 for ; Sat, 12 Apr 2003 09:06:57 -0700 (PDT) (envelope-from robert@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h3CG6vbS022269 for perforce@freebsd.org; Sat, 12 Apr 2003 09:06:57 -0700 (PDT) Date: Sat, 12 Apr 2003 09:06:57 -0700 (PDT) Message-Id: <200304121606.h3CG6vbS022269@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to robert@freebsd.org using -f From: Robert Drehmel To: Perforce Change Reviews Subject: PERFORCE change 28826 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, 12 Apr 2003 16:07:02 -0000 http://perforce.freebsd.org/chv.cgi?CH=28826 Change 28826 by robert@robert_spes on 2003/04/12 09:06:23 Do not include ; it is not needed. Affected files ... .. //depot/projects/mips/sys/boot/arc/lib/abort.c#2 edit .. //depot/projects/mips/sys/boot/arc/lib/delay.c#2 edit .. //depot/projects/mips/sys/boot/arc/lib/setjmperr.c#2 edit .. //depot/projects/mips/sys/boot/arc/lib/time.c#2 edit Differences ... ==== //depot/projects/mips/sys/boot/arc/lib/abort.c#2 (text+ko) ==== @@ -26,7 +26,6 @@ * $FreeBSD: src/sys/boot/arc/lib/abort.c,v 1.2 1999/08/28 00:39:35 peter Exp $ */ -#include #include #include "arctypes.h" #include "arcfuncs.h" ==== //depot/projects/mips/sys/boot/arc/lib/delay.c#2 (text+ko) ==== @@ -25,8 +25,6 @@ * * $FreeBSD: src/sys/boot/arc/lib/delay.c,v 1.2 1999/08/28 00:39:37 peter Exp $ */ - -#include #include #include "arctypes.h" #include "arcfuncs.h" ==== //depot/projects/mips/sys/boot/arc/lib/setjmperr.c#2 (text+ko) ==== @@ -26,7 +26,6 @@ * $FreeBSD: src/sys/boot/arc/lib/setjmperr.c,v 1.2 1999/08/28 00:39:39 peter Exp $ */ -#include #include #include "arctypes.h" #include "arcfuncs.h" ==== //depot/projects/mips/sys/boot/arc/lib/time.c#2 (text+ko) ==== @@ -26,7 +26,6 @@ * $FreeBSD: src/sys/boot/arc/lib/time.c,v 1.2 1999/08/28 00:39:39 peter Exp $ */ -#include #include #include "arctypes.h" #include "arcfuncs.h" From owner-p4-projects@FreeBSD.ORG Sat Apr 12 09:11:04 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 1E98937B404; Sat, 12 Apr 2003 09:11:04 -0700 (PDT) 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 75F8937B401 for ; Sat, 12 Apr 2003 09:11:03 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1FD4A43FAF for ; Sat, 12 Apr 2003 09:11:03 -0700 (PDT) (envelope-from robert@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h3CGB20U022734 for ; Sat, 12 Apr 2003 09:11:02 -0700 (PDT) (envelope-from robert@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h3CGB25D022729 for perforce@freebsd.org; Sat, 12 Apr 2003 09:11:02 -0700 (PDT) Date: Sat, 12 Apr 2003 09:11:02 -0700 (PDT) Message-Id: <200304121611.h3CGB25D022729@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to robert@freebsd.org using -f From: Robert Drehmel To: Perforce Change Reviews Subject: PERFORCE change 28827 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, 12 Apr 2003 16:11:05 -0000 http://perforce.freebsd.org/chv.cgi?CH=28827 Change 28827 by robert@robert_spes on 2003/04/12 09:11:01 Define the SPBlock macro - if `sgimips' is defined - to the value of the ARC BIOS SPB location on an SGI Octane. Add a comment which contains information on an issue which is still unresolved. Affected files ... .. //depot/projects/mips/sys/boot/arc/include/arcfuncs.h#2 edit Differences ... ==== //depot/projects/mips/sys/boot/arc/include/arcfuncs.h#2 (text+ko) ==== @@ -35,7 +35,19 @@ /* System Parameter Block holding ARC and VENDOR function vector addresses */ +#if defined(__alpha__) #define SPBlock ((SPB *)0xffffffff806fe000ul) +#elif defined(sgimips) +/* + * XXX This is probably not correct. + * All I know for sure is that the function vector is at + * address 0xa000000000001040 on a SGI Octane/R10000 here. + * That would be offset 0x40 of the usual ARCBIOS address + * 0xa000000000001000. + * But offsetof(SPB, FirmwareVectorP) is 0x3c! + */ +#define SPBlock ((SPB *)0xa000000000001008) +#endif /* * Convert between 32bit (ARC) and 64bit (Alpha) pointers From owner-p4-projects@FreeBSD.ORG Sat Apr 12 09:21:17 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id DDFC737B404; Sat, 12 Apr 2003 09:21:16 -0700 (PDT) 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 7D4DB37B401 for ; Sat, 12 Apr 2003 09:21:16 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 133C343FCB for ; Sat, 12 Apr 2003 09:21:16 -0700 (PDT) (envelope-from robert@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h3CGLF0U024405 for ; Sat, 12 Apr 2003 09:21:15 -0700 (PDT) (envelope-from robert@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h3CGLFTC024402 for perforce@freebsd.org; Sat, 12 Apr 2003 09:21:15 -0700 (PDT) Date: Sat, 12 Apr 2003 09:21:15 -0700 (PDT) Message-Id: <200304121621.h3CGLFTC024402@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to robert@freebsd.org using -f From: Robert Drehmel To: Perforce Change Reviews Subject: PERFORCE change 28828 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, 12 Apr 2003 16:21:17 -0000 http://perforce.freebsd.org/chv.cgi?CH=28828 Change 28828 by robert@robert_spes on 2003/04/12 09:20:25 If compiling for an `sgimips' platform, define an ARC pointer to have exactly the same size as an `void *' has. Affected files ... .. //depot/projects/mips/sys/boot/arc/include/arctypes.h#2 edit Differences ... ==== //depot/projects/mips/sys/boot/arc/include/arctypes.h#2 (text+ko) ==== @@ -69,9 +69,15 @@ #endif /* 0 */ +#if defined(__alpha__) typedef struct { int32_t adr; } arcptr; +#elif defined(sgimips) +typedef struct { + void *adr; +} arcptr; +#endif typedef struct { u_int32_t SPBSignature; From owner-p4-projects@FreeBSD.ORG Sat Apr 12 09:22:19 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id B2CF937B404; Sat, 12 Apr 2003 09:22:18 -0700 (PDT) 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 51EA137B401 for ; Sat, 12 Apr 2003 09:22:18 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id F237043FAF for ; Sat, 12 Apr 2003 09:22:17 -0700 (PDT) (envelope-from robert@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h3CGMH0U024433 for ; Sat, 12 Apr 2003 09:22:17 -0700 (PDT) (envelope-from robert@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h3CGMHDV024430 for perforce@freebsd.org; Sat, 12 Apr 2003 09:22:17 -0700 (PDT) Date: Sat, 12 Apr 2003 09:22:17 -0700 (PDT) Message-Id: <200304121622.h3CGMHDV024430@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to robert@freebsd.org using -f From: Robert Drehmel To: Perforce Change Reviews Subject: PERFORCE change 28829 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, 12 Apr 2003 16:22:19 -0000 http://perforce.freebsd.org/chv.cgi?CH=28829 Change 28829 by robert@robert_spes on 2003/04/12 09:22:10 Exclude some code from compilation if __mips__ is defined. This code needs further examination. Affected files ... .. //depot/projects/mips/sys/boot/arc/lib/bootinfo.c#3 edit Differences ... ==== //depot/projects/mips/sys/boot/arc/lib/bootinfo.c#3 (text+ko) ==== @@ -31,9 +31,12 @@ #include #include #include +#ifndef __mips__ +/* XXX mips */ #include #include #include +#endif #include "bootstrap.h" /* @@ -138,6 +141,7 @@ return(addr); } +#ifndef __mips__ /* * Load the information expected by an alpha kernel. * @@ -201,3 +205,4 @@ return(0); } +#endif /* !__mips__ */ From owner-p4-projects@FreeBSD.ORG Sat Apr 12 09:25:23 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 4164337B405; Sat, 12 Apr 2003 09:25:23 -0700 (PDT) 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 D2FFC37B401 for ; Sat, 12 Apr 2003 09:25:22 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5681643FA3 for ; Sat, 12 Apr 2003 09:25:22 -0700 (PDT) (envelope-from robert@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h3CGPM0U024558 for ; Sat, 12 Apr 2003 09:25:22 -0700 (PDT) (envelope-from robert@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h3CGPL2K024555 for perforce@freebsd.org; Sat, 12 Apr 2003 09:25:21 -0700 (PDT) Date: Sat, 12 Apr 2003 09:25:21 -0700 (PDT) Message-Id: <200304121625.h3CGPL2K024555@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to robert@freebsd.org using -f From: Robert Drehmel To: Perforce Change Reviews Subject: PERFORCE change 28830 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, 12 Apr 2003 16:25:24 -0000 http://perforce.freebsd.org/chv.cgi?CH=28830 Change 28830 by robert@robert_spes on 2003/04/12 09:24:22 - Avoid including some headers which currently cause problems for __mips__. Add an XXX comment. - Add a comment about unconditionally uncompiled code. Affected files ... .. //depot/projects/mips/sys/boot/arc/lib/elf_freebsd.c#2 edit Differences ... ==== //depot/projects/mips/sys/boot/arc/lib/elf_freebsd.c#2 (text+ko) ==== @@ -82,9 +82,12 @@ #include #include #include +#ifndef __mips__ +/* XXX mips */ #include #include #include +#endif #include "bootstrap.h" @@ -102,6 +105,7 @@ elf_exec(struct preloaded_file *fp) { #if 0 +/* XXX mips - this was already commented out, I suspect it's non-working */ static struct bootinfo_v1 bootinfo_v1; struct file_metadata *md; Elf_Ehdr *hdr; @@ -138,6 +142,3 @@ BOOTINFO_MAGIC, &bootinfo_v1, 1, 0); #endif } - - - From owner-p4-projects@FreeBSD.ORG Sat Apr 12 09:29:30 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 7B74D37B404; Sat, 12 Apr 2003 09:29:29 -0700 (PDT) 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 1B9BC37B401 for ; Sat, 12 Apr 2003 09:29:29 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id A67E543FD7 for ; Sat, 12 Apr 2003 09:29:28 -0700 (PDT) (envelope-from robert@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h3CGTS0U024743 for ; Sat, 12 Apr 2003 09:29:28 -0700 (PDT) (envelope-from robert@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h3CGTSrm024740 for perforce@freebsd.org; Sat, 12 Apr 2003 09:29:28 -0700 (PDT) Date: Sat, 12 Apr 2003 09:29:28 -0700 (PDT) Message-Id: <200304121629.h3CGTSrm024740@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to robert@freebsd.org using -f From: Robert Drehmel To: Perforce Change Reviews Subject: PERFORCE change 28832 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, 12 Apr 2003 16:29:30 -0000 http://perforce.freebsd.org/chv.cgi?CH=28832 Change 28832 by robert@robert_spes on 2003/04/12 09:28:52 Add two non-source files which belong to the loader. Affected files ... .. //depot/projects/mips/sys/boot/sgimips/loader/help.sgimips#1 add .. //depot/projects/mips/sys/boot/sgimips/loader/version#1 add Differences ... From owner-p4-projects@FreeBSD.ORG Sat Apr 12 09:34:36 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 4526B37B404; Sat, 12 Apr 2003 09:34:36 -0700 (PDT) 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 D02B037B401 for ; Sat, 12 Apr 2003 09:34:35 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 681F943F85 for ; Sat, 12 Apr 2003 09:34:35 -0700 (PDT) (envelope-from robert@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h3CGYZ0U025398 for ; Sat, 12 Apr 2003 09:34:35 -0700 (PDT) (envelope-from robert@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h3CGYZWH025395 for perforce@freebsd.org; Sat, 12 Apr 2003 09:34:35 -0700 (PDT) Date: Sat, 12 Apr 2003 09:34:35 -0700 (PDT) Message-Id: <200304121634.h3CGYZWH025395@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to robert@freebsd.org using -f From: Robert Drehmel To: Perforce Change Reviews Subject: PERFORCE change 28833 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, 12 Apr 2003 16:34:37 -0000 http://perforce.freebsd.org/chv.cgi?CH=28833 Change 28833 by robert@robert_spes on 2003/04/12 09:33:59 Add the actual SGI MIPS loader implementation. It is far from being completed (but it compiles...). Affected files ... .. //depot/projects/mips/sys/boot/sgimips/loader/locore.S#1 add .. //depot/projects/mips/sys/boot/sgimips/loader/main.c#1 add Differences ... From owner-p4-projects@FreeBSD.ORG Sat Apr 12 09:35:39 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id A4B4437B404; Sat, 12 Apr 2003 09:35:38 -0700 (PDT) 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 4374A37B401 for ; Sat, 12 Apr 2003 09:35:38 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id AC4A843F93 for ; Sat, 12 Apr 2003 09:35:37 -0700 (PDT) (envelope-from robert@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h3CGZb0U025473 for ; Sat, 12 Apr 2003 09:35:37 -0700 (PDT) (envelope-from robert@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h3CGZahb025470 for perforce@freebsd.org; Sat, 12 Apr 2003 09:35:36 -0700 (PDT) Date: Sat, 12 Apr 2003 09:35:36 -0700 (PDT) Message-Id: <200304121635.h3CGZahb025470@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to robert@freebsd.org using -f From: Robert Drehmel To: Perforce Change Reviews Subject: PERFORCE change 28834 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, 12 Apr 2003 16:35:39 -0000 http://perforce.freebsd.org/chv.cgi?CH=28834 Change 28834 by robert@robert_spes on 2003/04/12 09:34:57 Add a make file for the SGI MIPS loader. Affected files ... .. //depot/projects/mips/sys/boot/sgimips/loader/Makefile#1 add Differences ... From owner-p4-projects@FreeBSD.ORG Sat Apr 12 09:36:41 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 78DC937B405; Sat, 12 Apr 2003 09:36:41 -0700 (PDT) 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 10D3C37B401 for ; Sat, 12 Apr 2003 09:36:40 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 906A843F93 for ; Sat, 12 Apr 2003 09:36:39 -0700 (PDT) (envelope-from robert@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h3CGad0U025569 for ; Sat, 12 Apr 2003 09:36:39 -0700 (PDT) (envelope-from robert@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h3CGad2n025566 for perforce@freebsd.org; Sat, 12 Apr 2003 09:36:39 -0700 (PDT) Date: Sat, 12 Apr 2003 09:36:39 -0700 (PDT) Message-Id: <200304121636.h3CGad2n025566@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to robert@freebsd.org using -f From: Robert Drehmel To: Perforce Change Reviews Subject: PERFORCE change 28835 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, 12 Apr 2003 16:36:42 -0000 http://perforce.freebsd.org/chv.cgi?CH=28835 Change 28835 by robert@robert_spes on 2003/04/12 09:35:50 Add the `platform' link to the CLEANFILES variable. Affected files ... .. //depot/projects/mips/sys/boot/sgimips/loader/Makefile#2 edit Differences ... ==== //depot/projects/mips/sys/boot/sgimips/loader/Makefile#2 (text+ko) ==== @@ -116,4 +116,4 @@ ln -sf ${.CURDIR}/../../../mips/sgimips platform .endif -CLEANFILES+= machine +CLEANFILES+= machine platform From owner-p4-projects@FreeBSD.ORG Sat Apr 12 09:57:07 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id A579C37B404; Sat, 12 Apr 2003 09:57:06 -0700 (PDT) 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 547E437B401 for ; Sat, 12 Apr 2003 09:57:06 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id DFC7143FCB for ; Sat, 12 Apr 2003 09:57:05 -0700 (PDT) (envelope-from robert@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h3CGv50U027148 for ; Sat, 12 Apr 2003 09:57:05 -0700 (PDT) (envelope-from robert@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h3CGv5s5027145 for perforce@freebsd.org; Sat, 12 Apr 2003 09:57:05 -0700 (PDT) Date: Sat, 12 Apr 2003 09:57:05 -0700 (PDT) Message-Id: <200304121657.h3CGv5s5027145@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to robert@freebsd.org using -f From: Robert Drehmel To: Perforce Change Reviews Subject: PERFORCE change 28837 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, 12 Apr 2003 16:57:07 -0000 http://perforce.freebsd.org/chv.cgi?CH=28837 Change 28837 by robert@robert_spes on 2003/04/12 09:56:09 Add the R10000 as an option. Affected files ... .. //depot/projects/mips/sys/conf/options.mips#7 edit Differences ... ==== //depot/projects/mips/sys/conf/options.mips#7 (text+ko) ==== @@ -3,6 +3,7 @@ R4000 opt_global.h R4400 opt_global.h +R10000 opt_global.h SGIMIPS opt_platform.h From owner-p4-projects@FreeBSD.ORG Sat Apr 12 09:58:09 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id A030037B404; Sat, 12 Apr 2003 09:58:08 -0700 (PDT) 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 562B437B401 for ; Sat, 12 Apr 2003 09:58:08 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id DFA4C43F85 for ; Sat, 12 Apr 2003 09:58:07 -0700 (PDT) (envelope-from robert@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h3CGw70U027183 for ; Sat, 12 Apr 2003 09:58:07 -0700 (PDT) (envelope-from robert@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h3CGw77N027180 for perforce@freebsd.org; Sat, 12 Apr 2003 09:58:07 -0700 (PDT) Date: Sat, 12 Apr 2003 09:58:07 -0700 (PDT) Message-Id: <200304121658.h3CGw77N027180@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to robert@freebsd.org using -f From: Robert Drehmel To: Perforce Change Reviews Subject: PERFORCE change 28838 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, 12 Apr 2003 16:58:09 -0000 http://perforce.freebsd.org/chv.cgi?CH=28838 Change 28838 by robert@robert_spes on 2003/04/12 09:57:41 Fix another LP64 incompatibility. Affected files ... .. //depot/projects/mips/lib/libstand/qdivrem.c#2 edit Differences ... ==== //depot/projects/mips/lib/libstand/qdivrem.c#2 (text+ko) ==== @@ -47,7 +47,7 @@ #include "quad.h" -#define B (1 << HALF_BITS) /* digit base */ +#define B (1UL << HALF_BITS) /* digit base */ /* Combine two `digits' to make a single two-digit number. */ #define COMBINE(a, b) (((u_long)(a) << HALF_BITS) | (b)) From owner-p4-projects@FreeBSD.ORG Sat Apr 12 10:18:35 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 44C4B37B404; Sat, 12 Apr 2003 10:18:35 -0700 (PDT) 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 D798537B401 for ; Sat, 12 Apr 2003 10:18:34 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6AC9943F3F for ; Sat, 12 Apr 2003 10:18:34 -0700 (PDT) (envelope-from robert@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h3CHIY0U029695 for ; Sat, 12 Apr 2003 10:18:34 -0700 (PDT) (envelope-from robert@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h3CHIXro029692 for perforce@freebsd.org; Sat, 12 Apr 2003 10:18:33 -0700 (PDT) Date: Sat, 12 Apr 2003 10:18:33 -0700 (PDT) Message-Id: <200304121718.h3CHIXro029692@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to robert@freebsd.org using -f From: Robert Drehmel To: Perforce Change Reviews Subject: PERFORCE change 28841 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, 12 Apr 2003 17:18:36 -0000 http://perforce.freebsd.org/chv.cgi?CH=28841 Change 28841 by robert@robert_spes on 2003/04/12 10:17:43 Always pull in for now. The definition of `struct sigcontext' below needs `struct trapframe'. Affected files ... .. //depot/projects/mips/sys/mips/include/signal.h#2 edit Differences ... ==== //depot/projects/mips/sys/mips/include/signal.h#2 (text+ko) ==== @@ -43,9 +43,7 @@ typedef int sig_atomic_t; -#ifdef _KERNEL #include -#endif /* _KERNEL */ #if __BSD_VISIBLE struct sigcontext { From owner-p4-projects@FreeBSD.ORG Sat Apr 12 15:32:55 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id BFF9A37B404; Sat, 12 Apr 2003 15:32:54 -0700 (PDT) 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 4F97237B401 for ; Sat, 12 Apr 2003 15:32:54 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9722B43F75 for ; Sat, 12 Apr 2003 15:32:53 -0700 (PDT) (envelope-from marcel@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h3CMWr0U063494 for ; Sat, 12 Apr 2003 15:32:53 -0700 (PDT) (envelope-from marcel@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h3CMWrSs063491 for perforce@freebsd.org; Sat, 12 Apr 2003 15:32:53 -0700 (PDT) Date: Sat, 12 Apr 2003 15:32:53 -0700 (PDT) Message-Id: <200304122232.h3CMWrSs063491@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 28844 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, 12 Apr 2003 22:32:56 -0000 http://perforce.freebsd.org/chv.cgi?CH=28844 Change 28844 by marcel@marcel_nfs on 2003/04/12 15:32:21 Start of the new unwind logic. This is mostly a stripped down version of what we had, so that we can include it in the build again and have the ELF tables added/removed for modules. The intend here is to create an unwinder that returns the state at entry to some function only (maybe at the start of the body region of a function if that opens up more doors). We don't really need to have finegrained control (ie at the instruction level) because we're not a debugger. We only need to be able to create backtraces and unwind to the entry into the kernel so that we have the correct value for preserved registers). We're not even interested in scratch registers here, because we can grab them from the trapframe if we need them (eg for ptrace(2)). Note that we have keep track of the location of the register value, so that we can support setting the registers (eg for ptrace(2)). The location is either the register itself, some other general register or some memory location. This all means that we have a new register state and different ways to create the initial state. Remove . We move the RSE functions to the unwinder; either implicitly or explicitly. Converge on a fixed prefix for the unwinder so that we can drop 'ia64' from the names. This generally makes it more pleasing to read and write. Affected files ... .. //depot/projects/ia64_epc/sys/conf/files.ia64#6 edit .. //depot/projects/ia64_epc/sys/ia64/ia64/db_interface.c#4 edit .. //depot/projects/ia64_epc/sys/ia64/ia64/db_trace.c#2 edit .. //depot/projects/ia64_epc/sys/ia64/ia64/elf_machdep.c#3 edit .. //depot/projects/ia64_epc/sys/ia64/ia64/machdep.c#9 edit .. //depot/projects/ia64_epc/sys/ia64/ia64/syscall.s#4 edit .. //depot/projects/ia64_epc/sys/ia64/ia64/unaligned.c#2 edit .. //depot/projects/ia64_epc/sys/ia64/ia64/unwind.c#2 edit .. //depot/projects/ia64_epc/sys/ia64/include/rse.h#2 delete .. //depot/projects/ia64_epc/sys/ia64/include/unwind.h#2 edit Differences ... ==== //depot/projects/ia64_epc/sys/conf/files.ia64#6 (text+ko) ==== @@ -61,7 +61,7 @@ ia64/ia64/syscall.s standard ia64/ia64/trap.c standard #ia64/ia64/unaligned.c standard -#ia64/ia64/unwind.c standard +ia64/ia64/unwind.c standard ia64/ia64/vga_machdep.c optional vga ia64/ia64/vm_machdep.c standard ia64/isa/isa.c optional isa ==== //depot/projects/ia64_epc/sys/ia64/ia64/db_interface.c#4 (text+ko) ==== @@ -51,7 +51,6 @@ #include #include -#include #include #include ==== //depot/projects/ia64_epc/sys/ia64/ia64/db_trace.c#2 (text+ko) ==== @@ -31,7 +31,6 @@ #include #include #include -#include #include #include ==== //depot/projects/ia64_epc/sys/ia64/ia64/elf_machdep.c#3 (text+ko) ==== @@ -262,10 +262,8 @@ if (ph->p_type == PT_IA_64_UNWIND) { vaddr = ph->p_vaddr + reloc; -#if 0 - ia64_add_unwind_table((vm_offset_t)lf->address, vaddr, + unw_table_add((vm_offset_t)lf->address, vaddr, vaddr + ph->p_memsz); -#endif } ++ph; } @@ -277,8 +275,6 @@ elf_cpu_unload_file(linker_file_t lf) { -#if 0 - ia64_delete_unwind_table((vm_offset_t)lf->address); -#endif + unw_table_remove((vm_offset_t)lf->address); return (0); } ==== //depot/projects/ia64_epc/sys/ia64/ia64/machdep.c#9 (text+ko) ==== @@ -84,7 +84,6 @@ #include #include #include -#include #include #include @@ -1322,47 +1321,8 @@ *highp = high; } -static int -rse_slot(u_int64_t *bsp) -{ - return ((u_int64_t) bsp >> 3) & 0x3f; -} - -/* - * Return the address of register regno (regno >= 32) given that bsp - * points at the base of the register stack frame. - */ -u_int64_t * -ia64_rse_register_address(u_int64_t *bsp, int regno) -{ - int off = regno - 32; - u_int64_t rnats = (rse_slot(bsp) + off) / 63; - return bsp + off + rnats; -} - -/* - * Calculate the base address of the previous frame given that the - * current frame's locals area is 'size'. - */ -u_int64_t * -ia64_rse_previous_frame(u_int64_t *bsp, int size) -{ - int slot = rse_slot(bsp); - int rnats = 0; - int count = size; - - while (count > slot) { - count -= 63; - rnats++; - slot = 63; - } - return bsp - size - rnats; -} - - intptr_t casuptr(intptr_t *p, intptr_t old, intptr_t new) { return (-1); } - ==== //depot/projects/ia64_epc/sys/ia64/ia64/syscall.s#4 (text+ko) ==== ==== //depot/projects/ia64_epc/sys/ia64/ia64/unaligned.c#2 (text+ko) ==== @@ -34,7 +34,6 @@ #include #include #include -#include #define sign_extend(imm, w) (((int64_t)(imm) << (64 - (w))) >> (64 - (w))) ==== //depot/projects/ia64_epc/sys/ia64/ia64/unwind.c#2 (text+ko) ==== @@ -32,9 +32,8 @@ #include #include -#include +#include #include -#include #ifdef UNWIND_DEBUG #define DPF(x) printf x @@ -44,157 +43,125 @@ MALLOC_DEFINE(M_UNWIND, "Unwind table", "Unwind table information"); -struct ia64_unwind_table_entry { - u_int64_t ue_start; /* procedure start */ - u_int64_t ue_end; /* procedure end */ - u_int64_t ue_info; /* offset to procedure descriptors */ +struct unw_entry { + uint64_t ue_start; /* procedure start */ + uint64_t ue_end; /* procedure end */ + uint64_t ue_info; /* offset to procedure descriptors */ }; -struct ia64_unwind_info { - u_int64_t ui_length : 32; /* length in 64bit units */ - u_int64_t ui_flags : 16; - u_int64_t ui_version : 16; +struct unw_table { + LIST_ENTRY(unw_table) ut_link; + uint64_t ut_base; + uint64_t ut_limit; + struct unw_entry *ut_start; + struct unw_entry *ut_end; }; -LIST_HEAD(ia64_unwind_table_list, ia64_unwind_table); +LIST_HEAD(unw_table_list, unw_table); -struct ia64_unwind_table { - LIST_ENTRY(ia64_unwind_table) ut_link; - u_int64_t ut_base; - u_int64_t ut_limit; - struct ia64_unwind_table_entry *ut_start; - struct ia64_unwind_table_entry *ut_end; -}; +static struct unw_table_list unw_tables; -struct unwind_reg { - u_int64_t ur_value; /* current value */ - u_int64_t *ur_save; /* save location */ - int ur_when; /* when the save happened */ -}; +static void +unw_initialize(void *dummy __unused) +{ -struct unwind_fpreg { - struct ia64_fpreg ur_value; /* current value */ - struct ia64_fpreg *ur_save; /* save location */ - int ur_when; /* when the save happened */ -}; + LIST_INIT(&unw_tables); +} +SYSINIT(unwind, SI_SUB_KMEM, SI_ORDER_ANY, unw_initialize, 0); -struct ia64_unwind_state { - LIST_ENTRY(ia64_unwind_state) us_link; /* free list */ - - /* - * Current register state and location of saved register state - */ - struct register_state { - struct unwind_reg rs_psp; - struct unwind_reg rs_pfs; - struct unwind_reg rs_preds; - struct unwind_reg rs_unat; - struct unwind_reg rs_lc; - struct unwind_reg rs_rnat; - struct unwind_reg rs_bsp; - struct unwind_reg rs_bspstore; - struct unwind_reg rs_fpsr; - struct unwind_reg rs_priunat; - struct unwind_reg rs_br[8]; - struct unwind_reg rs_gr[32]; - struct unwind_fpreg rs_fr[32]; - u_int64_t rs_stack_size; - } us_regs; - - /* - * Variables used while parsing unwind records. - */ - u_int64_t us_ip; /* value of IP for this frame */ - int us_ri; /* RI field from cr.ipsr */ - u_int64_t us_pc; /* slot offset in procedure */ - u_int64_t *us_bsp; /* backing store for frame */ - u_int64_t us_cfm; /* CFM value for frame */ - u_int64_t *us_spill; /* spill_base location */ - int us_spilloff; /* offset into spill area */ - int us_grmask; /* mask of grs being spilled */ - int us_frmask; /* mask of frs being spilled */ - int us_brmask; /* mask of brs being spilled */ -}; - -static int ia64_unwind_initialised; -static struct ia64_unwind_table_list ia64_unwind_tables; -#define MAX_UNWIND_STATES 4 -static struct ia64_unwind_state ia64_unwind_state_static[MAX_UNWIND_STATES]; -static LIST_HEAD(ia64_unwind_state_list, ia64_unwind_state) ia64_unwind_states; - -static void -ia64_initialise_unwind(void *arg __unused) +#if NOTYET +static struct unw_entry * +unw_entry_lookup(struct unw_table *ut, uint64_t ip) { - int i; + struct unw_entry *end, *mid, *start; - KASSERT(!ia64_unwind_initialised, ("foo")); - - LIST_INIT(&ia64_unwind_tables); - LIST_INIT(&ia64_unwind_states); - for (i = 0; i < MAX_UNWIND_STATES; i++) { - LIST_INSERT_HEAD(&ia64_unwind_states, - &ia64_unwind_state_static[i], us_link); + ip -= ut->ut_base; + start = ut->ut_start; + end = ut->ut_end - 1; + while (start < end) { + mid = start + ((end - start) >> 1); + if (ip < mid->ue_start) + end = mid; + else if (ip >= mid->ue_end) + start = mid + 1; + else + break; } - - ia64_unwind_initialised = 1; + return ((start < end) ? mid : NULL); } -SYSINIT(unwind, SI_SUB_KMEM, SI_ORDER_ANY, ia64_initialise_unwind, 0); +#endif -static struct ia64_unwind_table * -find_table(u_int64_t ip) +static struct unw_table * +unw_table_lookup(uint64_t ip) { - struct ia64_unwind_table *ut; + struct unw_table *ut; - LIST_FOREACH(ut, &ia64_unwind_tables, ut_link) { + LIST_FOREACH(ut, &unw_tables, ut_link) { if (ip >= ut->ut_base && ip < ut->ut_limit) - return ut; + return (ut); } - return 0; + return (NULL); } -static struct ia64_unwind_table_entry * -find_entry(struct ia64_unwind_table *ut, u_int64_t ip) +int +unw_state_create(struct unw_regstate *rs) { - struct ia64_unwind_table_entry *start; - struct ia64_unwind_table_entry *end; - struct ia64_unwind_table_entry *mid; + struct pcb pcb; + + savectx(&pcb); + /* Cache the values. */ + rs->rs_val.special = pcb.pcb_special; + rs->rs_val.preserved = pcb.pcb_preserved; + rs->rs_val.preserved_fp = pcb.pcb_preserved_fp; + /* Set the location to 'self' (ie in the register itself). */ + memset(&rs->rs_loc.special, 0, sizeof(rs->rs_loc.special)); + memset(&rs->rs_loc.preserved, 0, sizeof(rs->rs_loc.preserved)); + memset(&rs->rs_loc.preserved_fp, 0, sizeof(rs->rs_loc.preserved_fp)); + return (0); +} - ip -= ut->ut_base; - start = ut->ut_start; - end = ut->ut_end - 1; - while (start < end) { - mid = start + (end - start) / 2; - if (ip < mid->ue_start) { - if (end == mid) - break; - end = mid; - } else if (ip >= mid->ue_end) { - if (start == mid) - break; - start = mid; - } else - return mid; +static __inline void +unw_set_loc(void *rs, void *pcb, int sz) +{ + while (sz > 0) { + *((uint64_t*)rs) = (uint64_t)pcb; + ((uint64_t*)pcb)++, ((uint64_t*)rs)++; + sz -= sizeof(uint64_t); } +} + +int +unw_state_create_from_pcb(struct unw_regstate *rs, struct pcb *pcb) +{ - return 0; + /* Cache the values. */ + rs->rs_val.special = pcb->pcb_special; + rs->rs_val.preserved = pcb->pcb_preserved; + rs->rs_val.preserved_fp = pcb->pcb_preserved_fp; + /* Set the location to the memory address in the PCB. */ + unw_set_loc(&rs->rs_loc.special, &pcb->pcb_special, + sizeof(rs->rs_loc.special)); + unw_set_loc(&rs->rs_loc.preserved, &pcb->pcb_preserved, + sizeof(rs->rs_loc.preserved)); + unw_set_loc(&rs->rs_loc.preserved_fp, &pcb->pcb_preserved_fp, + sizeof(rs->rs_loc.preserved_fp)); + return (0); } int -ia64_add_unwind_table(vm_offset_t base, vm_offset_t start, vm_offset_t end) +unw_table_add(uint64_t base, uint64_t start, uint64_t end) { - struct ia64_unwind_table *ut; + struct unw_table *ut; - KASSERT(ia64_unwind_initialised, ("foo")); - - ut = malloc(sizeof(struct ia64_unwind_table), M_UNWIND, M_NOWAIT); + ut = malloc(sizeof(struct unw_table), M_UNWIND, M_NOWAIT); if (ut == NULL) return (ENOMEM); ut->ut_base = base; - ut->ut_start = (struct ia64_unwind_table_entry*)start; - ut->ut_end = (struct ia64_unwind_table_entry*)end; + ut->ut_start = (struct unw_entry*)start; + ut->ut_end = (struct unw_entry*)end; ut->ut_limit = base + ut->ut_end[-1].ue_end; - LIST_INSERT_HEAD(&ia64_unwind_tables, ut, ut_link); + LIST_INSERT_HEAD(&unw_tables, ut, ut_link); if (bootverbose) printf("UNWIND: table added: base=%lx, start=%lx, end=%lx\n", @@ -204,13 +171,11 @@ } void -ia64_delete_unwind_table(vm_offset_t base) +unw_table_remove(uint64_t base) { - struct ia64_unwind_table *ut; + struct unw_table *ut; - KASSERT(ia64_unwind_initialised, ("foo")); - - ut = find_table(base); + ut = unw_table_lookup(base); if (ut != NULL) { LIST_REMOVE(ut, ut_link); free(ut, M_UNWIND); @@ -219,86 +184,7 @@ } } -struct ia64_unwind_state * -ia64_create_unwind_state(struct trapframe *framep) -{ - struct ia64_unwind_state *us; - int i; - - if (!ia64_unwind_initialised) - return 0; - - us = LIST_FIRST(&ia64_unwind_states); - if (us) { - LIST_REMOVE(us, us_link); - } else { - us = malloc(sizeof(struct ia64_unwind_state), - M_UNWIND, M_NOWAIT); - if (!us) - return 0; - } - - bzero(us, sizeof(*us)); - us->us_regs.rs_psp.ur_value = framep->tf_r[FRAME_SP]; - us->us_regs.rs_pfs.ur_value = framep->tf_ar_pfs; - us->us_regs.rs_preds.ur_value = framep->tf_pr; - us->us_regs.rs_unat.ur_value = framep->tf_ar_unat; - us->us_regs.rs_rnat.ur_value = framep->tf_ar_rnat; - us->us_regs.rs_bsp.ur_value = - (u_int64_t) (framep->tf_ar_bspstore + framep->tf_ndirty); - us->us_regs.rs_bspstore.ur_value = framep->tf_ar_bspstore; - us->us_regs.rs_fpsr.ur_value = framep->tf_ar_fpsr; - for (i = 0; i < 8; i++) { - us->us_regs.rs_br[i].ur_value = framep->tf_b[i]; - } - us->us_regs.rs_gr[0].ur_value = 0; - for (i = 1; i < 32; i++) { - us->us_regs.rs_gr[i].ur_value = framep->tf_r[i-1]; - } - for (i = 6; i < 16; i++) { - us->us_regs.rs_fr[i].ur_value = framep->tf_f[i-6]; - } - - us->us_ip = framep->tf_cr_iip; - us->us_ri = (framep->tf_cr_ipsr & IA64_PSR_RI) >> 41; - us->us_spill = (u_int64_t *) us->us_regs.rs_gr[12].ur_value; - us->us_cfm = framep->tf_cr_ifs; - us->us_bsp = ia64_rse_previous_frame - ((u_int64_t *) us->us_regs.rs_bsp.ur_value, us->us_cfm & 0x7f); - - return us; -} - -void -ia64_free_unwind_state(struct ia64_unwind_state *us) -{ - LIST_INSERT_HEAD(&ia64_unwind_states, us, us_link); -} - -u_int64_t -ia64_unwind_state_get_ip(struct ia64_unwind_state *us) -{ - return us->us_ip + us->us_ri; -} - -u_int64_t -ia64_unwind_state_get_sp(struct ia64_unwind_state *us) -{ - return us->us_regs.rs_gr[12].ur_value; -} - -u_int64_t -ia64_unwind_state_get_cfm(struct ia64_unwind_state *us) -{ - return us->us_cfm; -} - -u_int64_t * -ia64_unwind_state_get_bsp(struct ia64_unwind_state *us) -{ - return us->us_bsp; -} - +#if 0 static u_int64_t read_uleb128(u_int8_t **pp) { @@ -1510,3 +1396,4 @@ return 0; } +#endif ==== //depot/projects/ia64_epc/sys/ia64/include/unwind.h#2 (text+ko) ==== @@ -26,13 +26,37 @@ * $FreeBSD: src/sys/ia64/include/unwind.h,v 1.2 2002/10/19 19:30:38 marcel Exp $ */ -int ia64_add_unwind_table(vm_offset_t, vm_offset_t, vm_offset_t); -void ia64_delete_unwind_table(vm_offset_t); +#ifndef _MACHINE_UNWIND_H_ +#define _MACHINE_UNWIND_H_ + +#include + +/* + * The unwind register state (unw_regstate) consists of the special + * registers and all the preserved registers. For each register in + * the unwind register state we need to keep track of the value and + * the location of that value. We use the common register structures + * for both the value and the location. Encoding of the location is + * as follows: + * 0x0...00 - value is in the register itself + * 0x0...01-0x0...7F - value is in the general register + * 0x2...00-0xF...F8 - value is at the memory address + */ +struct _unw_regs { + struct _special special; + struct _callee_saved preserved; + struct _callee_saved_fp preserved_fp; +}; + +struct unw_regstate { + struct _unw_regs rs_val; + struct _unw_regs rs_loc; +}; + +int unw_state_create(struct unw_regstate *); +int unw_state_create_from_pcb(struct unw_regstate *, struct pcb *); + +int unw_table_add(uint64_t, uint64_t, uint64_t); +void unw_table_remove(uint64_t); -struct ia64_unwind_state *ia64_create_unwind_state(struct trapframe *framep); -void ia64_free_unwind_state(struct ia64_unwind_state *us); -u_int64_t ia64_unwind_state_get_ip(struct ia64_unwind_state *us); -u_int64_t ia64_unwind_state_get_sp(struct ia64_unwind_state *us); -u_int64_t ia64_unwind_state_get_cfm(struct ia64_unwind_state *us); -u_int64_t *ia64_unwind_state_get_bsp(struct ia64_unwind_state *us); -int ia64_unwind_state_previous_frame(struct ia64_unwind_state *us); +#endif /* _MACHINE_UNWIND_H_ */ From owner-p4-projects@FreeBSD.ORG Sat Apr 12 15:37:01 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id B3B4237B408; Sat, 12 Apr 2003 15:37:00 -0700 (PDT) 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 659F037B401 for ; Sat, 12 Apr 2003 15:37:00 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0BD1243FA3 for ; Sat, 12 Apr 2003 15:37:00 -0700 (PDT) (envelope-from marcel@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h3CMax0U063699 for ; Sat, 12 Apr 2003 15:36:59 -0700 (PDT) (envelope-from marcel@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h3CMaxpb063696 for perforce@freebsd.org; Sat, 12 Apr 2003 15:36:59 -0700 (PDT) Date: Sat, 12 Apr 2003 15:36:59 -0700 (PDT) Message-Id: <200304122236.h3CMaxpb063696@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 28846 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, 12 Apr 2003 22:37:01 -0000 http://perforce.freebsd.org/chv.cgi?CH=28846 Change 28846 by marcel@marcel_nfs on 2003/04/12 15:36:54 Remove the CMU copyright. There isn't anything here that can be contributed to them. Affected files ... .. //depot/projects/ia64_epc/sys/ia64/ia64/locore.s#7 edit Differences ... ==== //depot/projects/ia64_epc/sys/ia64/ia64/locore.s#7 (text+ko) ==== @@ -25,32 +25,6 @@ * * $FreeBSD: src/sys/ia64/ia64/locore.s,v 1.28 2003/04/06 21:31:26 marcel Exp $ */ -/* - * Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University. - * All rights reserved. - * - * Author: Chris G. Demetriou - * - * Permission to use, copy, modify and distribute this software and - * its documentation is hereby granted, provided that both the copyright - * notice and this permission notice appear in all copies of the - * software, derivative works or modified versions, and any portions - * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" - * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND - * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * - * Carnegie Mellon requests users of this software to return to - * - * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU - * School of Computer Science - * Carnegie Mellon University - * Pittsburgh PA 15213-3890 - * - * any improvements or extensions that they make and grant Carnegie the - * rights to redistribute these changes. - */ #include #include From owner-p4-projects@FreeBSD.ORG Sat Apr 12 17:31:25 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id EF05437B404; Sat, 12 Apr 2003 17:31:24 -0700 (PDT) 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 8F37937B401 for ; Sat, 12 Apr 2003 17:31:24 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 365FF43FAF for ; Sat, 12 Apr 2003 17:31:24 -0700 (PDT) (envelope-from marcel@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h3D0VO0U079066 for ; Sat, 12 Apr 2003 17:31:24 -0700 (PDT) (envelope-from marcel@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h3D0VNSe079063 for perforce@freebsd.org; Sat, 12 Apr 2003 17:31:23 -0700 (PDT) Date: Sat, 12 Apr 2003 17:31:23 -0700 (PDT) Message-Id: <200304130031.h3D0VNSe079063@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 28850 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, 13 Apr 2003 00:31:26 -0000 http://perforce.freebsd.org/chv.cgi?CH=28850 Change 28850 by marcel@marcel_nfs on 2003/04/12 17:31:00 AARRGGHH.. GCC checks the code for calls to "special" functions, such as setjmp(), longjmp() and alloca(). It also checks for savectx() and marks the function as having a call that can return twice. I don't particularly have a problem with that, but it also means that the function has a large prologue and epilogue in which most of the context is saved and restore. Since cpu_switch() is in C and uses savectx() and restorectx() to handle the register contexts, we're doing most of it twice. That sucks :-( For some reason GCC continues to make assumptions about functions even though we compile with -ffreestanding. Stop GCC's interference by renaming savectx to savectx__ with a preprocessor define. We may want to make the define dependent on the compiler, but I didn't bother doing that now... Affected files ... .. //depot/projects/ia64_epc/sys/ia64/ia64/context.s#10 edit .. //depot/projects/ia64_epc/sys/ia64/include/pcb.h#6 edit Differences ... ==== //depot/projects/ia64_epc/sys/ia64/ia64/context.s#10 (text+ko) ==== @@ -163,11 +163,11 @@ END(restorectx) /* - * void savectx(struct pcb *) + * void savectx__(struct pcb *) * void swapctx(struct pcb *old, struct pcb *new) */ -ENTRY(savectx,1) +ENTRY(savectx__,1) { .mmi alloc r16=ar.pfs,1,1,0,0 ;; ==== //depot/projects/ia64_epc/sys/ia64/include/pcb.h#6 (text+ko) ==== @@ -49,6 +49,7 @@ }; #ifdef _KERNEL +#define savectx savectx__ void restorectx(struct pcb *) __dead2; int savectx(struct pcb *); void swapctx(struct pcb *old, struct pcb *new);