BUG()

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

 



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi there guys,
a new day - a new question :))

I've been trying to figure out today how BUG() works, it is inline assembly,
again:

<from include/asm-i386/bug.h:12>
 12 #if 1   /* Set to zero for a slightly smaller kernel */
 13 #define BUG()                           \
 14  __asm__ __volatile__(  "ud2\n"         \
 15                         "\t.word %c0\n" \
 16                         "\t.long %c1\n" \
 17                          : : "i" (__LINE__), "i" (__FILE__))

I know that ud2 means undefined and generates invalid opcode exception, .word
and .long are as directives, "i" as an input operand constraint is an
immediate integer operand with constant value, but what I can't understand
after looking into the as and gcc manuals is:

1. what does the c mean in the constraint %c0, %c1 resp.?
2. Where does the compiler get those __LINE__ and __FILE__ from?

Thanks in advance for your patience,
Boris.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD4DBQFA5S59iBySr3Fn37QRAkGEAJsHBryqVQ+0JMOss3VbwHCQ6XIIwQCY0w1J
1WsQ29Rtna0rQ7OQyb3AnA==
=vvr7
-----END PGP SIGNATURE-----

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           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