DEFINE() Macro defined in /linux/kbuild.h

王玮鸿 g.wangweihong at gmail.com
Fri Jul 12 04:30:47 EDT 2013


  Hi,
         There are three macro(DEFINE, BLANK, OFFSET) contained in
/linux/kbuild.h in kernerl version 2.6.32.60.   All of them are inline
assembly statements. I don't know what they means. Could anyone please
explain them to me.
          Also I have written a test module to watch what they will print
or do something, however I failed. I couldn't compile it .
Here is my code, I just steal it from arch/x86/kernel/asm-offsets_32.c:
#define PZ 4096
static int __init test_init(void)
{
        DEFINE(PZ_asm, PZ);
        BLANK();
        OFFSET(INODE, inode, i_hash);
        return 0;
}
And here is message when I compiled it:
/home/kiongf/kernel_module_test/test/test.c: Assembler messages:
/home/kiongf/kernel_module_test/test/test.c:13: Error: junk at end of line,
first unrecognized character is `-'
/home/kiongf/kernel_module_test/test/test.c:14: Error: junk at end of line,
first unrecognized character is `-'
/home/kiongf/kernel_module_test/test/test.c:15: Error: junk at end of line,
first unrecognized character is `-'

Did I do something wrong?

Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20130712/84878f4b/attachment.html 


More information about the Kernelnewbies mailing list