]> git.saurik.com Git - apple/xnu.git/blobdiff - osfmk/kern/sched_prim.h
xnu-1228.3.13.tar.gz
[apple/xnu.git] / osfmk / kern / sched_prim.h
index faccfe48b847123b9a7cf4554f402970250eb222..6cdde8933d496ff1806769811b5bfc1a726c4ecb 100644 (file)
@@ -1,31 +1,29 @@
 /*
- * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000-2006 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@
  */
 /*
  * @OSF_COPYRIGHT@
@@ -79,7 +77,7 @@
 #ifdef MACH_KERNEL_PRIVATE
 
 /* Initialization */
-extern void            sched_init(void);
+extern void            sched_init(void) __attribute__((section("__TEXT, initcode")));
 
 extern void            sched_startup(void);
 
@@ -97,10 +95,6 @@ extern void                  thread_unstop(
 extern void                    thread_wait(
                                                thread_t        thread);
 
-/* Select a thread to run */
-extern thread_t                thread_select(
-                                               processor_t             myprocessor);
-
 /* Unblock thread on wake up */
 extern boolean_t       thread_unblock(
                                                thread_t                thread,
@@ -111,26 +105,10 @@ extern kern_return_t      thread_go(
                                                        thread_t                thread,
                                                        wait_result_t   wresult);
 
-/* Context switch primitive */
-extern boolean_t       thread_invoke(
-                                               thread_t                        old_thread,
-                                               thread_t                        new_thread,
-                                               ast_t                           reason);
-
-/* Perform calculations for thread finishing execution */
-extern void                    thread_done(
-                                               thread_t                old_thread,
-                                               thread_t                new_thread,
-                                               processor_t             processor);
-
-/* Set up for thread beginning execution */
-extern void                    thread_begin(
-                                               thread_t                thread,
-                                               processor_t             processor);
-
-/* Handle previous thread at context switch */
+/* Handle threads at context switch */
 extern void                    thread_dispatch(
-                                               thread_t                thread);
+                                               thread_t                old_thread,
+                                               thread_t                new_thread);
 
 /* Switch directly to a particular thread */
 extern int                     thread_run(
@@ -199,15 +177,17 @@ extern void               thread_setrun(
                                        thread_t        thread,
                                        integer_t       options);
 
-#define SCHED_TAILQ            0
-#define SCHED_HEADQ            1
-#define SCHED_PREEMPT  2
+#define SCHED_TAILQ            1
+#define SCHED_HEADQ            2
+#define SCHED_PREEMPT  4
 
-/* Bind thread to a particular processor */
+/* Bind the current thread to a particular processor */
 extern processor_t             thread_bind(
-                                                       thread_t                thread,
                                                        processor_t             processor);
 
+extern void            run_queue_init(
+                                       run_queue_t             runq);
+
 extern void            thread_timer_expire(
                                        void                    *thread,
                                        void                    *p1);
@@ -243,7 +223,7 @@ extern kern_return_t clear_wait(
                                                wait_result_t   result);
 
 /* Return from exception (BSD-visible interface) */
-extern void            thread_exception_return(void);
+extern void            thread_exception_return(void) __dead2;
 
 #endif /* XNU_KERNEL_PRIVATE */