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>
34 #include <machine/exec.h>
35 #include <machine/machine_routines.h>
37 /**********************************************************************
38 * Routine: grade_binary()
40 * Function: Keep the API the same between PPC and X86; always say
41 * any CPU subtype is OK with us, but only OK CPU types
42 * for which we are actually capable of executing the
43 * binary, either directly or via an imputed interpreter.
44 **********************************************************************/
46 grade_binary(cpu_type_t exectype
, cpu_subtype_t execsubtype
)
49 case CPU_TYPE_X86
: /* native */
50 case CPU_TYPE_POWERPC
: /* via translator */
52 case CPU_TYPE_X86_64
: /* native 64-bit */
53 return (ml_is64bit() && execsubtype
== CPU_SUBTYPE_X86_64_ALL
) ? 2 : 0;
54 default: /* all other binary types */
59 extern void md_prepare_for_shutdown(int, int, char *);
62 md_prepare_for_shutdown(
65 __unused
char * command
)