push $main_err_msg
#endif
call panic
-SIZE(_start)
+ENDFUNC(_start)
.section .rodata.str1, "aMS", @progbits, 1
push $main_err_msg
#endif
call panic
-SIZE(_start)
+ENDFUNC(_start)
.section .rodata.str1, "aMS", @progbits, 1
push $\vec
jmp handle_exception
+
+ENDFUNC(entry_\sym)
.endm
exception_entry DE X86_EXC_DE
add $8, %esp /* Pop error_code/entry_vector. */
env_IRET
+ENDFUNC(handle_exception)
ENTRY(entry_ret_to_kernel) /* int $0x20 (return to kernel) */
mov 3*4(%esp), %esp /* Load %esp from iret frame */
jmp *%eax /* Jump back */
+ENDFUNC(entry_ret_to_kernel)
ENTRY(exec_user) /* void (*fn)(void) */
int $0x20 /* Return to kernel privilege. */
ret
+ENDFUNC(exec_user)
+
/*
* Local variables:
* tab-width: 8
movl $\vec, 4(%rsp)
jmp handle_exception
+
+ENDFUNC(entry_\sym)
.endm
exception_entry DE X86_EXC_DE
add $8, %rsp /* Pop error_code/entry_vector. */
env_IRETQ
+ENDFUNC(handle_exception)
ENTRY(entry_ret_to_kernel) /* int $0x20 (return to kernel) */
mov 3*8(%rsp), %rsp /* Load %esp from iret frame */
jmp *%rax /* Jump back */
+ENDFUNC(entry_ret_to_kernel)
ENTRY(exec_user) /* void (*fn)(void) */
int $0x20 /* Return to kernel privilege. */
ret
+ENDFUNC(exec_user)
+
/*
* Local variables:
* tab-width: 8
#define SIZE(name) \
.size name, . - name;
+/**
+ * Set the type of @p name to function, and set its size.
+ * @param name Symbol name.
+ */
+#define ENDFUNC(name) \
+ .type name, STT_FUNC; \
+ SIZE(name)
+
/**
* Create an ELF note entry.
*
/* Fixup from fault label to trap label. */
_ASM_EXTABLE(label_\insn\()_\type\()_fault,
label_\insn\()_\type\()_trap)
+
+ENDFUNC(stub_\insn\()_\type)
.endm
/* For a single instruction, generate each test variant. */