From 57618ff11dd6e4539ef46f36599db48a40cbb181 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Wed, 21 Nov 2012 13:47:59 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@4835 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/ports/GCC/PPC/chcore.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'os/ports/GCC/PPC/chcore.h') 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 @@ -344,6 +344,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. -- cgit v1.2.3