Re: determine if a CPU is Intel 64-bit
Re: determine if a CPU is Intel 64-bit
- Subject: Re: determine if a CPU is Intel 64-bit
- From: Scott Ribe <email@hidden>
- Date: Tue, 26 Mar 2013 10:45:04 -0600
On Mar 26, 2013, at 10:21 AM, Ronald Oussoren wrote:
> There's also hw.optional.x86_64 that's at least somewhat documented in the sys/sysctl.h header file.
How is it documented? I'm still on Xcode 3.2.6. (Thanks to supporting a few old machines that I want to locate and get rid of, sort of the point of this exercise...) And in my sys/sysctl.h, hw.optional.x86_64 is only mentioned in a comment labeled "XXX This information should be moved to the man page." and there is no info about constants to actually get this info by calling sysctl. In fact, the documented constants are a small subset of what the command line returns: no hw options, no cpu type or subtype. But there's machine architecture, with no documentation on what that means.
Do you have more in your, presumably newer, sysctl.h? (See below.)
> Both correctly indicated that a 10.5 system with a 32-bit kernel is capable of running 64-bit binaries, which hw.machine is i386 on that machine.
Thanks, that's very good to know--confirms that hw.machine == i386 does not mean what I thought it did. Also, user reports hw.optional.x86_64: 1, so that indeed seems to be what I need to check.
FYI, this is all I have for CTL_HW constants:
#define HW_MACHINE 1 /* string: machine class */
#define HW_MODEL 2 /* string: specific machine model */
#define HW_NCPU 3 /* int: number of cpus */
#define HW_BYTEORDER 4 /* int: machine byte order */
#define HW_PHYSMEM 5 /* int: total memory */
#define HW_USERMEM 6 /* int: non-kernel memory */
#define HW_PAGESIZE 7 /* int: software page size */
#define HW_DISKNAMES 8 /* strings: disk drive names */
#define HW_DISKSTATS 9 /* struct: diskstats[] */
#define HW_EPOCH 10 /* int: 0 for Legacy, else NewWorld */
#define HW_FLOATINGPT 11 /* int: has HW floating point? */
#define HW_MACHINE_ARCH 12 /* string: machine architecture */
#define HW_VECTORUNIT 13 /* int: has HW vector unit? */
#define HW_BUS_FREQ 14 /* int: Bus Frequency */
#define HW_CPU_FREQ 15 /* int: CPU Frequency */
#define HW_CACHELINE 16 /* int: Cache Line Size in Bytes */
#define HW_L1ICACHESIZE 17 /* int: L1 I Cache Size in Bytes */
#define HW_L1DCACHESIZE 18 /* int: L1 D Cache Size in Bytes */
#define HW_L2SETTINGS 19 /* int: L2 Cache Settings */
#define HW_L2CACHESIZE 20 /* int: L2 Cache Size in Bytes */
#define HW_L3SETTINGS 21 /* int: L3 Cache Settings */
#define HW_L3CACHESIZE 22 /* int: L3 Cache Size in Bytes */
#define HW_TB_FREQ 23 /* int: Bus Frequency */
#define HW_MEMSIZE 24 /* uint64_t: physical ram size */
#define HW_AVAILCPU 25 /* int: number of available CPUs */
#define HW_MAXID 26 /* number of valid hw ids */
--
Scott Ribe
email@hidden
http://www.elevated-dev.com/
(303) 722-0567 voice
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden