[lkml]   [2000]   [Jul]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    Subjectasm in C slightly OT
    Can someone point be to some documentation on the asm capabilities in
    gcc. In particular I find this in asm/hw_irq.h:

    #define BUILD_COMMON_IRQ() \
    asmlinkage void call_do_IRQ(void); \
    __asm__( \
    "\n" __ALIGN_STR"\n" \
    "common_interrupt:\n\t" \
    SAVE_ALL \
    "pushl $ret_from_intr\n\t" \
    SYMBOL_NAME_STR(call_do_IRQ)":\n\t" \
    "jmp "SYMBOL_NAME_STR(do_IRQ));

    The first line looks like a function proto type. It is unclear how it
    is related to the rest of the macro. This macro generates a bit of code
    that is not a function in any way. It has an entry label
    "common_interrupt" and ends with a jmp. What I really want to know is
    how to refer to a C variable inside of such a construct. The gcc
    documentation talks about how to do it in more standard asm. I would
    like, for example to add to the above macro, for example:

    "incl" where bar is a member of structure foo.

    I know this could be done as: "incl foo+xxx" where xxx is the offset
    of bar in foo, but I would like the compiler to figure this for me so as
    to follow structure changes.


    P.S. I know why this code is the way it is. What I am trying to
    understand is how to add references to C data structures, not to
    understand the what or why of this particular code fragment.

    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to
    Please read the FAQ at

     \ /
      Last update: 2005-03-22 13:57    [W:0.020 / U:14.660 seconds]
    ©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site