Date: Sun, 26 Aug 2001 22:18:02 -0700 (PDT) From: Erik Greenwald <erik@smluc.org> To: freebsd-gnats-submit@FreeBSD.org Subject: ports/30116: New Port: x86info shows interesting info about the 80x86 processors on the machine Message-ID: <200108270518.f7R5I2T34059@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 30116 >Category: ports >Synopsis: New Port: x86info shows interesting info about the 80x86 processors on the machine >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sun Aug 26 22:20:00 PDT 2001 >Closed-Date: >Last-Modified: >Originator: Erik Greenwald >Release: 4.4-RC (cvs aug 18 2001) >Organization: >Environment: FreeBSD fenris.br0kenland.org 4.4-RC FreeBSD 4.4-RC #19: Sat Aug 18 21:06:10 CDT 2001 erik@fenris.br0kenland.org:/usr/src/sys/compile/FENRIS i386 >Description: The x86info utility displays information about each of the systems 80x86 processors. Cache info, flags, registers, msr's, and processor name/family/model are all displayed. x86info is released under the GPL and available at http://sourceforge.net/projects/x86info/ >How-To-Repeat: >Fix: # This is a shell archive. Save it in a file, remove anything before # this line, and then unpack it by entering "sh file". Note, it may # create directories; files and directories will be owned by you and # have default permissions. # # This archive contains: # # x86info # x86info/Makefile # x86info/files # x86info/files/patch-aa # x86info/distinfo # x86info/pkg-plist # x86info/pkg-comment # x86info/pkg-descr # echo c - x86info mkdir -p x86info > /dev/null 2>&1 echo x - x86info/Makefile sed 's/^X//' >x86info/Makefile << 'END-of-x86info/Makefile' X# Ports collection makefile for: x86info X# Date created: 26 Aug 2001 X# Whom: Erik Greenwald <erik@smluc.org> X# X# $FreeBSD$ X# X XPORTNAME= x86info XPORTVERSION= 1.4 XCATEGORIES= sysutils XMASTER_SITES= ${MASTER_SITE_SOURCEFORGE} XMASTER_SITE_SUBDIR=x86info XEXTRACT_SUFX= .tgz X XMAINTAINER= erik@smluc.org X Xdo-install: X ${INSTALL} ${COPY} ${STRIP} -o ${BINOWN} -g ${BINGRP} -m 755 ${WRKSRC}/x86info ${PREFIX}/bin X X.include <bsd.port.mk> END-of-x86info/Makefile echo c - x86info/files mkdir -p x86info/files > /dev/null 2>&1 echo x - x86info/files/patch-aa sed 's/^X//' >x86info/files/patch-aa << 'END-of-x86info/files/patch-aa' X--- Makefile.orig Thu Jul 26 14:40:46 2001 X+++ Makefile Sun Aug 26 23:11:15 2001 X@@ -23,5 +23,9 @@ X x86info: $(OBJS) X gcc -o x86info $(OBJS) X X+.c.o: X+ gcc $(CFLAGS) -o $@ -c $< X+ X+ X clean: X rm -f *.o x86info Xdiff -urNb x86info.c x86info.c X--- x86info.c.orig Thu Jul 26 14:40:46 2001 X+++ x86info.c Sun Aug 26 23:12:02 2001 X@@ -11,6 +11,10 @@ X #include <string.h> X #include <stdlib.h> X #include <unistd.h> X+#ifndef linux X+#include <sys/types.h> X+#include <sys/sysctl.h> X+#endif X #include "x86info.h" X X int show_msr=0; X@@ -89,7 +93,21 @@ X return(0); X } X X+#if defined _SC_NPROCESSORS /* linux */ X nrCPUs = sysconf (_SC_NPROCESSORS_CONF); X+#elif defined HW_NCPU /* bsd */ X+ { X+ int mib[2] = { CTL_HW, HW_NCPU }; X+ size_t len; X+ X+ len = sizeof(nrCPUs); X+ sysctl(mib, 2, &nrCPUs, &len, NULL, 0); X+ } X+#else X+ /* unknown interface to count cpu's */ X+ nrCPUs=1; X+#endif X+ X printf ("Found %d CPU", nrCPUs); X if (nrCPUs > 1) X printf ("s"); Xdiff -urNb x86info.h x86info.h X--- x86info.h.orig Thu Jul 26 14:40:46 2001 X+++ x86info.h Sun Aug 26 23:12:33 2001 X@@ -3,7 +3,12 @@ X * May be used under the terms of the GNU Public License (GPL) X */ X X+#ifdef linux X #include <linux/types.h> X+#else X+#include <machine/types.h> X+#define __u32 int X+#endif X X typedef __u32 u32; X END-of-x86info/files/patch-aa echo x - x86info/distinfo sed 's/^X//' >x86info/distinfo << 'END-of-x86info/distinfo' XMD5 (x86info-1.4.tgz) = 9921a0932a1f0eda4587a1046ca92217 END-of-x86info/distinfo echo x - x86info/pkg-plist sed 's/^X//' >x86info/pkg-plist << 'END-of-x86info/pkg-plist' Xbin/x86info END-of-x86info/pkg-plist echo x - x86info/pkg-comment sed 's/^X//' >x86info/pkg-comment << 'END-of-x86info/pkg-comment' XUtility to display information about the systems x86 processor(s) END-of-x86info/pkg-comment echo x - x86info/pkg-descr sed 's/^X//' >x86info/pkg-descr << 'END-of-x86info/pkg-descr' XThe x86info utility displays information about each of the systems 80x86 Xprocessors. Cache info, flags, registers, msr's, and processor Xname/family/model are all displayed. END-of-x86info/pkg-descr exit >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200108270518.f7R5I2T34059>