From owner-p4-projects Mon Sep 23 0:56:51 2002 Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id A4E1D37B404; Mon, 23 Sep 2002 00:56: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 5192937B401 for ; Mon, 23 Sep 2002 00:56:43 -0700 (PDT) Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id EE89643E3B for ; Mon, 23 Sep 2002 00:56:42 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from freefall.freebsd.org (perforce@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id g8N7ugCo090707 for ; Mon, 23 Sep 2002 00:56:42 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id g8N7ugBN090704 for perforce@freebsd.org; Mon, 23 Sep 2002 00:56:42 -0700 (PDT) Date: Mon, 23 Sep 2002 00:56:42 -0700 (PDT) Message-Id: <200209230756.g8N7ugBN090704@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm Subject: PERFORCE change 17983 for review To: Perforce Change Reviews Sender: owner-p4-projects@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG http://people.freebsd.org/~peter/p4db/chv.cgi?CH=17983 Change 17983 by peter@peter_overcee on 2002/09/23 00:56:05 IFC @17982 (and i386_hammer, sorry about the repeated spam about this) Affected files ... .. //depot/projects/hammer/lib/csu/x86_64/Makefile#1 branch .. //depot/projects/hammer/lib/csu/x86_64/crt1.c#1 branch .. //depot/projects/hammer/lib/csu/x86_64/crti.S#1 branch .. //depot/projects/hammer/lib/csu/x86_64/crtn.S#1 branch .. //depot/projects/hammer/sys/i386/include/asm.h#3 integrate .. //depot/projects/hammer/sys/powerpc/include/asm.h#3 integrate .. //depot/projects/hammer/sys/sys/vnode.h#4 integrate .. //depot/projects/hammer/sys/x86_64/include/asm.h#3 integrate .. //depot/projects/hammer/usr.bin/uname/uname.c#5 integrate Differences ... ==== //depot/projects/hammer/sys/i386/include/asm.h#3 (text+ko) ==== @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)DEFS.h 5.1 (Berkeley) 4/23/90 - * $FreeBSD: src/sys/i386/include/asm.h,v 1.9 2002/09/17 01:48:57 peter Exp $ + * $FreeBSD: src/sys/i386/include/asm.h,v 1.10 2002/09/23 07:27:45 peter Exp $ */ #ifndef _MACHINE_ASM_H_ @@ -53,13 +53,11 @@ popl %ebx #define PIC_PLT(x) x@PLT #define PIC_GOT(x) x@GOT(%ebx) -#define PIC_GOTOFF(x) x@GOTOFF(%ebx) #else #define PIC_PROLOGUE #define PIC_EPILOGUE #define PIC_PLT(x) x #define PIC_GOT(x) x -#define PIC_GOTOFF(x) x #endif /* ==== //depot/projects/hammer/sys/powerpc/include/asm.h#3 (text+ko) ==== @@ -29,7 +29,7 @@ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $NetBSD: asm.h,v 1.6.18.1 2000/07/25 08:37:14 kleink Exp $ - * $FreeBSD: src/sys/powerpc/include/asm.h,v 1.5 2002/09/17 01:48:58 peter Exp $ + * $FreeBSD: src/sys/powerpc/include/asm.h,v 1.6 2002/09/23 07:27:45 peter Exp $ */ #ifndef _MACHINE_ASM_H_ @@ -41,17 +41,14 @@ #define PIC_PLT(x) x@plt #ifdef __STDC__ #define PIC_GOT(x) XXX -#define PIC_GOTOFF(x) XXX #else /* not __STDC__ */ #define PIC_GOT(x) XXX -#define PIC_GOTOFF(x) XXX #endif /* __STDC__ */ #else #define PIC_PROLOGUE #define PIC_EPILOGUE #define PIC_PLT(x) x #define PIC_GOT(x) x -#define PIC_GOTOFF(x) x #endif #define CNAME(csym) csym ==== //depot/projects/hammer/sys/sys/vnode.h#4 (text+ko) ==== @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)vnode.h 8.7 (Berkeley) 2/4/94 - * $FreeBSD: src/sys/sys/vnode.h,v 1.208 2002/09/14 09:02:15 njl Exp $ + * $FreeBSD: src/sys/sys/vnode.h,v 1.209 2002/09/23 07:21:25 jeff Exp $ */ #ifndef _SYS_VNODE_H_ @@ -52,6 +52,7 @@ #include #include #include +#include /* * The vnode is the focus of all file activity in UNIX. There is a ==== //depot/projects/hammer/sys/x86_64/include/asm.h#3 (text+ko) ==== @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)DEFS.h 5.1 (Berkeley) 4/23/90 - * $FreeBSD: src/sys/i386/include/asm.h,v 1.9 2002/09/17 01:48:57 peter Exp $ + * $FreeBSD: src/sys/i386/include/asm.h,v 1.10 2002/09/23 07:27:45 peter Exp $ */ #ifndef _MACHINE_ASM_H_ ==== //depot/projects/hammer/usr.bin/uname/uname.c#5 (text+ko) ==== @@ -34,7 +34,7 @@ #include -__FBSDID("$FreeBSD: src/usr.bin/uname/uname.c,v 1.10 2002/09/23 06:14:13 jmallett Exp $"); +__FBSDID("$FreeBSD: src/usr.bin/uname/uname.c,v 1.11 2002/09/23 06:47:39 jmallett Exp $"); #ifndef lint static const char copyright[] = @@ -84,6 +84,7 @@ int ch; setup_get(); + flags = 0; while ((ch = getopt(argc, argv, "amnprsv")) != -1) switch(ch) { @@ -169,99 +170,53 @@ printf("\n"); } -void -native_sysname(void) -{ - int mib[2]; - size_t len; - static char buf[1024]; +#define NATIVE_SYSCTL2_GET(var,mib0,mib1) \ +void \ +native_##var(void) \ +{ \ + int mib[] = { (mib0), (mib1) }; \ + size_t len; \ + static char buf[1024]; \ + char **varp = &(var); \ + \ + len = sizeof buf; \ + if (sysctl(mib, sizeof mib / sizeof mib[0], \ + &buf, &len, NULL, 0) == -1) \ + err(1, "sysctl"); - mib[0] = CTL_KERN; - mib[1] = KERN_OSTYPE; - len = sizeof(buf); - if (sysctl(mib, 2, &buf, &len, NULL, 0) == -1) - err(1, "sysctl"); - sysname = buf; -} +#define NATIVE_SET \ + *varp = buf; \ + return; \ +} struct __hack -void -native_hostname(void) -{ - int mib[2]; - size_t len; - static char buf[1024]; +#define NATIVE_BUFFER (buf) +#define NATIVE_LENGTH (len) - mib[0] = CTL_KERN; - mib[1] = KERN_HOSTNAME; - len = sizeof(buf); - if (sysctl(mib, 2, &buf, &len, NULL, 0) == -1) - err(1, "sysctl"); - hostname = buf; -} +NATIVE_SYSCTL2_GET(sysname, CTL_KERN, KERN_OSTYPE) { +} NATIVE_SET; -void -native_release(void) -{ - int mib[2]; - size_t len; - static char buf[1024]; +NATIVE_SYSCTL2_GET(hostname, CTL_KERN, KERN_HOSTNAME) { +} NATIVE_SET; - mib[0] = CTL_KERN; - mib[1] = KERN_OSRELEASE; - len = sizeof(buf); - if (sysctl(mib, 2, &buf, &len, NULL, 0) == -1) - err(1, "sysctl"); - release = buf; -} +NATIVE_SYSCTL2_GET(release, CTL_KERN, KERN_OSRELEASE) { +} NATIVE_SET; -void -native_version(void) -{ - int mib[2]; - size_t len, tlen; +NATIVE_SYSCTL2_GET(version, CTL_KERN, KERN_VERSION) { + size_t n; char *p; - static char buf[1024]; - mib[0] = CTL_KERN; - mib[1] = KERN_VERSION; - len = sizeof(buf); - if (sysctl(mib, 2, &buf, &len, NULL, 0) == -1) - err(1, "sysctl"); - for (p = buf, tlen = len; tlen--; ++p) + p = NATIVE_BUFFER; + n = NATIVE_LENGTH; + for (; n--; ++p) if (*p == '\n' || *p == '\t') *p = ' '; - version = buf; -} +} NATIVE_SET; -void -native_platform(void) -{ - int mib[2]; - size_t len; - static char buf[1024]; +NATIVE_SYSCTL2_GET(platform, CTL_HW, HW_MACHINE) { +} NATIVE_SET; - mib[0] = CTL_HW; - mib[1] = HW_MACHINE; - len = sizeof(buf); - if (sysctl(mib, 2, &buf, &len, NULL, 0) == -1) - err(1, "sysctl"); - platform = buf; -} - -void -native_arch(void) -{ - int mib[2]; - size_t len; - static char buf[1024]; - - mib[0] = CTL_HW; - mib[1] = HW_MACHINE_ARCH; - len = sizeof(buf); - if (sysctl(mib, 2, &buf, &len, NULL, 0) == -1) - err(1, "sysctl"); - arch = buf; -} +NATIVE_SYSCTL2_GET(arch, CTL_HW, HW_MACHINE_ARCH) { +} NATIVE_SET; void usage(void) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message