]> git.saurik.com Git - apple/xnu.git/blob - bsd/dev/i386/kern_machdep.c
6ff80a540ca08d6183f7f49f85374b664a3c7c05
[apple/xnu.git] / bsd / dev / i386 / kern_machdep.c
1 /*
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
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.
11 *
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
18 * under the License.
19 *
20 * @APPLE_LICENSE_HEADER_END@
21 */
22 /*
23 * Copyright (C) 1990, NeXT, Inc.
24 *
25 * File: next/kern_machdep.c
26 * Author: John Seamons
27 *
28 * Machine-specific kernel routines.
29 */
30
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>
36
37 /**********************************************************************
38 * Routine: grade_binary()
39 *
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 **********************************************************************/
45 int
46 grade_binary(cpu_type_t exectype, cpu_subtype_t execsubtype)
47 {
48 switch(exectype) {
49 case CPU_TYPE_X86: /* native */
50 case CPU_TYPE_POWERPC: /* via translator */
51 return 1;
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 */
55 return 0;
56 }
57 }
58
59 extern void md_prepare_for_shutdown(int, int, char *);
60
61 void
62 md_prepare_for_shutdown(
63 __unused int paniced,
64 __unused int howto,
65 __unused char * command)
66 {
67 }