mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-01-08 22:45:43 +00:00
compiler.h: add QEMU_ALIGNED() to enforce struct alignment
Backports commit 911a4d2215b05267b16925503218f49d607c6b29 from qemu
This commit is contained in:
parent
48539e54da
commit
8518f55df7
|
@ -52,7 +52,7 @@ static union MSVC_FLOAT_HACK __NAN = {{0x00, 0x00, 0xC0, 0x7F}};
|
|||
#define QEMU_ARTIFICIAL
|
||||
#define QEMU_PACK( __Declaration__ ) __pragma( pack(push, 1) ) __Declaration__ __pragma( pack(pop) )
|
||||
|
||||
#define QEMU_ALIGN(A, B) __declspec(align(A)) B
|
||||
#define QEMU_ALIGNED(A, B) __declspec(align(A)) B
|
||||
|
||||
#define cat(x,y) x ## y
|
||||
#define cat2(x,y) cat(x,y)
|
||||
|
@ -101,7 +101,7 @@ static union MSVC_FLOAT_HACK __NAN = {{0x00, 0x00, 0xC0, 0x7F}};
|
|||
# define QEMU_PACK( __Declaration__ ) __Declaration__ __attribute__((packed))
|
||||
#endif
|
||||
|
||||
#define QEMU_ALIGN(A, B) B __attribute__((aligned(A)))
|
||||
#define QEMU_ALIGNED(A, B) B __attribute__((aligned(A)))
|
||||
|
||||
#ifndef glue
|
||||
#define xglue(x, y) x ## y
|
||||
|
|
|
@ -803,7 +803,7 @@ typedef struct BNDCSReg {
|
|||
#define MMX_Q(n) _q_MMXReg[n]
|
||||
|
||||
typedef union {
|
||||
floatx80 QEMU_ALIGN(16, d);
|
||||
floatx80 QEMU_ALIGNED(16, d);
|
||||
MMXReg mmx;
|
||||
} FPReg;
|
||||
|
||||
|
|
|
@ -70,8 +70,8 @@ static void patch_reloc(tcg_insn_unit *code_ptr, int type,
|
|||
|
||||
/* The CIE and FDE header definitions will be common to all hosts. */
|
||||
typedef struct {
|
||||
//uint32_t QEMU_ALIGN(sizeof(void *), len);
|
||||
uint32_t QEMU_ALIGN(8, len);
|
||||
//uint32_t QEMU_ALIGNED(sizeof(void *), len);
|
||||
uint32_t QEMU_ALIGNED(8, len);
|
||||
uint32_t id;
|
||||
uint8_t version;
|
||||
char augmentation[1];
|
||||
|
@ -81,8 +81,8 @@ typedef struct {
|
|||
} DebugFrameCIE;
|
||||
|
||||
QEMU_PACK( typedef struct {
|
||||
// uint32_t QEMU_ALIGN(sizeof(void *), len);
|
||||
uint32_t QEMU_ALIGN(8, len);
|
||||
// uint32_t QEMU_ALIGNED(sizeof(void *), len);
|
||||
uint32_t QEMU_ALIGNED(8, len);
|
||||
uint32_t cie_offset;
|
||||
uintptr_t func_start;
|
||||
uintptr_t func_len;
|
||||
|
|
|
@ -214,7 +214,7 @@ typedef struct TCGLabel {
|
|||
typedef struct TCGPool {
|
||||
struct TCGPool *next;
|
||||
int size;
|
||||
uint8_t QEMU_ALIGN(8, data[0]);
|
||||
uint8_t QEMU_ALIGNED(8, data[0]);
|
||||
} TCGPool;
|
||||
|
||||
#define TCG_POOL_CHUNK_SIZE 32768
|
||||
|
|
|
@ -544,7 +544,7 @@ static inline void *split_cross_256mb(struct uc_struct *uc, void *buf1, size_t s
|
|||
#endif
|
||||
|
||||
#ifdef USE_STATIC_CODE_GEN_BUFFER
|
||||
static uint8_t QEMU_ALIGN(CODE_GEN_ALIGN, static_code_gen_buffer[DEFAULT_CODE_GEN_BUFFER_SIZE]);
|
||||
static uint8_t QEMU_ALIGNED(CODE_GEN_ALIGN, static_code_gen_buffer[DEFAULT_CODE_GEN_BUFFER_SIZE]);
|
||||
|
||||
void free_code_gen_buffer(struct uc_struct *uc)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue