From owner-freebsd-questions@FreeBSD.ORG Sat Jan 21 18:10:42 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6148316A41F for ; Sat, 21 Jan 2006 18:10:42 +0000 (GMT) (envelope-from nb_root@videotron.ca) Received: from relais.videotron.ca (relais.videotron.ca [24.201.245.36]) by mx1.FreeBSD.org (Postfix) with ESMTP id 03E7443D53 for ; Sat, 21 Jan 2006 18:10:38 +0000 (GMT) (envelope-from nb_root@videotron.ca) Received: from clk01a ([66.130.198.54]) by VL-MH-MR001.ip.videotron.ca (Sun Java System Messaging Server 6.2-2.05 (built Apr 28 2005)) with ESMTP id <0ITG004T1FTQ6I40@VL-MH-MR001.ip.videotron.ca> for freebsd-questions@freebsd.org; Sat, 21 Jan 2006 13:10:38 -0500 (EST) Date: Sat, 21 Jan 2006 13:10:38 -0500 From: Nicolas Blais To: freebsd-questions@freebsd.org Message-id: <200601211310.38269.nb_root@videotron.ca> MIME-version: 1.0 Content-type: multipart/signed; boundary=nextPart126455167.fDGb05XMVB; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-transfer-encoding: 7bit User-Agent: KMail/1.9.1 Subject: C/C++ call to detect cpu? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2006 18:10:42 -0000 --nextPart126455167.fDGb05XMVB Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Other than 'grep'ing dmesg, is there a way to know the current cpu such as = a=20 struct with the machine's cpu and cpu feature (kinda like a time_t struct)? Portability is not really an issue (though I would be nice if it could run = on=20 BSD/linux systems). =46or example, on one of my systems (from dmesg): CPU: AMD Athlon(tm) 64 Processor 3000+ (2493.04-MHz 686-class CPU) Origin =3D "AuthenticAMD" Id =3D 0x20ff0 Stepping =3D 0 =20 =46eatures=3D0x78bfbff Features2=3D0x1 AMD Features=3D0xe2500800 AMD Features2=3D0x1 I would need AMD Athlon(tm) 64 Processor 3000+ (2493.04-MHz 686-class CPU) = or=20 similar. Thanks, Nicolas. =2D-=20 =46reeBSD 7.0-CURRENT #0: Sat Jan 21 11:33:22 EST 2006 =20 root@clk01a:/usr/obj/usr/src/sys/CLK01A=20 PGP? (updated 16 Nov 05) : http://www.clkroot.net/security/nb_root.asc --nextPart126455167.fDGb05XMVB Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (FreeBSD) iD8DBQBD0nke4wTBlvcsbJURAgeSAKChhGSc5d/5iCeq0DoYNrYToLQu1QCgi25X v915kyYKzrNcltLI9c4ctWM= =FZK6 -----END PGP SIGNATURE----- --nextPart126455167.fDGb05XMVB--