]> git.saurik.com Git - apple/xnu.git/blobdiff - osfmk/kern/mach_clock.c
xnu-344.49.tar.gz
[apple/xnu.git] / osfmk / kern / mach_clock.c
index 09cba548c7807d3cfed989ff98fad287b6373350..c0b234c63cf281df69b767ae1245ef3b627cf0aa 100644 (file)
@@ -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@
  */
@@ -133,7 +136,6 @@ hertz_tick(
        pc++;
 #endif /* lint */
 
-       mp_disable_preemption();
        my_cpu = cpu_number();
 
        /*
@@ -142,10 +144,8 @@ hertz_tick(
         *      especially when debugging, to wind up here with
         *      no thread to bill against.  So ignore the tick.
         */
-       if (thread == THREAD_NULL) {
-               mp_enable_preemption();
+       if (thread == THREAD_NULL)
                return;
-       }
 
 #if            MACH_PROF
        inkernel = !usermode && (pc < (unsigned int)ETEXT);
@@ -164,11 +164,9 @@ hertz_tick(
 
        if (usermode) {
                TICKBUMP(&thread->user_timer);
-#if 0
                if (thread->priority < BASEPRI_DEFAULT)
                        state = CPU_STATE_NICE;
                else
-#endif
                        state = CPU_STATE_USER;
 #if GPROF
                        if (pv->active)
@@ -211,7 +209,6 @@ hertz_tick(
        }
 
        machine_slot[my_cpu].cpu_ticks[state]++;
-       thread_quantum_update(my_cpu, thread, 1, state);
 
        /*
         * Hertz processing performed by the master-cpu
@@ -260,5 +257,4 @@ hertz_tick(
                        profile(pc, kernel_task->profil_buffer);
        }
 #endif /* MACH_PROF */
-       mp_enable_preemption();
 }