10 Aug, 2010

1 commit


30 Jun, 2010

1 commit

  • A __naked function is defined in C but with a body completely implemented
    by asm(), including any prologue and epilogue. These asm() bodies expect
    standard calling conventions for parameter passing. Older GCCs implement
    that correctly, but 4.[56] currently do not, see GCC PR44290. In the
    Linux kernel this breaks ARM, causing most arch/arm/mm/copypage-*.c
    modules to get miscompiled, resulting in kernel crashes during bootup.

    Part of the kernel fix is to augment the __naked function attribute to
    also imply noinline and noclone. This patch implements that, and has been
    verified to fix boot failures with gcc-4.5 compiled 2.6.34 and 2.6.35-rc1
    kernels. The patch is a no-op with older GCCs.

    Signed-off-by: Mikael Pettersson
    Signed-off-by: Khem Raj
    Cc: Russell King
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mikael Pettersson
     

02 Nov, 2009

1 commit

  • I wrote some code which is used as compile-time checker, and the
    code should be elided after compile.

    So I need to annotate the code as "always unused", compared to
    "maybe unused".

    Signed-off-by: Li Zefan
    Cc: Steven Rostedt
    Cc: Frederic Weisbecker
    Cc: Linus Torvalds
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Li Zefan
     

13 Mar, 2009

1 commit

  • This is a fix for the following crash observed in 2.6.29-rc3:
    http://lkml.org/lkml/2009/1/29/150

    On ARM it doesn't make sense to trace a naked function because then
    mcount is called without stack and frame pointer being set up and there
    is no chance to restore the lr register to the value before mcount was
    called.

    Reported-by: Matthias Kaehlcke
    Tested-by: Matthias Kaehlcke

    Cc: Abhishek Sagar
    Cc: Steven Rostedt
    Cc: Ingo Molnar
    Signed-off-by: Uwe Kleine-König
    Signed-off-by: Russell King

    Uwe Kleine-König
     

10 Jan, 2009

1 commit


03 Jan, 2009

1 commit

  • - include the gcc version-dependent header files from the generic gcc
    header file, rather than the other way around (iow: don't make the
    non-gcc header file have to know about gcc versions)

    - don't include compiler-gcc4.h for gcc 5 (for whenever it gets
    released). That's just confusing and made us do odd things in the
    gcc4 header file (testing that we really had version 4!)

    - generate the name from the __GNUC__ version directly, rather than
    having a mess of #if conditionals.

    Signed-off-by: Linus Torvalds

    Linus Torvalds
     

30 Apr, 2008

1 commit


26 Apr, 2008

2 commits

  • Stephen Rothwell reported that linux-next did not build on powerpc64.

    make optimized inlining dependent on architecture opt-in.

    Reported-by: Stephen Rothwell
    Signed-off-by: Ingo Molnar

    Ingo Molnar
     
  • add CONFIG_OPTIMIZE_INLINING=y.

    allow gcc to optimize the kernel image's size by uninlining
    functions that have been marked 'inline'. Previously gcc was
    forced by Linux to always-inline these functions via a gcc
    attribute:

    #define inline inline __attribute__((always_inline))

    Especially when the user has already selected
    CONFIG_OPTIMIZE_FOR_SIZE=y this can make a huge difference in
    kernel image size (using a standard Fedora .config):

    text data bss dec hex filename
    5613924 562708 3854336 10030968 990f78 vmlinux.before
    5486689 562708 3854336 9903733 971e75 vmlinux.after

    that's a 2.3% text size reduction (!).

    Signed-off-by: Ingo Molnar

    Ingo Molnar
     

19 Oct, 2007

1 commit

  • To be consistent with the use of attributes in the rest of the kernel
    replace all use of __attribute_pure__ with __pure and delete the definition
    of __attribute_pure__.

    Signed-off-by: Ralf Baechle
    Cc: Russell King
    Acked-by: Mauro Carvalho Chehab
    Cc: Bryan Wu
    Cc: Paul Mackerras
    Cc: Benjamin Herrenschmidt
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ralf Baechle
     

17 Oct, 2007

1 commit


10 May, 2007

