- int cpusubtype = cpu_subtype();
-
- switch (cpusubtype) {
- case CPU_SUBTYPE_386:
- switch (execsubtype) {
- case CPU_SUBTYPE_386:
- return 1;
- default:
- return 0;
- }
-
- case CPU_SUBTYPE_486:
- switch (execsubtype) {
- case CPU_SUBTYPE_386:
- return 1;
-
- case CPU_SUBTYPE_486SX:
- return 2;
-
- case CPU_SUBTYPE_486:
- return 3;
-
- default:
- return 0;
- }
-
- case CPU_SUBTYPE_486SX:
- switch (execsubtype) {
- case CPU_SUBTYPE_386:
- return 1;
-
- case CPU_SUBTYPE_486:
- return 2;
-
- case CPU_SUBTYPE_486SX:
- return 3;
-
- default:
- return 0;
- }
-
- case CPU_SUBTYPE_586:
- switch (execsubtype) {
- case CPU_SUBTYPE_386:
- return 1;
-
- case CPU_SUBTYPE_486SX:
- return 2;
-
- case CPU_SUBTYPE_486:
- return 3;
-
- case CPU_SUBTYPE_586:
- return 4;
-
- default:
- return 0;
- }
-
- default:
- if ( CPU_SUBTYPE_INTEL_MODEL(execsubtype) ==
- CPU_SUBTYPE_INTEL_MODEL_ALL) {
- if ( CPU_SUBTYPE_INTEL_FAMILY(cpusubtype) >=
- CPU_SUBTYPE_INTEL_FAMILY(execsubtype))
- return CPU_SUBTYPE_INTEL_FAMILY_MAX -
- CPU_SUBTYPE_INTEL_FAMILY(cpusubtype) -
- CPU_SUBTYPE_INTEL_FAMILY(execsubtype);
+ cpu_subtype_t hostsubtype = cpu_subtype();
+
+ switch(exectype) {
+ case CPU_TYPE_X86_64: /* native 64-bit */
+ switch(hostsubtype) {
+ case CPU_SUBTYPE_X86_64_H: /* x86_64h can execute anything */
+ switch (execsubtype) {
+ case CPU_SUBTYPE_X86_64_H:
+ return 3;
+ case CPU_SUBTYPE_X86_64_ALL:
+ return 2;
+ }
+ break;
+ case CPU_SUBTYPE_X86_ARCH1: /* generic systems can only execute ALL subtype */
+ switch (execsubtype) {
+ case CPU_SUBTYPE_X86_64_ALL:
+ return 2;
+ }
+ break;