diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2012-01-06 07:45:06 -0800 |
|---|---|---|
| committer | Niko Matsakis <niko@alum.mit.edu> | 2012-01-06 07:45:06 -0800 |
| commit | fefae72a53a61c256481328ed29aafb725056f5c (patch) | |
| tree | 386ba19c3f1c2f7dc36f9d43687e97c6601705d8 /src/rt | |
| parent | 82cb906dd89c16d8cfd387ec782d115ce6eaa2a5 (diff) | |
| download | rust-fefae72a53a61c256481328ed29aafb725056f5c.tar.gz rust-fefae72a53a61c256481328ed29aafb725056f5c.zip | |
fix alignment of registers structure
Diffstat (limited to 'src/rt')
| -rw-r--r-- | src/rt/arch/x86_64/context.h | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/rt/arch/x86_64/context.h b/src/rt/arch/x86_64/context.h index 5784a4b85fd..bb35486dbc1 100644 --- a/src/rt/arch/x86_64/context.h +++ b/src/rt/arch/x86_64/context.h @@ -21,21 +21,18 @@ T align_down(T sp) // The struct in which we store the saved data. This is mostly the // volatile registers and instruction pointer, but it also includes // 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" struct registers_t { uint64_t data[RUSTRT_MAX]; -}; +} __attribute__((aligned(16))); extern "C" void __morestack(void *args, void *fn_ptr, uintptr_t stack_ptr); class context { public: -#ifdef __FreeBSD__ - registers_t regs __attribute__((aligned(16))); -#else registers_t regs; -#endif context(); |
