X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/5d5c5d0d5b79ade9a973d55186ffda2638ba2b6e..21362eb3e66fd2c787aee132bce100a44d71a99c:/osfmk/ppc/cpu.c diff --git a/osfmk/ppc/cpu.c b/osfmk/ppc/cpu.c index 234cd8e02..5ad083250 100644 --- a/osfmk/ppc/cpu.c +++ b/osfmk/ppc/cpu.c @@ -1,31 +1,29 @@ /* * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved. * - * @APPLE_LICENSE_OSREFERENCE_HEADER_START@ + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * - * 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. The rights granted to you under the - * License may not be used to create, or enable the creation or - * redistribution of, unlawful or unlicensed copies of an Apple operating - * system, or to circumvent, violate, or enable the circumvention or - * violation of, any terms of an Apple operating system software license - * agreement. - * - * 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, QUIET ENJOYMENT OR NON-INFRINGEMENT. - * Please see the License for the specific language governing rights and + * 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. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * 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, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and * limitations under the License. - * - * @APPLE_LICENSE_OSREFERENCE_HEADER_END@ + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ #include @@ -39,7 +37,6 @@ #include #include #include -#include #include #include @@ -57,6 +54,7 @@ #include #include #include +#include #include decl_mutex_data(static,ppt_lock); @@ -73,9 +71,9 @@ static unsigned int rht_state = 0; decl_simple_lock_data(static,SignalReadyLock); struct SIGtimebase { - volatile boolean_t avail; - volatile boolean_t ready; - volatile boolean_t done; + boolean_t avail; + boolean_t ready; + boolean_t done; uint64_t abstime; }; @@ -128,9 +126,8 @@ cpu_init( mttbu(proc_info->save_tbu); mttb(proc_info->save_tbl); } - - proc_info->rtcPop = EndOfAllTime; /* forget any existing decrementer setting */ - etimer_resync_deadlines(); /* Now that the time base is sort of correct, request the next timer pop */ + + setTimerReq(); /* Now that the time base is sort of correct, request the next timer pop */ proc_info->cpu_type = CPU_TYPE_POWERPC; proc_info->cpu_subtype = (cpu_subtype_t)proc_info->pf.rptdProc; @@ -714,7 +711,7 @@ cpu_sync_timebase( (unsigned int)&syncClkSpot) != KERN_SUCCESS) continue; - while (syncClkSpot.avail == FALSE) + while (*(volatile int *)&(syncClkSpot.avail) == FALSE) continue; isync(); @@ -732,10 +729,11 @@ cpu_sync_timebase( syncClkSpot.ready = TRUE; - while (syncClkSpot.done == FALSE) + while (*(volatile int *)&(syncClkSpot.done) == FALSE) continue; - etimer_resync_deadlines(); /* Start the timer */ + setTimerReq(); /* Start the timer */ + (void)ml_set_interrupts_enabled(intr); } @@ -768,8 +766,7 @@ cpu_timebase_signal_handler( timebaseAddr->avail = TRUE; - while (timebaseAddr->ready == FALSE) - continue; + while (*(volatile int *)&(timebaseAddr->ready) == FALSE); if(proc_info->time_base_enable != (void(*)(cpu_id_t, boolean_t ))NULL) proc_info->time_base_enable(proc_info->cpu_id, TRUE);