From 2eabe8ba107dc9fa7ec6b8c46dfcecd34b58786b Mon Sep 17 00:00:00 2001 From: Maximus32 Date: Sun, 10 Jan 2021 15:05:36 +0100 Subject: [PATCH] Make IOP assembly compatible with new toolchain --- .../debug/ioptrap/{handler.s => handler.S} | 0 modules/ds34bt/iop/{smsutils.s => smsutils.S} | 4 +- .../ds34usb/iop/{smsutils.s => smsutils.S} | 4 +- .../cdvdman/{smsutils.s => smsutils.S} | 4 +- modules/iopcore/patches/iremsndpatch/asm.S | 2 + .../udnl-t300/{udnl_asm.s => udnl_asm.S} | 2 + .../iopcore/udnl/{udnl_asm.s => udnl_asm.S} | 2 + modules/network/SMSTCPIP/{inet.s => inet.S} | 3 + .../SMSUTILS/{SMSUTILS.s => SMSUTILS.S} | 3 + modules/network/smap-ingame/xfer.c | 60 +++++++++---------- 10 files changed, 51 insertions(+), 33 deletions(-) rename modules/debug/ioptrap/{handler.s => handler.S} (100%) rename modules/ds34bt/iop/{smsutils.s => smsutils.S} (99%) rename modules/ds34usb/iop/{smsutils.s => smsutils.S} (99%) rename modules/iopcore/cdvdman/{smsutils.s => smsutils.S} (99%) rename modules/iopcore/udnl-t300/{udnl_asm.s => udnl_asm.S} (99%) rename modules/iopcore/udnl/{udnl_asm.s => udnl_asm.S} (99%) rename modules/network/SMSTCPIP/{inet.s => inet.S} (99%) rename modules/network/SMSUTILS/{SMSUTILS.s => SMSUTILS.S} (99%) diff --git a/modules/debug/ioptrap/handler.s b/modules/debug/ioptrap/handler.S similarity index 100% rename from modules/debug/ioptrap/handler.s rename to modules/debug/ioptrap/handler.S diff --git a/modules/ds34bt/iop/smsutils.s b/modules/ds34bt/iop/smsutils.S similarity index 99% rename from modules/ds34bt/iop/smsutils.s rename to modules/ds34bt/iop/smsutils.S index 3de679964..ac2111cf6 100644 --- a/modules/ds34bt/iop/smsutils.s +++ b/modules/ds34bt/iop/smsutils.S @@ -7,6 +7,9 @@ # Pulled out 'sde' library from MIPS. # by Eugene Plotnikov */ + +#include "as_reg_compat.h" + .ifdef .gasversion. .section .mdebug.abi32 .nan legacy @@ -175,4 +178,3 @@ mips_memset: _dummy: jr $ra nop - \ No newline at end of file diff --git a/modules/ds34usb/iop/smsutils.s b/modules/ds34usb/iop/smsutils.S similarity index 99% rename from modules/ds34usb/iop/smsutils.s rename to modules/ds34usb/iop/smsutils.S index 3de679964..ac2111cf6 100644 --- a/modules/ds34usb/iop/smsutils.s +++ b/modules/ds34usb/iop/smsutils.S @@ -7,6 +7,9 @@ # Pulled out 'sde' library from MIPS. # by Eugene Plotnikov */ + +#include "as_reg_compat.h" + .ifdef .gasversion. .section .mdebug.abi32 .nan legacy @@ -175,4 +178,3 @@ mips_memset: _dummy: jr $ra nop - \ No newline at end of file diff --git a/modules/iopcore/cdvdman/smsutils.s b/modules/iopcore/cdvdman/smsutils.S similarity index 99% rename from modules/iopcore/cdvdman/smsutils.s rename to modules/iopcore/cdvdman/smsutils.S index 3de679964..ac2111cf6 100644 --- a/modules/iopcore/cdvdman/smsutils.s +++ b/modules/iopcore/cdvdman/smsutils.S @@ -7,6 +7,9 @@ # Pulled out 'sde' library from MIPS. # by Eugene Plotnikov */ + +#include "as_reg_compat.h" + .ifdef .gasversion. .section .mdebug.abi32 .nan legacy @@ -175,4 +178,3 @@ mips_memset: _dummy: jr $ra nop - \ No newline at end of file diff --git a/modules/iopcore/patches/iremsndpatch/asm.S b/modules/iopcore/patches/iremsndpatch/asm.S index 35b50ef29..7b81c7e7b 100644 --- a/modules/iopcore/patches/iremsndpatch/asm.S +++ b/modules/iopcore/patches/iremsndpatch/asm.S @@ -1,3 +1,5 @@ +#include "as_reg_compat.h" + .set noreorder .text diff --git a/modules/iopcore/udnl-t300/udnl_asm.s b/modules/iopcore/udnl-t300/udnl_asm.S similarity index 99% rename from modules/iopcore/udnl-t300/udnl_asm.s rename to modules/iopcore/udnl-t300/udnl_asm.S index df7fbb79a..3b77627f5 100644 --- a/modules/iopcore/udnl-t300/udnl_asm.s +++ b/modules/iopcore/udnl-t300/udnl_asm.S @@ -1,3 +1,5 @@ +#include "as_reg_compat.h" + .set noat .set noreorder diff --git a/modules/iopcore/udnl/udnl_asm.s b/modules/iopcore/udnl/udnl_asm.S similarity index 99% rename from modules/iopcore/udnl/udnl_asm.s rename to modules/iopcore/udnl/udnl_asm.S index 4ca9da2a3..91e22df8a 100644 --- a/modules/iopcore/udnl/udnl_asm.s +++ b/modules/iopcore/udnl/udnl_asm.S @@ -1,3 +1,5 @@ +#include "as_reg_compat.h" + .ifdef .gasversion. .section .mdebug.abi32 .nan legacy diff --git a/modules/network/SMSTCPIP/inet.s b/modules/network/SMSTCPIP/inet.S similarity index 99% rename from modules/network/SMSTCPIP/inet.s rename to modules/network/SMSTCPIP/inet.S index 81a92a11d..905ea5a3b 100644 --- a/modules/network/SMSTCPIP/inet.s +++ b/modules/network/SMSTCPIP/inet.S @@ -6,6 +6,9 @@ # Licenced under Academic Free License version 2.0 # Review ps2sdk README & LICENSE files for further details. # + +#include "as_reg_compat.h" + .ifdef .gasversion. .section .mdebug.abi32 .nan legacy diff --git a/modules/network/SMSUTILS/SMSUTILS.s b/modules/network/SMSUTILS/SMSUTILS.S similarity index 99% rename from modules/network/SMSUTILS/SMSUTILS.s rename to modules/network/SMSUTILS/SMSUTILS.S index 7f71b3cd4..ef24a68cf 100644 --- a/modules/network/SMSUTILS/SMSUTILS.s +++ b/modules/network/SMSUTILS/SMSUTILS.S @@ -7,6 +7,9 @@ # Pulled out 'sde' library from MIPS. # */ + +#include "as_reg_compat.h" + .ifdef .gasversion. .section .mdebug.abi32 .nan legacy diff --git a/modules/network/smap-ingame/xfer.c b/modules/network/smap-ingame/xfer.c index 78f9630a2..a8a8bb8e1 100644 --- a/modules/network/smap-ingame/xfer.c +++ b/modules/network/smap-ingame/xfer.c @@ -93,37 +93,37 @@ static inline void CopyFromFIFO(volatile u8 *smap_regbase, void *buffer, unsigne ".set noreorder\n\t" ".set nomacro\n\t" ".set noat\n\t" - "lui $v0, 0xB000\n\t" + "lui $2, 0xB000\n\t" "srl $at, %1, 5\n\t" "blez $at, 3f\n\t" "andi %1, %1, 0x1F\n\t" "4:\n\t" - "lw $t0, 4608($v0)\n\t" - "lw $t1, 4608($v0)\n\t" - "lw $t2, 4608($v0)\n\t" - "lw $t3, 4608($v0)\n\t" - "lw $t4, 4608($v0)\n\t" - "lw $t5, 4608($v0)\n\t" - "lw $t6, 4608($v0)\n\t" - "lw $t7, 4608($v0)\n\t" + "lw $8, 4608($2)\n\t" + "lw $9, 4608($2)\n\t" + "lw $10, 4608($2)\n\t" + "lw $11, 4608($2)\n\t" + "lw $12, 4608($2)\n\t" + "lw $13, 4608($2)\n\t" + "lw $14, 4608($2)\n\t" + "lw $15, 4608($2)\n\t" "addiu $at, $at, -1\n\t" - "sw $t0, 0(%0)\n\t" - "sw $t1, 4(%0)\n\t" - "sw $t2, 8(%0)\n\t" - "sw $t3, 12(%0)\n\t" - "sw $t4, 16(%0)\n\t" - "sw $t5, 20(%0)\n\t" - "sw $t6, 24(%0)\n\t" - "sw $t7, 28(%0)\n\t" + "sw $8, 0(%0)\n\t" + "sw $9, 4(%0)\n\t" + "sw $10, 8(%0)\n\t" + "sw $11, 12(%0)\n\t" + "sw $12, 16(%0)\n\t" + "sw $13, 20(%0)\n\t" + "sw $14, 24(%0)\n\t" + "sw $15, 28(%0)\n\t" "bgtz $at, 4b\n\t" "addiu %0, %0, 32\n\t" "3:\n\t" "blez %1, 1f\n\t" "nop\n\t" "2:\n\t" - "lw $t0, 4608($v0)\n\t" + "lw $8, 4608($2)\n\t" "addiu %1, %1, -4\n\t" - "sw $t0, 0(%0)\n\t" + "sw $8, 0(%0)\n\t" "bgtz %1, 2b\n\t" "addiu %0, %0, 4\n\t" "1:\n\t" @@ -210,28 +210,28 @@ int SMAPSendPacket(const void *data, unsigned int length) ".set nomacro\n\t" ".set noat\n\t" "srl $at, %1, 4\n\t" - "lui $v1, 0xB000\n\t" + "lui $3, 0xB000\n\t" "beqz $at, 3f\n\t" "andi %1, %1, 0xF\n\t" "4:\n\t" - "lw $t0, 0(%0)\n\t" - "lw $t1, 4(%0)\n\t" - "lw $t2, 8(%0)\n\t" - "lw $t3, 12(%0)\n\t" + "lw $8, 0(%0)\n\t" + "lw $9, 4(%0)\n\t" + "lw $10, 8(%0)\n\t" + "lw $11, 12(%0)\n\t" "addiu $at, $at, -1\n\t" - "sw $t0, 4352($v1)\n\t" - "sw $t1, 4352($v1)\n\t" - "sw $t2, 4352($v1)\n\t" + "sw $8, 4352($3)\n\t" + "sw $9, 4352($3)\n\t" + "sw $10, 4352($3)\n\t" "addiu %0, %0, 16\n\t" "bgtz $at, 4b\n\t" - "sw $t3, 4352($v1)\n\t" + "sw $11, 4352($3)\n\t" "3:\n\t" "beqz %1, 1f\n\t" "nop\n\t" "2:\n\t" - "lw $v0, 0(%0)\n\t" + "lw $2, 0(%0)\n\t" "addiu %1, %1, -4\n\t" - "sw $v0, 4352($v1)\n\t" + "sw $2, 4352($3)\n\t" "bnez %1, 2b\n\t" "addiu %0, %0, 4\n\t" "1:\n\t"