2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
20 * @APPLE_LICENSE_HEADER_END@
23 * Copyright (C) 1990, NeXT, Inc.
25 * File: next/kern_machdep.c
26 * Author: John Seamons
28 * Machine-specific kernel routines.
31 #include <sys/types.h>
32 #include <mach/machine.h>
33 #include <kern/cpu_number.h>
35 extern int grade_binary(cpu_type_t exectype
, cpu_subtype_t execsubtype
);
37 /**********************************************************************
38 * Routine: grade_binary()
40 * Function: Return a relative preference for exectypes and
41 * execsubtypes in fat executable files. The higher the
42 * grade, the higher the preference. A grade of 0 means
44 **********************************************************************/
46 grade_binary(__unused cpu_type_t exectype
, cpu_subtype_t execsubtype
)
48 int cpusubtype
= cpu_subtype();
52 switch (execsubtype
) {
60 switch (execsubtype
) {
64 case CPU_SUBTYPE_486SX
:
74 case CPU_SUBTYPE_486SX
:
75 switch (execsubtype
) {
82 case CPU_SUBTYPE_486SX
:
90 switch (execsubtype
) {
94 case CPU_SUBTYPE_486SX
:
100 case CPU_SUBTYPE_586
:
108 if ( CPU_SUBTYPE_INTEL_MODEL(execsubtype
) ==
109 CPU_SUBTYPE_INTEL_MODEL_ALL
) {
110 if ( CPU_SUBTYPE_INTEL_FAMILY(cpusubtype
) >=
111 CPU_SUBTYPE_INTEL_FAMILY(execsubtype
))
112 return CPU_SUBTYPE_INTEL_FAMILY_MAX
-
113 CPU_SUBTYPE_INTEL_FAMILY(cpusubtype
) -
114 CPU_SUBTYPE_INTEL_FAMILY(execsubtype
);
117 if ( cpusubtype
== execsubtype
)
118 return CPU_SUBTYPE_INTEL_FAMILY_MAX
+ 1;
124 extern void md_prepare_for_shutdown(int, int, char *);
127 md_prepare_for_shutdown(
128 __unused
int paniced
,
130 __unused
char * command
)