#ifndef _MACH_MACHINE_H_
#define _MACH_MACHINE_H_
#import <mach/machine/vm_types.h>
#import <mach/boolean.h>
struct machine_info {
int major_version;
int minor_version;
int max_cpus;
int avail_cpus;
vm_size_t memory_size;
};
typedef struct machine_info *machine_info_t;
typedef struct machine_info machine_info_data_t;
typedef int cpu_type_t;
typedef int cpu_subtype_t;
typedef integer_t cpu_threadtype_t;
#define CPU_STATE_MAX 3
#define CPU_STATE_USER 0
#define CPU_STATE_SYSTEM 1
#define CPU_STATE_IDLE 2
struct machine_slot {
boolean_t is_cpu;
cpu_type_t cpu_type;
cpu_subtype_t cpu_subtype;
volatile boolean_t running;
long cpu_ticks[CPU_STATE_MAX];
int clock_freq;
};
typedef struct machine_slot *machine_slot_t;
typedef struct machine_slot machine_slot_data_t;
#ifdef KERNEL
extern struct machine_info machine_info;
extern struct machine_slot machine_slot[];
extern vm_offset_t interrupt_stack[];
#endif
#define CPU_TYPE_ANY ((cpu_type_t) -1)
#define CPU_TYPE_VAX ((cpu_type_t) 1)
#define CPU_TYPE_ROMP ((cpu_type_t) 2)
#define CPU_TYPE_NS32032 ((cpu_type_t) 4)
#define CPU_TYPE_NS32332 ((cpu_type_t) 5)
#define CPU_TYPE_MC680x0 ((cpu_type_t) 6)
#define CPU_TYPE_I386 ((cpu_type_t) 7)
#define CPU_TYPE_X86_64 ((cpu_type_t) (CPU_TYPE_I386 | CPU_ARCH_ABI64))
#define CPU_TYPE_MIPS ((cpu_type_t) 8)
#define CPU_TYPE_NS32532 ((cpu_type_t) 9)
#define CPU_TYPE_HPPA ((cpu_type_t) 11)
#define CPU_TYPE_ARM ((cpu_type_t) 12)
#define CPU_TYPE_MC88000 ((cpu_type_t) 13)
#define CPU_TYPE_SPARC ((cpu_type_t) 14)
#define CPU_TYPE_I860 ((cpu_type_t) 15) // big-endian
#define CPU_TYPE_I860_LITTLE ((cpu_type_t) 16) // little-endian
#define CPU_TYPE_RS6000 ((cpu_type_t) 17)
#define CPU_TYPE_MC98000 ((cpu_type_t) 18)
#define CPU_TYPE_POWERPC ((cpu_type_t) 18)
#define CPU_ARCH_ABI64 0x1000000
#define CPU_TYPE_POWERPC64 ((cpu_type_t)(CPU_TYPE_POWERPC | CPU_ARCH_ABI64))
#define CPU_TYPE_VEO ((cpu_type_t) 255)
#define CPU_TYPE_ARM64 ((cpu_type_t)(CPU_TYPE_ARM | CPU_ARCH_ABI64))
#define CPU_SUBTYPE_MASK 0xff000000
#define CPU_SUBTYPE_LIB64 0x80000000
#define CPU_SUBTYPE_MULTIPLE ((cpu_subtype_t) -1)
#define CPU_SUBTYPE_VAX_ALL ((cpu_subtype_t) 0)
#define CPU_SUBTYPE_VAX780 ((cpu_subtype_t) 1)
#define CPU_SUBTYPE_VAX785 ((cpu_subtype_t) 2)
#define CPU_SUBTYPE_VAX750 ((cpu_subtype_t) 3)
#define CPU_SUBTYPE_VAX730 ((cpu_subtype_t) 4)
#define CPU_SUBTYPE_UVAXI ((cpu_subtype_t) 5)
#define CPU_SUBTYPE_UVAXII ((cpu_subtype_t) 6)
#define CPU_SUBTYPE_VAX8200 ((cpu_subtype_t) 7)
#define CPU_SUBTYPE_VAX8500 ((cpu_subtype_t) 8)
#define CPU_SUBTYPE_VAX8600 ((cpu_subtype_t) 9)
#define CPU_SUBTYPE_VAX8650 ((cpu_subtype_t) 10)
#define CPU_SUBTYPE_VAX8800 ((cpu_subtype_t) 11)
#define CPU_SUBTYPE_UVAXIII ((cpu_subtype_t) 12)
#define CPU_SUBTYPE_RT_ALL ((cpu_subtype_t) 0)
#define CPU_SUBTYPE_RT_PC ((cpu_subtype_t) 1)
#define CPU_SUBTYPE_RT_APC ((cpu_subtype_t) 2)
#define CPU_SUBTYPE_RT_135 ((cpu_subtype_t) 3)
#define CPU_SUBTYPE_MMAX_ALL ((cpu_subtype_t) 0)
#define CPU_SUBTYPE_MMAX_DPC ((cpu_subtype_t) 1)
#define CPU_SUBTYPE_SQT ((cpu_subtype_t) 2)
#define CPU_SUBTYPE_MMAX_APC_FPU ((cpu_subtype_t) 3)
#define CPU_SUBTYPE_MMAX_APC_FPA ((cpu_subtype_t) 4)
#define CPU_SUBTYPE_MMAX_XPC ((cpu_subtype_t) 5)
#define CPU_SUBTYPE_I386_ALL ((cpu_subtype_t) 3)
#define CPU_SUBTYPE_X86_64_ALL CPU_SUBTYPE_I386_ALL
#define CPU_SUBTYPE_386 ((cpu_subtype_t) 3)
#define CPU_SUBTYPE_486 ((cpu_subtype_t) 4)
#define CPU_SUBTYPE_486SX ((cpu_subtype_t) 4 + 128)
#define CPU_SUBTYPE_586 ((cpu_subtype_t) 5)
#define CPU_SUBTYPE_INTEL(f, m) ((cpu_subtype_t) (f) + ((m) << 4))
#define CPU_SUBTYPE_PENT CPU_SUBTYPE_INTEL(5, 0)
#define CPU_SUBTYPE_PENTPRO CPU_SUBTYPE_INTEL(6, 1)
#define CPU_SUBTYPE_PENTII_M3 CPU_SUBTYPE_INTEL(6, 3)
#define CPU_SUBTYPE_PENTII_M5 CPU_SUBTYPE_INTEL(6, 5)
#define CPU_SUBTYPE_PENTIUM_4 CPU_SUBTYPE_INTEL(10, 0)
#define CPU_SUBTYPE_INTEL_FAMILY(x) ((x) & 15)
#define CPU_SUBTYPE_INTEL_FAMILY_MAX 15
#define CPU_SUBTYPE_INTEL_MODEL(x) ((x) >> 4)
#define CPU_SUBTYPE_INTEL_MODEL_ALL 0
#define CPU_SUBTYPE_X86_64_H ((cpu_subtype_t)8)
#define CPU_SUBTYPE_MIPS_ALL ((cpu_subtype_t) 0)
#define CPU_SUBTYPE_MIPS_R2300 ((cpu_subtype_t) 1)
#define CPU_SUBTYPE_MIPS_R2600 ((cpu_subtype_t) 2)
#define CPU_SUBTYPE_MIPS_R2800 ((cpu_subtype_t) 3)
#define CPU_SUBTYPE_MIPS_R2000a ((cpu_subtype_t) 4)
#define CPU_SUBTYPE_MC680x0_ALL ((cpu_subtype_t) 1)
#define CPU_SUBTYPE_MC68030 ((cpu_subtype_t) 1)
#define CPU_SUBTYPE_MC68040 ((cpu_subtype_t) 2)
#define CPU_SUBTYPE_MC68030_ONLY ((cpu_subtype_t) 3)
#define CPU_SUBTYPE_HPPA_ALL ((cpu_subtype_t) 0)
#define CPU_SUBTYPE_HPPA_7100 ((cpu_subtype_t) 0)
#define CPU_SUBTYPE_HPPA_7100LC ((cpu_subtype_t) 1)
#define CPU_SUBTYPE_ARM_ALL ((cpu_subtype_t) 0)
#define CPU_SUBTYPE_ARM_A500_ARCH ((cpu_subtype_t) 1)
#define CPU_SUBTYPE_ARM_A500 ((cpu_subtype_t) 2)
#define CPU_SUBTYPE_ARM_A440 ((cpu_subtype_t) 3)
#define CPU_SUBTYPE_ARM_M4 ((cpu_subtype_t) 4)
#define CPU_SUBTYPE_ARM_V4T ((cpu_subtype_t) 5)
#define CPU_SUBTYPE_ARM_V6 ((cpu_subtype_t) 6)
#define CPU_SUBTYPE_ARM_V5TEJ ((cpu_subtype_t) 7)
#define CPU_SUBTYPE_ARM_XSCALE ((cpu_subtype_t) 8)
#define CPU_SUBTYPE_ARM_V7 ((cpu_subtype_t) 9)
#define CPU_SUBTYPE_ARM_V7F ((cpu_subtype_t) 10)
#define CPU_SUBTYPE_ARM_V7S ((cpu_subtype_t) 11)
#define CPU_SUBTYPE_ARM_V7K ((cpu_subtype_t) 12)
#define CPU_SUBTYPE_ARM_V6M ((cpu_subtype_t) 14)
#define CPU_SUBTYPE_ARM_V7M ((cpu_subtype_t) 15)
#define CPU_SUBTYPE_ARM_V7EM ((cpu_subtype_t) 16)
#define CPU_SUBTYPE_ARM_V8 ((cpu_subtype_t) 13)
#define CPU_SUBTYPE_ARM64_ALL ((cpu_subtype_t) 0)
#define CPU_SUBTYPE_ARM64_V8 ((cpu_subtype_t) 1)
#define CPU_SUBTYPE_MC88000_ALL ((cpu_subtype_t) 0)
#define CPU_SUBTYPE_MMAX_JPC ((cpu_subtype_t) 1)
#define CPU_SUBTYPE_MC88100 ((cpu_subtype_t) 1)
#define CPU_SUBTYPE_MC88110 ((cpu_subtype_t) 2)
#define CPU_SUBTYPE_MC98000_ALL ((cpu_subtype_t) 0)
#define CPU_SUBTYPE_MC98601 ((cpu_subtype_t) 1)
#define CPU_SUBTYPE_I860_ALL ((cpu_subtype_t) 0)
#define CPU_SUBTYPE_I860_860 ((cpu_subtype_t) 1)
#define CPU_SUBTYPE_LITTLE_ENDIAN ((cpu_subtype_t) 0)
#define CPU_SUBTYPE_BIG_ENDIAN ((cpu_subtype_t) 1)
#define CPU_SUBTYPE_I860_LITTLE_ALL ((cpu_subtype_t) 0)
#define CPU_SUBTYPE_I860_LITTLE ((cpu_subtype_t) 1)
#define CPU_SUBTYPE_RS6000_ALL ((cpu_subtype_t) 0)
#define CPU_SUBTYPE_RS6000 ((cpu_subtype_t) 1)
#define CPU_SUBTYPE_SUN4_ALL ((cpu_subtype_t) 0)
#define CPU_SUBTYPE_SUN4_260 ((cpu_subtype_t) 1)
#define CPU_SUBTYPE_SUN4_110 ((cpu_subtype_t) 2)
#define CPU_SUBTYPE_SPARC_ALL ((cpu_subtype_t) 0)
#define CPU_SUBTYPE_POWERPC_ALL ((cpu_subtype_t) 0)
#define CPU_SUBTYPE_POWERPC_601 ((cpu_subtype_t) 1)
#define CPU_SUBTYPE_POWERPC_602 ((cpu_subtype_t) 2)
#define CPU_SUBTYPE_POWERPC_603 ((cpu_subtype_t) 3)
#define CPU_SUBTYPE_POWERPC_603e ((cpu_subtype_t) 4)
#define CPU_SUBTYPE_POWERPC_603ev ((cpu_subtype_t) 5)
#define CPU_SUBTYPE_POWERPC_604 ((cpu_subtype_t) 6)
#define CPU_SUBTYPE_POWERPC_604e ((cpu_subtype_t) 7)
#define CPU_SUBTYPE_POWERPC_620 ((cpu_subtype_t) 8)
#define CPU_SUBTYPE_POWERPC_750 ((cpu_subtype_t) 9)
#define CPU_SUBTYPE_POWERPC_7400 ((cpu_subtype_t) 10)
#define CPU_SUBTYPE_POWERPC_7450 ((cpu_subtype_t) 11)
#define CPU_SUBTYPE_POWERPC_970 ((cpu_subtype_t) 100)
#define CPU_SUBTYPE_VEO_1 ((cpu_subtype_t) 1)
#define CPU_SUBTYPE_VEO_2 ((cpu_subtype_t) 2)
#define CPU_SUBTYPE_VEO_3 ((cpu_subtype_t) 3)
#define CPU_SUBTYPE_VEO_4 ((cpu_subtype_t) 4)
#define CPU_SUBTYPE_VEO_ALL CPU_SUBTYPE_VEO_2
#endif