33 #include "common/psxlibc/circularbuffer.h"
34 #include "common/psxlibc/device.h"
35 #include "common/psxlibc/handlers.h"
39 static __attribute__((always_inline))
int enterCriticalSection() {
40 register int n
asm(
"a0") = 1;
41 register int r
asm(
"v0");
42 __asm__
volatile(
"syscall\n"
45 :
"at",
"v1",
"a1",
"a2",
"a3",
"t0",
"t1",
"t2",
"t3",
"t4",
"t5",
"t6",
"t7",
"t8",
"t9",
50 static __attribute__((always_inline))
void leaveCriticalSection() {
51 register int n
asm(
"a0") = 2;
52 __asm__
volatile(
"syscall\n"
55 :
"at",
"v0",
"v1",
"a1",
"a2",
"a3",
"t0",
"t1",
"t2",
"t3",
"t4",
"t5",
"t6",
"t7",
"t8",
"t9",
59 static __attribute__((always_inline))
int changeThreadSubFunction(uint32_t address) {
60 register int n
asm(
"a0") = 3;
61 register int tcb
asm(
"a1") = address;
62 register int r
asm(
"v0");
63 __asm__
volatile(
"syscall\n"
64 :
"=r"(r),
"=r"(n),
"=r"(tcb)
66 :
"at",
"v1",
"a2",
"a3",
"t0",
"t1",
"t2",
"t3",
"t4",
"t5",
"t6",
"t7",
"t8",
"t9",
"memory");
71 static __attribute__((always_inline))
int syscall_setjmp(
struct JmpBuf *buf) {
72 register int n
asm(
"t1") = 0x13;
73 __asm__
volatile(
"" :
"=r"(n) :
"r"(n));
74 return ((
int (*)(
struct JmpBuf * buf))0xa0)(buf);
77 static __attribute__((always_inline)) __attribute__((noreturn))
void syscall_longjmp(
struct JmpBuf *buf,
int ret) {
78 register int n
asm(
"t1") = 0x14;
79 __asm__
volatile(
"" :
"=r"(n) :
"r"(n));
80 ((void (*)(
struct JmpBuf *, int))0xa0)(buf, ret);
83 static __attribute__((always_inline))
char *syscall_strcat(
char *dst,
const char *src) {
84 register int n
asm(
"t1") = 0x15;
85 __asm__
volatile(
"" :
"=r"(n) :
"r"(n));
86 return ((
char *(*)(
char *,
const char *))0xa0)(dst, src);
89 static __attribute__((always_inline))
char *syscall_strncat(
char *dst,
const char *src,
size_t size) {
90 register int n
asm(
"t1") = 0x16;
91 __asm__
volatile(
"" :
"=r"(n) :
"r"(n));
92 return ((
char *(*)(
char *,
const char *, size_t))0xa0)(dst, src, size);
95 static __attribute__((always_inline))
int syscall_strcmp(
const char *s1,
const char *s2) {
96 register int n
asm(
"t1") = 0x17;
97 __asm__
volatile(
"" :
"=r"(n) :
"r"(n));
98 return ((
int (*)(
const char *,
const char *))0xa0)(s1, s2);
101 static __attribute__((always_inline))
int syscall_strncmp(
const char *s1,
const char *s2,
size_t size) {
102 register int n
asm(
"t1") = 0x18;
103 __asm__
volatile(
"" :
"=r"(n) :
"r"(n));
104 return ((
int (*)(
const char *,
const char *, size_t))0xa0)(s1, s2, size);
107 static __attribute__((always_inline))
char *syscall_strcpy(
char *dst,
const char *src) {
108 register int n
asm(
"t1") = 0x19;
109 __asm__
volatile(
"" :
"=r"(n) :
"r"(n));
110 return ((
char *(*)(
char *,
const char *))0xa0)(dst, src);
113 static __attribute__((always_inline))
char *syscall_strncpy(
char *dst,
const char *src,
size_t size) {
114 register int n
asm(
"t1") = 0x1a;
115 __asm__
volatile(
"" :
"=r"(n) :
"r"(n));
116 return ((
char *(*)(
char *,
const char *, size_t))0xa0)(dst, src, size);
119 static __attribute__((always_inline))
size_t syscall_strlen(
const char *s) {
120 register int n
asm(
"t1") = 0x1b;
121 __asm__
volatile(
"" :
"=r"(n) :
"r"(n));
122 return ((
size_t(*)(
const char *))0xa0)(s);
125 static __attribute__((always_inline))
char *syscall_index(
const char *s,
int c) {
126 register int n
asm(
"t1") = 0x1c;
127 __asm__
volatile(
"" :
"=r"(n) :
"r"(n));
128 return ((
char *(*)(
const char *,
int c))0xa0)(s, c);
131 static __attribute__((always_inline))
char *syscall_rindex(
const char *s,
int c) {
132 register int n
asm(
"t1") = 0x1d;
133 __asm__
volatile(
"" :
"=r"(n) :
"r"(n));
134 return ((
char *(*)(
const char *,
int c))0xa0)(s, c);
137 static __attribute__((always_inline))
char *syscall_strchr(
const char *s,
int c) {
138 register int n
asm(
"t1") = 0x1e;
139 __asm__
volatile(
"" :
"=r"(n) :
"r"(n));
140 return ((
char *(*)(
const char *,
int c))0xa0)(s, c);
143 static __attribute__((always_inline))
char *syscall_strrchr(
const char *s,
int c) {
144 register int n
asm(
"t1") = 0x1f;
145 __asm__
volatile(
"" :
"=r"(n) :
"r"(n));
146 return ((
char *(*)(
const char *,
int c))0xa0)(s, c);
149 static __attribute__((always_inline))
void *syscall_memcpy(
void *dst,
const void *src,
size_t count) {
150 register int n
asm(
"t1") = 0x2a;
151 __asm__
volatile(
"" :
"=r"(n) :
"r"(n));
152 return ((
void *(*)(
void *,
const void *, size_t))0xa0)(dst, src, count);
155 static __attribute__((always_inline))
void *syscall_memset(
void *dst,
int c,
size_t count) {
156 register int n
asm(
"t1") = 0x2b;
157 __asm__
volatile(
"" :
"=r"(n) :
"r"(n));
158 return ((
void *(*)(
void *, int, size_t))0xa0)(dst, c, count);
161 static __attribute__((always_inline))
void syscall_qsort(
void *base,
size_t nel,
size_t width,
162 int (*compar)(
const void *,
const void *)) {
163 register int n
asm(
"t1") = 0x31;
164 __asm__
volatile(
"" :
"=r"(n) :
"r"(n));
165 ((void (*)(
void *, size_t, size_t, int (*)(
const void *,
const void *)))0xa0)(base, nel, width, compar);
168 static __attribute__((always_inline))
void *syscall_userMalloc(
size_t size) {
169 register int n
asm(
"t1") = 0x33;
170 __asm__
volatile(
"" :
"=r"(n) :
"r"(n));
171 return ((
void *(*)(size_t))0xa0)(size);
174 static __attribute__((always_inline))
void syscall_userFree(
void *ptr) {
175 register int n
asm(
"t1") = 0x34;
176 __asm__
volatile(
"" :
"=r"(n) :
"r"(n));
177 ((void (*)(
void *))0xa0)(ptr);
180 static __attribute__((always_inline))
void syscall_userInitheap(
void *ptr,
size_t size) {
181 register int n
asm(
"t1") = 0x39;
182 __asm__
volatile(
"" :
"=r"(n) :
"r"(n));
183 ((void (*)(
void *, size_t))0xa0)(ptr, size);
186 static __attribute__((always_inline))
void syscall__exit(
int code) {
187 register int n
asm(
"t1") = 0x3a;
188 __asm__
volatile(
"" :
"=r"(n) :
"r"(n));
189 ((void (*)(int))0xa0)(code);
198 int romsyscall_printf(
const char *fmt, ...);
199 int ramsyscall_printf(
const char *fmt, ...);
204 static __attribute__((always_inline))
int syscall_unresolvedException() {
205 register int n
asm(
"t1") = 0x40;
206 __asm__
volatile(
"" :
"=r"(n) :
"r"(n));
207 return ((
int (*)())0xa0)();
210 static __attribute__((always_inline))
void syscall_flushCache() {
211 register int n
asm(
"t1") = 0x44;
212 __asm__
volatile(
"" :
"=r"(n) :
"r"(n));
213 ((void (*)())0xa0)();
216 static __attribute__((always_inline))
int syscall_cdromSeekL(uint8_t *msf) {
217 register int n
asm(
"t1") = 0x78;
218 __asm__
volatile(
"" :
"=r"(n) :
"r"(n));
219 return ((
int (*)(uint8_t *))0xa0)(msf);
222 static __attribute__((always_inline))
int syscall_cdromGetStatus(uint8_t *ptr) {
223 register int n
asm(
"t1") = 0x7c;
224 __asm__
volatile(
"" :
"=r"(n) :
"r"(n));
225 return ((
int (*)(uint8_t *))0xa0)(ptr);
228 static __attribute__((always_inline))
int syscall_cdromRead(
int count,
void *buffer, uint32_t mode) {
229 register int n
asm(
"t1") = 0x7e;
230 __asm__
volatile(
"" :
"=r"(n) :
"r"(n));
231 return ((
int (*)(int,
void *, uint32_t))0xa0)(count, buffer, mode);
234 static __attribute__((always_inline))
int syscall_cdromInnerInit() {
235 register int n
asm(
"t1") = 0x95;
236 __asm__
volatile(
"" :
"=r"(n) :
"r"(n));
237 return ((
int (*)())0xa0)();
240 static __attribute__((always_inline))
int syscall_addCDRomDevice() {
241 register int n
asm(
"t1") = 0x96;
242 __asm__
volatile(
"" :
"=r"(n) :
"r"(n));
243 return ((
int (*)())0xa0)();
246 static __attribute__((always_inline))
int syscall_addMemoryCardDevice() {
247 register int n
asm(
"t1") = 0x97;
248 __asm__
volatile(
"" :
"=r"(n) :
"r"(n));
249 return ((
int (*)())0xa0)();
252 static __attribute__((always_inline))
int syscall_addConsoleDevice() {
253 register int n
asm(
"t1") = 0x98;
254 __asm__
volatile(
"" :
"=r"(n) :
"r"(n));
255 return ((
int (*)())0xa0)();
258 static __attribute__((always_inline))
int syscall_addDummyConsoleDevice() {
259 register int n
asm(
"t1") = 0x99;
260 __asm__
volatile(
"" :
"=r"(n) :
"r"(n));
261 return ((
int (*)())0xa0)();
264 static __attribute__((always_inline))
void syscall_exception(
int code1,
int code2) {
265 register int n
asm(
"t1") = 0xa1;
266 __asm__
volatile(
"" :
"=r"(n) :
"r"(n));
267 ((void (*)(int, int))0xa0)(code1, code2);
270 static __attribute__((always_inline))
void syscall_enqueueCDRomHandlers() {
271 register int n
asm(
"t1") = 0xa2;
272 __asm__
volatile(
"" :
"=r"(n) :
"r"(n));
273 ((void (*)())0xa0)();
276 static __attribute__((always_inline))
void syscall_dequeueCDRomHandlers() {
277 register int n
asm(
"t1") = 0xa3;
278 __asm__
volatile(
"" :
"=r"(n) :
"r"(n));
279 ((void (*)())0xa0)();
282 static __attribute__((always_inline))
void syscall_buLowLevelOpCompleted() {
283 register int n
asm(
"t1") = 0xa7;
284 __asm__
volatile(
"" :
"=r"(n) :
"r"(n));
285 ((void (*)())0xa0)();
288 static __attribute__((always_inline))
void syscall_buLowLevelOpError1() {
289 register int n
asm(
"t1") = 0xa8;
290 __asm__
volatile(
"" :
"=r"(n) :
"r"(n));
291 ((void (*)())0xa0)();
294 static __attribute__((always_inline))
void syscall_buLowLevelOpError2() {
295 register int n
asm(
"t1") = 0xa9;
296 __asm__
volatile(
"" :
"=r"(n) :
"r"(n));
297 ((void (*)())0xa0)();
300 static __attribute__((always_inline))
void syscall_buLowLevelOpError3() {
301 register int n
asm(
"t1") = 0xaa;
302 __asm__
volatile(
"" :
"=r"(n) :
"r"(n));
303 ((void (*)())0xa0)();
306 static __attribute__((always_inline))
void syscall_buLowLevelOpError4() {
307 register int n
asm(
"t1") = 0xae;
308 __asm__
volatile(
"" :
"=r"(n) :
"r"(n));
309 ((void (*)())0xa0)();
312 static __attribute__((always_inline))
int syscall_ioabortraw(
int code) {
313 register int n
asm(
"t1") = 0xb2;
314 __asm__
volatile(
"" :
"=r"(n) :
"r"(n));
315 return ((
int (*)(int))0xa0)(code);
319 static __attribute__((always_inline))
void *syscall_kmalloc(
unsigned size) {
320 register int n
asm(
"t1") = 0x00;
321 __asm__
volatile(
"" :
"=r"(n) :
"r"(n));
322 return ((
void *(*)(unsigned))0xb0)(size);
325 static __attribute__((always_inline))
void syscall_kfree(
void *ptr) {
326 register int n
asm(
"t1") = 0x01;
327 __asm__
volatile(
"" :
"=r"(n) :
"r"(n));
328 ((void (*)(
void *))0xb0)(ptr);
331 static __attribute__((always_inline))
int syscall_initTimer(uint32_t timer, uint16_t target, uint16_t flags) {
332 register int n
asm(
"t1") = 0x02;
333 __asm__
volatile(
"" :
"=r"(n) :
"r"(n));
334 return ((
int (*)(uint32_t, uint16_t, uint16_t))0xb0)(timer, target, flags);
337 static __attribute__((always_inline))
int syscall_getTimer(uint32_t timer) {
338 register int n
asm(
"t1") = 0x03;
339 __asm__
volatile(
"" :
"=r"(n) :
"r"(n));
340 return ((
int (*)(uint32_t))0xb0)(timer);
343 static __attribute__((always_inline))
int syscall_enableTimerIRQ(uint32_t timer) {
344 register int n
asm(
"t1") = 0x04;
345 __asm__
volatile(
"" :
"=r"(n) :
"r"(n));
346 return ((
int (*)(uint32_t))0xb0)(timer);
349 static __attribute__((always_inline))
int syscall_disableTimerIRQ(uint32_t timer) {
350 register int n
asm(
"t1") = 0x05;
351 __asm__
volatile(
"" :
"=r"(n) :
"r"(n));
352 return ((
int (*)(uint32_t))0xb0)(timer);
355 static __attribute__((always_inline))
int syscall_restartTimer(uint32_t timer) {
356 register int n
asm(
"t1") = 0x06;
357 __asm__
volatile(
"" :
"=r"(n) :
"r"(n));
358 return ((
int (*)(uint32_t))0xb0)(timer);
361 static __attribute__((always_inline))
void syscall_deliverEvent(uint32_t classId, uint32_t spec) {
362 register int n
asm(
"t1") = 0x07;
363 __asm__
volatile(
"" :
"=r"(n) :
"r"(n));
364 ((void (*)(uint32_t, uint32_t))0xb0)(classId, spec);
367 static __attribute__((always_inline)) uint32_t syscall_openEvent(uint32_t classId, uint32_t spec, uint32_t mode,
369 register int n
asm(
"t1") = 0x08;
370 __asm__
volatile(
"" :
"=r"(n) :
"r"(n));
371 return ((uint32_t(*)(uint32_t, uint32_t, uint32_t, void (*)()))0xb0)(classId, spec, mode, handler);
374 static __attribute__((always_inline))
int syscall_closeEvent(uint32_t event) {
375 register int n
asm(
"t1") = 0x09;
376 __asm__
volatile(
"" :
"=r"(n) :
"r"(n));
377 return ((uint32_t(*)(uint32_t))0xb0)(event);
380 static __attribute__((always_inline))
int syscall_testEvent(uint32_t event) {
381 register int n
asm(
"t1") = 0x0b;
382 __asm__
volatile(
"" :
"=r"(n) :
"r"(n));
383 return ((
int (*)(uint32_t))0xb0)(event);
386 static __attribute__((always_inline))
int syscall_enableEvent(uint32_t event) {
387 register int n
asm(
"t1") = 0x0c;
388 __asm__
volatile(
"" :
"=r"(n) :
"r"(n));
389 return ((
int (*)(uint32_t))0xb0)(event);
392 static __attribute__((always_inline))
void syscall_initPad(
void *buffer1,
size_t size1,
void *buffer2,
size_t size2) {
393 register int n
asm(
"t1") = 0x12;
394 __asm__
volatile(
"" :
"=r"(n) :
"r"(n));
395 ((void (*)(
void *, size_t,
void *, size_t))0xb0)(buffer1, size1, buffer2, size2);
398 static __attribute__((always_inline))
void syscall_startPad() {
399 register int n
asm(
"t1") = 0x13;
400 __asm__
volatile(
"" :
"=r"(n) :
"r"(n));
401 ((void (*)())0xb0)();
404 static __attribute__((always_inline))
void syscall_stopPad() {
405 register int n
asm(
"t1") = 0x14;
406 __asm__
volatile(
"" :
"=r"(n) :
"r"(n));
407 ((void (*)())0xb0)();
410 static __attribute__((noreturn)) __attribute__((always_inline))
void syscall_returnFromException() {
411 register int n
asm(
"t1") = 0x17;
412 __asm__
volatile(
"" :
"=r"(n) :
"r"(n));
413 ((__attribute__((noreturn)) void (*)())0xb0)();
416 static __attribute__((always_inline))
void syscall_setDefaultExceptionJmpBuf() {
417 register int n
asm(
"t1") = 0x18;
418 __asm__
volatile(
"" :
"=r"(n) :
"r"(n));
419 ((void (*)())0xb0)();
422 static __attribute__((always_inline))
void syscall_undeliverEvent(uint32_t classId, uint32_t mode) {
423 register int n
asm(
"t1") = 0x20;
424 __asm__
volatile(
"" :
"=r"(n) :
"r"(n));
425 ((void (*)(uint32_t, uint32_t))0xb0)(classId, mode);
428 static __attribute__((always_inline))
int syscall_open(
const char *filename,
int mode) {
429 register int n
asm(
"t1") = 0x32;
430 __asm__
volatile(
"" :
"=r"(n) :
"r"(n));
431 return ((
int (*)(
const char *, int))0xb0)(filename, mode);
434 static __attribute__((always_inline))
int syscall_read(
int fd,
void *buffer,
int size) {
435 register int n
asm(
"t1") = 0x34;
436 __asm__
volatile(
"" :
"=r"(n) :
"r"(n));
437 return ((
int (*)(int,
void *, int))0xb0)(fd, buffer, size);
440 static __attribute__((always_inline))
int syscall_close(
int fd) {
441 register int n
asm(
"t1") = 0x36;
442 __asm__
volatile(
"" :
"=r"(n) :
"r"(n));
443 return ((
int (*)(int))0xb0)(fd);
446 static __attribute__((always_inline))
void syscall_putchar(
int c) {
447 register int n
asm(
"t1") = 0x3d;
448 __asm__
volatile(
"" :
"=r"(n) :
"r"(n));
449 ((void (*)(int))0xb0)(c);
452 static __attribute__((always_inline))
int syscall_addDevice(
const struct Device *device) {
453 register int n
asm(
"t1") = 0x47;
454 __asm__
volatile(
"" :
"=r"(n) :
"r"(n));
455 return ((
int (*)(
const struct Device *))0xb0)(device);
458 static __attribute__((always_inline))
int syscall_cardInfoInternal(
int deviceID) {
459 register int n
asm(
"t1") = 0x4d;
460 __asm__
volatile(
"" :
"=r"(n) :
"r"(n));
461 return ((
int (*)(int))0xb0)(deviceID);
464 static __attribute__((always_inline))
int syscall_mcWriteSector(
int deviceID,
int sector,
const uint8_t *buffer) {
465 register int n
asm(
"t1") = 0x4e;
466 __asm__
volatile(
"" :
"=r"(n) :
"r"(n));
467 return ((
int (*)(int, int,
const uint8_t *))0xb0)(deviceID, sector, buffer);
470 static __attribute__((always_inline))
int syscall_mcReadSector(
int deviceID,
int sector, uint8_t *buffer) {
471 register int n
asm(
"t1") = 0x4f;
472 __asm__
volatile(
"" :
"=r"(n) :
"r"(n));
473 return ((
int (*)(int, int, uint8_t *))0xb0)(deviceID, sector, buffer);
476 static __attribute__((always_inline))
void syscall_mcAllowNewCard() {
477 register int n
asm(
"t1") = 0x50;
478 __asm__
volatile(
"" :
"=r"(n) :
"r"(n));
479 ((void (*)())0xb0)();
482 static __attribute__((always_inline))
int syscall_mcGetLastDevice() {
483 register int n
asm(
"t1") = 0x58;
484 __asm__
volatile(
"" :
"=r"(n) :
"r"(n));
485 return ((
int (*)())0xb0)();
489 static __attribute__((always_inline))
int syscall_enqueueRCntIrqs(
int priority) {
490 register int n
asm(
"t1") = 0x00;
491 __asm__
volatile(
"" :
"=r"(n) :
"r"(n));
492 return ((
int (*)(int))0xc0)(priority);
495 static __attribute__((always_inline))
int syscall_enqueueSyscallHandler(
int priority) {
496 register int n
asm(
"t1") = 0x01;
497 __asm__
volatile(
"" :
"=r"(n) :
"r"(n));
498 return ((
int (*)(int))0xc0)(priority);
501 static __attribute__((always_inline))
int syscall_sysEnqIntRP(
int priority,
struct HandlerInfo *
info) {
502 register int n
asm(
"t1") = 0x02;
503 __asm__
volatile(
"" :
"=r"(n) :
"r"(n));
507 static __attribute__((always_inline))
int syscall_sysDeqIntRP(
int priority,
struct HandlerInfo *
info) {
508 register int n
asm(
"t1") = 0x03;
509 __asm__
volatile(
"" :
"=r"(n) :
"r"(n));
513 static __attribute__((always_inline))
void syscall_installExceptionHandler() {
514 register int n
asm(
"t1") = 0x07;
515 __asm__
volatile(
"" :
"=r"(n) :
"r"(n));
516 ((void (*)())0xc0)();
519 static __attribute__((always_inline))
void syscall_kernInitheap(
void *base,
size_t size) {
520 register int n
asm(
"t1") = 0x08;
521 __asm__
volatile(
"" :
"=r"(n) :
"r"(n));
522 ((void (*)(
void *, size_t))0xc0)(base, size);
525 static __attribute__((always_inline))
int syscall_setTimerAutoAck(uint32_t timer,
int value) {
526 register int n
asm(
"t1") = 0x0a;
527 __asm__
volatile(
"" :
"=r"(n) :
"r"(n));
528 return ((
int (*)(uint32_t, int))0xc0)(timer, value);
531 static __attribute__((always_inline))
int syscall_enqueueIrqHandler(
int priority) {
532 register int n
asm(
"t1") = 0x0c;
533 __asm__
volatile(
"" :
"=r"(n) :
"r"(n));
534 return ((
int (*)(int))0xc0)(priority);
537 static __attribute__((always_inline))
void syscall_setIrqAutoAck(uint32_t irq,
int value) {
538 register int n
asm(
"t1") = 0x0d;
539 __asm__
volatile(
"" :
"=r"(n) :
"r"(n));
540 ((void (*)(uint32_t, int))0xc0)(irq, value);
543 static __attribute__((always_inline))
void syscall_setupFileIO(
int installTTY) {
544 register int n
asm(
"t1") = 0x12;
545 __asm__
volatile(
"" :
"=r"(n) :
"r"(n));
546 ((void (*)(int))0xc0)(installTTY);
549 static __attribute__((always_inline))
void syscall_cdevinput(
struct CircularBuffer *circ,
int c) {
550 register int n
asm(
"t1") = 0x15;
551 __asm__
volatile(
"" :
"=r"(n) :
"r"(n));
555 static __attribute__((always_inline))
void syscall_cdevscan() {
556 register int n
asm(
"t1") = 0x16;
557 __asm__
volatile(
"" :
"=r"(n) :
"r"(n));
558 ((void (*)())0xc0)();
561 static __attribute__((always_inline))
int syscall_circgetc(
struct CircularBuffer *circ) {
562 register int n
asm(
"t1") = 0x17;
563 __asm__
volatile(
"" :
"=r"(n) :
"r"(n));
567 static __attribute__((always_inline))
int syscall_ioabort(
const char *msg) {
568 register int n
asm(
"t1") = 0x19;
569 __asm__
volatile(
"" :
"=r"(n) :
"r"(n));
570 return ((
int (*)(
const char *))0xc0)(msg);
573 static __attribute__((always_inline))
void syscall_setDeviceStatus(
int status) {
574 register int n
asm(
"t1") = 0x1a;
575 __asm__
volatile(
"" :
"=r"(n) :
"r"(n));
576 ((void (*)(int))0xc0)(status);
579 static __attribute__((always_inline))
void syscall_patchA0table() {
580 register int n
asm(
"t1") = 0x1c;
581 __asm__
volatile(
"" :
"=r"(n) :
"r"(n));
582 ((void (*)())0xc0)();
585 static __attribute__((always_inline))
int syscall_getDeviceStatus() {
586 register int n
asm(
"t1") = 0x1d;
587 __asm__
volatile(
"" :
"=r"(n) :
"r"(n));
588 return ((
int (*)())0xc0)();
Definition: circularbuffer.h:37
Definition: handlers.h:33
Definition: xprintf.c:115