1 #ifndef ARCH_x86_COMMON_H
2 #define ARCH_x86_COMMON_H
10 #if defined(_MSC_VER) && !__INTEL_COMPILER
11 #define FASTCALL_TAG __fastcall
13 #define FASTCALL_TAG __attribute__((fastcall))
42 x86(
const Entry &entry,
const size_t stackSize = 0);
50 static void ValidateStackSize(
const size_t size);
51 static void* AllocStack(
const size_t bytes);
52 static void DeallocStack(
void*
stack);
53 static void CothreadReturned();
54 static void FASTCALL_TAG DereferenceCallInfo(CallInfo *info);
55 static void Prepare(
x86 *thread,
const Entry &entry);
75 static void JumpToEntry();
106 static thread_local std::array<uintptr_t, kMainStackSize> gMainStack;
109 bool ownsStack{
false};
111 void *stackTop{
nullptr};
Architecture specific methods for working with cothreads on x86 systems.
static constexpr const size_t kMainStackSize
static constexpr const size_t kDefaultStackSize
void switchTo(CothreadImpl *from) override
static const size_t kNumSavedRegisters
static constexpr const size_t kStackAlignment
x86(std::span< uintptr_t > stack)
x86(const Entry &entry, const size_t stackSize=0)
Implementation details (including architecture/platform specific code) for the library.
CothreadImpl * AllocKernelThreadWrapper()
Abstract interface for a platform implementation of cothreads.
std::span< uintptr_t > stack
Stack used by this cothread, if any.