summaryrefslogtreecommitdiff
path: root/include/asm-um
diff options
context:
space:
mode:
authorJeff Dike <jdike@addtoit.com>2007-10-16 01:26:56 -0700
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-16 09:43:05 -0700
commit6aa802ce6acc9b1f0b34114b3f7c21c84872cc3a (patch)
tree74523303349693ef482dec4a1d803566b69c6abd /include/asm-um
parent4c9e13851315a25a705e7a686116e491041ca228 (diff)
downloadlinux-3.10-6aa802ce6acc9b1f0b34114b3f7c21c84872cc3a.tar.gz
linux-3.10-6aa802ce6acc9b1f0b34114b3f7c21c84872cc3a.tar.bz2
linux-3.10-6aa802ce6acc9b1f0b34114b3f7c21c84872cc3a.zip
uml: throw out CHOOSE_MODE
The next stage after removing code which depends on CONFIG_MODE_TT is removing the CHOOSE_MODE abstraction, which provided both compile-time and run-time branching to either tt-mode or skas-mode code. This patch removes choose-mode.h and all inclusions of it, and replaces all CHOOSE_MODE invocations with the skas branch. This leaves a number of trivial functions which will be dealt with in a later patch. There are some changes in the uaccess and tls support which go somewhat beyond this and eliminate some of the now-redundant functions. Signed-off-by: Jeff Dike <jdike@linux.intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/asm-um')
-rw-r--r--include/asm-um/a.out.h7
-rw-r--r--include/asm-um/mmu_context.h12
-rw-r--r--include/asm-um/processor-generic.h1
-rw-r--r--include/asm-um/ptrace-i386.h12
-rw-r--r--include/asm-um/tlbflush.h6
-rw-r--r--include/asm-um/uaccess.h2
6 files changed, 10 insertions, 30 deletions
diff --git a/include/asm-um/a.out.h b/include/asm-um/a.out.h
index 78bc9eed26b..7912f0997cb 100644
--- a/include/asm-um/a.out.h
+++ b/include/asm-um/a.out.h
@@ -2,7 +2,6 @@
#define __UM_A_OUT_H
#include "asm/arch/a.out.h"
-#include "choose-mode.h"
#undef STACK_TOP
#undef STACK_TOP_MAX
@@ -13,10 +12,8 @@ extern unsigned long host_task_size;
#define STACK_ROOM (stacksizelim)
-extern int honeypot;
-#define STACK_TOP \
- CHOOSE_MODE((honeypot ? host_task_size : task_size), task_size)
+#define STACK_TOP task_size
-#define STACK_TOP_MAX STACK_TOP
+#define STACK_TOP_MAX STACK_TOP
#endif
diff --git a/include/asm-um/mmu_context.h b/include/asm-um/mmu_context.h
index 92b0a703fb9..a4186af65f2 100644
--- a/include/asm-um/mmu_context.h
+++ b/include/asm-um/mmu_context.h
@@ -9,7 +9,6 @@
#include <asm-generic/mm_hooks.h>
#include "linux/sched.h"
-#include "choose-mode.h"
#include "um_mmu.h"
#define get_mmu_context(task) do ; while(0)
@@ -30,8 +29,7 @@ static inline void activate_mm(struct mm_struct *old, struct mm_struct *new)
* possible.
*/
if (old != new && (current->flags & PF_BORROWED_MM))
- CHOOSE_MODE(force_flush_all(),
- switch_mm_skas(&new->context.skas.id));
+ switch_mm_skas(&new->context.skas.id);
}
static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
@@ -43,8 +41,7 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
cpu_clear(cpu, prev->cpu_vm_mask);
cpu_set(cpu, next->cpu_vm_mask);
if(next != &init_mm)
- CHOOSE_MODE((void) 0,
- switch_mm_skas(&next->context.skas.id));
+ switch_mm_skas(&next->context.skas.id);
}
}
@@ -59,15 +56,14 @@ extern int init_new_context_skas(struct task_struct *task,
static inline int init_new_context(struct task_struct *task,
struct mm_struct *mm)
{
- return(CHOOSE_MODE_PROC(init_new_context_tt, init_new_context_skas,
- task, mm));
+ return(init_new_context_skas(task, mm));
}
extern void destroy_context_skas(struct mm_struct *mm);
static inline void destroy_context(struct mm_struct *mm)
{
- CHOOSE_MODE((void) 0, destroy_context_skas(mm));
+ destroy_context_skas(mm);
}
#endif
diff --git a/include/asm-um/processor-generic.h b/include/asm-um/processor-generic.h
index 70c8183d1db..be3ffec3a6a 100644
--- a/include/asm-um/processor-generic.h
+++ b/include/asm-um/processor-generic.h
@@ -11,7 +11,6 @@ struct pt_regs;
struct task_struct;
#include "asm/ptrace.h"
-#include "choose-mode.h"
#include "registers.h"
#include "sysdep/archsetjmp.h"
diff --git a/include/asm-um/ptrace-i386.h b/include/asm-um/ptrace-i386.h
index 6e2528bb008..4928a31aca7 100644
--- a/include/asm-um/ptrace-i386.h
+++ b/include/asm-um/ptrace-i386.h
@@ -12,7 +12,6 @@
#include "sysdep/ptrace.h"
#include "asm/ptrace-generic.h"
#include "asm/host_ldt.h"
-#include "choose-mode.h"
#define PT_REGS_EAX(r) UPT_EAX(&(r)->regs)
#define PT_REGS_EBX(r) UPT_EBX(&(r)->regs)
@@ -59,15 +58,8 @@ extern int arch_switch_tls_tt(struct task_struct *from, struct task_struct *to);
extern void arch_switch_to_tt(struct task_struct *from, struct task_struct *to);
extern void arch_switch_to_skas(struct task_struct *from, struct task_struct *to);
-static inline int do_get_thread_area(struct user_desc *info)
-{
- return CHOOSE_MODE_PROC(do_get_thread_area_tt, do_get_thread_area_skas, info);
-}
-
-static inline int do_set_thread_area(struct user_desc *info)
-{
- return CHOOSE_MODE_PROC(do_set_thread_area_tt, do_set_thread_area_skas, info);
-}
+extern int do_get_thread_area_skas(struct user_desc *info);
+extern int do_set_thread_area_skas(struct user_desc *info);
struct task_struct;
diff --git a/include/asm-um/tlbflush.h b/include/asm-um/tlbflush.h
index e78c28c1f35..7912e18d93e 100644
--- a/include/asm-um/tlbflush.h
+++ b/include/asm-um/tlbflush.h
@@ -7,7 +7,6 @@
#define __UM_TLBFLUSH_H
#include <linux/mm.h>
-#include "choose-mode.h"
/*
* TLB flushing:
@@ -31,10 +30,7 @@ extern void flush_tlb_page_skas(struct vm_area_struct *vma,
static inline void flush_tlb_page(struct vm_area_struct *vma,
unsigned long address)
{
- address &= PAGE_MASK;
-
- CHOOSE_MODE(flush_tlb_range(vma, address, address + PAGE_SIZE),
- flush_tlb_page_skas(vma, address));
+ flush_tlb_page_skas(vma, address & PAGE_MASK);
}
extern void flush_tlb_page(struct vm_area_struct *vma, unsigned long vmaddr);
diff --git a/include/asm-um/uaccess.h b/include/asm-um/uaccess.h
index 16c734af919..077032d4fc4 100644
--- a/include/asm-um/uaccess.h
+++ b/include/asm-um/uaccess.h
@@ -80,7 +80,7 @@
__put_user(x, private_ptr) : -EFAULT); \
})
-#define strlen_user(str) strnlen_user(str, ~0UL >> 1)
+#define strlen_user(str) strnlen_user(str, ~0U >> 1)
struct exception_table_entry
{