fix alignment of registers structure
This commit is contained in:
parent
82cb906dd8
commit
fefae72a53
1 changed files with 3 additions and 6 deletions
|
@ -21,21 +21,18 @@ T align_down(T sp)
|
||||||
// The struct in which we store the saved data. This is mostly the
|
// The struct in which we store the saved data. This is mostly the
|
||||||
// volatile registers and instruction pointer, but it also includes
|
// volatile registers and instruction pointer, but it also includes
|
||||||
// RCX/RDI which are used to pass arguments. The indices for each
|
// RCX/RDI which are used to pass arguments. The indices for each
|
||||||
// register are found in "regs.h":
|
// register are found in "regs.h". Note that the alignment must be
|
||||||
|
// 16 bytes so that SSE instructions can be used.
|
||||||
#include "regs.h"
|
#include "regs.h"
|
||||||
struct registers_t {
|
struct registers_t {
|
||||||
uint64_t data[RUSTRT_MAX];
|
uint64_t data[RUSTRT_MAX];
|
||||||
};
|
} __attribute__((aligned(16)));
|
||||||
|
|
||||||
extern "C" void __morestack(void *args, void *fn_ptr, uintptr_t stack_ptr);
|
extern "C" void __morestack(void *args, void *fn_ptr, uintptr_t stack_ptr);
|
||||||
|
|
||||||
class context {
|
class context {
|
||||||
public:
|
public:
|
||||||
#ifdef __FreeBSD__
|
|
||||||
registers_t regs __attribute__((aligned(16)));
|
|
||||||
#else
|
|
||||||
registers_t regs;
|
registers_t regs;
|
||||||
#endif
|
|
||||||
|
|
||||||
context();
|
context();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue