Re: odd definition of function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dnia 07-08-2010 o 21:32:49 Parmenides <mobile.parmenides@xxxxxxxxx> napisał(a):

asmlinage void IRQ3;
asm(...);
yes, we get it exactly. But, asm(...) is just a statement and in my
opinion, it should belong to some function body. While the first line
merely declare a function without definition owing to the semicolon
behind IRQ3.


GCC allow to declare asms outside functions. In this case asm statement (which is _outside_ any function) is preceded by function declaration. Later in the asm macro places a label having the same name as the function declared above. This is function definition. Actually AFAIK from the linker point of view functions are just labels placed somewhere in the code.

I'm just a noob so I'm probably wrong here, but using BUILD_IRQ(0x01) should produce something like:

asmlinkage void IRQ0x01_interrupt(void);

__asm__(
"\n"__ALIGN_STR"\n" <- some alignment will replace this
        "IRQ0x01_interrupt:\n\t" <- label == function
        "pushl $"0x01"-256\n\t"
        "jmp common_interrupt");

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux