[Bug 1607] __RTEMS_SIZEOF_VOID_P__ flawed design

bugzilla-daemon at rtems.org bugzilla-daemon at rtems.org
Fri Jul 16 15:33:55 UTC 2010


https://www.rtems.org/bugzilla/show_bug.cgi?id=1607

--- Comment #19 from Gedare <giddyup44 at yahoo.com> 2010-07-16 10:33:54 CDT ---
(In reply to comment #18)
> Created an attachment (id=889)
 --> (https://www.rtems.org/bugzilla/attachment.cgi?id=889) [details]
> Test Program for Structure offsets in inline asm
> 
> The attachment is a test program to see what's required to convert the
> ISR code to a .c with assistance from the compiler for offsets.  So far,
> even on x86, I can't get the offset into the assembly so it can be used
> to write a OFF(REG) expression.  If we can't demonstrate this test program
> on all architectures, then this is not an alternative.
> 
> Help with prove of technique requested

I find it easier to write inline assembly in separate statements, although it
should be doable by combining lines, this code snippet works for me:
int f()
{
__asm__ __volatile__("my_start:");
__asm__ __volatile__("movl %0, %%eax" : : "m" (S.c) : "%eax" );
__asm__ __volatile__("movl $S, %%eax\n");
__asm__ __volatile__("movl %0(%%eax), %%eax\n"
    :
    : "i" (__builtin_offsetof(X_t,c)) );
}

-- 
Configure bugmail: https://www.rtems.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.



More information about the bugs mailing list