Skip to content

Commit 6fedd97

Browse files
authored
add yield subr (#398)
* Add experimental SUBR to call nanosleep() for experiments in reducing CPU load This adds a SUBR, sb_YIELD, value (octal) 0322 which takes a single number 0..999999999 which is the number of nanoseconds to pass to nanosleep(). The return value is T if the call to nanosleep() was executed or NIL if it was not (argument out-of-range, or other error in getting the number from the argument). To use this experimental SUBR in a sysout you should: (SETQ \INITSUBRS (CONS '(YIELD #o322) \INITSUBRS)) then you can define functions that use that SUBR: (DEFINEQ (BACKGROUND-YIELD () (SUBRCALL YIELD 833333))) (COMPILE 'BACKGROUND-YIELD) (SETQ BACKGROUNDFNS (CONS 'BACKGROUND-YIELD BACKGROUNDFNS)) * Update to use subrs.h newly generated from LLSUBRS The subrs.h include file is generated by WRITECALLSUBRS based on the \INITSUBRS list. This update provides for the new YIELD subr in the generated file, and makes some necessary updates to the C code implementations for some subr names which have changed.
1 parent a70b18d commit 6fedd97

File tree

2 files changed

+168
-194
lines changed

2 files changed

+168
-194
lines changed

inc/subrs.h

Lines changed: 144 additions & 188 deletions
Original file line numberDiff line numberDiff line change
@@ -1,194 +1,150 @@
11
#ifndef SUBRS_H
22
#define SUBRS_H 1
3-
4-
/* $Id: subrs.h,v 1.2 1999/01/03 02:06:24 sybalsky Exp $ (C) Copyright Venue, All Rights Reserved */
5-
3+
/* This file written from LLSUBRS on 13-Sep-2021 15:19:22 */
64
/* Do not edit this file! Instead, edit the list \initsubrs */
7-
/* on the lisp file LLSUBRS and then call WRITECALLSUBRS to */
8-
/* generate a new version. */
9-
#define sb_BACKGROUNDSUBR 06
10-
#define sb_CHECKBCPLPASSWORD 07
11-
#define sb_DISKPARTITION 010
12-
#define sb_DSPBOUT 011
13-
#define sb_DSPRATE 012
14-
#define sb_GATHERSTATS 013
15-
#define sb_GETPACKETBUFFER 014
16-
#define sb_LISPFINISH 015
17-
#define sb_MOREVMEMFILE 016
18-
#define sb_RAID 017
19-
#define sb_READRAWPBI 020
20-
#define sb_WRITERAWPBI 021
21-
#define sb_SETSCREENCOLOR 022
22-
#define sb_SHOWDISPLAY 023
23-
#define sb_PUPLEVEL1STATE 024
24-
#define sb_WRITESTATS 025
25-
#define sb_CONTEXTSWITCH 026
26-
#define sb_COPYSYS0SUBR 027
27-
#define sb_WRITEMAP 030
28-
29-
#define sb_UFS_GETFILENAME 042
30-
#define sb_UFS_DELETEFILE 043
31-
#define sb_UFS_RENAMEFILE 044
32-
#define sb_COM_READPAGES 045
33-
#define sb_COM_WRITEPAGES 046
34-
#define sb_COM_TRUNCATEFILE 047
35-
36-
#define sb_UFS_DIRECTORYNAMEP 051
37-
#define sb_COM_GETFREEBLOCK 055
38-
#define sb_SETUNIXTIME 060
39-
#define sb_GETUNIXTIME 061
40-
#define sb_COPYTIMESTATS 062
41-
#define sb_UNIX_USERNAME 063
42-
#define sb_UNIX_FULLNAME 064
43-
#define sb_UNIX_GETENV 065
44-
#define sb_UNIX_GETPARM 066
45-
#define sb_CHECK_SUM 067
46-
#define sb_ETHER_SUSPEND 070
47-
#define sb_ETHER_RESUME 071
48-
#define sb_ETHER_AVAILABLE 072
49-
#define sb_ETHER_RESET 073
50-
#define sb_ETHER_GET 074
51-
#define sb_ETHER_SEND 075
52-
#define sb_ETHER_SETFILTER 076
53-
#define sb_ETHER_CHECK 077
54-
#define sb_DSPCURSOR 0100
55-
#define sb_SETMOUSEXY 0101
56-
#define sb_DSP_VIDEOCOLOR 0102
57-
#define sb_DSP_SCREENWIDTH 0103
58-
#define sb_DSP_SCREENHEIGHT 0104
59-
#define sb_BITBLTSUB 0105
60-
#define sb_BLTCHAR 0106
61-
#define sb_TEDIT_BLTCHAR 0107
62-
#define sb_BITBLT_BITMAP 0110
63-
#define sb_BLTSHADE_BITMAP 0111
64-
65-
#define sb_RS232C_CMD 0112
66-
#define sb_RS232C_READ_INIT 0113
67-
#define sb_RS232C_WRITE 0114
68-
69-
#define sb_KEYBOARDBEEP 0120
70-
#define sb_KEYBOARDMAP 0121
71-
#define sb_KEYBOARDSTATE 0122
72-
73-
#define sb_VMEMSAVE 0131
74-
#define sb_LISP_FINISH 0132
75-
#define sb_NEWPAGE 0133
76-
#define sb_DORECLAIM 0134
77-
#define sb_DUMMY_135Q 0135
78-
#define sb_NATIVE_MEMORY_REFERENCE 0136
79-
#define sb_OLD_COMPILE_LOAD_NATIVE 0137 /* obsolete */
80-
#define sb_DISABLEGC 0140
81-
82-
#define sb_COM_SETFILEINFO 0147
83-
#define sb_COM_OPENFILE 0150
84-
#define sb_COM_CLOSEFILE 0151
85-
#define sb_DSK_GETFILENAME 0152
86-
#define sb_DSK_DELETEFILE 0153
87-
#define sb_DSK_RENAMEFILE 0154
88-
#define sb_COM_NEXT_FILE 0156
89-
#define sb_COM_FINISH_FINFO 0157
90-
#define sb_COM_GEN_FILES 0160
91-
#define sb_DSK_DIRECTORYNAMEP 0161
92-
#define sb_COM_GETFILEINFO 0162
93-
#define sb_COM_CHANGEDIR 0164
94-
#define sb_UNIX_HANDLECOMM 0165
95-
#define sb_OCR_COMM 0166
96-
#define sb_RPC_CALL 0167
97-
#define sb_MESSAGE_READP 0170
98-
#define sb_MESSAGE_READ 0171
99-
#define sb_MONITOR_CONTROL 0200
100-
#define sb_GET_NATIVE_ADDR_FROM_LISP_PTR 0203
101-
#define sb_GET_LISP_PTR_FROM_NATIVE_ADDR 0204
102-
#define sb_LOAD_NATIVE_FILE 0205 /* obsolete */
103-
#define sb_SUSPEND_LISP 0206
104-
#define sb_NEW_BLTCHAR 0207
105-
#define sb_COLOR_INIT 0210
106-
#define sb_COLOR_SCREENMODE 0211
107-
#define sb_COLOR_MAP 0212
108-
#define sb_COLOR_BASE 0213
109-
#define sb_C_SlowBltChar 0214
110-
#define sb_TCP_OP 0220
111-
#define sb_WITH_SYMBOL 0221
112-
113-
/* For linear-programming interface */
114-
#define sb_LP_SETUP 0230
115-
#define sb_LP_RUN 0231
116-
117-
/* For Native Windows */
118-
#define sb_MNW_OP 0244
119-
#define sb_QUERY_WINDOWS 0245
120-
#define sb_FILL_IN 0246
121-
122-
123-
/* DLD codes */
124-
#define sb_CALL_C_FN 0247
125-
#define sb_DLD_LINK 0250
126-
#define sb_DLD_UNLINK_BY_FILE 0251
127-
#define sb_DLD_UNLINK_BY_SYMBOL 0252
128-
#define sb_DLD_GET_SYMBOL 0253
129-
#define sb_DLD_GET_FUNC 0254
130-
#define sb_DLD_FUNCTION_EXECUTABLE_P 0255
131-
#define sb_DLD_LIST_UNDEFINED_SYM 0256
132-
#define sb_MALLOC 0257
133-
#define sb_FREE 0260
134-
#define sb_PUT_C_BASEBYTE 0261
135-
#define sb_GET_C_BASEBYTE 0262
136-
#define sb_SMASHING_APPLY 0263
137-
138-
#ifdef TRUECOLOR
139-
#define sb_PICTURE_OP 0250
140-
#define sb_TRUE_COLOR_OP 0251
141-
#ifdef VIDEO
142-
#define sb_VIDEO_OP 0252
143-
#endif /* VIDEO */
144-
145-
#endif /* TRUECOLOR */
146-
147-
148-
#define sb_CHAR_OPENFILE 0310
149-
#define sb_CHAR_BIN 0311
150-
#define sb_CHAR_BOUT 0312
151-
#define sb_CHAR_IOCTL 0313
152-
#define sb_CHAR_CLOSEFILE 0314
153-
#define sb_CHAR_EOFP 0315
154-
#define sb_CHAR_READP 0316
155-
#define sb_CHAR_BINS 0317
156-
#define sb_CHAR_BOUTS 0320
157-
#define sb_CHAR_FILLBUFFER 0321
158-
159-
160-
5+
/* on the lisp file LLSUBRS and then call WRITECALLSUBRS to */
6+
/* generate a new version. */
7+
#define sb_BACKGROUNDSUBR 06
8+
#define sb_CHECKBCPLPASSWORD 07
9+
#define sb_DISKPARTITION 010
10+
#define sb_DSPBOUT 011
11+
#define sb_DSPRATE 012
12+
#define sb_GATHERSTATS 013
13+
#define sb_GETPACKETBUFFER 014
14+
#define sb_LISPFINISH 015
15+
#define sb_MOREVMEMFILE 016
16+
#define sb_RAID 017
17+
#define sb_READRAWPBI 020
18+
#define sb_WRITERAWPBI 021
19+
#define sb_SETSCREENCOLOR 022
20+
#define sb_SHOWDISPLAY 023
21+
#define sb_PUPLEVEL1STATE 024
22+
#define sb_WRITESTATS 025
23+
#define sb_CONTEXTSWITCH 026
24+
#define sb_COPYSYS0SUBR 027
25+
#define sb_WRITEMAP 030
26+
#define sb_UFS_GETFILENAME 042
27+
#define sb_UFS_DELETEFILE 043
28+
#define sb_UFS_RENAMEFILE 044
29+
#define sb_COM_READPAGES 045
30+
#define sb_COM_WRITEPAGES 046
31+
#define sb_COM_TRUNCATEFILE 047
32+
#define sb_UFS_DIRECTORYNAMEP 051
33+
#define sb_COM_GETFREEBLOCK 055
34+
#define sb_SETUNIXTIME 060
35+
#define sb_GETUNIXTIME 061
36+
#define sb_COPYTIMESTATS 062
37+
#define sb_UNIX_USERNAME 063
38+
#define sb_UNIX_FULLNAME 064
39+
#define sb_UNIX_GETENV 065
40+
#define sb_UNIX_GETPARM 066
41+
#define sb_CHECK_SUM 067
42+
#define sb_ETHER_SUSPEND 070
43+
#define sb_ETHER_RESUME 071
44+
#define sb_ETHER_AVAILABLE 072
45+
#define sb_ETHER_RESET 073
46+
#define sb_ETHER_GET 074
47+
#define sb_ETHER_SEND 075
48+
#define sb_ETHER_SETFILTER 076
49+
#define sb_ETHER_CHECK 077
50+
#define sb_DSPCURSOR 0100
51+
#define sb_SETMOUSEXY 0101
52+
#define sb_DSP_VIDEOCOLOR 0102
53+
#define sb_DSP_SCREENWIDTH 0103
54+
#define sb_DSP_SCREENHEIGHT 0104
55+
#define sb_BITBLTSUB 0105
56+
#define sb_BLTCHAR 0106
57+
#define sb_TEDIT_BLTCHAR 0107
58+
#define sb_BITBLT_BITMAP 0110
59+
#define sb_BLTSHADE_BITMAP 0111
60+
#define sb_RS232C_CMD 0112
61+
#define sb_RS232C_READ_INIT 0113
62+
#define sb_RS232C_WRITE 0114
63+
#define sb_KEYBOARDBEEP 0120
64+
#define sb_KEYBOARDMAP 0121
65+
#define sb_KEYBOARDSTATE 0122
66+
#define sb_VMEMSAVE 0131
67+
#define sb_LISP_FINISH 0132
68+
#define sb_NEWPAGE 0133
69+
#define sb_DORECLAIM 0134
70+
#define sb_DUMMY_135Q 0135
71+
#define sb_NATIVE_MEMORY_REFERENCE 0136
72+
#define sb_OLD_COMPILE_LOAD_NATIVE 0137
73+
#define sb_DISABLEGC 0140
74+
#define sb_COM_SETFILEINFO 0147
75+
#define sb_COM_OPENFILE 0150
76+
#define sb_COM_CLOSEFILE 0151
77+
#define sb_DSK_GETFILENAME 0152
78+
#define sb_DSK_DELETEFILE 0153
79+
#define sb_DSK_RENAMEFILE 0154
80+
#define sb_COM_NEXT_FILE 0156
81+
#define sb_COM_FINISH_FINFO 0157
82+
#define sb_COM_GEN_FILES 0160
83+
#define sb_DSK_DIRECTORYNAMEP 0161
84+
#define sb_COM_GETFILEINFO 0162
85+
#define sb_COM_CHANGEDIR 0164
86+
#define sb_UNIX_HANDLECOMM 0165
87+
#define sb_RPC_CALL 0167
88+
#define sb_MESSAGE_READP 0170
89+
#define sb_MESSAGE_READ 0171
90+
#define sb_MONITOR_CONTROL 0200
91+
#define sb_GET_NATIVE_ADDR_FROM_LISP_PTR 0203
92+
#define sb_GET_LISP_PTR_FROM_NATIVE_ADDR 0204
93+
#define sb_LOAD_NATIVE_FILE 0205
94+
#define sb_SUSPEND_LISP 0206
95+
#define sb_NEW_BLTCHAR 0207
96+
#define sb_COLOR_INIT 0210
97+
#define sb_COLOR_SCREENMODE 0211
98+
#define sb_COLOR_MAP 0212
99+
#define sb_COLOR_BASE 0213
100+
#define sb_C_SlowBltChar 0214
101+
#define sb_UNCOLORIZE_BITMAP 0215
102+
#define sb_COLORIZE_BITMAP 0216
103+
#define sb_COLOR_8BPPDRAWLINE 0217
104+
#define sb_TCP_OP 0220
105+
#define sb_WITH_SYMBOL 0221
106+
#define sb_CAUSE_INTERRUPT 0222
107+
#define sb_OPEN_SOCKET 0240
108+
#define sb_CLOSE_SOCKET 0241
109+
#define sb_READ_SOCKET 0242
110+
#define sb_WRITE_SOCKET 0243
111+
#define sb_CALL_C_FUNCTION 0247
112+
#define sb_DLD_LINK 0250
113+
#define sb_DLD_UNLINK_BY_FILE 0251
114+
#define sb_DLD_UNLINK_BY_SYMBOL 0252
115+
#define sb_DLD_GET_SYMBOL 0253
116+
#define sb_DLD_GET_FUNC 0254
117+
#define sb_DLD_FUNCTION_EXECUTABLE_P 0255
118+
#define sb_DLD_LIST_UNDEFINED_SYMBOLS 0256
119+
#define sb_C_MALLOC 0257
120+
#define sb_C_FREE 0260
121+
#define sb_C_PUTBASEBYTE 0261
122+
#define sb_C_GETBASEBYTE 0262
123+
#define sb_CHAR_OPENFILE 0310
124+
#define sb_CHAR_BIN 0311
125+
#define sb_CHAR_BOUT 0312
126+
#define sb_CHAR_IOCTL 0313
127+
#define sb_CHAR_CLOSEFILE 0314
128+
#define sb_CHAR_EOFP 0315
129+
#define sb_CHAR_READP 0316
130+
#define sb_CHAR_BINS 0317
131+
#define sb_CHAR_BOUTS 0320
132+
#define sb_CHAR_FILLBUFFER 0321
133+
#define sb_YIELD 0322
161134
/* MISCN opcodes */
162-
#define miscn_USER_SUBR 00
163-
#define miscn_VALUES 01
164-
#define miscn_SXHASH 02
165-
#define miscn_EQLHASHBITSFN 03
166-
#define miscn_STRINGHASHBITS 04
167-
#define miscn_STRING_EQUAL_HASHBITS 05
168-
#define miscn_VALUES_LIST 06
169-
#define miscn_LCFetchMethod 07
170-
#define miscn_LCFetchMethodOrHelp 010
171-
#define miscn_LCFindVarIndex 011
172-
#define miscn_LCGetIVValue 012
173-
#define miscn_LCPutIVValue 013
174-
175-
/* for accessing RAW RS232C port */
176-
#define miscn_RAW_RS232C_OPEN 050
177-
#define miscn_RAW_RS232C_CLOSE 051
178-
#define miscn_RAW_RS232C_SETPARAM 052
179-
#define miscn_RAW_RS232C_GETPARAM 053
180-
#define miscn_RAW_RS232C_READ 054
181-
#define miscn_RAW_RS232C_WRITE 055
182-
#define miscn_RAW_RS232C_SETINT 056
183-
184-
/* for CHATTER */
185-
#define miscn_CHATTER 040
186-
187-
/* for EJLISP */
188-
#define miscn_EJLISP 060
189-
135+
#define miscn_USER_SUBR 00
136+
#define miscn_VALUES 01
137+
#define miscn_SXHASH 02
138+
#define miscn_EQLHASHBITSFN 03
139+
#define miscn_STRINGHASHBITS 04
140+
#define miscn_STRING_EQUAL_HASHBITS 05
141+
#define miscn_VALUES_LIST 06
142+
#define miscn_LCFetchMethod 07
143+
#define miscn_LCFetchMethodOrHelp 010
144+
#define miscn_LCFindVarIndex 011
145+
#define miscn_LCGetIVValue 012
146+
#define miscn_LCPutIVValue 013
190147
/* Assigned USER SUBR numbers */
191-
#define user_subr_DUMMY 012
192-
#define user_subr_SAMPLE_USER_SUBR 00
193-
148+
#define user_subr_DUMMY 012
149+
#define user_subr_SAMPLE_USER_SUBR 00
194150
#endif

0 commit comments

Comments
 (0)