diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2014-03-09 02:04:08 +0100 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2014-03-09 02:04:08 +0100 |
commit | 62ffb9c16e0e0490404f3b0a7c2c7c560fd56ec4 (patch) | |
tree | afc8dd1b6952b00a0570335559cacebbc8b36ebc /sys/src/libmach | |
parent | beb7827425bc2412fc70b3c43a11564d68867d45 (diff) |
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.
Diffstat (limited to 'sys/src/libmach')
-rw-r--r-- | sys/src/libmach/5.c | 6 | ||||
-rw-r--r-- | sys/src/libmach/8.c | 7 | ||||
-rw-r--r-- | sys/src/libmach/k.c | 7 | ||||
-rw-r--r-- | sys/src/libmach/q.c | 6 | ||||
-rw-r--r-- | sys/src/libmach/v.c | 7 |
5 files changed, 23 insertions, 10 deletions
diff --git a/sys/src/libmach/5.c b/sys/src/libmach/5.c index 6e8490ccd..9c3fde25f 100644 --- a/sys/src/libmach/5.c +++ b/sys/src/libmach/5.c @@ -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) diff --git a/sys/src/libmach/8.c b/sys/src/libmach/8.c index 82df2b7d4..21a94ba65 100644 --- a/sys/src/libmach/8.c +++ b/sys/src/libmach/8.c @@ -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) diff --git a/sys/src/libmach/k.c b/sys/src/libmach/k.c index 9993e8046..f881d44e0 100644 --- a/sys/src/libmach/k.c +++ b/sys/src/libmach/k.c @@ -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) diff --git a/sys/src/libmach/q.c b/sys/src/libmach/q.c index db828ecda..32a4ca8a0 100644 --- a/sys/src/libmach/q.c +++ b/sys/src/libmach/q.c @@ -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) diff --git a/sys/src/libmach/v.c b/sys/src/libmach/v.c index f059c2598..a03799aac 100644 --- a/sys/src/libmach/v.c +++ b/sys/src/libmach/v.c @@ -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) |