summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJeff Dike <jdike@addtoit.com>2004-09-23 19:46:21 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-09-23 19:46:21 -0700
commit3c7a74a7bcb75de9d30dcc942fd6e85ee91d4898 (patch)
treec957c4e83bda6685384ce7321b83d7d45c450b97 /include
parent17e03d0db86dcdc52a757bd678983f8cd3b6d9bf (diff)
[PATCH] uml: implement current_text_addr
Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade_spam@yahoo.it> Signed-off-by: Jeff Dike <jdike@addtoit.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include')
-rw-r--r--include/asm-um/processor-generic.h2
-rw-r--r--include/asm-um/processor-i386.h7
2 files changed, 7 insertions, 2 deletions
diff --git a/include/asm-um/processor-generic.h b/include/asm-um/processor-generic.h
index 55d91954516c..fa39a3985394 100644
--- a/include/asm-um/processor-generic.h
+++ b/include/asm-um/processor-generic.h
@@ -16,8 +16,6 @@ struct task_struct;
struct mm_struct;
-#define current_text_addr() ((void *) 0)
-
#define cpu_relax() barrier()
struct thread_struct {
diff --git a/include/asm-um/processor-i386.h b/include/asm-um/processor-i386.h
index 0f08c0225029..b276481cc6cb 100644
--- a/include/asm-um/processor-i386.h
+++ b/include/asm-um/processor-i386.h
@@ -19,6 +19,13 @@ struct arch_thread {
#include "asm/arch/user.h"
+/*
+ * Default implementation of macro that returns current
+ * instruction pointer ("program counter"). Stolen
+ * from asm-i386/processor.h
+ */
+#define current_text_addr() ({ void *pc; __asm__("movl $1f,%0\n1:":"=g" (pc)); pc; })
+
#include "asm/processor-generic.h"
#endif