x86: Clean up asmlinkage use

From: Andi Kleen
Date: Mon Aug 05 2013 - 18:03:26 EST

This patchkit makes the use of asmlinkage consistent in arch/x86
Originally arch/x86 was (mostly) fully annotated with asmlinkage, but
this has bitrotted over time.

These changes were originally part of my LTO patchkit. In the interest
of making it smaller, I'm posting them separately, as they can be
considered cleanups.

By itself they do not improve anything in the existing kernel,
except for making things more consistent.

They may be useful for other global compile time instrumentation tools
to indicate clearly that some function/variable can be changed
outside their view.


The goal is to mark every function or variable that can be called
from assembler. asmlinkage on 32bit includes regparm(0) so changes
semantics. Since I didn't want to audit every caller and make
this patchkit a nop by itself, I did not add new asmlinkage
to 32bit functions that take parameters. So no existing function
switches from regparm(3) to (0).

Instead every function with parameter (and variables) becomes
__visible. This is roughly equivalent now to the old "asmregparm"
(which was removed some time ago), except it also works for

So in summary the changes are:
- Mark every function without arguments (or 64bit only)
that is used by assembler asmlinkage
- Mark every function with parameters or variables
that is used by assembler __visible.

I also included a few related fixes with inline assembler
and a type fix for the syscall table.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/