summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2005-01-04 05:15:00 -0800
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-01-04 05:15:00 -0800
commit1fa5e01246a4f0ec32f9bdfc910d57e30bfc0260 (patch)
tree7e44a66f9c2a8cc6e6449c04af9fc10afabf7cf0 /include/linux
parentfc1d4be6b015e2c34847df3994d80f3eec44cc42 (diff)
[PATCH] GP-REL data support
The attached patch makes it possible to support gp-rel addressing for small variables. Since the FR-V cpu's have fixed-length instructions and plenty of general-purpose registers, one register is nominated as a base for the small data area. This makes it possible to use single-insn accesses to access global and static variables instead of having to use multiple instructions. This, however, causes problems with small variables used to pinpoint the beginning and end of sections. The compiler assumes it can use gp-rel addressing for these, but the linker then complains because the displacement is out of range. By declaring certain variables as arrays or by forcing them into named sections, the compiler is persuaded to access them as if they can be outside the displacement range. Declaring the variables as "const void" type also works. Signed-Off-By: David Howells <dhowells@redhat.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/init.h4
-rw-r--r--include/linux/jiffies.h10
-rw-r--r--include/linux/kernel.h2
3 files changed, 12 insertions, 4 deletions
diff --git a/include/linux/init.h b/include/linux/init.h
index 7a9f69992516..05c83e0521ca 100644
--- a/include/linux/init.h
+++ b/include/linux/init.h
@@ -64,8 +64,8 @@
typedef int (*initcall_t)(void);
typedef void (*exitcall_t)(void);
-extern initcall_t __con_initcall_start, __con_initcall_end;
-extern initcall_t __security_initcall_start, __security_initcall_end;
+extern initcall_t __con_initcall_start[], __con_initcall_end[];
+extern initcall_t __security_initcall_start[], __security_initcall_end[];
/* Defined in init/main.c */
extern char saved_command_line[];
diff --git a/include/linux/jiffies.h b/include/linux/jiffies.h
index d45eff83b906..d882d689519a 100644
--- a/include/linux/jiffies.h
+++ b/include/linux/jiffies.h
@@ -70,13 +70,19 @@
/* a value TUSEC for TICK_USEC (can be set bij adjtimex) */
#define TICK_USEC_TO_NSEC(TUSEC) (SH_DIV (TUSEC * USER_HZ * 1000, ACTHZ, 8))
+/* some arch's have a small-data section that can be accessed register-relative
+ * but that can only take up to, say, 4-byte variables. jiffies being part of
+ * an 8-byte variable may not be correctly accessed unless we force the issue
+ */
+#define __jiffy_data __attribute__((section(".data")))
+
/*
* The 64-bit value is not volatile - you MUST NOT read it
* without sampling the sequence number in xtime_lock.
* get_jiffies_64() will do this for you as appropriate.
*/
-extern u64 jiffies_64;
-extern unsigned long volatile jiffies;
+extern u64 __jiffy_data jiffies_64;
+extern unsigned long volatile __jiffy_data jiffies;
#if (BITS_PER_LONG < 64)
u64 get_jiffies_64(void);
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 1d33d8dcbc1b..843ad4f18ec0 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -16,6 +16,8 @@
#include <asm/byteorder.h>
#include <asm/bug.h>
+extern const char linux_banner[];
+
#define INT_MAX ((int)(~0U>>1))
#define INT_MIN (-INT_MAX - 1)
#define UINT_MAX (~0U)