Skip to content

Commit

Permalink
CogVM source as per VMMaker.oscog-eem.3475
Browse files Browse the repository at this point in the history
Extend VMCallbackContext with the relevant support for the
two register value struct return convention in the x86_64 Sys V ABI.
  • Loading branch information
eliotmiranda committed Dec 4, 2024
1 parent c440057 commit 9d41521
Show file tree
Hide file tree
Showing 12 changed files with 204 additions and 96 deletions.
25 changes: 17 additions & 8 deletions src/spur32.cog.lowcode/vmCallback.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* Automatically generated by
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3150 uuid: 832f44e4-6d22-4545-ae94-d8453b49d54f
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3475 uuid: 8b989602-3968-4b65-a727-59288aa8ebcf
(Compiler-eem.512)
*/

#define VM_CALLBACK_INC 1
Expand All @@ -12,21 +13,29 @@ typedef struct _VMCallbackContext {
void *savedCStackPointer;
void *savedCFramePointer;
union {
sqIntptr_t valword;
struct { int low, high; } valleint64;
struct { int high, low; } valbeint64;
double valflt64;
struct { void *addr; sqIntptr_t size; } valstruct;
}rvs;
sqIntptr_t valword;
struct { int low, high; } valleint64;
struct { int high, low; } valbeint64;
double valflt64;
struct { void *addr; sqIntptr_t size; } valstruct;
struct { sqIntptr_t a; sqIntptr_t b; } valstructll; // x86_64 Sys V ABI value struct register return types
struct { sqIntptr_t a; double b; } valstructld;
struct { double a; sqIntptr_t b; } valstructdl;
struct { double a; double b; } valstructdd;
}rvs;
void *savedMostRecentCallbackContext;
jmp_buf trampoline;
jmp_buf savedReenterInterpreter;
} VMCallbackContext;

/* The callback return type codes */
// The callback return type codes
#define retword 1
#define retword64 2
#define retdouble 3
#define retstruct 4
#define retstructll 5
#define retstructld 6
#define retstructdl 7
#define retstructdd 8


25 changes: 17 additions & 8 deletions src/spur32.cog/vmCallback.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* Automatically generated by
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3150 uuid: 832f44e4-6d22-4545-ae94-d8453b49d54f
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3475 uuid: 8b989602-3968-4b65-a727-59288aa8ebcf
(Compiler-eem.512)
*/

#define VM_CALLBACK_INC 1
Expand All @@ -12,21 +13,29 @@ typedef struct _VMCallbackContext {
void *savedCStackPointer;
void *savedCFramePointer;
union {
sqIntptr_t valword;
struct { int low, high; } valleint64;
struct { int high, low; } valbeint64;
double valflt64;
struct { void *addr; sqIntptr_t size; } valstruct;
}rvs;
sqIntptr_t valword;
struct { int low, high; } valleint64;
struct { int high, low; } valbeint64;
double valflt64;
struct { void *addr; sqIntptr_t size; } valstruct;
struct { sqIntptr_t a; sqIntptr_t b; } valstructll; // x86_64 Sys V ABI value struct register return types
struct { sqIntptr_t a; double b; } valstructld;
struct { double a; sqIntptr_t b; } valstructdl;
struct { double a; double b; } valstructdd;
}rvs;
void *savedMostRecentCallbackContext;
jmp_buf trampoline;
jmp_buf savedReenterInterpreter;
} VMCallbackContext;

/* The callback return type codes */
// The callback return type codes
#define retword 1
#define retword64 2
#define retdouble 3
#define retstruct 4
#define retstructll 5
#define retstructld 6
#define retstructdl 7
#define retstructdd 8


25 changes: 17 additions & 8 deletions src/spur32.sista/vmCallback.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* Automatically generated by
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3150 uuid: 832f44e4-6d22-4545-ae94-d8453b49d54f
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3475 uuid: 8b989602-3968-4b65-a727-59288aa8ebcf
(Compiler-eem.512)
*/

