From 9f2828f06bd134a2d08d05b86e1d64bbf64f4cbb Mon Sep 17 00:00:00 2001 From: Max Wash Date: Sat, 1 Aug 2020 09:45:25 +0100 Subject: [PATCH] Updated mx_process_kill() call in crt0 --- CMakeLists.txt | 2 +- photon/libc/sys/magenta/machine/x86_64/crt0.s | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7b61fc8..fc5f3fa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -43,7 +43,7 @@ file(GLOB photon_libc_crt ${CMAKE_CURRENT_SOURCE_DIR}/photon/libc/sys/${platform}/machine/${machine}/crt*.s) add_library(crt OBJECT ${photon_libc_crt}) -target_compile_options(crt PRIVATE -c) +target_compile_options(crt PRIVATE -c -ffreestanding -nostdlib) file(GLOB platform_sources ${CMAKE_CURRENT_SOURCE_DIR}/photon/libc/sys/${platform}/*.c diff --git a/photon/libc/sys/magenta/machine/x86_64/crt0.s b/photon/libc/sys/magenta/machine/x86_64/crt0.s index 90e0b6d..375b84c 100644 --- a/photon/libc/sys/magenta/machine/x86_64/crt0.s +++ b/photon/libc/sys/magenta/machine/x86_64/crt0.s @@ -11,7 +11,8 @@ _start: mov %rsp, %rsi andq $-16, %rsp call __crt_init - movq %rax, %rsi - movq $1, %rdi /* MX_EXIT_ALL_THREADS */ - movq $1, %rax /* mx_exit() */ + movq %rax, %rdx + movq $1, %rsi /* MX_EXIT_ALL_THREADS */ + movq $0, %rdi /* MX_NULL_HANDLE */ + movq $23, %rax /* mx_process_kill() */ syscall