]>
git.saurik.com Git - apple/xnu.git/blob - pexpert/i386/pe_spl.c
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
8 * This file contains Original Code and/or Modifications of Original Code
9 * as defined in and that are subject to the Apple Public Source License
10 * Version 2.0 (the 'License'). You may not use this file except in
11 * compliance with the License. Please obtain a copy of the License at
12 * http://www.opensource.apple.com/apsl/ and read it before using this
15 * The Original Code and all software distributed under the License are
16 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
20 * Please see the License for the specific language governing rights and
21 * limitations under the License.
23 * @APPLE_LICENSE_HEADER_END@
25 #include <pexpert/protos.h>
28 typedef unsigned long spl_t
;
30 spl_t
PE_set_spl(spl_t x
);
32 spl_t
splhi() { return PE_set_spl(8); }
33 spl_t
splhigh() { return PE_set_spl(8); }
34 spl_t
splclock() { return PE_set_spl(8); }
35 spl_t
splvm() { return PE_set_spl(8); }
36 spl_t
splsched() { return PE_set_spl(8); }
37 spl_t
splimp() { return PE_set_spl(6); }
38 void splx(spl_t x
) { (void) PE_set_spl(x
); }
39 spl_t
splnet() { return PE_set_spl(6); }
40 void spllo() { (void) PE_set_spl(0); }
41 spl_t
spl1() { return PE_set_spl(1); }
42 spl_t
spl2() { return PE_set_spl(2); }
43 spl_t
spl3() { return PE_set_spl(3); }
44 spl_t
spl4() { return PE_set_spl(4); }
45 spl_t
spl5() { return PE_set_spl(5); }
46 spl_t
spl6() { return PE_set_spl(6); }
47 spl_t
splbio() { return PE_set_spl(5); }
48 spl_t
spltty() { return PE_set_spl(6); }
50 spl_t
sploff() { return PE_set_spl(8); }
51 void splon(spl_t x
) { (void) PE_set_spl(x
); }
53 spl_t
PE_set_spl(spl_t lvl
)
59 __asm__
volatile("cli");
62 old_level
= cpu_data
[mycpu
].spl_level
;
63 cpu_data
[mycpu
].spl_level
= lvl
;
65 if (!lvl
) __asm__
volatile("sti");
70 void PE_set_spl_no_interrupt(spl_t lvl
)
74 __asm__
volatile("cli");
77 cpu_data
[mycpu
].spl_level
= lvl
;