#define VM_CALLBACK_INC 1
Expand All @@ -12,21 +13,29 @@ typedef struct _VMCallbackContext {
void *savedCStackPointer;
void *savedCFramePointer;
union {
sqIntptr_t valword;
struct { int low, high; } valleint64;
struct { int high, low; } valbeint64;
double valflt64;
struct { void *addr; sqIntptr_t size; } valstruct;
}rvs;
sqIntptr_t valword;
struct { int low, high; } valleint64;
struct { int high, low; } valbeint64;
double valflt64;
struct { void *addr; sqIntptr_t size; } valstruct;
struct { sqIntptr_t a; sqIntptr_t b; } valstructll; // x86_64 Sys V ABI value struct register return types
struct { sqIntptr_t a; double b; } valstructld;
struct { double a; sqIntptr_t b; } valstructdl;
struct { double a; double b; } valstructdd;
}rvs;
void *savedMostRecentCallbackContext;
jmp_buf trampoline;
jmp_buf savedReenterInterpreter;
} VMCallbackContext;

/* The callback return type codes */
// The callback return type codes
#define retword 1
#define retword64 2
#define retdouble 3
#define retstruct 4
#define retstructll 5
#define retstructld 6
#define retstructdl 7
#define retstructdd 8


25 changes: 17 additions & 8 deletions src/spur32.stack.lowcode/vmCallback.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* Automatically generated by
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3150 uuid: 832f44e4-6d22-4545-ae94-d8453b49d54f
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3475 uuid: 8b989602-3968-4b65-a727-59288aa8ebcf
(Compiler-eem.512)
*/

#define VM_CALLBACK_INC 1
Expand All @@ -12,21 +13,29 @@ typedef struct _VMCallbackContext {
void *savedCStackPointer;
void *savedCFramePointer;
union {
sqIntptr_t valword;
struct { int low, high; } valleint64;
struct { int high, low; } valbeint64;
double valflt64;
struct { void *addr; sqIntptr_t size; } valstruct;
}rvs;
sqIntptr_t valword;
struct { int low, high; } valleint64;
struct { int high, low; } valbeint64;
double valflt64;
struct { void *addr; sqIntptr_t size; } valstruct;
struct { sqIntptr_t a; sqIntptr_t b; } valstructll; // x86_64 Sys V ABI value struct register return types
struct { sqIntptr_t a; double b; } valstructld;
struct { double a; sqIntptr_t b; } valstructdl;
struct { double a; double b; } valstructdd;
}rvs;
void *savedMostRecentCallbackContext;
jmp_buf trampoline;
jmp_buf savedReenterInterpreter;
} VMCallbackContext;

/* The callback return type codes */
// The callback return type codes
#define retword 1
#define retword64 2
#define retdouble 3
#define retstruct 4
#define retstructll 5
#define retstructld 6
#define retstructdl 7
#define retstructdd 8


25 changes: 17 additions & 8 deletions src/spur32.stack/vmCallback.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* Automatically generated by
CCodeGeneratorGlobalStructure VMMaker.oscog-mt.3362 uuid: b8f74e14-6430-924d-93fb-2fc1cd50ba34
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3475 uuid: 8b989602-3968-4b65-a727-59288aa8ebcf
(Compiler-eem.512)
*/

#define VM_CALLBACK_INC 1
Expand All @@ -12,21 +13,29 @@ typedef struct _VMCallbackContext {
void *savedCStackPointer;
void *savedCFramePointer;
union {
sqIntptr_t valword;
struct { int low, high; } valleint64;
struct { int high, low; } valbeint64;
double valflt64;
struct { void *addr; sqIntptr_t size; } valstruct;
}rvs;
sqIntptr_t valword;
struct { int low, high; } valleint64;
struct { int high, low; } valbeint64;
double valflt64;
struct { void *addr; sqIntptr_t size; } valstruct;
struct { sqIntptr_t a; sqIntptr_t b; } valstructll; // x86_64 Sys V ABI value struct register return types
struct { sqIntptr_t a; double b; } valstructld;
struct { double a; sqIntptr_t b; } valstructdl;
struct { double a; double b; } valstructdd;
}rvs;
void *savedMostRecentCallbackContext;
jmp_buf trampoline;
jmp_buf savedReenterInterpreter;
} VMCallbackContext;

/* The callback return type codes */
// The callback return type codes
#define retword 1
#define retword64 2
#define retdouble 3
#define retstruct 4
#define retstructll 5
#define retstructld 6
#define retstructdl 7
#define retstructdd 8


25 changes: 17 additions & 8 deletions src/spur64.cog.lowcode/vmCallback.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* Automatically generated by
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3150 uuid: 832f44e4-6d22-4545-ae94-d8453b49d54f
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3475 uuid: 8b989602-3968-4b65-a727-59288aa8ebcf
(Compiler-eem.512)
*/

