aboutsummaryrefslogtreecommitdiffstats
path: root/firmware/custom_ops.S
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2015-06-28 02:10:45 +0200
committerClifford Wolf <clifford@clifford.at>2015-06-28 02:10:45 +0200
commit818faffe25190fdc2f1a4e1c018724289a370fe0 (patch)
treebfdaf461c0626df218238aafb10269d91277319e /firmware/custom_ops.S
parent792baeabcff0de1a3cd8f0c59ea061f81a9458e5 (diff)
downloadpicorv32-818faffe25190fdc2f1a4e1c018724289a370fe0.tar.gz
picorv32-818faffe25190fdc2f1a4e1c018724289a370fe0.zip
Improved IRQ documentation, added assembler macros
Diffstat (limited to 'firmware/custom_ops.S')
-rw-r--r--firmware/custom_ops.S36
1 files changed, 36 insertions, 0 deletions
diff --git a/firmware/custom_ops.S b/firmware/custom_ops.S
new file mode 100644
index 0000000..b5ea7ba
--- /dev/null
+++ b/firmware/custom_ops.S
@@ -0,0 +1,36 @@
+// This is free and unencumbered software released into the public domain.
+//
+// Anyone is free to copy, modify, publish, use, compile, sell, or
+// distribute this software, either in source code form or as a compiled
+// binary, for any purpose, commercial or non-commercial, and by any
+// means.
+
+#define q0 0
+#define q1 1
+#define q2 2
+#define q3 3
+
+.macro getq rd qs
+custom0 \rd,\qs,0,0
+.endm
+
+.macro setq qd rs
+custom0 \qd,\rs,0,1
+.endm
+
+.macro retirq
+custom0 0,0,0,2
+.endm
+
+.macro maskirq rd rs
+custom0 \rd,\rs,0,3
+.endm
+
+.macro waitirq rd
+custom0 \rd,0,0,4
+.endm
+
+.macro timer rd rs
+custom0 \rd,\rs,0,5
+.endm
+