From owner-svn-ports-all@FreeBSD.ORG Tue Dec 9 22:07:16 2014 Return-Path: Delivered-To: svn-ports-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2095C75C; Tue, 9 Dec 2014 22:07:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 017E4CA9; Tue, 9 Dec 2014 22:07:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB9M7FNY028894; Tue, 9 Dec 2014 22:07:15 GMT (envelope-from makc@FreeBSD.org) Received: (from makc@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB9M7Et5028882; Tue, 9 Dec 2014 22:07:14 GMT (envelope-from makc@FreeBSD.org) Message-Id: <201412092207.sB9M7Et5028882@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: makc set sender to makc@FreeBSD.org using -f From: Max Brazhnikov Date: Tue, 9 Dec 2014 22:07:14 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r374435 - in head/sysutils: . cpuid cpuid/files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Dec 2014 22:07:16 -0000 Author: makc Date: Tue Dec 9 22:07:14 2014 New Revision: 374435 URL: https://svnweb.freebsd.org/changeset/ports/374435 QAT: https://qat.redports.org/buildarchive/r374435/ Log: Add new port sysutils/cpuid: tool to dump x86 CPUID information. WWW: http://www.etallen.com/cpuid.html The package and the binary have been renamed to cpuid-etallen in order to avoid conflict with misc/cpuid. PR: 194826 Submitted by: Uffe Jakobsen Added: head/sysutils/cpuid/ head/sysutils/cpuid/Makefile (contents, props changed) head/sysutils/cpuid/distinfo (contents, props changed) head/sysutils/cpuid/files/ head/sysutils/cpuid/files/patch-cpuid.c (contents, props changed) head/sysutils/cpuid/pkg-descr (contents, props changed) Modified: head/sysutils/Makefile Modified: head/sysutils/Makefile ============================================================================== --- head/sysutils/Makefile Tue Dec 9 22:06:20 2014 (r374434) +++ head/sysutils/Makefile Tue Dec 9 22:07:14 2014 (r374435) @@ -149,6 +149,7 @@ SUBDIR += cpdup SUBDIR += cpu SUBDIR += cpuburn + SUBDIR += cpuid SUBDIR += cpulimit SUBDIR += cramfs SUBDIR += crashme Added: head/sysutils/cpuid/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/cpuid/Makefile Tue Dec 9 22:07:14 2014 (r374435) @@ -0,0 +1,34 @@ +# Created by: uffe@uffe.org +# $FreeBSD$ + +PORTNAME= cpuid +PORTVERSION= 20140123 +CATEGORIES= sysutils +MASTER_SITES= http://www.etallen.com/cpuid/ +PKGNAMESUFFIX= ${CPUID_SUFFIX} +DISTNAME= ${PORTNAME}-${PORTVERSION}.src + +MAINTAINER= uffe@uffe.org +COMMENT= Tool to dump x86 CPUID information about the CPU(s) + +LICENSE= GPLv2 +LICENSE_FILE= ${WRKSRC}/LICENSE + +USES= gmake +ALL_TARGET= default +WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION} + +# Renamed to avoid conflict with misc/cpuid +CPUID_SUFFIX= -etallen + +PLIST_FILES= bin/cpuid${CPUID_SUFFIX} \ + man/man1/cpuid${CPUID_SUFFIX}.1.gz + +post-patch: + ${REINPLACE_CMD} 's,CFL=.*,& -pthread,' ${WRKSRC}/Makefile + +do-install: + ${INSTALL_PROGRAM} ${WRKSRC}/cpuid ${STAGEDIR}${PREFIX}/bin/cpuid${CPUID_SUFFIX} + ${INSTALL_MAN} ${WRKSRC}/cpuid.man.gz ${STAGEDIR}${PREFIX}/man/man1/cpuid${CPUID_SUFFIX}.1.gz + +.include Added: head/sysutils/cpuid/distinfo ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/cpuid/distinfo Tue Dec 9 22:07:14 2014 (r374435) @@ -0,0 +1,2 @@ +SHA256 (cpuid-20140123.src.tar.gz) = b85aba5696d382f0dba8dc246bd42d09767089d6181a9cd0633d626f079d79ff +SIZE (cpuid-20140123.src.tar.gz) = 67882 Added: head/sysutils/cpuid/files/patch-cpuid.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/cpuid/files/patch-cpuid.c Tue Dec 9 22:07:14 2014 (r374435) @@ -0,0 +1,75 @@ +--- cpuid.c.orig 2014-01-24 01:26:27 UTC ++++ cpuid.c +@@ -17,6 +17,8 @@ + ** 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + ++#define CPUID_MAJOR 0 ++ + #define _GNU_SOURCE + #include + #include +@@ -26,11 +28,14 @@ + #include + #include + #include +-#include ++//#include + #include + #include + #include + ++#include ++#include ++ + typedef int boolean; + #define TRUE 1 + #define FALSE 0 +@@ -5877,7 +5882,8 @@ real_setup(unsigned int cpu, + = (1 << cpu % (sizeof(unsigned int)*8)); + + int status; +- status = syscall(__NR_sched_setaffinity, 0, sizeof(mask), &mask); ++ //status = syscall(__NR_sched_setaffinity, 0, sizeof(mask), &mask); ++ status = pthread_setaffinity_np(0, sizeof(mask), &mask); + if (status == -1) { + if (cpu > 0) { + if (errno == EINVAL) return -1; +@@ -5987,11 +5993,14 @@ static int real_get (int cpuid + : "a" (reg), + "c" (ecx)); + } else { +- off64_t result; +- off64_t offset = ((off64_t)ecx << 32) + reg; ++ //off64_t result; ++ //off64_t offset = ((uint64_t)ecx << 32) + reg; ++ uint64_t result; ++ uint64_t offset = ((uint64_t)ecx << 32) + reg; + int status; + +- result = lseek64(cpuid_fd, offset, SEEK_SET); ++ //result = lseek64(cpuid_fd, offset, SEEK_SET); ++ result = lseek(cpuid_fd, offset, SEEK_SET); + if (result == -1) { + if (quiet) { + return FALSE; +@@ -6432,7 +6441,8 @@ main(int argc, + }; + + boolean opt_one_cpu = FALSE; +- boolean opt_inst = FALSE; ++ //boolean opt_inst = FALSE; ++ boolean opt_inst = TRUE; + boolean opt_kernel = FALSE; + boolean opt_raw = FALSE; + boolean opt_debug = FALSE; +@@ -6508,7 +6518,8 @@ main(int argc, + } + + // Default to -i. So use inst unless -k is specified. +- boolean inst = !opt_kernel; ++ //boolean inst = !opt_kernel; ++ boolean inst = TRUE; + + if (opt_version) { + printf("cpuid version %s\n", XSTR(VERSION)); Added: head/sysutils/cpuid/pkg-descr ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/cpuid/pkg-descr Tue Dec 9 22:07:14 2014 (r374435) @@ -0,0 +1,6 @@ +Cpuid dumps detailed information about the CPU(s) gathered from the +CPUID instruction, and also determines the exact model of CPU(s). +It supports Intel, AMD, and VIA CPUs, as well as older Transmeta, +Cyrix, UMC, NexGen, Rise, and SiS CPUs. + +WWW: http://www.etallen.com/cpuid.html