#include <xtf/types.h>
#include <xtf/asm_macros.h>
+#include <xtf/macro_magic.h>
#ifdef __ASSEMBLY__
*/
#define _ASM_EXTABLE(fault, fixup) \
".pushsection .ex_table, \"a\";\n" \
- _WORD #fault ", " #fixup ", 0;\n" \
+ _WORD STR(fault) ", " STR(fixup) ", 0;\n" \
".popsection;\n"
/**
* @param fixup Fixup address.
* @param handler Handler to call.
*/
-#define _ASM_EXTABLE_HANDLER(fault, fixup, handler) \
- ".pushsection .ex_table, \"a\";\n" \
- _WORD #fault ", " #fixup ", " #handler ";\n" \
+#define _ASM_EXTABLE_HANDLER(fault, fixup, handler) \
+ ".pushsection .ex_table, \"a\";\n" \
+ _WORD STR(fault) ", " STR(fixup) ", " STR(handler) ";\n" \
".popsection;\n"
struct cpu_regs;
#ifndef XTF_MACRO_MAGIC_H
#define XTF_MACRO_MAGIC_H
+/**
+ * Stringise an expression, expanding preprocessor tokens.
+ *
+ * @param x Expression to stringise.
+ */
+/** @cond */
+#define _STR(x) #x
+/** @endcond */
+#define STR(x) _STR(x)
+
/**
* Count the number of varadic arguments provided.
*