aboutsummaryrefslogtreecommitdiff
path: root/sysutils/x86info/files
diff options
context:
space:
mode:
authorYing-Chieh Liao <ijliao@FreeBSD.org>2001-10-14 18:13:23 +0000
committerYing-Chieh Liao <ijliao@FreeBSD.org>2001-10-14 18:13:23 +0000
commit0b278f3c0b570f992bb51549ec44443b1ed0f7c8 (patch)
tree8865a6d4516679895ea50eb42e843ffe4097fd6f /sysutils/x86info/files
parent7b1a111123c65b7c37d014eb57c5f53b20ecb766 (diff)
Notes
Diffstat (limited to 'sysutils/x86info/files')
-rw-r--r--sysutils/x86info/files/patch-Makefile18
-rw-r--r--sysutils/x86info/files/patch-x86info.c35
-rw-r--r--sysutils/x86info/files/patch-x86info.h16
3 files changed, 69 insertions, 0 deletions
diff --git a/sysutils/x86info/files/patch-Makefile b/sysutils/x86info/files/patch-Makefile
new file mode 100644
index 000000000000..88d0fde539d3
--- /dev/null
+++ b/sysutils/x86info/files/patch-Makefile
@@ -0,0 +1,18 @@
+--- Makefile.orig Mon Oct 15 02:07:53 2001
++++ Makefile Mon Oct 15 02:08:22 2001
+@@ -1,4 +1,4 @@
+-CFLAGS = -Wall -W -g -O2
++#CFLAGS = -Wall -W -g -O2
+ all: x86info
+
+ OBJS =\
+@@ -22,6 +22,9 @@
+
+ x86info: $(OBJS)
+ gcc -o x86info $(OBJS)
++
++.c.o:
++ gcc $(CFLAGS) -o $@ -c $<
+
+ clean:
+ rm -f *.o x86info
diff --git a/sysutils/x86info/files/patch-x86info.c b/sysutils/x86info/files/patch-x86info.c
new file mode 100644
index 000000000000..a0e8551559d4
--- /dev/null
+++ b/sysutils/x86info/files/patch-x86info.c
@@ -0,0 +1,35 @@
+--- x86info.c.orig Mon Oct 15 02:04:23 2001
++++ x86info.c Mon Oct 15 02:06:27 2001
+@@ -11,6 +11,10 @@
+ #include <string.h>
+ #include <stdlib.h>
+ #include <unistd.h>
++#ifndef linux
++#include <sys/types.h>
++#include <sys/sysctl.h>
++#endif
+ #include "x86info.h"
+
+ int show_msr=0;
+@@ -89,7 +93,21 @@
+ return(0);
+ }
+
++#if defined _SC_NPROCESSORS /* linux */
+ nrCPUs = sysconf (_SC_NPROCESSORS_CONF);
++#elif defined HW_NCPU /* bsd */
++ {
++ int mib[2] = { CTL_HW, HW_NCPU };
++ size_t len;
++
++ len = sizeof(nrCPUs);
++ sysctl(mib, 2, &nrCPUs, &len, NULL, 0);
++ }
++#else
++ /* unknown interface to count cpu's */
++ nrCPUs=1;
++#endif
++
+ printf ("Found %d CPU", nrCPUs);
+ if (nrCPUs > 1)
+ printf ("s");
diff --git a/sysutils/x86info/files/patch-x86info.h b/sysutils/x86info/files/patch-x86info.h
new file mode 100644
index 000000000000..96c8c7281f0f
--- /dev/null
+++ b/sysutils/x86info/files/patch-x86info.h
@@ -0,0 +1,16 @@
+diff -urNb x86info.h x86info.h
+--- x86info.h.orig Thu Jul 26 14:40:46 2001
++++ x86info.h Sun Aug 26 23:12:33 2001
+@@ -3,7 +3,12 @@
+ * May be used under the terms of the GNU Public License (GPL)
+ */
+
++#ifdef linux
+ #include <linux/types.h>
++#else
++#include <machine/types.h>
++#define __u32 int
++#endif
+
+ typedef __u32 u32;
+