40static __attribute__((always_inline))
int enterCriticalSection() {
41 register int n asm(
"a0") = 1;
42 register int r asm(
"v0");
43 __asm__ volatile(
"syscall\n" :
"=r"(
r) :
"r"(
n) :
"memory");
47static __attribute__((always_inline))
void leaveCriticalSection() {
48 register int n asm(
"a0") = 2;
49 __asm__ volatile(
"syscall\n" : :
"r"(
n) :
"memory");
53 register int n asm(
"a0") = 3;
54 register int tcb
asm(
"a1") = address;
55 register int r asm(
"v0");
56 __asm__ volatile(
"syscall\n" :
"=r"(
r) :
"r"(
n),
"r"(tcb) :
"memory");
62 register int n
asm(
"t1") = 0x03;
64 return ((
size_t(*)(
int,
const void *,
size_t))0xa0)(
fd,
buf,
size);
68 register int n asm(
"t1") = 0x13;
74 register int n
asm(
"t1") = 0x14;
75 __asm__ volatile(
"" :
"=r"(n) :
"r"(n));
80static __attribute__((always_inline))
char *syscall_strcat(
char *dst,
const char *
src) {
81 register int n
asm(
"t1") = 0x15;
82 __asm__ volatile(
"" :
"=r"(n) :
"r"(n));
83 return ((
char *(*)(
char *,
const char *))0xa0)(dst,
src);
86static __attribute__((always_inline))
char *syscall_strncat(
char *dst,
const char *
src,
size_t size) {
87 register int n asm(
"t1") = 0x16;
89 return ((
char *(*)(
char *,
const char *,
size_t))0xa0)(dst,
src,
size);
93 register int n
asm(
"t1") = 0x17;
94 __asm__ volatile(
"" :
"=r"(n) :
"r"(n));
95 return ((
int (*)(
const char *,
const char *))0xa0)(
s1,
s2);
98static __attribute__((always_inline))
int syscall_strncmp(
const char *
s1,
const char *
s2,
size_t size) {
99 register int n asm(
"t1") = 0x18;
101 return ((
int (*)(
const char *,
const char *,
size_t))0xa0)(
s1,
s2,
size);
104static __attribute__((always_inline))
char *syscall_strcpy(
char *dst,
const char *
src) {
105 register int n asm(
"t1") = 0x19;
107 return ((
char *(*)(
char *,
const char *))0xa0)(dst,
src);
110static __attribute__((always_inline))
char *syscall_strncpy(
char *dst,
const char *
src,
size_t size) {
111 register int n asm(
"t1") = 0x1a;
113 return ((
char *(*)(
char *,
const char *,
size_t))0xa0)(dst,
src,
size);
116static __attribute__((always_inline))
size_t syscall_strlen(
const char *
s) {
117 register int n asm(
"t1") = 0x1b;
119 return ((
size_t(*)(
const char *))0xa0)(
s);
123 register int n
asm(
"t1") = 0x1c;
124 __asm__ volatile(
"" :
"=r"(n) :
"r"(n));
125 return ((
char *(*)(
const char *,
int c))0xa0)(
s,
c);
128static __attribute__((always_inline))
char *syscall_rindex(
const char *
s,
int c) {
129 register int n asm(
"t1") = 0x1d;
131 return ((
char *(*)(
const char *,
int c))0xa0)(
s,
c);
134static __attribute__((always_inline))
char *syscall_strchr(
const char *
s,
int c) {
135 register int n asm(
"t1") = 0x1e;
137 return ((
char *(*)(
const char *,
int c))0xa0)(
s,
c);
140static __attribute__((always_inline))
char *syscall_strrchr(
const char *
s,
int c) {
141 register int n asm(
"t1") = 0x1f;
143 return ((
char *(*)(
const char *,
int c))0xa0)(
s,
c);
147 register int n
asm(
"t1") = 0x2a;
148 __asm__ volatile(
"" :
"=r"(n) :
"r"(n));
149 return ((
void *(*)(
void *,
const void *,
size_t))0xa0)(dst,
src,
count);
152static __attribute__((always_inline))
void *syscall_memset(
void *dst,
int c,
size_t count) {
153 register int n asm(
"t1") = 0x2b;
155 return ((
void *(*)(
void *,
int,
size_t))0xa0)(dst,
c,
count);
159 int (*
compar)(
const void *,
const void *)) {
160 register int n
asm(
"t1") = 0x31;
161 __asm__ volatile(
"" :
"=r"(n) :
"r"(n));
162 ((
void (*)(
void *, size_t, size_t,
int (*)(
const void *,
const void *)))0xa0)(base,
nel,
width,
compar);
166 register int n asm(
"t1") = 0x33;
168 return ((
void *(*)(
size_t))0xa0)(
size);
172 register int n asm(
"t1") = 0x34;
178 register int n asm(
"t1") = 0x39;
183static __attribute__((always_inline))
void syscall__exit(
int code) {
184 register int n asm(
"t1") = 0x3a;
189static __attribute__((always_inline))
void syscall_puts(
const char *msg) {
190 register int n asm(
"t1") = 0x3e;
192 ((
void (*)(
const char *))0xa0)(msg);
207static __attribute__((always_inline))
int syscall_unresolvedException() {
208 register int n asm(
"t1") = 0x40;
210 return ((
int (*)())0xa0)();
214 register int n asm(
"t1") = 0x44;
216 ((
void (*)())0xa0)();
219static __attribute__((always_inline))
int syscall_cdromSeekL(uint8_t *msf) {
220 register int n asm(
"t1") = 0x78;
222 return ((
int (*)(uint8_t *))0xa0)(msf);
225static __attribute__((always_inline))
int syscall_cdromGetStatus(uint8_t *
ptr) {
226 register int n asm(
"t1") = 0x7c;
228 return ((
int (*)(uint8_t *))0xa0)(
ptr);
232 register int n
asm(
"t1") = 0x7e;
233 __asm__ volatile(
"" :
"=r"(n) :
"r"(n));
237static __attribute__((always_inline))
int syscall_cdromInnerInit() {
238 register int n asm(
"t1") = 0x95;
240 return ((
int (*)())0xa0)();
243static __attribute__((always_inline))
int syscall_addCDRomDevice() {
244 register int n asm(
"t1") = 0x96;
246 return ((
int (*)())0xa0)();
249static __attribute__((always_inline))
int syscall_addMemoryCardDevice() {
250 register int n asm(
"t1") = 0x97;
252 return ((
int (*)())0xa0)();
255static __attribute__((always_inline))
int syscall_addConsoleDevice() {
256 register int n asm(
"t1") = 0x98;
258 return ((
int (*)())0xa0)();
261static __attribute__((always_inline))
int syscall_addDummyConsoleDevice() {
262 register int n asm(
"t1") = 0x99;
264 return ((
int (*)())0xa0)();
268 register int n
asm(
"t1") = 0xa1;
269 __asm__ volatile(
"" :
"=r"(n) :
"r"(n));
273static __attribute__((always_inline))
void syscall_enqueueCDRomHandlers() {
274 register int n asm(
"t1") = 0xa2;
276 ((
void (*)())0xa0)();
279static __attribute__((always_inline))
void syscall_dequeueCDRomHandlers() {
280 register int n asm(
"t1") = 0xa3;
282 ((
void (*)())0xa0)();
285static __attribute__((always_inline))
void syscall_buLowLevelOpCompleted() {
286 register int n asm(
"t1") = 0xa7;
288 ((
void (*)())0xa0)();
291static __attribute__((always_inline))
void syscall_buLowLevelOpError1() {
292 register int n asm(
"t1") = 0xa8;
294 ((
void (*)())0xa0)();
297static __attribute__((always_inline))
void syscall_buLowLevelOpError2() {
298 register int n asm(
"t1") = 0xa9;
300 ((
void (*)())0xa0)();
303static __attribute__((always_inline))
void syscall_buLowLevelOpError3() {
304 register int n asm(
"t1") = 0xaa;
306 ((
void (*)())0xa0)();
309static __attribute__((always_inline))
void syscall_buLowLevelOpError4() {
310 register int n asm(
"t1") = 0xae;
312 ((
void (*)())0xa0)();
315static __attribute__((always_inline))
int syscall_ioabortraw(
int code) {
316 register int n asm(
"t1") = 0xb2;
318 return ((
int (*)(
int))0xa0)(code);
323 register int n asm(
"t1") = 0x00;
325 return ((
void *(*)(
unsigned))0xb0)(
size);
329 register int n asm(
"t1") = 0x01;
335 register int n
asm(
"t1") = 0x02;
336 __asm__ volatile(
"" :
"=r"(n) :
"r"(n));
341 register int n asm(
"t1") = 0x03;
343 return ((
int (*)(
uint32_t))0xb0)(timer);
347 register int n asm(
"t1") = 0x04;
349 return ((
int (*)(
uint32_t))0xb0)(timer);
353 register int n asm(
"t1") = 0x05;
355 return ((
int (*)(
uint32_t))0xb0)(timer);
359 register int n asm(
"t1") = 0x06;
361 return ((
int (*)(
uint32_t))0xb0)(timer);
365 register int n
asm(
"t1") = 0x07;
366 __asm__ volatile(
"" :
"=r"(n) :
"r"(n));
372 register int n
asm(
"t1") = 0x08;
373 __asm__ volatile(
"" :
"=r"(n) :
"r"(n));
378 register int n asm(
"t1") = 0x09;
384 register int n asm(
"t1") = 0x0b;
386 return ((
int (*)(
uint32_t))0xb0)(event);
390 register int n asm(
"t1") = 0x0c;
392 return ((
int (*)(
uint32_t))0xb0)(event);
396 register int n
asm(
"t1") = 0x12;
397 __asm__ volatile(
"" :
"=r"(n) :
"r"(n));
401static __attribute__((always_inline))
void syscall_startPad() {
402 register int n asm(
"t1") = 0x13;
404 ((
void (*)())0xb0)();
407static __attribute__((always_inline))
void syscall_stopPad() {
408 register int n asm(
"t1") = 0x14;
410 ((
void (*)())0xb0)();
413static __attribute__((always_inline, noreturn))
void syscall_returnFromException() {
414 register int n asm(
"t1") = 0x17;
420static __attribute__((always_inline))
void syscall_setDefaultExceptionJmpBuf() {
421 register int n asm(
"t1") = 0x18;
423 ((
void (*)())0xb0)();
427 register int n asm(
"t1") = 0x20;
432static __attribute__((always_inline))
int syscall_open(
const char *filename,
int mode) {
433 register int n asm(
"t1") = 0x32;
435 return ((
int (*)(
const char *,
int))0xb0)(filename,
mode);
439 register int n asm(
"t1") = 0x34;
445 register int n asm(
"t1") = 0x36;
447 return ((
int (*)(
int))0xb0)(
fd);
450static __attribute__((always_inline))
void syscall_putchar(
int c) {
451 register int n asm(
"t1") = 0x3d;
457 register int n asm(
"t1") = 0x47;
459 return ((
int (*)(
const struct Device *))0xb0)(device);
462static __attribute__((always_inline))
int syscall_cardInfoInternal(
int deviceID) {
463 register int n asm(
"t1") = 0x4d;
465 return ((
int (*)(
int))0xb0)(deviceID);
469 register int n
asm(
"t1") = 0x4e;
470 __asm__ volatile(
"" :
"=r"(n) :
"r"(n));
471 return ((
int (*)(
int,
int,
const uint8_t *))0xb0)(deviceID,
sector,
buffer);
475 register int n asm(
"t1") = 0x4f;
480static __attribute__((always_inline))
void syscall_mcAllowNewCard() {
481 register int n asm(
"t1") = 0x50;
483 ((
void (*)())0xb0)();
487 register int n asm(
"t1") = 0x51;
489 return ((uint8_t * (*)(
uint32_t))0xb0)(
c);
492static __attribute__((always_inline))
int syscall_mcGetLastDevice() {
493 register int n asm(
"t1") = 0x58;
495 return ((
int (*)())0xb0)();
499static __attribute__((always_inline))
int syscall_enqueueRCntIrqs(
int priority) {
500 register int n asm(
"t1") = 0x00;
502 return ((
int (*)(
int))0xc0)(priority);
505static __attribute__((always_inline))
int syscall_enqueueSyscallHandler(
int priority) {
506 register int n asm(
"t1") = 0x01;
508 return ((
int (*)(
int))0xc0)(priority);
512 register int n
asm(
"t1") = 0x02;
513 __asm__ volatile(
"" :
"=r"(n) :
"r"(n));
518 register int n
asm(
"t1") = 0x03;
519 __asm__ volatile(
"" :
"=r"(n) :
"r"(n));
523static __attribute__((always_inline))
void syscall_installExceptionHandler() {
524 register int n asm(
"t1") = 0x07;
526 ((
void (*)())0xc0)();
529static __attribute__((always_inline))
void syscall_kernInitheap(
void *base,
size_t size) {
530 register int n asm(
"t1") = 0x08;
536 register int n
asm(
"t1") = 0x0a;
537 __asm__ volatile(
"" :
"=r"(n) :
"r"(n));
541static __attribute__((always_inline))
int syscall_enqueueIrqHandler(
int priority) {
542 register int n asm(
"t1") = 0x0c;
544 return ((
int (*)(
int))0xc0)(priority);
550 register int n asm(
"t1") = 0x0d;
555static __attribute__((always_inline))
void syscall_setupFileIO(
int installTTY) {
556 register int n asm(
"t1") = 0x12;
558 ((
void (*)(
int))0xc0)(installTTY);
562 register int n asm(
"t1") = 0x15;
567static __attribute__((always_inline))
void syscall_cdevscan() {
568 register int n asm(
"t1") = 0x16;
570 ((
void (*)())0xc0)();
574 register int n asm(
"t1") = 0x17;
579static __attribute__((always_inline))
int syscall_ioabort(
const char *msg) {
580 register int n asm(
"t1") = 0x19;
582 return ((
int (*)(
const char *))0xc0)(msg);
585static __attribute__((always_inline))
void syscall_setDeviceStatus(
int status) {
586 register int n asm(
"t1") = 0x1a;
591static __attribute__((always_inline))
void syscall_patchA0table() {
592 register int n asm(
"t1") = 0x1c;
594 ((
void (*)())0xc0)();
597static __attribute__((always_inline))
int syscall_getDeviceStatus() {
598 register int n asm(
"t1") = 0x1d;
600 return ((
int (*)())0xc0)();
int irq
Definition cdltest.c:296
ramsyscall_printf("T21 phase=%s t=%u v=%02x cause=%u size=%u stat=%02x\n", phase, t/1000, response[0], cause, size,(nopCause==3 &&nopSize >=1) ? stat[0] :0xff)
__attribute__((weak))
Definition clz.c:56
volatile uint32_t * ptr
Definition cop0.c:80
uint32_t r
Definition cpu.c:310
__asm__(" .section .text.monitorSlotEntry, \"ax\", @progbits\n" " .align 2\n" " .global monitorSlotEntry\n" " .type monitorSlotEntry, @function\n" " .set push\n" " .set noreorder\n" " .set noat\n" "monitorSlotEntry:\n" " mfc0 $v0, $13\n" " nop\n" " andi $v0, $v0, 0x7c\n" " beqz $v0, 1f\n" " srl $v0, $v0, 2\n" " li $v1, " MON_STR(MON_SLOT_EXCMASK) "\n" " srlv $v1, $v1, $v0\n" " andi $v1, $v1, 1\n" " bnez $v1, 2f\n" " nop\n" " jr $ra\n" " nop\n" "1:\n" MON_SLOT_RX_TEST " jr $ra\n" " nop\n" "2:\n" " sw $a0, 0x10($k0)\n" " sw $a1, 0x14($k0)\n" " sw $a2, 0x18($k0)\n" " sw $a3, 0x1c($k0)\n" " mfc0 $a0, $12\n" " nop\n" " sw $a0, 0x8c($k0)\n" " mfc0 $a1, $13\n" " nop\n" " sw $a1, 0x90($k0)\n" " sw $k1, 0x6c($k0)\n" " sw $s0, 0x40($k0)\n" " sw $s1, 0x44($k0)\n" " sw $s2, 0x48($k0)\n" " sw $s3, 0x4c($k0)\n" " sw $s4, 0x50($k0)\n" " sw $s5, 0x54($k0)\n" " sw $s6, 0x58($k0)\n" " sw $s7, 0x5c($k0)\n" " sw $t0, 0x20($k0)\n" " sw $t1, 0x24($k0)\n" " sw $t2, 0x28($k0)\n" " sw $t3, 0x2c($k0)\n" " sw $t4, 0x30($k0)\n" " sw $t5, 0x34($k0)\n" " sw $t6, 0x38($k0)\n" " sw $t7, 0x3c($k0)\n" " sw $t8, 0x60($k0)\n" " sw $t9, 0x64($k0)\n" " sw $gp, 0x70($k0)\n" " sw $sp, 0x74($k0)\n" " sw $fp, 0x78($k0)\n" " mfhi $a0\n" " nop\n" " sw $a0, 0x84($k0)\n" " mflo $a0\n" " nop\n" " sw $a0, 0x88($k0)\n" " move $s0, $ra\n" " la $sp, monitorSlotStack + " MON_STR(MONITOR_SLOT_STACK_WORDS) " * 4 - 16\n" " jal monitorSlotDispatch\n" " nop\n" " lw $k0, 0x108($zero)\n" " move $ra, $s0\n" " lw $k0, 0($k0)\n" " nop\n" " addiu $k0, $k0, 8\n" " lw $a0, 0x84($k0)\n" " lw $a1, 0x88($k0)\n" " mthi $a0\n" " mtlo $a1\n" " lw $a0, 0x10($k0)\n" " lw $a1, 0x14($k0)\n" " lw $a2, 0x18($k0)\n" " lw $a3, 0x1c($k0)\n" " lw $t0, 0x20($k0)\n" " lw $t1, 0x24($k0)\n" " lw $t2, 0x28($k0)\n" " lw $t3, 0x2c($k0)\n" " lw $t4, 0x30($k0)\n" " lw $t5, 0x34($k0)\n" " lw $t6, 0x38($k0)\n" " lw $t7, 0x3c($k0)\n" " lw $t8, 0x60($k0)\n" " lw $t9, 0x64($k0)\n" " lw $s0, 0x40($k0)\n" " lw $sp, 0x74($k0)\n" " jr $ra\n" " nop\n" " .set pop\n" " .size monitorSlotEntry, . - monitorSlotEntry\n" " .previous\n")
n
Definition gentable.py:95
int fd
Definition pcdrv-net.c:68
char * s
Definition string.c:48
Definition circularbuffer.h:37
uint32_t s1
Definition setjmp.h:32
int romsyscall_printf(const char *fmt,...)
static int value
Definition syscalls.h:535
static void * buffer
Definition syscalls.h:231
static uint32_t spec
Definition syscalls.h:364
static size_t nel
Definition syscalls.h:158
static size_t size_t width
Definition syscalls.h:158
static const char * s2
Definition syscalls.h:92
static const void size_t count
Definition syscalls.h:146
static int ret
Definition syscalls.h:73
static uint32_t uint32_t void(* handler)())
Definition syscalls.h:371
static int c
Definition syscalls.h:122
static int sector
Definition syscalls.h:468
static struct HandlerInfo * info
Definition syscalls.h:511
static const void * buf
Definition syscalls.h:61
static size_t void size_t size2
Definition syscalls.h:395
static const void size_t size
Definition syscalls.h:61
static uint16_t uint16_t flags
Definition syscalls.h:334
static size_t size_t int(* compar)(const void *, const void *))
Definition syscalls.h:159
static size_t void * buffer2
Definition syscalls.h:395
static const char * src
Definition syscalls.h:80
static size_t size1
Definition syscalls.h:395
static uint16_t target
Definition syscalls.h:334
static void uint32_t mode
Definition syscalls.h:231
static int code2
Definition syscalls.h:267
void uint32_t(classId, spec)
syscall_qsort(input, size, sizeof(input[0]), icmp)