summaryrefslogtreecommitdiff
path: root/berry_fix/payload/asm/macros
diff options
context:
space:
mode:
Diffstat (limited to 'berry_fix/payload/asm/macros')
-rw-r--r--berry_fix/payload/asm/macros/asm.inc12
-rw-r--r--berry_fix/payload/asm/macros/function.inc29
2 files changed, 41 insertions, 0 deletions
diff --git a/berry_fix/payload/asm/macros/asm.inc b/berry_fix/payload/asm/macros/asm.inc
new file mode 100644
index 000000000..4ac003fab
--- /dev/null
+++ b/berry_fix/payload/asm/macros/asm.inc
@@ -0,0 +1,12 @@
+ .macro inc x
+ .set \x, \x + 1
+ .endm
+
+ .macro enum_start x=0
+ .set __enum__, \x
+ .endm
+
+ .macro enum constant
+ .equiv \constant, __enum__
+ inc __enum__
+ .endm
diff --git a/berry_fix/payload/asm/macros/function.inc b/berry_fix/payload/asm/macros/function.inc
new file mode 100644
index 000000000..b109595df
--- /dev/null
+++ b/berry_fix/payload/asm/macros/function.inc
@@ -0,0 +1,29 @@
+ .macro arm_func_start name
+ .align 2, 0
+ .global \name
+ .arm
+ .type \name, %function
+ .endm
+
+ .macro arm_func_end name
+ .size \name, .-\name
+ .endm
+
+ .macro thumb_func_start name
+ .align 2, 0
+ .global \name
+ .thumb
+ .thumb_func
+ .type \name, %function
+ .endm
+
+ .macro non_word_aligned_thumb_func_start name
+ .global \name
+ .thumb
+ .thumb_func
+ .type \name, %function
+ .endm
+
+ .macro thumb_func_end name
+ .size \name, .-\name
+ .endm