X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/1c79356b52d46aa6b508fb032f5ae709b1f2897b..4a2492630c73add3c3aa8a805ba4ff343d4a58ea:/bsd/dev/ppc/kern_machdep.c?ds=inline diff --git a/bsd/dev/ppc/kern_machdep.c b/bsd/dev/ppc/kern_machdep.c index 38a00cc3c..d4422a1b9 100644 --- a/bsd/dev/ppc/kern_machdep.c +++ b/bsd/dev/ppc/kern_machdep.c @@ -3,19 +3,22 @@ * * @APPLE_LICENSE_HEADER_START@ * - * The contents of this file constitute Original Code as defined in and - * are subject to the Apple Public Source License Version 1.1 (the - * "License"). You may not use this file except in compliance with the - * License. Please obtain a copy of the License at - * http://www.apple.com/publicsource and read it before using this file. + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. * - * This Original Code and all software distributed under the License are - * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the - * License for the specific language governing rights and limitations - * under the License. + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. * * @APPLE_LICENSE_HEADER_END@ */ @@ -52,18 +55,14 @@ check_cpu_subtype(cpu_subtype_t cpu_subtype) if (cpu_subtype == ms->cpu_subtype) return (TRUE); - if (cpu_subtype == CPU_SUBTYPE_POWERPC_601) - return (FALSE); - switch (cpu_subtype) { + case CPU_SUBTYPE_POWERPC_970: + /* Do not allow a 970 binary to run on non-970 systems */ + if (ms->cpu_subtype != CPU_SUBTYPE_POWERPC_970) + break; case CPU_SUBTYPE_POWERPC_7450: case CPU_SUBTYPE_POWERPC_7400: case CPU_SUBTYPE_POWERPC_750: - case CPU_SUBTYPE_POWERPC_604e: - case CPU_SUBTYPE_POWERPC_604: - case CPU_SUBTYPE_POWERPC_603ev: - case CPU_SUBTYPE_POWERPC_603e: - case CPU_SUBTYPE_POWERPC_603: case CPU_SUBTYPE_POWERPC_ALL: return (TRUE); } @@ -90,43 +89,35 @@ grade_cpu_subtype(cpu_subtype_t cpu_subtype) * cctools project. As of 2/16/98 this is what has been agreed upon for * the PowerPC subtypes. If an exact match is not found the subtype will * be picked from the following order: - * 7400, 750, 604e, 604, 603ev, 603e, 603, ALL + * 970(but only on 970), 7450, 7400, 750, ALL * Note the 601 is NOT in the list above. It is only picked via an exact * match. For details see Radar 2213821. * * To implement this function to follow what was agreed upon above, we use - * the fact there are currently 10 different subtypes. Exact matches return - * the value 10, the value 0 is returned for 601 that is not an exact match, - * and the values 9 thru 1 are returned for the subtypes listed in the order - * above. + * the fact there are currently 4 different subtypes. Exact matches return + * the value 6, and the values 5 thru 1 are returned for the + * subtypes listed in the order above. */ if (ms->cpu_subtype == cpu_subtype) - return 10; - if (cpu_subtype == CPU_SUBTYPE_POWERPC_601) - return 0; + return 6; switch (cpu_subtype) { - case CPU_SUBTYPE_POWERPC_7450: - return 9; - case CPU_SUBTYPE_POWERPC_7400: - return 8; - case CPU_SUBTYPE_POWERPC_750: - return 7; - case CPU_SUBTYPE_POWERPC_604e: - return 6; - case CPU_SUBTYPE_POWERPC_604: + case CPU_SUBTYPE_POWERPC_970: + /* Do not allow a 970 binary to run on non-970 systems */ + if (ms->cpu_subtype != CPU_SUBTYPE_POWERPC_970) + break; return 5; - case CPU_SUBTYPE_POWERPC_603ev: + case CPU_SUBTYPE_POWERPC_7450: return 4; - case CPU_SUBTYPE_POWERPC_603e: + case CPU_SUBTYPE_POWERPC_7400: return 3; - case CPU_SUBTYPE_POWERPC_603: + case CPU_SUBTYPE_POWERPC_750: return 2; case CPU_SUBTYPE_POWERPC_ALL: return 1; } /* - * If we get here it is because it is a cpusubtype we don't support (602 and - * 620) or new cpusubtype that was added since this code was written. Both + * If we get here it is because it is a cpusubtype we don't support + * or a new cpusubtype that was added since this code was written. Both * will be considered unacceptable. */ return 0; @@ -141,7 +132,7 @@ kernacc( off_t base; off_t end; - base = trunc_page(start); + base = trunc_page_64(start); end = start + len; while (base < end) {