chiark / gitweb /
Initial revision
[ssr] / StraySrc / Libraries / Sapphire / sh / idle
1 ;
2 ; idle.sh
3 ;
4 ; Idle event and alarm handling
5 ;
6 ; © 1994-1998 Straylight
7 ;
8
9 ;----- Licensing note -------------------------------------------------------
10 ;
11 ; This file is part of Straylight's Sapphire library.
12 ;
13 ; Sapphire is free software; you can redistribute it and/or modify
14 ; it under the terms of the GNU General Public License as published by
15 ; the Free Software Foundation; either version 2, or (at your option)
16 ; any later version.
17 ;
18 ; Sapphire is distributed in the hope that it will be useful,
19 ; but WITHOUT ANY WARRANTY; without even the implied warranty of
20 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21 ; GNU General Public License for more details.
22 ;
23 ; You should have received a copy of the GNU General Public License
24 ; along with Sapphire.  If not, write to the Free Software Foundation,
25 ; 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
26
27 ;----- Overview -------------------------------------------------------------
28 ;
29 ; Functions provided:
30 ;
31 ;  idle_handler
32 ;  idle_removeHandler
33 ;  idle_setAlarm
34 ;  idle_removeAlarm
35 ;  idle_removeAllAlarms
36 ;  idle_init
37
38                 [       :LNOT::DEF:idle__dfn
39                 GBLL    idle__dfn
40
41 ; --- idle_handler ---
42 ;
43 ; On entry:     R0 == how frequently to call
44 ;               R1 == pointer to routine to call
45 ;               R2 == R10 value to call routine with
46 ;               R3 == R12 value to call routine with
47 ;
48 ; On exit:      May return an error
49 ;
50 ; Use:          Adds a routine to the idle handler list. Later added
51 ;               routines are called first. The idle handing routine
52 ;               may corrupt R10 and R12.
53
54                 IMPORT  idle_handler
55
56 ; --- idle_removeHandler ---
57 ;
58 ; On entry:     R0 == How frequently it was called
59 ;               R1 == pointer to routine called
60 ;               R2 == R10 value routine is called with
61 ;               R3 == R12 value routine is called with
62 ;
63 ; On exit:      --
64 ;
65 ; Use:          Removes a routine from the idle handler list.
66
67                 IMPORT  idle_removeHandler
68
69 ; --- idle_setAlarm ---
70 ;
71 ; On entry:     R3 == Time to call
72 ;               R1 == pointer to routine to call
73 ;               R2 == R10 value to call routine with
74 ;               R3 == R12 value to call routine with
75 ;
76 ; On exit:      May return an error
77 ;
78 ; Use:          Adds a alarm to be called. The idle handing routine
79 ;               may corrupt R10 and R12.
80
81                 IMPORT  idle_setAlarm
82
83 ; --- idle_removeAlarm ---
84 ;
85 ; On entry:     R0 == When it was to be called
86 ;               R1 == pointer to routine called
87 ;               R2 == R10 value routine is called with
88 ;               R3 == R12 value routine is called with
89 ;
90 ; On exit:      --
91 ;
92 ; Use:          Removes a routine from the idle handler list. It has
93 ;               no effect if it doesn't exist.
94
95                 IMPORT  idle_removeAlarm
96
97 ; --- idle_removeAllAlarms ---
98 ;
99 ; On entry:     R0 == R10 value to look for
100 ;
101 ; On exit:      --
102 ;
103 ; Use:          Removes all alarms with the handle that was passed to them
104 ;               to be put into R10.  You should not remove an alarm within
105 ;               an alarm handler.
106
107
108                 IMPORT  idle_removeAllAlarms
109
110 ; --- idle_init ---
111 ;
112 ; On entry:     --
113 ;
114 ; On exit:      --
115 ;
116 ; Use:          Initialises the idle system.
117
118                 IMPORT  idle_init
119
120                 ]
121
122 ;----- That's all, folks ----------------------------------------------------
123
124                 END