From 70aa82c37cc56c9c39ab231b7d9badaced6a51b3 Mon Sep 17 00:00:00 2001 From: tqcq <99722391+tqcq@users.noreply.github.com> Date: Tue, 11 Jun 2024 23:34:48 +0800 Subject: [PATCH] feat update aarch64 asm --- CMakeLists.txt | 4 +++- tile/fiber/detail/asm/ucontext_aarch64.S | 3 ++- tile/fiber/detail/fiber.cc | 3 ++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 688cd54..fff12c3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,7 +27,9 @@ endif() if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") # set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static") set(CMAKE_C_FLAGS - # "${CMAKE_CXX_FLAGS} -static") + # "${CMAKE_CXX_FLAGS} -static") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} + # -fsanitize=address ") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address + # ") set(WHOLE_ARCHIVE_PREFIX "-Wl,-force_load") # set(NO_WHOLE_ARCHIVE_PREFIX "") diff --git a/tile/fiber/detail/asm/ucontext_aarch64.S b/tile/fiber/detail/asm/ucontext_aarch64.S index bff94d3..8c682e7 100644 --- a/tile/fiber/detail/asm/ucontext_aarch64.S +++ b/tile/fiber/detail/asm/ucontext_aarch64.S @@ -50,7 +50,8 @@ // x1: to .text .global TILE_ASM_SYMBOL(tile_ucontext_swap) -.balign 16 +// .balign 16 +.align 8 TILE_ASM_SYMBOL(tile_ucontext_swap): // Save context 'from' diff --git a/tile/fiber/detail/fiber.cc b/tile/fiber/detail/fiber.cc index 64a7908..c633fd1 100644 --- a/tile/fiber/detail/fiber.cc +++ b/tile/fiber/detail/fiber.cc @@ -44,7 +44,8 @@ std::unique_ptr Fiber::Create(std::function proc) noexcept { Fiber::Fiber(std::function proc) : ctx_(object_pool::Get().Leak()), proc_(std::move(proc)) { - memset(&ctx_->uctx, 0, sizeof(tile_ucontext_t)); + // memset(&ctx_->uctx, 0, sizeof(tile_ucontext_t)); + // memset(&ctx_->stack, 0, kStackSize); if (proc_) { tile_ucontext_set_target(&ctx_->uctx, &ctx_->stack, kStackSize, RunProc, &proc_);