]>
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 * 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@
22 #include <pexpert/protos.h>
25 typedef unsigned long spl_t
;
27 spl_t
PE_set_spl(spl_t x
);
29 spl_t
splhi() { return PE_set_spl(8); }
30 spl_t
splhigh() { return PE_set_spl(8); }
31 spl_t
splclock() { return PE_set_spl(8); }
32 spl_t
splvm() { return PE_set_spl(8); }
33 spl_t
splsched() { return PE_set_spl(8); }
34 spl_t
splimp() { return PE_set_spl(6); }
35 void splx(spl_t x
) { (void) PE_set_spl(x
); }
36 spl_t
splnet() { return PE_set_spl(6); }
37 void spllo() { (void) PE_set_spl(0); }
38 spl_t
spl1() { return PE_set_spl(1); }
39 spl_t
spl2() { return PE_set_spl(2); }
40 spl_t
spl3() { return PE_set_spl(3); }
41 spl_t
spl4() { return PE_set_spl(4); }
42 spl_t
spl5() { return PE_set_spl(5); }
43 spl_t
spl6() { return PE_set_spl(6); }
44 spl_t
splbio() { return PE_set_spl(5); }
45 spl_t
spltty() { return PE_set_spl(6); }
47 spl_t
sploff() { return PE_set_spl(8); }
48 void splon(spl_t x
) { (void) PE_set_spl(x
); }
50 spl_t
PE_set_spl(spl_t lvl
)
56 __asm__
volatile("cli");
59 old_level
= cpu_data
[mycpu
].spl_level
;
60 cpu_data
[mycpu
].spl_level
= lvl
;
62 if (!lvl
) __asm__
volatile("sti");
67 void PE_set_spl_no_interrupt(spl_t lvl
)
71 __asm__
volatile("cli");
74 cpu_data
[mycpu
].spl_level
= lvl
;