]>
git.saurik.com Git - apple/xnu.git/blob - bsd/kern/parallel.c
2d93edd970433b5056077cd19c82052292f6058d
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
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.
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
20 * @APPLE_LICENSE_HEADER_END@
23 * Mach Operating System
24 * Copyright (c) 1989 Carnegie-Mellon University
25 * Copyright (c) 1988 Carnegie-Mellon University
26 * Copyright (c) 1987 Carnegie-Mellon University
27 * All rights reserved. The CMU software License Agreement specifies
28 * the terms and conditions for use and redistribution.
33 * Revision 1.1.1.1 1998/09/22 21:06:13 wsanchez
34 * Import of Mac OS X kernel (~semeria)
36 * Revision 1.1.1.1 1997/09/30 02:44:39 wsanchez
37 * Import of kernel from umeshv/kernel
39 * Revision 2.4 89/12/22 15:52:48 rpd
40 * MACH_HOST support: when releasing master, context switch away
41 * immediately if thread is not assigned to default processor set.
44 * Revision 2.3 89/10/11 14:19:20 dlb
45 * Processor logic - explicitly record bound processor in thread
46 * instead of changing whichq pointer.
49 * Revision 2.2 89/02/25 18:07:24 gm0w
50 * Changes for cleanup.
52 * 15-Oct-87 David Golub (dbg) at Carnegie-Mellon University
53 * Use thread_bind (inline version) to bind thread to master cpu
54 * while holding unix-lock.
56 * 9-Oct-87 Robert Baron (rvb) at Carnegie-Mellon University
57 * Define unix_reset for longjmp/setjmp reset.
59 * 25-Sep-87 Robert Baron (rvb) at Carnegie-Mellon University
60 * Clean out some debugging code.
62 * 21-Sep-87 Robert Baron (rvb) at Carnegie-Mellon University
69 #include <mach_host.h>
73 #include <kern/processor.h>
74 #include <kern/thread.h>
75 #include <kern/sched_prim.h>
76 #include <kern/parallel.h>
80 register thread_t t
= current_thread();
82 if (! (++( t
->unix_lock
))) {
84 /* thread_bind(t, master_processor); */
85 t
->bound_processor
= master_processor
;
87 if (cpu_number() != master_cpu
) {
88 t
->interruptible
= FALSE
;
96 register thread_t t
= current_thread();
99 if (t
->unix_lock
< 0) {
100 /* thread_bind(t, PROCESSOR_NULL); */
101 t
->bound_processor
= PROCESSOR_NULL
;
103 if (t
->processor_set
!= &default_pset
)
111 register thread_t t
= current_thread();
113 if (t
->unix_lock
!= -1)