libmach: pragma pack 32bit Ureg structs for amd64
when libmach is compiled with 6c, unions in the 32bit Uregs cause fields to be wronly aligned. use #pragma pack arround the #include "/$objtype/include/ureg.h" statement.
This commit is contained in:
parent
beb7827425
commit
62ffb9c16e
5 changed files with 23 additions and 10 deletions
|
@ -4,11 +4,13 @@
|
|||
#include <u.h>
|
||||
#include <libc.h>
|
||||
#include <bio.h>
|
||||
#include "/arm/include/ureg.h"
|
||||
#include <mach.h>
|
||||
|
||||
#pragma pack on
|
||||
#include "/arm/include/ureg.h"
|
||||
#pragma pack off
|
||||
|
||||
#define REGOFF(x) (ulong) (&((struct Ureg *) 0)->x)
|
||||
#define REGOFF(x) (uintptr)(&((struct Ureg *) 0)->x)
|
||||
|
||||
#define SP REGOFF(r13)
|
||||
#define PC REGOFF(pc)
|
||||
|
|
|
@ -4,10 +4,13 @@
|
|||
#include <u.h>
|
||||
#include <libc.h>
|
||||
#include <bio.h>
|
||||
#include "/386/include/ureg.h"
|
||||
#include <mach.h>
|
||||
|
||||
#define REGOFF(x) (ulong)(&((struct Ureg *) 0)->x)
|
||||
#pragma pack on
|
||||
#include "/386/include/ureg.h"
|
||||
#pragma pack off
|
||||
|
||||
#define REGOFF(x) (uintptr)(&((struct Ureg *) 0)->x)
|
||||
|
||||
#define PC REGOFF(pc)
|
||||
#define SP REGOFF(sp)
|
||||
|
|
|
@ -4,10 +4,13 @@
|
|||
#include <u.h>
|
||||
#include <libc.h>
|
||||
#include <bio.h>
|
||||
#include "/sparc/include/ureg.h"
|
||||
#include <mach.h>
|
||||
|
||||
#define REGOFF(x) (ulong)(&((struct Ureg *) 0)->x)
|
||||
#pragma pack on
|
||||
#include "/sparc/include/ureg.h"
|
||||
#pragma pack off
|
||||
|
||||
#define REGOFF(x) (uintptr)(&((struct Ureg *) 0)->x)
|
||||
|
||||
#define R1 REGOFF(r1)
|
||||
#define R7 REGOFF(r7)
|
||||
|
|
|
@ -5,11 +5,13 @@
|
|||
#include <u.h>
|
||||
#include <libc.h>
|
||||
#include <bio.h>
|
||||
#include "/power/include/ureg.h"
|
||||
#include <mach.h>
|
||||
|
||||
#pragma pack on
|
||||
#include "/power/include/ureg.h"
|
||||
#pragma pack off
|
||||
|
||||
#define REGOFF(x) (ulong) (&((struct Ureg *) 0)->x)
|
||||
#define REGOFF(x) (uintptr) (&((struct Ureg *) 0)->x)
|
||||
|
||||
#define SP REGOFF(sp)
|
||||
#define PC REGOFF(pc)
|
||||
|
|
|
@ -4,10 +4,13 @@
|
|||
#include <u.h>
|
||||
#include <libc.h>
|
||||
#include <bio.h>
|
||||
#include "/mips/include/ureg.h"
|
||||
#include <mach.h>
|
||||
|
||||
#define REGOFF(x) (ulong)(&((struct Ureg *) 0)->x)
|
||||
#pragma pack on
|
||||
#include "/mips/include/ureg.h"
|
||||
#pragma pack off
|
||||
|
||||
#define REGOFF(x) (uintptr)(&((struct Ureg *) 0)->x)
|
||||
|
||||
#define SP REGOFF(sp)
|
||||
#define PC REGOFF(pc)
|
||||
|
|
Loading…
Reference in a new issue