]>
git.saurik.com Git - apple/system_cmds.git/blob - KDBG/Kernel.cpp
5 // Created by James McIlree on 4/17/13.
6 // Copyright (c) 2014 Apple. All rights reserved.
13 bool Kernel::is_64_bit()
19 /* Now determine if the kernel is running in 64-bit mode */
22 mib
[2] = KERN_PROC_PID
;
23 mib
[3] = 0; /* kernproc, pid 0 */
25 if (sysctl(mib
, sizeof(mib
)/sizeof(mib
[0]), &kp
, &len
, NULL
, 0) == -1) {
26 THROW("sysctl to get kernel size failed");
29 if (kp
.kp_proc
.p_flag
& P_LP64
)
35 uint32_t Kernel::active_cpu_count()
42 * grab the number of cpus and scale the buffer size
47 len
= sizeof(num_cpus
);
49 sysctl(mib
, 2, &num_cpus
, &len
, NULL
, 0);