diff --git a/src/lib/lib_4e090.c b/src/lib/lib_4e090.c deleted file mode 100644 index cfea5749d..000000000 --- a/src/lib/lib_4e090.c +++ /dev/null @@ -1,91 +0,0 @@ -#include -#include "constants.h" -#include "bss.h" -#include "lib/libc/ll.h" -#include "data.h" -#include "types.h" - -GLOBAL_ASM( -glabel bcmp -/* 4e090: 28c10010 */ slti $at,$a2,0x10 -/* 4e094: 14200037 */ bnez $at,.L0004e174 -/* 4e098: 00851026 */ xor $v0,$a0,$a1 -/* 4e09c: 30420003 */ andi $v0,$v0,0x3 -/* 4e0a0: 14400019 */ bnez $v0,.L0004e108 -/* 4e0a4: 0004c023 */ negu $t8,$a0 -/* 4e0a8: 33180003 */ andi $t8,$t8,0x3 -/* 4e0ac: 13000007 */ beqz $t8,.L0004e0cc -/* 4e0b0: 00d83023 */ subu $a2,$a2,$t8 -/* 4e0b4: 00601025 */ or $v0,$v1,$zero -/* 4e0b8: 88820000 */ lwl $v0,0x0($a0) -/* 4e0bc: 88a30000 */ lwl $v1,0x0($a1) -/* 4e0c0: 00982021 */ addu $a0,$a0,$t8 -/* 4e0c4: 00b82821 */ addu $a1,$a1,$t8 -/* 4e0c8: 14430036 */ bne $v0,$v1,.L0004e1a4 -.L0004e0cc: -/* 4e0cc: 2401fffc */ addiu $at,$zero,-4 -/* 4e0d0: 00c13824 */ and $a3,$a2,$at -/* 4e0d4: 10e00027 */ beqz $a3,.L0004e174 -/* 4e0d8: 00c73023 */ subu $a2,$a2,$a3 -/* 4e0dc: 00e43821 */ addu $a3,$a3,$a0 -/* 4e0e0: 8c820000 */ lw $v0,0x0($a0) -.L0004e0e4: -/* 4e0e4: 8ca30000 */ lw $v1,0x0($a1) -/* 4e0e8: 24840004 */ addiu $a0,$a0,0x4 -/* 4e0ec: 24a50004 */ addiu $a1,$a1,0x4 -/* 4e0f0: 1443002c */ bne $v0,$v1,.L0004e1a4 -/* 4e0f4: 00000000 */ nop -/* 4e0f8: 5487fffa */ bnel $a0,$a3,.L0004e0e4 -/* 4e0fc: 8c820000 */ lw $v0,0x0($a0) -/* 4e100: 1000001c */ b .L0004e174 -/* 4e104: 00000000 */ nop -.L0004e108: -/* 4e108: 00053823 */ negu $a3,$a1 -/* 4e10c: 30e70003 */ andi $a3,$a3,0x3 -/* 4e110: 10e0000a */ beqz $a3,.L0004e13c -/* 4e114: 00c73023 */ subu $a2,$a2,$a3 -/* 4e118: 00e43821 */ addu $a3,$a3,$a0 -/* 4e11c: 90820000 */ lbu $v0,0x0($a0) -.L0004e120: -/* 4e120: 90a30000 */ lbu $v1,0x0($a1) -/* 4e124: 24840001 */ addiu $a0,$a0,0x1 -/* 4e128: 24a50001 */ addiu $a1,$a1,0x1 -/* 4e12c: 1443001d */ bne $v0,$v1,.L0004e1a4 -/* 4e130: 00000000 */ nop -/* 4e134: 5487fffa */ bnel $a0,$a3,.L0004e120 -/* 4e138: 90820000 */ lbu $v0,0x0($a0) -.L0004e13c: -/* 4e13c: 2401fffc */ addiu $at,$zero,-4 -/* 4e140: 00c13824 */ and $a3,$a2,$at -/* 4e144: 10e0000b */ beqz $a3,.L0004e174 -/* 4e148: 00c73023 */ subu $a2,$a2,$a3 -/* 4e14c: 00e43821 */ addu $a3,$a3,$a0 -/* 4e150: 88820000 */ lwl $v0,0x0($a0) -.L0004e154: -/* 4e154: 8ca30000 */ lw $v1,0x0($a1) -/* 4e158: 98820003 */ lwr $v0,0x3($a0) -/* 4e15c: 24840004 */ addiu $a0,$a0,0x4 -/* 4e160: 24a50004 */ addiu $a1,$a1,0x4 -/* 4e164: 1443000f */ bne $v0,$v1,.L0004e1a4 -/* 4e168: 00000000 */ nop -/* 4e16c: 5487fff9 */ bnel $a0,$a3,.L0004e154 -/* 4e170: 88820000 */ lwl $v0,0x0($a0) -.L0004e174: -/* 4e174: 18c00009 */ blez $a2,.L0004e19c -/* 4e178: 00c43821 */ addu $a3,$a2,$a0 -/* 4e17c: 90820000 */ lbu $v0,0x0($a0) -.L0004e180: -/* 4e180: 90a30000 */ lbu $v1,0x0($a1) -/* 4e184: 24840001 */ addiu $a0,$a0,0x1 -/* 4e188: 24a50001 */ addiu $a1,$a1,0x1 -/* 4e18c: 14430005 */ bne $v0,$v1,.L0004e1a4 -/* 4e190: 00000000 */ nop -/* 4e194: 5487fffa */ bnel $a0,$a3,.L0004e180 -/* 4e198: 90820000 */ lbu $v0,0x0($a0) -.L0004e19c: -/* 4e19c: 03e00008 */ jr $ra -/* 4e1a0: 00001025 */ or $v0,$zero,$zero -.L0004e1a4: -/* 4e1a4: 03e00008 */ jr $ra -/* 4e1a8: 24020001 */ addiu $v0,$zero,0x1 -); diff --git a/src/lib/ultra/os/interrupt.c b/src/lib/ultra/os/interrupt.c deleted file mode 100644 index f6d13fa37..000000000 --- a/src/lib/ultra/os/interrupt.c +++ /dev/null @@ -1,43 +0,0 @@ -GLOBAL_ASM( -glabel __osDisableInt -/* 495b0: 3c0a8006 */ lui $t2,%hi(__osGlobalIntMask) -/* 495b4: 254acf70 */ addiu $t2,$t2,%lo(__osGlobalIntMask) -/* 495b8: 8d4b0000 */ lw $t3,0x0($t2) -/* 495bc: 316bff00 */ andi $t3,$t3,0xff00 -/* 495c0: 40086000 */ mfc0 $t0,$12 -/* 495c4: 2401fffe */ addiu $at,$zero,-2 -/* 495c8: 01014824 */ and $t1,$t0,$at -/* 495cc: 40896000 */ mtc0 $t1,$12 -/* 495d0: 31020001 */ andi $v0,$t0,0x1 -/* 495d4: 8d480000 */ lw $t0,0x0($t2) -/* 495d8: 3108ff00 */ andi $t0,$t0,0xff00 -/* 495dc: 110b000e */ beq $t0,$t3,.L00049618 -/* 495e0: 3c0a8006 */ lui $t2,%hi(__osRunningThread) -/* 495e4: 254a0940 */ addiu $t2,$t2,%lo(__osRunningThread) -/* 495e8: 8d490118 */ lw $t1,0x118($t2) -/* 495ec: 312aff00 */ andi $t2,$t1,0xff00 -/* 495f0: 01485024 */ and $t2,$t2,$t0 -/* 495f4: 3c01ffff */ lui $at,0xffff -/* 495f8: 342100ff */ ori $at,$at,0xff -/* 495fc: 01214824 */ and $t1,$t1,$at -/* 49600: 012a4825 */ or $t1,$t1,$t2 -/* 49604: 2401fffe */ addiu $at,$zero,-2 -/* 49608: 01214824 */ and $t1,$t1,$at -/* 4960c: 40896000 */ mtc0 $t1,$12 -/* 49610: 00000000 */ nop -/* 49614: 00000000 */ nop -.L00049618: -/* 49618: 03e00008 */ jr $ra -/* 4961c: 00000000 */ nop -); - -GLOBAL_ASM( -glabel __osRestoreInt -/* 49620: 40086000 */ mfc0 $t0,$12 -/* 49624: 01044025 */ or $t0,$t0,$a0 -/* 49628: 40886000 */ mtc0 $t0,$12 -/* 4962c: 00000000 */ nop -/* 49630: 00000000 */ nop -/* 49634: 03e00008 */ jr $ra -/* 49638: 00000000 */ nop -); diff --git a/src/lib/ultra/os/interrupt.s b/src/lib/ultra/os/interrupt.s new file mode 100644 index 000000000..bf5448e2b --- /dev/null +++ b/src/lib/ultra/os/interrupt.s @@ -0,0 +1,46 @@ +#include "asm_helper.h" +#include "macros.inc" +.set noat +.set noreorder + +.text + +glabel __osDisableInt + lui $t2, %hi(__osGlobalIntMask) + addiu $t2, $t2, %lo(__osGlobalIntMask) + lw $t3, 0x0($t2) + andi $t3, $t3, 0xff00 + mfc0 $t0, $12 + addiu $at, $zero, -2 + and $t1, $t0, $at + mtc0 $t1, $12 + andi $v0, $t0, 0x1 + lw $t0, 0x0($t2) + andi $t0, $t0, 0xff00 + beq $t0, $t3, .L00049618 + lui $t2, %hi(__osRunningThread) + addiu $t2, $t2, %lo(__osRunningThread) + lw $t1, 0x118($t2) + andi $t2, $t1, 0xff00 + and $t2, $t2, $t0 + lui $at, 0xffff + ori $at, $at, 0xff + and $t1, $t1, $at + or $t1, $t1, $t2 + addiu $at, $zero, -2 + and $t1, $t1, $at + mtc0 $t1, $12 + nop + nop +.L00049618: + jr $ra + nop + +glabel __osRestoreInt + mfc0 $t0, $12 + or $t0, $t0, $a0 + mtc0 $t0, $12 + nop + nop + jr $ra + nop