From 900e7bd2d1e74785a43def0be79aef7872d9f714 Mon Sep 17 00:00:00 2001 From: David Mosberger Date: Wed, 16 Jul 2003 05:44:13 -0700 Subject: 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. --- include/asm-ia64/percpu.h | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'include') 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 -#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 -- cgit v1.2.3