#define VM_CALLBACK_INC 1
Expand All @@ -12,21 +13,29 @@ typedef struct _VMCallbackContext {
void *savedCStackPointer;
void *savedCFramePointer;
union {
sqIntptr_t valword;
struct { int low, high; } valleint64;
struct { int high, low; } valbeint64;
double valflt64;
struct { void *addr; sqIntptr_t size; } valstruct;
}rvs;
sqIntptr_t valword;
struct { int low, high; } valleint64;
struct { int high, low; } valbeint64;
double valflt64;
struct { void *addr; sqIntptr_t size; } valstruct;
struct { sqIntptr_t a; sqIntptr_t b; } valstructll; // x86_64 Sys V ABI value struct register return types
struct { sqIntptr_t a; double b; } valstructld;
struct { double a; sqIntptr_t b; } valstructdl;
struct { double a; double b; } valstructdd;
}rvs;
void *savedMostRecentCallbackContext;
jmp_buf trampoline;
jmp_buf savedReenterInterpreter;
} VMCallbackContext;

/* The callback return type codes */
// The callback return type codes
#define retword 1
#define retword64 2
#define retdouble 3
#define retstruct 4
#define retstructll 5
#define retstructld 6
#define retstructdl 7
#define retstructdd 8


25 changes: 17 additions & 8 deletions src/spur64.cog/vmCallback.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* Automatically generated by
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3150 uuid: 832f44e4-6d22-4545-ae94-d8453b49d54f
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3475 uuid: 8b989602-3968-4b65-a727-59288aa8ebcf
(Compiler-eem.512)
*/

#define VM_CALLBACK_INC 1
Expand All @@ -12,21 +13,29 @@ typedef struct _VMCallbackContext {
void *savedCStackPointer;
void *savedCFramePointer;
union {
sqIntptr_t valword;
struct { int low, high; } valleint64;
struct { int high, low; } valbeint64;
double valflt64;
struct { void *addr; sqIntptr_t size; } valstruct;
}rvs;
sqIntptr_t valword;
struct { int low, high; } valleint64;
struct { int high, low; } valbeint64;
double valflt64;
struct { void *addr; sqIntptr_t size; } valstruct;
struct { sqIntptr_t a; sqIntptr_t b; } valstructll; // x86_64 Sys V ABI value struct register return types
struct { sqIntptr_t a; double b; } valstructld;
struct { double a; sqIntptr_t b; } valstructdl;
struct { double a; double b; } valstructdd;
}rvs;
void *savedMostRecentCallbackContext;
jmp_buf trampoline;
jmp_buf savedReenterInterpreter;
} VMCallbackContext;

/* The callback return type codes */
// The callback return type codes
#define retword 1
#define retword64 2
#define retdouble 3
#define retstruct 4
#define retstructll 5
#define retstructld 6
#define retstructdl 7
#define retstructdd 8


25 changes: 17 additions & 8 deletions src/spur64.sista/vmCallback.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* Automatically generated by
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3150 uuid: 832f44e4-6d22-4545-ae94-d8453b49d54f
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3475 uuid: 8b989602-3968-4b65-a727-59288aa8ebcf
(Compiler-eem.512)
*/

#define VM_CALLBACK_INC 1
Expand All @@ -12,21 +13,29 @@ typedef struct _VMCallbackContext {
void *savedCStackPointer;
void *savedCFramePointer;
union {
sqIntptr_t valword;
struct { int low, high; } valleint64;
struct { int high, low; } valbeint64;
double valflt64;
struct { void *addr; sqIntptr_t size; } valstruct;
}rvs;
sqIntptr_t valword;
struct { int low, high; } valleint64;
struct { int high, low; } valbeint64;
double valflt64;
struct { void *addr; sqIntptr_t size; } valstruct;
struct { sqIntptr_t a; sqIntptr_t b; } valstructll; // x86_64 Sys V ABI value struct register return types
struct { sqIntptr_t a; double b; } valstructld;
struct { double a; sqIntptr_t b; } valstructdl;
struct { double a; double b; } valstructdd;
}rvs;
void *savedMostRecentCallbackContext;
jmp_buf trampoline;
jmp_buf savedReenterInterpreter;
} VMCallbackContext;

/* The callback return type codes */
// The callback return type codes
#define retword 1
#define retword64 2
#define retdouble 3
#define retstruct 4
#define retstructll 5
#define retstructld 6
#define retstructdl 7
#define retstructdd 8


Loading

0 comments on commit 9d41521

Please sign in to comment.