Re: header files hierarchy

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

 



Hi,

Le Sun, 16 Sep 2007 08:26:03 -0700 (PDT),
Pawel K <pawlaczus@xxxxxxxxx> a écrit :

> 1. include/linux/linkage.h:64
> 2. include/asm-i386/linkage.h:6
> 
> Which is the proper file containing the macro?
> What is the quickest way to know it ?

The file include/linux/linkage.h starts by including
include/asm/linkage.h. As asm is a symlink to asm-$(ARCH), if your arch
is i386, it includes include/asm-i386/linkage.h. This file defines the
fastcall macro, and the FASTCALL macro as well.

Then later, the include/linux/linkage.h does:

#ifndef FASTCALL
#define FASTCALL(x)     x
#define fastcall
#endif

So it defines FASTCALL and fastcall to nothing only if it hasn't
already been defined. To sum up, FASTCALL and fastcall expand to
nothing on all arches, except on i386 where they expand to what's
defined in include/asm-i386/linkage.h.

This sort of macro trickery is very usual: a generic include file
defines a default value, but allows it to be overriden by an
architecture-specific include file.

Sincerly,

Thomas
-- 
PETAZZONI Thomas - thomas.petazzoni@xxxxxxxx 
http://{thomas,sos,kos}.enix.org - Jabber: thomas.petazzoni@xxxxxxxxx
http://{agenda,livret}dulibre.org - http://www.toulibre.org
Fingerprint : 0BE1 4CF3 CEA4 AC9D CC6E  1624 F653 CB30 98D3 F7A7

Attachment: signature.asc
Description: PGP signature


[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