Date: Sat, 3 Dec 2016 13:13:24 +0000 (UTC) From: Emanuel Haupt <ehaupt@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r427612 - in head/sysutils/x86info: . files Message-ID: <201612031313.uB3DDOPK013409@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: ehaupt Date: Sat Dec 3 13:13:24 2016 New Revision: 427612 URL: https://svnweb.freebsd.org/changeset/ports/427612 Log: - Update to latest GitHub version - Update WWW PR: 214878 Submitted by: kib Added: head/sysutils/x86info/files/patch-lsmsr_Makefile (contents, props changed) head/sysutils/x86info/files/patch-lsmsr_lsmsr.c (contents, props changed) Deleted: head/sysutils/x86info/files/patch-AMD_powernow.c head/sysutils/x86info/files/patch-Intel_cachesize.c head/sysutils/x86info/files/patch-Intel_topology.c head/sysutils/x86info/files/patch-apic.c head/sysutils/x86info/files/patch-cpuid.c head/sysutils/x86info/files/patch-lsmsr.c head/sysutils/x86info/files/patch-mptable.c head/sysutils/x86info/files/patch-mtrr.c head/sysutils/x86info/files/patch-rdmsr.c head/sysutils/x86info/files/patch-x86info.h Modified: head/sysutils/x86info/Makefile head/sysutils/x86info/distinfo head/sysutils/x86info/files/patch-Makefile head/sysutils/x86info/pkg-descr Modified: head/sysutils/x86info/Makefile ============================================================================== --- head/sysutils/x86info/Makefile Sat Dec 3 12:57:57 2016 (r427611) +++ head/sysutils/x86info/Makefile Sat Dec 3 13:13:24 2016 (r427612) @@ -2,13 +2,11 @@ # $FreeBSD$ PORTNAME= x86info -PORTVERSION= 1.30 -PORTREVISION= 1 +DISTVERSION= 1.31snap01 CATEGORIES= sysutils -MASTER_SITES= http://codemonkey.org.uk/projects/x86info/ MAINTAINER= ports@FreeBSD.org -COMMENT= x86 CPU identification utility +COMMENT= x86 CPU identification and feature display utility LICENSE= GPLv2 @@ -17,19 +15,32 @@ LIB_DEPENDS= libpci.so:devel/libpci ONLY_FOR_ARCHS= i386 amd64 USES= gmake pkgconfig python:build tar:tgz -ALL_TARGET= x86info lsmsr +USE_GITHUB= yes +GH_ACCOUNT= kernelslacker +GH_PROJECT= x86info +GH_TAGNAME= 636fbaa PLIST_FILES= bin/lsmsr bin/x86info man/man8/lsmsr.8.gz man/man1/x86info.1.gz +.include <bsd.port.pre.mk> + +.if ${OPSYS} == FreeBSD && ${OSVERSION} < 1000000 +USE_GCC= yes +.endif + +do-build: + @cd ${WRKSRC} ; ${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${_MAKE_JOBS} ${MAKE_ARGS} + @cd ${WRKSRC}/lsmsr ; ${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${_MAKE_JOBS} ${MAKE_ARGS} + do-install: ${INSTALL_PROGRAM} ${WRKSRC}/x86info ${STAGEDIR}${PREFIX}/bin - ${INSTALL_PROGRAM} ${WRKSRC}/lsmsr ${STAGEDIR}${PREFIX}/bin + ${INSTALL_PROGRAM} ${WRKSRC}/lsmsr/lsmsr ${STAGEDIR}${PREFIX}/bin ${INSTALL_MAN} ${WRKSRC}/x86info.1 ${STAGEDIR}${MAN1PREFIX}/man/man1 - ${INSTALL_MAN} ${WRKSRC}/lsmsr.8 ${STAGEDIR}${MAN8PREFIX}/man/man8 + ${INSTALL_MAN} ${WRKSRC}/lsmsr/lsmsr.8 ${STAGEDIR}${MAN8PREFIX}/man/man8 post-patch: @${REINPLACE_CMD} \ - -e 's|python scripts/createheader.py|${PYTHON_CMD} scripts/createheader.py|' \ - ${WRKSRC}/Makefile + -e 's|python createheader.py|${PYTHON_CMD} createheader.py|' \ + ${WRKSRC}/lsmsr/Makefile -.include <bsd.port.mk> +.include <bsd.port.post.mk> Modified: head/sysutils/x86info/distinfo ============================================================================== --- head/sysutils/x86info/distinfo Sat Dec 3 12:57:57 2016 (r427611) +++ head/sysutils/x86info/distinfo Sat Dec 3 13:13:24 2016 (r427612) @@ -1,2 +1,3 @@ -SHA256 (x86info-1.30.tgz) = fe3009850e93a9c5fa38ed6bf74d72686043329fead8f1b2be4b5943d4fc9428 -SIZE (x86info-1.30.tgz) = 95727 +TIMESTAMP = 1480247467 +SHA256 (kernelslacker-x86info-1.31snap01-636fbaa_GH0.tar.gz) = 86f832da6ffcb2097fb10d6bab279d15470357f2efbbf1afd647fa26cd056e8c +SIZE (kernelslacker-x86info-1.31snap01-636fbaa_GH0.tar.gz) = 85199 Modified: head/sysutils/x86info/files/patch-Makefile ============================================================================== --- head/sysutils/x86info/files/patch-Makefile Sat Dec 3 12:57:57 2016 (r427611) +++ head/sysutils/x86info/files/patch-Makefile Sat Dec 3 13:13:24 2016 (r427612) @@ -1,22 +1,37 @@ ---- Makefile.orig 2011-09-15 15:43:52.000000000 -0700 -+++ Makefile 2011-09-15 15:44:01.000000000 -0700 -@@ -1,8 +1,8 @@ - VERSION=1.30 - --CFLAGS = -g -O2 -Werror -Wall -Wshadow -Wextra -Wmissing-declarations -Wdeclaration-after-statement -Wredundant-decls -+CFLAGS += -Wall -Wshadow -Wextra -Wmissing-declarations -Wdeclaration-after-statement -Wredundant-decls `pkg-config --cflags libpci` +--- Makefile.orig 2016-10-12 19:04:55 UTC ++++ Makefile +@@ -18,6 +18,7 @@ CFLAGS += -Wstrict-prototypes -Wmissing- + CFLAGS += -Wswitch-enum + CFLAGS += -Wundef + CFLAGS += -Wwrite-strings ++CFLAGS += `pkg-config --cflags libpci` + + # gcc specific + ifneq ($(shell $(CC) -v 2>&1 | grep -c "clang"), 1) +@@ -37,7 +38,7 @@ CFLAGS += $(shell if [ $(CPP_MAJOR) -eq LDFLAGS = -Wl,-z,relro,-z,now + + ifeq ($(CC),"") -CC = gcc +CC ?= gcc + endif - SHELL = /bin/sh + ifdef STATIC_LIBPCI +@@ -50,7 +51,7 @@ SHELL = /bin/sh -@@ -91,7 +91,7 @@ - X86INFO_OBJS = $(X86INFO_SRC:%.c=%.o) + V = @ + Q = $(V:1=) +-QUIET_CC = $(Q:@=@echo ' CC '$@;) ++#QUIET_CC = $(Q:@=@echo ' CC '$@;) - x86info: $(X86INFO_OBJS) -- $(CC) $(CFLAGS) $(LDFLAGS) -o x86info $(X86INFO_OBJS) -lpci -+ $(CC) $(CFLAGS) $(LDFLAGS) -o x86info $(X86INFO_OBJS) `pkg-config --libs libpci` -lpci + all: x86info +@@ -67,7 +68,7 @@ X86INFO_OBJS = $(sort $(patsubst %.c,%.o + x86info: $(X86INFO_OBJS) $(X86INFO_HEADERS) + $(QUIET_CC)$(CC) $(CFLAGS) $(LDFLAGS) -o x86info $(X86INFO_OBJS) \ +- $(LIBPCI) ++ `pkg-config --libs libpci` $(LIBPCI) + DEPDIR= .deps + -include $(X86INFO_SRC:%.c=$(DEPDIR)/%.d) Added: head/sysutils/x86info/files/patch-lsmsr_Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/x86info/files/patch-lsmsr_Makefile Sat Dec 3 13:13:24 2016 (r427612) @@ -0,0 +1,24 @@ +--- lsmsr/Makefile.orig 2016-10-12 19:04:55 UTC ++++ lsmsr/Makefile +@@ -14,12 +14,10 @@ CFLAGS += -Wdeclaration-after-statement + CFLAGS += -Wformat=2 + CFLAGS += -Wimplicit + CFLAGS += -Winit-self +-CFLAGS += -Wlogical-op + CFLAGS += -Wmissing-declarations -Wredundant-decls + CFLAGS += -Wnested-externs + CFLAGS += -Wpacked + CFLAGS += -Wshadow +-CFLAGS += -Wstrict-aliasing=3 + CFLAGS += -Wstrict-prototypes -Wmissing-prototypes + CFLAGS += -Wswitch-enum + CFLAGS += -Wundef +@@ -40,7 +38,7 @@ LSMSR_TMP_HEADERS=AMD_k8.h \ + generic_msr.h + + %.h: %.regs createheader.py +- @python createheader.py $< `basename $< .regs` >$@ ++ @/usr/local/bin/python2.7 createheader.py $< `basename $< .regs` >$@ + + LSMSR_SRC = \ + lsmsr.c \ Added: head/sysutils/x86info/files/patch-lsmsr_lsmsr.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/x86info/files/patch-lsmsr_lsmsr.c Sat Dec 3 13:13:24 2016 (r427612) @@ -0,0 +1,100 @@ +--- lsmsr/lsmsr.c.orig 2016-10-12 19:04:55 UTC ++++ lsmsr/lsmsr.c +@@ -34,6 +34,18 @@ + #include "AMD_fam15h.h" + #include "generic_msr.h" + ++#if defined(__FreeBSD__) ++# include <sys/param.h> ++# include <sys/ioctl.h> ++# if __FreeBSD_version < 701102 ++# define CPUDEV "/dev/cpu%d" ++# include <cpu.h> ++# else ++# define CPUDEV "/dev/cpuctl%d" ++# include <sys/cpuctl.h> ++# endif ++#endif ++ + /* Todos: + * - add (list and eventually write) support for write-only MSR + * - add decoding support for bit fields +@@ -119,13 +131,40 @@ static void version(void) + fprintf(stdout, "%s version %s\n", g.prog, LSMSR_VERSION); + } + ++#if defined(__FreeBSD__) ++ ++static int get_msr_val(unsigned int msr, unsigned long long *val) ++{ ++#if __FreeBSD_version < 701102 ++ cpu_msr_args_t args; ++#else ++ cpuctl_msr_args_t args; ++#endif ++ ++ args.msr = msr; ++#if __FreeBSD_version < 701102 ++ if (ioctl(g.fd, CPU_RDMSR, &args) != 0) { ++#else ++ if (ioctl(g.fd, CPUCTL_RDMSR, &args) != 0) { ++#endif ++ fflush(stdout); ++ fprintf(stderr, ++ "could not read MSR 0x%8.8x (%s): %s\n", ++ msr, get_reg_name(msr, g.msr_table), strerror(errno)); ++ return 0; ++ } ++ *val = args.data; ++ ++ return 0; ++} ++#else /* !__FreeBSD__ */ + static int get_msr_val(unsigned int msr, unsigned long long *val) + { + off64_t off; + int err; + + *val = 0; +- off = lseek64(g.fd, (off64_t) msr, SEEK_SET); ++ off = lseek(g.fd, (off64_t) msr, SEEK_SET); + if (off == (off_t) -1) { + perror("invalid MSR"); + return 1; +@@ -144,11 +183,17 @@ static int get_msr_val(unsigned int msr, + return 0; + } + ++#endif ++ + static int open_dev(int cpu) + { + char s[20]; + ++#ifdef __FreeBSD__ ++ snprintf(s, sizeof(s), CPUDEV, cpu); ++#else + snprintf(s, sizeof(s), "/dev/cpu/%d/msr", cpu); ++#endif + g.fd = open(s, O_RDONLY); + if (g.fd < 0) + fprintf(stderr, "could not open device %s: %s\n", s, +@@ -317,6 +362,7 @@ static int set_msr_table(void) + } + + struct reg_spec unknown_msr = {0, "unknown", "(at your own risk)", NULL, NULL}; ++unsigned int nrCPUs = 1; + + #define OPT_MAX 32 + int main(int argc, char *argv[]) +@@ -325,6 +371,10 @@ int main(int argc, char *argv[]) + int i, li, ret; + struct reg_spec *reg; + ++ nrCPUs = sysconf(_SC_NPROCESSORS_ONLN); ++ if (nrCPUs > 65535) ++ nrCPUs = 1; ++ + ret = 1; + if((g.prog = rindex(argv[0], '/'))) + ++g.prog; Modified: head/sysutils/x86info/pkg-descr ============================================================================== --- head/sysutils/x86info/pkg-descr Sat Dec 3 12:57:57 2016 (r427611) +++ head/sysutils/x86info/pkg-descr Sat Dec 3 13:13:24 2016 (r427612) @@ -3,4 +3,4 @@ the system. Cache information, flags, r family, and model are all displayed. It works with all Intel, AMD, Centaur, Cyrix, VIA processors. -WWW: http://codemonkey.org.uk/projects/x86info/ +WWW: https://github.com/kernelslacker/x86info/
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201612031313.uB3DDOPK013409>