aboutsummaryrefslogtreecommitdiffstats
path: root/sysutils
diff options
context:
space:
mode:
authorstas <stas@FreeBSD.org>2008-09-01 03:21:15 +0800
committerstas <stas@FreeBSD.org>2008-09-01 03:21:15 +0800
commitf6bffb3d204efefa71a1394bdeda58ddb0f5d5dd (patch)
tree9a62d85012290df2af0c1ce32ad8ddf91a0d4e7d /sysutils
parentbf3789e3316019237e1eb24a203c829cbc2c1584 (diff)
downloadfreebsd-ports-gnome-f6bffb3d204efefa71a1394bdeda58ddb0f5d5dd.tar.gz
freebsd-ports-gnome-f6bffb3d204efefa71a1394bdeda58ddb0f5d5dd.tar.zst
freebsd-ports-gnome-f6bffb3d204efefa71a1394bdeda58ddb0f5d5dd.zip
- Update to 1.21.
- Use cpuctl(4) to read MSR's and cpuid info whenever available. - Rely on devcpu where cpuctl(4) isn't available. - Add missing termination flag to cache descriptions list. Approved by: maintainer timeout (3 weeks)
Diffstat (limited to 'sysutils')
-rw-r--r--sysutils/x86info/Makefile10
-rw-r--r--sysutils/x86info/distinfo6
-rw-r--r--sysutils/x86info/files/patch-Intel_info.c11
-rw-r--r--sysutils/x86info/files/patch-bench_benchmarks.c17
-rw-r--r--sysutils/x86info/files/patch-cpuid.c53
-rw-r--r--sysutils/x86info/files/patch-rdmsr.c50
-rw-r--r--sysutils/x86info/files/patch-x86info.c35
7 files changed, 110 insertions, 72 deletions
diff --git a/sysutils/x86info/Makefile b/sysutils/x86info/Makefile
index 2a7c05e78935..0bfec4f052e9 100644
--- a/sysutils/x86info/Makefile
+++ b/sysutils/x86info/Makefile
@@ -6,7 +6,7 @@
#
PORTNAME= x86info
-PORTVERSION= 1.20
+PORTVERSION= 1.21
CATEGORIES= sysutils
MASTER_SITES= http://www.codemonkey.org.uk/projects/x86info/
EXTRACT_SUFX= .tgz
@@ -19,8 +19,14 @@ PLIST_FILES= bin/x86info
MAN1= x86info.1
MAKE_ARGS= CFLAGS="${CFLAGS}"
+.include <bsd.port.pre.mk>
+.if ${OSVERSION} < 800042
+BUILD_DEPENDS+= ${LOCALBASE}/include/cpu.h:${PORTSDIR}/sysutils/devcpu
+CFLAGS+= -I"${LOCALBASE}"/include
+.endif
+
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/x86info ${PREFIX}/bin
${INSTALL_MAN} ${WRKSRC}/x86info.1 ${MAN1PREFIX}/man/man1
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
diff --git a/sysutils/x86info/distinfo b/sysutils/x86info/distinfo
index 82e69e46cdc8..f9fc31e648be 100644
--- a/sysutils/x86info/distinfo
+++ b/sysutils/x86info/distinfo
@@ -1,3 +1,3 @@
-MD5 (x86info-1.20.tgz) = fc593ee2510fc2e265de9c2681170842
-SHA256 (x86info-1.20.tgz) = 7bf65db8dfb9e9deea51de9589ee2b62dd20345ec69869ff0da39716a335b12d
-SIZE (x86info-1.20.tgz) = 54364
+MD5 (x86info-1.21.tgz) = 1fbfaa392170e2636006603659dec0f0
+SHA256 (x86info-1.21.tgz) = 2bb3fb33832e073452657adf9f946b2d73d32c7382382f2136750c29d2637fe1
+SIZE (x86info-1.21.tgz) = 59354
diff --git a/sysutils/x86info/files/patch-Intel_info.c b/sysutils/x86info/files/patch-Intel_info.c
deleted file mode 100644
index fcb768cd51d1..000000000000
--- a/sysutils/x86info/files/patch-Intel_info.c
+++ /dev/null
@@ -1,11 +0,0 @@
---- Intel/info.c.orig Thu Aug 24 01:24:35 2006
-+++ Intel/info.c Thu Aug 24 01:25:13 2006
-@@ -35,7 +35,7 @@
- if (show_msr) {
- if (cpu->family==0xf)
- dump_p4_MSRs(cpu);
-- if (cpu->family==0x6 && cpu->model==9)
-+ if (cpu->family==0x6 && (cpu->model == 9 || cpu->model == 13))
- dump_centrino_MSRs(cpu);
- }
-
diff --git a/sysutils/x86info/files/patch-bench_benchmarks.c b/sysutils/x86info/files/patch-bench_benchmarks.c
deleted file mode 100644
index d6885d16938f..000000000000
--- a/sysutils/x86info/files/patch-bench_benchmarks.c
+++ /dev/null
@@ -1,17 +0,0 @@
---- bench/benchmarks.c.orig Tue Oct 4 19:22:20 2005
-+++ bench/benchmarks.c Tue Oct 4 19:22:40 2005
-@@ -1,6 +1,5 @@
- #include <time.h>
- #include <sys/time.h>
--#include <asm/unistd.h>
- #include <sys/stat.h>
- #include <stdio.h>
- #include "../x86info.h"
-@@ -13,7 +12,6 @@
- if (show_bench != 1)
- return;
-
-- TIME(asm volatile("int $0x80" :"=a" (ret) :"0" (__NR_getppid)), "int 0x80");
- TIME(asm volatile("cpuid": : :"ax", "dx", "cx", "bx"), "cpuid");
-
- TIME(asm volatile("addl $1,0(%esp)"), "addl");
diff --git a/sysutils/x86info/files/patch-cpuid.c b/sysutils/x86info/files/patch-cpuid.c
index 667257bce2ea..6a3977c4661a 100644
--- a/sysutils/x86info/files/patch-cpuid.c
+++ b/sysutils/x86info/files/patch-cpuid.c
@@ -1,11 +1,56 @@
---- cpuid.c.orig Wed Aug 9 22:54:05 2006
-+++ cpuid.c Wed Aug 9 22:54:20 2006
-@@ -42,7 +42,7 @@
+--- cpuid.c.orig 2007-11-27 03:37:20.000000000 +0300
++++ cpuid.c 2008-08-09 23:02:57.000000000 +0400
+@@ -21,8 +21,15 @@
+ #include <errno.h>
+
+ #if defined(__FreeBSD__)
++# include <sys/param.h>
+ # include <sys/ioctl.h>
+-# include <cpu.h>
++# if __FreeBSD_version < 800042
++# define CPUDEV "/dev/cpu%d"
++# include <cpu.h>
++# else
++# define CPUDEV "/dev/cpuctl%d"
++# include <sys/cpuctl.h>
++# endif
+ #endif
+
+ #include "x86info.h"
+@@ -38,7 +45,11 @@
+ char cpuname[20];
+ unsigned char buffer[16];
+ int fh;
++#if __FreeBSD_version < 800042
+ cpu_cpuid_args_t args;
++#else
++ cpuctl_cpuid_args_t args;
++#endif
+
+ if (nodriver==1) {
+ cpuid_UP(idx, eax, ebx, ecx, edx);
+@@ -47,10 +58,14 @@
+
+ args.level = idx;
+ /* Ok, use the /dev/CPU interface in preference to the _up code. */
+- (void)snprintf(cpuname,18, "/dev/cpu%d", CPU_number);
++ (void)snprintf(cpuname,18, CPUDEV, CPU_number);
+ fh = open(cpuname, O_RDONLY);
+ if (fh != -1) {
++#if __FreeBSD_version < 800042
+ if (ioctl(fh, CPU_CPUID, &args) != 0) {
++#else
++ if (ioctl(fh, CPUCTL_CPUID, &args) != 0) {
++#endif
+ perror(cpuname);
+ exit(EXIT_FAILURE);
+ }
+@@ -107,7 +122,7 @@
fh = open(cpuname, O_RDONLY);
if (fh != -1) {
#ifndef S_SPLINT_S
- lseek64(fh, (off64_t)idx, SEEK_CUR);
+ lseek(fh, (off_t)idx, SEEK_CUR);
#endif
- if (read(fh, &buffer[0], 16) == -1) {
+ if (read(fh, &buffer[0], CPUID_CHUNK_SIZE) == -1) {
perror(cpuname);
diff --git a/sysutils/x86info/files/patch-rdmsr.c b/sysutils/x86info/files/patch-rdmsr.c
new file mode 100644
index 000000000000..fc4bed205f75
--- /dev/null
+++ b/sysutils/x86info/files/patch-rdmsr.c
@@ -0,0 +1,50 @@
+--- rdmsr.c.orig 2007-11-27 03:37:20.000000000 +0300
++++ rdmsr.c 2008-08-09 23:03:05.000000000 +0400
+@@ -17,8 +17,15 @@
+ #include "x86info.h"
+
+ #if defined(__FreeBSD__)
+-# include <sys/ioctl.h>
+-# include <cpu.h>
++# include <sys/param.h>
++# include <sys/ioctl.h>
++# if __FreeBSD_version < 800042
++# define CPUDEV "/dev/cpu%d"
++# include <cpu.h>
++# else
++# define CPUDEV "/dev/cpuctl%d"
++# include <sys/cpuctl.h>
++# endif
+ #endif
+
+ #if defined(__FreeBSD__)
+@@ -30,12 +37,16 @@
+ unsigned long lo, hi;
+ int fh;
+ static int nodriver=0;
++#if __FreeBSD_version < 800042
+ cpu_msr_args_t args;
++#else
++ cpuctl_msr_args_t args;
++#endif
+
+ if (nodriver==1)
+ return 0;
+
+- (void)snprintf(cpuname, sizeof(cpuname), "/dev/cpu%d", cpu);
++ (void)snprintf(cpuname, sizeof(cpuname), CPUDEV, cpu);
+
+ fh = open(cpuname, O_RDONLY);
+ if (fh==-1) {
+@@ -46,7 +57,11 @@
+ }
+
+ args.msr = idx;
++#if __FreeBSD_version < 800042
+ if (ioctl(fh, CPU_RDMSR, &args) != 0) {
++#else
++ if (ioctl(fh, CPUCTL_RDMSR, &args) != 0) {
++#endif
+ if (close(fh) == -1) {
+ perror("close");
+ exit(EXIT_FAILURE);
diff --git a/sysutils/x86info/files/patch-x86info.c b/sysutils/x86info/files/patch-x86info.c
deleted file mode 100644
index 48cc9ea95154..000000000000
--- a/sysutils/x86info/files/patch-x86info.c
+++ /dev/null
@@ -1,35 +0,0 @@
---- x86info.c.orig Sat Sep 24 17:33:38 2005
-+++ x86info.c Wed Oct 5 17:34:30 2005
-@@ -11,6 +11,10 @@
- #include <string.h>
- #include <stdlib.h>
- #include <unistd.h>
-+#if __FreeBSD__ < 500000
-+#include <sys/types.h>
-+#include <sys/sysctl.h>
-+#endif
-
- #include "x86info.h"
-
-@@ -175,6 +179,9 @@
- {
- unsigned int i;
- struct cpudata *cpu, *head=NULL, *tmp;
-+#if __FreeBSD__ < 500000
-+ size_t nr = sizeof(nrCPUs);
-+#endif
-
- parse_command_line(argc, argv);
- if (!silent) {
-@@ -194,7 +201,11 @@
- if (need_root && !user_is_root)
- printf ("Need to be root to use specified options.\n");
-
-+#if __FreeBSD__ > 500000
- nrCPUs = sysconf (_SC_NPROCESSORS_CONF);
-+#else
-+ sysctlbyname("hw.ncpu", &nrCPUs, &nr, NULL, 0);
-+#endif
-
- if (!silent) {
- printf ("Found %u CPU", nrCPUs);