aboutsummaryrefslogtreecommitdiffstats
path: root/os/ports/GCC/PPC/chcore.h
diff options
context:
space:
mode:
Diffstat (limited to 'os/ports/GCC/PPC/chcore.h')
-rw-r--r--os/ports/GCC/PPC/chcore.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/os/ports/GCC/PPC/chcore.h b/os/ports/GCC/PPC/chcore.h
index 0a4476ea4..4fd1cd300 100644
--- a/os/ports/GCC/PPC/chcore.h
+++ b/os/ports/GCC/PPC/chcore.h
@@ -345,6 +345,15 @@ struct context {
#define port_enable() asm volatile ("wrteei 1" : : : "memory")
/**
+ * @brief Writes to a special register.
+ *
+ * @param[in] spr special register number
+ * @param[in] val value to be written
+ */
+#define port_mtspr(spr, val) \
+ asm volatile ("mtspr %0,%1" : : "n" (spr), "r" (val))
+
+/**
* @details This port function is implemented as inlined code for performance
* reasons.
*/