From a160b2f56716f70fa3e485ae89875da48baefc1d Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Thu, 16 May 2019 15:51:37 +0900 Subject: Make COROUTINE_REGISTERS compile-time only not to be a global symbol --- coroutine/amd64/Context.h | 2 +- coroutine/arm32/Context.h | 2 +- coroutine/arm64/Context.h | 2 +- coroutine/ppc64le/Context.h | 6 ++++-- coroutine/win32/Context.h | 2 +- coroutine/win64/Context.h | 2 +- coroutine/x86/Context.h | 2 +- 7 files changed, 10 insertions(+), 8 deletions(-) (limited to 'coroutine') diff --git a/coroutine/amd64/Context.h b/coroutine/amd64/Context.h index 1801c1e2c5..4ae31d157b 100644 --- a/coroutine/amd64/Context.h +++ b/coroutine/amd64/Context.h @@ -16,7 +16,7 @@ extern "C" { #define COROUTINE __attribute__((noreturn)) void -const size_t COROUTINE_REGISTERS = 6; +enum {COROUTINE_REGISTERS = 6}; typedef struct { diff --git a/coroutine/arm32/Context.h b/coroutine/arm32/Context.h index 60732df7a0..d2bb582be6 100644 --- a/coroutine/arm32/Context.h +++ b/coroutine/arm32/Context.h @@ -16,7 +16,7 @@ extern "C" { #define COROUTINE __attribute__((noreturn)) void -const size_t COROUTINE_REGISTERS = 9; +enum {COROUTINE_REGISTERS = 9}; typedef struct { diff --git a/coroutine/arm64/Context.h b/coroutine/arm64/Context.h index 03b91fd937..ed646e818b 100644 --- a/coroutine/arm64/Context.h +++ b/coroutine/arm64/Context.h @@ -16,7 +16,7 @@ extern "C" { #define COROUTINE __attribute__((noreturn)) void -const size_t COROUTINE_REGISTERS = 0xb0 / 8; +enum {COROUTINE_REGISTERS = 0xb0 / 8}; typedef struct { diff --git a/coroutine/ppc64le/Context.h b/coroutine/ppc64le/Context.h index de592f5a46..5971cd8a9b 100644 --- a/coroutine/ppc64le/Context.h +++ b/coroutine/ppc64le/Context.h @@ -9,9 +9,11 @@ extern "C" { #define COROUTINE __attribute__((noreturn)) void -const size_t COROUTINE_REGISTERS = +enum { + COROUTINE_REGISTERS = 19 /* 18 general purpose registers (r14-r31) and 1 return address */ - + 4; /* space for fiber_entry() to store the link register */ + + 4 /* space for fiber_entry() to store the link register */ +}; typedef struct { diff --git a/coroutine/win32/Context.h b/coroutine/win32/Context.h index aa9f17ddab..779a9a8938 100644 --- a/coroutine/win32/Context.h +++ b/coroutine/win32/Context.h @@ -17,7 +17,7 @@ extern "C" { #define COROUTINE __declspec(noreturn) void __fastcall /* This doesn't include thread information block */ -const size_t COROUTINE_REGISTERS = 4; +enum {COROUTINE_REGISTERS = 4}; typedef struct { diff --git a/coroutine/win64/Context.h b/coroutine/win64/Context.h index 16a8f583ab..1c78dd5b14 100644 --- a/coroutine/win64/Context.h +++ b/coroutine/win64/Context.h @@ -16,7 +16,7 @@ extern "C" { #define COROUTINE __declspec(noreturn) void -const size_t COROUTINE_REGISTERS = 8; +enum {COROUTINE_REGISTERS = 8}; const size_t COROUTINE_XMM_REGISTERS = 1+10*2; typedef struct diff --git a/coroutine/x86/Context.h b/coroutine/x86/Context.h index b077227a1d..b471ecd9fe 100644 --- a/coroutine/x86/Context.h +++ b/coroutine/x86/Context.h @@ -16,7 +16,7 @@ extern "C" { #define COROUTINE __attribute__((noreturn, fastcall)) void -const size_t COROUTINE_REGISTERS = 4; +enum {COROUTINE_REGISTERS = 4}; typedef struct { -- cgit v1.2.3