mirror of
https://github.com/Interlisp/maiko.git
synced 2026-03-15 22:37:22 +00:00
Compare commits
1 Commits
sdl-textur
...
testing123
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
439d92adbd |
@@ -191,4 +191,6 @@
|
|||||||
#define user_subr_DUMMY 012
|
#define user_subr_DUMMY 012
|
||||||
#define user_subr_SAMPLE_USER_SUBR 00
|
#define user_subr_SAMPLE_USER_SUBR 00
|
||||||
|
|
||||||
|
/* Experimental yield */
|
||||||
|
#define sb_YIELD 0322
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
15
src/subr.c
15
src/subr.c
@@ -29,6 +29,7 @@
|
|||||||
/***********************************************************/
|
/***********************************************************/
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <time.h>
|
||||||
#include "lispemul.h"
|
#include "lispemul.h"
|
||||||
#include "address.h"
|
#include "address.h"
|
||||||
#include "adr68k.h"
|
#include "adr68k.h"
|
||||||
@@ -779,6 +780,20 @@ void OP_subrcall(int subr_no, int argnum) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif /* LPSOLVE */
|
#endif /* LPSOLVE */
|
||||||
|
case sb_YIELD: {
|
||||||
|
struct timespec rqts = {0, 833333};
|
||||||
|
unsigned sleepnanos;
|
||||||
|
POP_SUBR_ARGS;
|
||||||
|
N_GETNUMBER(args[0], sleepnanos, ret_nil);
|
||||||
|
if (sleepnanos > 999999999) {
|
||||||
|
TopOfStack = NIL;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
rqts.tv_nsec = sleepnanos;
|
||||||
|
nanosleep(&rqts, NULL);
|
||||||
|
TopOfStack = ATOM_T;
|
||||||
|
break;
|
||||||
|
}
|
||||||
default: {
|
default: {
|
||||||
char errtext[200];
|
char errtext[200];
|
||||||
sprintf(errtext, "OP_subrcall: Invalid alpha byte 0%o", ((*(PC + 1)) & 0xff));
|
sprintf(errtext, "OP_subrcall: Invalid alpha byte 0%o", ((*(PC + 1)) & 0xff));
|
||||||
|
|||||||
Reference in New Issue
Block a user