diff options
Diffstat (limited to 'sysutils/x86info/files')
-rw-r--r-- | sysutils/x86info/files/patch-Makefile | 29 | ||||
-rw-r--r-- | sysutils/x86info/files/patch-lsmsr_Makefile | 15 | ||||
-rw-r--r-- | sysutils/x86info/files/patch-lsmsr_lsmsr.c | 100 |
3 files changed, 0 insertions, 144 deletions
diff --git a/sysutils/x86info/files/patch-Makefile b/sysutils/x86info/files/patch-Makefile deleted file mode 100644 index 4f80b57aad83..000000000000 --- a/sysutils/x86info/files/patch-Makefile +++ /dev/null @@ -1,29 +0,0 @@ ---- Makefile.orig 2017-09-06 10:17:13.000000000 -0600 -+++ Makefile 2018-01-11 10:23:07.741490000 -0700 -@@ -39,7 +39,7 @@ - LDFLAGS += $(shell pkg-config --libs libpci) - - ifeq ($(CC),"") --CC = gcc -+CC ?= gcc - endif - - ifdef STATIC_LIBPCI -@@ -52,7 +52,7 @@ - - V = @ - Q = $(V:1=) --QUIET_CC = $(Q:@=@echo ' CC '$@;) -+#QUIET_CC = $(Q:@=@echo ' CC '$@;) - - all: x86info - -@@ -69,7 +69,7 @@ - - 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) diff --git a/sysutils/x86info/files/patch-lsmsr_Makefile b/sysutils/x86info/files/patch-lsmsr_Makefile deleted file mode 100644 index 85f95c391314..000000000000 --- a/sysutils/x86info/files/patch-lsmsr_Makefile +++ /dev/null @@ -1,15 +0,0 @@ ---- 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 diff --git a/sysutils/x86info/files/patch-lsmsr_lsmsr.c b/sysutils/x86info/files/patch-lsmsr_lsmsr.c deleted file mode 100644 index 929e3feadfc1..000000000000 --- a/sysutils/x86info/files/patch-lsmsr_lsmsr.c +++ /dev/null @@ -1,100 +0,0 @@ ---- 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; |