]>
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_OSREFERENCE_LICENSE_HEADER_START@
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
28 #include <pexpert/protos.h>
31 typedef unsigned long spl_t
;
33 spl_t
PE_set_spl(spl_t x
);
35 spl_t
splhi() { return PE_set_spl(8); }
36 spl_t
splhigh() { return PE_set_spl(8); }
37 spl_t
splclock() { return PE_set_spl(8); }
38 spl_t
splvm() { return PE_set_spl(8); }
39 spl_t
splsched() { return PE_set_spl(8); }
40 spl_t
splimp() { return PE_set_spl(6); }
41 void splx(spl_t x
) { (void) PE_set_spl(x
); }
42 spl_t
splnet() { return PE_set_spl(6); }
43 void spllo() { (void) PE_set_spl(0); }
44 spl_t
spl1() { return PE_set_spl(1); }
45 spl_t
spl2() { return PE_set_spl(2); }
46 spl_t
spl3() { return PE_set_spl(3); }
47 spl_t
spl4() { return PE_set_spl(4); }
48 spl_t
spl5() { return PE_set_spl(5); }
49 spl_t
spl6() { return PE_set_spl(6); }
50 spl_t
splbio() { return PE_set_spl(5); }
51 spl_t
spltty() { return PE_set_spl(6); }
53 spl_t
sploff() { return PE_set_spl(8); }
54 void splon(spl_t x
) { (void) PE_set_spl(x
); }
56 spl_t
PE_set_spl(spl_t lvl
)
62 __asm__
volatile("cli");
65 old_level
= cpu_data
[mycpu
].spl_level
;
66 cpu_data
[mycpu
].spl_level
= lvl
;
68 if (!lvl
) __asm__
volatile("sti");
73 void PE_set_spl_no_interrupt(spl_t lvl
)
77 __asm__
volatile("cli");
80 cpu_data
[mycpu
].spl_level
= lvl
;