Provide a macro to emit exception table entries that can be used in asm() statements. Signed-off-by: Mathias Krause --- lib/x86/desc.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/x86/desc.h b/lib/x86/desc.h index 68f38f3d7533..21e0ae8dd028 100644 --- a/lib/x86/desc.h +++ b/lib/x86/desc.h @@ -150,11 +150,14 @@ typedef struct __attribute__((packed)) { u16 iomap_base; } tss64_t; +#define ASM_EX_ENTRY(src, dst) \ + ".pushsection .data.ex\n\t" \ + __ASM_SEL(.long, .quad) src ", " dst "\n\t" \ + ".popsection \n\t" + #define __ASM_TRY(prefix, catch) \ "movl $0, %%gs:4\n\t" \ - ".pushsection .data.ex\n\t" \ - __ASM_SEL(.long, .quad) " 1111f, " catch "\n\t" \ - ".popsection \n\t" \ + ASM_EX_ENTRY("1111f", catch) \ prefix "\n\t" \ "1111:" -- 2.30.2