]> git.lizzy.rs Git - plan9front.git/blob - sys/man/9/splhi
turn ptrdiff_t into a 64 bit type
[plan9front.git] / sys / man / 9 / splhi
1 .TH SPLHI 9
2 .SH NAME
3 splhi, spllo, splx, islo \- enable and disable interrupts
4 .SH SYNOPSIS
5 .ta \w'\fLvoid 'u
6 .B
7 int     spllo(void)
8 .PP
9 .B
10 int     splhi(void)
11 .PP
12 .B
13 void    splx(int x)
14 .PP
15 .B
16 int     islo(void)
17 .SH DESCRIPTION
18 These primitives enable and disable maskable interrupts on the current
19 processor.
20 Generally, device drivers should use
21 .I ilock
22 (see
23 .IR lock (9)),
24 .IR sleep (9),
25 or the functions in
26 .IR qio (9)
27 to control interaction between processes and interrupt handlers.
28 Those routines (but not these) provide correct synchronisation on multiprocessors.
29 .PP
30 .I Spllo
31 enables interrupts and returns a flag representing the previous interrupt enable state.
32 It must not normally be called from interrupt level.
33 .PP
34 .I Splhi
35 disables all maskable interrupts and returns the previous interrupt enable state.
36 The period during which interrupts are disabled had best be short,
37 or real-time applications will suffer.
38 .PP
39 .I Splx
40 restores the interrupt enable state to
41 .IR x ,
42 which must be a value returned
43 by a previous call to
44 .I splhi
45 or
46 .IR spllo .
47 .PP
48 .I Islo
49 returns true (non-zero) if interrupts are currently enabled, and 0 otherwise.
50 .SH SOURCE
51 .B /sys/src/9/*/l.s
52 .SH SEE ALSO
53 .IR lock (9),
54 .IR qio (9),
55 .IR sleep (9),
56 .IR intrenable (9)