mirror of
https://github.com/clearlinux/graphene.git
synced 2026-10-03 23:48:19 +00:00
[LibOS] Move inline assembly to macro in shim_internal-arch.h
This commit is contained in:
committed by
Michał Kowalczyk
parent
5181b073b2
commit
2540c63d21
@@ -26,4 +26,14 @@ static_always_inline void* current_stack(void) {
|
||||
return _rsp;
|
||||
}
|
||||
|
||||
#define CALL_ELF_ENTRY(ENTRY, ARGCP) \
|
||||
__asm__ volatile( \
|
||||
"pushq $0\r\n" \
|
||||
"popfq\r\n" \
|
||||
"movq %%rbx, %%rsp\r\n" \
|
||||
"jmp *%%rax\r\n" \
|
||||
: \
|
||||
: "a"(ENTRY), "b"(ARGCP), "d"(0) \
|
||||
: "memory", "cc")
|
||||
|
||||
#endif /* _SHIM_INTERNAL_ARCH_H_ */
|
||||
|
||||
@@ -1592,18 +1592,8 @@ noreturn void execute_elf_object(struct shim_handle* exec, int* argcp, const cha
|
||||
shim_tcb_t* tcb = shim_get_tcb();
|
||||
__enable_preempt(tcb);
|
||||
|
||||
#if defined(__x86_64__)
|
||||
__asm__ volatile(
|
||||
"pushq $0\r\n"
|
||||
"popfq\r\n"
|
||||
"movq %%rbx, %%rsp\r\n"
|
||||
"jmp *%%rax\r\n"
|
||||
:
|
||||
: "a"(entry), "b"(argcp), "d"(0)
|
||||
: "memory", "cc");
|
||||
#else
|
||||
#error "architecture not supported"
|
||||
#endif
|
||||
CALL_ELF_ENTRY(entry, argcp);
|
||||
|
||||
while (true)
|
||||
/* nothing */;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user