summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTharo <17233964+Thar0@users.noreply.github.com>2024-12-22 23:48:13 +0000
committerGitHub <noreply@github.com>2024-12-22 15:48:13 -0800
commit06b06ab50759d1b92fe0a3510453a11454d9409c (patch)
treec4a14c616087f4cf55b1900fd8b2380c71b598fb /include
parent187e75c4417f3a2b5373be4610adcf836dba93a1 (diff)
Check in makerom files (#1758)
* Check in makerom files * Fix disasm for asm files in src
Diffstat (limited to 'include')
-rw-r--r--include/PR/asm.h85
-rw-r--r--include/boot.h6
2 files changed, 91 insertions, 0 deletions
diff --git a/include/PR/asm.h b/include/PR/asm.h
new file mode 100644
index 000000000..d5058f5c1
--- /dev/null
+++ b/include/PR/asm.h
@@ -0,0 +1,85 @@
+#ifndef PR_ASM_H
+#define PR_ASM_H
+
+#ifdef __sgi
+#define _MIPS_ISA_MIPS1 1
+#define _MIPS_ISA_MIPS2 2
+#define _MIPS_ISA_MIPS3 3
+#define _MIPS_ISA_MIPS4 4
+#endif
+
+#ifndef _LANGUAGE_C
+
+#define LEAF(x) \
+ .balign 4 ;\
+ .globl x ;\
+ .type x, @function ;\
+ x: ;\
+ .ent x, 0 ;\
+ .frame $sp, 0, $ra
+
+#define XLEAF(x) \
+ .balign 4 ;\
+ .globl x ;\
+ .type x, @function ;\
+ x: ;\
+ .aent x, 0
+
+#define NESTED(x, fsize, ra) \
+ .globl x ;\
+ x: ;\
+ .ent x, 0 ;\
+ .frame $sp, fsize, ra
+
+#define XNESTED(x) \
+ .globl x ;\
+ x: ;\
+ .aent x, 0
+
+#define END(x) \
+ .size x, . - x ;\
+ .end x
+
+#define IMPORT(x, size) \
+ .extern x, size
+
+#define EXPORT(x) \
+ .globl x ;\
+ x:
+
+#define DATA(x) \
+ .balign 4 ;\
+ .globl x ;\
+ .type x, @object ;\
+ x:
+
+#define ENDDATA(x) \
+ .size x, . - x
+
+#endif
+
+/**
+ * Stack Alignment
+ */
+#if (_MIPS_SIM == _ABIO32)
+#define NARGSAVE 4 // space for 4 args must be allocated
+#define ALSZ (8-1)
+#define ALMASK ~(8-1)
+#elif (_MIPS_SIM == _ABIN32 || _MIPS_SIM == _ABI64)
+#define NARGSAVE 0 // no caller responsibilities
+#define ALSZ (16-1)
+#define ALMASK ~(16-1)
+#endif
+
+#define FRAMESZ(size) (((size) + ALSZ) & ALMASK)
+
+/**
+ * Register Size
+ */
+#if (_MIPS_ISA == _MIPS_ISA_MIPS1 || _MIPS_ISA == _MIPS_ISA_MIPS2)
+#define SZREG 4
+#elif (_MIPS_ISA == _MIPS_ISA_MIPS3 || _MIPS_ISA == _MIPS_ISA_MIPS4)
+#define SZREG 8
+#endif
+
+#endif
diff --git a/include/boot.h b/include/boot.h
new file mode 100644
index 000000000..b0c1a50f0
--- /dev/null
+++ b/include/boot.h
@@ -0,0 +1,6 @@
+#ifndef BOOT_H
+#define BOOT_H
+
+#define BOOT_STACK_SIZE 0x400
+
+#endif