Make COROUTINE_REGISTERS compile-time only not to be a global symbol

This commit is contained in:
Nobuyoshi Nakada 2019-05-16 15:51:37 +09:00
parent 7069f64c41
commit a160b2f567
No known key found for this signature in database
GPG Key ID: 4BC7D6DF58D8DF60
7 changed files with 10 additions and 8 deletions

View File

@ -16,7 +16,7 @@ extern "C" {
#define COROUTINE __attribute__((noreturn)) void #define COROUTINE __attribute__((noreturn)) void
const size_t COROUTINE_REGISTERS = 6; enum {COROUTINE_REGISTERS = 6};
typedef struct typedef struct
{ {

View File

@ -16,7 +16,7 @@ extern "C" {
#define COROUTINE __attribute__((noreturn)) void #define COROUTINE __attribute__((noreturn)) void
const size_t COROUTINE_REGISTERS = 9; enum {COROUTINE_REGISTERS = 9};
typedef struct typedef struct
{ {

View File

@ -16,7 +16,7 @@ extern "C" {
#define COROUTINE __attribute__((noreturn)) void #define COROUTINE __attribute__((noreturn)) void
const size_t COROUTINE_REGISTERS = 0xb0 / 8; enum {COROUTINE_REGISTERS = 0xb0 / 8};
typedef struct typedef struct
{ {

View File

@ -9,9 +9,11 @@ extern "C" {
#define COROUTINE __attribute__((noreturn)) void #define COROUTINE __attribute__((noreturn)) void
const size_t COROUTINE_REGISTERS = enum {
COROUTINE_REGISTERS =
19 /* 18 general purpose registers (r14-r31) and 1 return address */ 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 typedef struct
{ {

View File

@ -17,7 +17,7 @@ extern "C" {
#define COROUTINE __declspec(noreturn) void __fastcall #define COROUTINE __declspec(noreturn) void __fastcall
/* This doesn't include thread information block */ /* This doesn't include thread information block */
const size_t COROUTINE_REGISTERS = 4; enum {COROUTINE_REGISTERS = 4};
typedef struct typedef struct
{ {

View File

@ -16,7 +16,7 @@ extern "C" {
#define COROUTINE __declspec(noreturn) void #define COROUTINE __declspec(noreturn) void
const size_t COROUTINE_REGISTERS = 8; enum {COROUTINE_REGISTERS = 8};
const size_t COROUTINE_XMM_REGISTERS = 1+10*2; const size_t COROUTINE_XMM_REGISTERS = 1+10*2;
typedef struct typedef struct

View File

@ -16,7 +16,7 @@ extern "C" {
#define COROUTINE __attribute__((noreturn, fastcall)) void #define COROUTINE __attribute__((noreturn, fastcall)) void
const size_t COROUTINE_REGISTERS = 4; enum {COROUTINE_REGISTERS = 4};
typedef struct typedef struct
{ {