1 commit

  • __used is defined to be __attribute__((unused)) for all pre-3.3 gcc
    compilers to suppress warnings for unused functions because perhaps they
    are referenced only in inline assembly. It is defined to be
    __attribute__((used)) for gcc 3.3 and later so that the code is still
    emitted for such functions.

    __maybe_unused is defined to be __attribute__((unused)) for both function
    and variable use if it could possibly be unreferenced due to the evaluation
    of preprocessor macros. Function prototypes shall be marked with
    __maybe_unused if the actual definition of the function is dependant on
    preprocessor macros.

    No update to compiler-intel.h is necessary because ICC supports both
    __attribute__((used)) and __attribute__((unused)) as specified by the gcc
    manual.

    __attribute_used__ is deprecated and will be removed once all current
    code is converted to using __used.

    Cc: Rusty Russell
    Cc: Adrian Bunk
    Signed-off-by: David Rientjes
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Rientjes
     

08 May, 2007

1 commit

  • We can use a gcc extension to ensure that ARRAY_SIZE() is handed an array,
    not a pointer. This is especially important when code is changed from a
    fixed array to a pointer. I assume the Intel compiler doesn't support
    __builtin_types_compatible_p.

    [jdike@addtoit.com: uml: update UML definition of ARRAY_SIZE]
    Signed-off-by: Rusty Russell
    Signed-off-by: Jeff Dike
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rusty Russell
     

12 Feb, 2007

1 commit

  • Extend the set of "__attribute__" shortcut macros, and remove identical
    (and now superfluous) definitions from a couple of source files.

    based on a page at robert love's blog:

    http://rlove.org/log/2005102601

    extend the set of shortcut macros defined in compiler-gcc.h with the
    following:

    #define __packed __attribute__((packed))
    #define __weak __attribute__((weak))
    #define __naked __attribute__((naked))
    #define __noreturn __attribute__((noreturn))
    #define __pure __attribute__((pure))
    #define __aligned(x) __attribute__((aligned(x)))
    #define __printf(a,b) __attribute__((format(printf,a,b)))

    Once these are in place, it's up to subsystem maintainers to decide if they
    want to take advantage of them. there is already a strong precedent for
    using shortcuts like this in the source tree.

    The ones that might give people pause are "__aligned" and "__printf", but
    shortcuts for both of those are already in use, and in some ways very
    confusingly. note the two very different definitions for a macro named
    "ALIGNED":

    drivers/net/sgiseeq.c:#define ALIGNED(x) ((((unsigned long)(x)) + 0xf) & ~(0xf))
    drivers/scsi/ultrastor.c:#define ALIGNED(x) __attribute__((aligned(x)))

    also:

    include/acpi/platform/acgcc.h:
    #define ACPI_PRINTF_LIKE(c) __attribute__ ((__format__ (__printf__, c, c+1)))

    Given the precedent, then, it seems logical to at least standardize on a
    consistent set of these macros.

    Signed-off-by: Robert P. J. Day
    Acked-by: Ralf Baechle
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Robert P. J. Day
     

11 Jan, 2006

1 commit

  • In the process of optimising our per cpu data code, I found a ppc64
    compiler bug that has been around forever. Basically the current
    RELOC_HIDE can end up trashing r30. Details of the bug can be found at

    http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25572

    This bug is present in all compilers before 4.1. It is masked by the
    fact that our current per cpu data code is inefficient and causes
    other loads that end up marking r30 as used.

    A workaround identified by Alan Modra is to use the =r asm constraint
    instead of =g.

    Signed-off-by: Anton Blanchard
    [ Verified that this makes no real difference on x86[-64] */
    Signed-off-by: Linus Torvalds

    Anton Blanchard
     

09 Jan, 2006

1 commit

  • Remove various things which were checking for gcc-1.x and gcc-2.x compilers.

    From: Adrian Bunk

    Some documentation updates and removes some code paths for gcc < 3.2.

    Acked-by: Russell King
    Signed-off-by: Adrian Bunk
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Morton
     

17 Apr, 2005

1 commit

  • Initial git repository build. I'm not bothering with the full history,
    even though we have it. We can create a separate "historical" git
    archive of that later if we want to, and in the meantime it's about
    3.2GB when imported into git - space that would just make the early
    git days unnecessarily complicated, when we don't have a lot of good
    infrastructure for it.

    Let it rip!

    Linus Torvalds