From mboxrd@z Thu Jan 1 00:00:00 1970 From: erik quanstrom Date: Fri, 9 May 2014 10:21:50 -0400 To: 9fans@9fans.net Message-ID: <51d4d8ec419f841a99baf30ede300c25@brasstown.quanstro.net> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: [9fans] ureg alignment Topicbox-Message-UUID: e4c1fb90-ead8-11e9-9d60-3106f5b1d025 on 64-bit machines, the unions in the ureg.h can lead to internal padding. (power64 avoids this issue because everything is 64-bit aligned anyway.) to sidestep the issue, i think it might make sense to use #defines. for example, for arm the conversion would look something like this: typedef struct Ureg { ulong r0; ulong r1; ulong r2; ulong r3; ulong r4; ulong r5; ulong r6; ulong r7; ulong r8; ulong r9; ulong r10; ulong r11; ulong r12; /* sb */ ulong r13; #define sp r13 ulong r14; #define link r14 ulong type; /* of exception */ ulong psr; ulong pc; /* interrupted addr */ } Ureg; is there any reason not to do this? - erik