diff options
| author | David Mosberger <davidm@tiger.hpl.hp.com> | 2003-07-16 05:44:13 -0700 |
|---|---|---|
| committer | David Mosberger <davidm@tiger.hpl.hp.com> | 2003-07-16 05:44:13 -0700 |
| commit | 900e7bd2d1e74785a43def0be79aef7872d9f714 (patch) | |
| tree | 52aeed2adf069b2d1daf158912040a0d28be92f5 /include | |
| parent | 0f4f7d2428612ae2c06ba62e6ed1c9b77677819c (diff) | |
ia64: If the compiler supports it, use attribute (model (small)) to
tell the compiler that per-CPU variables can be addressed
with "addl".
On the simulator kernel, this saves about 2776 bytes in the
kernel image. On a zx1 kernel, it saves about 5593 bytes.
As per-CPU variables are used more, these savings will
increase, of course.
Diffstat (limited to 'include')
| -rw-r--r-- | include/asm-ia64/percpu.h | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/include/asm-ia64/percpu.h b/include/asm-ia64/percpu.h index 2fc53d7e9f64..b0980ac00723 100644 --- a/include/asm-ia64/percpu.h +++ b/include/asm-ia64/percpu.h @@ -16,11 +16,19 @@ #include <linux/threads.h> -#define DECLARE_PER_CPU(type, name) extern __typeof__(type) per_cpu__##name +#ifdef HAVE_MODEL_SMALL_ATTRIBUTE +# define __SMALL_ADDR_AREA __attribute__((__model__ (__small__))) +#else +# define __SMALL_ADDR_AREA +#endif + +#define DECLARE_PER_CPU(type, name) \ + extern __SMALL_ADDR_AREA __typeof__(type) per_cpu__##name /* Separate out the type, so (int[3], foo) works. */ -#define DEFINE_PER_CPU(type, name) \ - __attribute__((__section__(".data.percpu"))) __typeof__(type) per_cpu__##name +#define DEFINE_PER_CPU(type, name) \ + __attribute__((__section__(".data.percpu"))) \ + __SMALL_ADDR_AREA __typeof__(type) per_cpu__##name /* * Pretty much a literal copy of asm-generic/percpu.h, except that percpu_modcopy() is an |
