splhi 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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
  41. state to
  42. .IR x ,
  43. which must be a value returned
  44. by a previous call to
  45. .I splhi
  46. or
  47. .IR spllo .
  48. .PP
  49. .I Islo
  50. returns true (non-zero) if interrupts are currently enabled, and 0 otherwise.
  51. .SH SOURCE
  52. .B /sys/src/9/*/l.s
  53. .SH SEE ALSO
  54. .IR lock (9),
  55. .IR qio (9),
  56. .IR sleep (9),
  57. .IR intrenable (9)