aboutsummaryrefslogtreecommitdiff
path: root/macros.s
diff options
context:
space:
mode:
Diffstat (limited to 'macros.s')
-rw-r--r--macros.s31
1 files changed, 31 insertions, 0 deletions
diff --git a/macros.s b/macros.s
new file mode 100644
index 0000000..fcb80eb
--- /dev/null
+++ b/macros.s
@@ -0,0 +1,31 @@
+
+.macro enter x
+ mov \x, %rbp
+ jmp *(%rbp)
+.endm
+
+.macro cell x
+ .quad \x
+.endm
+
+.macro continue
+ enter %rdi
+.endm
+
+.macro thunkenv arg, dest
+ mov (8*(\arg+2))(%rbp), \dest
+.endm
+
+.macro enter_thunkenv arg
+ mov (8*(\arg+2))(%rbp), %rbp
+ jmp *(%rbp)
+.endm
+
+.macro .makethunk name
+ .align 8
+ \name\()_info:
+ cell THU_evacuate
+ cell THU_scavenge
+ cell 0
+ \name:
+.endm