Commit 6aa802ce authored by Jeff Dike's avatar Jeff Dike Committed by Linus Torvalds
Browse files

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: default avatarJeff Dike <jdike@linux.intel.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 4c9e1385
......@@ -264,8 +264,7 @@ void register_winch(int fd, struct tty_struct *tty)
return;
pid = tcgetpgrp(fd);
if (!CHOOSE_MODE_PROC(is_tracer_winch, is_skas_winch, pid, fd, tty) &&
(pid == -1)) {
if (!is_skas_winch(pid, fd, tty) && (pid == -1)) {
thread = winch_tramp(fd, tty, &thread_fd, &stack);
if (thread < 0)
return;
......
......@@ -9,7 +9,6 @@
#include "user.h"
#include "mconsole.h"
#include "os.h"
#include "choose-mode.h"
#include "mode.h"
struct dog_data {
......@@ -64,7 +63,7 @@ int start_watchdog(int *in_fd_ret, int *out_fd_ret, char *sock)
}
else {
/* XXX The os_getpid() is not SMP correct */
sprintf(pid_buf, "%d", CHOOSE_MODE(tracing_pid, os_getpid()));
sprintf(pid_buf, "%d", os_getpid());
args = pid_args;
}
......
......@@ -33,7 +33,6 @@
#include "init.h"
#include "os.h"
#include "irq_kern.h"
#include "choose-mode.h"
static int do_unlink_socket(struct notifier_block *notifier,
unsigned long what, void *data)
......
/*
* Copyright (C) 2002 Jeff Dike (jdike@karaya.com)
* Licensed under the GPL
*/
#ifndef __CHOOSE_MODE_H__
#define __CHOOSE_MODE_H__
#include "uml-config.h"
#define CHOOSE_MODE(tt, skas) (skas)
#define CHOOSE_MODE_PROC(tt, skas, args...) \
CHOOSE_MODE(tt(args), skas(args))
#ifndef __CHOOSE_MODE
#define __CHOOSE_MODE(tt, skas) CHOOSE_MODE(tt, skas)
#endif
#endif
/*
* Copyright (C) 2002 Jeff Dike (jdike@karaya.com)
* Licensed under the GPL
*/
#ifndef __SKAS_UACCESS_H
#define __SKAS_UACCESS_H
#include "asm/errno.h"
/* No SKAS-specific checking. */
#define access_ok_skas(type, addr, size) 0
extern int copy_from_user_skas(void *to, const void __user *from, int n);
extern int copy_to_user_skas(void __user *to, const void *from, int n);
extern int strncpy_from_user_skas(char *dst, const char __user *src, int count);
extern int __clear_user_skas(void __user *mem, int len);
extern int clear_user_skas(void __user *mem, int len);
extern int strnlen_user_skas(const void __user *str, int len);
#endif
/*
* Copyright (C) 2000, 2001, 2002 Jeff Dike (jdike@karaya.com)
* Copyright (C) 2000 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
* Licensed under the GPL
*/
......@@ -9,7 +9,6 @@
#include "uml-config.h"
#include "user_constants.h"
#include "sysdep/faultinfo.h"
#include "choose-mode.h"
#define MAX_REG_NR (UM_FRAME_SIZE / sizeof(unsigned long))
#define MAX_REG_OFFSET (UM_FRAME_SIZE)
......@@ -67,40 +66,23 @@ union uml_pt_regs {
#define EMPTY_UML_PT_REGS { }
#define UPT_SC(r) ((r)->tt.sc)
#define UPT_IP(r) \
__CHOOSE_MODE(SC_IP(UPT_SC(r)), REGS_IP((r)->skas.regs))
#define UPT_SP(r) \
__CHOOSE_MODE(SC_SP(UPT_SC(r)), REGS_SP((r)->skas.regs))
#define UPT_EFLAGS(r) \
__CHOOSE_MODE(SC_EFLAGS(UPT_SC(r)), REGS_EFLAGS((r)->skas.regs))
#define UPT_EAX(r) \
__CHOOSE_MODE(SC_EAX(UPT_SC(r)), REGS_EAX((r)->skas.regs))
#define UPT_EBX(r) \
__CHOOSE_MODE(SC_EBX(UPT_SC(r)), REGS_EBX((r)->skas.regs))
#define UPT_ECX(r) \
__CHOOSE_MODE(SC_ECX(UPT_SC(r)), REGS_ECX((r)->skas.regs))
#define UPT_EDX(r) \
__CHOOSE_MODE(SC_EDX(UPT_SC(r)), REGS_EDX((r)->skas.regs))
#define UPT_ESI(r) \
__CHOOSE_MODE(SC_ESI(UPT_SC(r)), REGS_ESI((r)->skas.regs))
#define UPT_EDI(r) \
__CHOOSE_MODE(SC_EDI(UPT_SC(r)), REGS_EDI((r)->skas.regs))
#define UPT_EBP(r) \
__CHOOSE_MODE(SC_EBP(UPT_SC(r)), REGS_EBP((r)->skas.regs))
#define UPT_ORIG_EAX(r) \
__CHOOSE_MODE((r)->tt.syscall, (r)->skas.syscall)
#define UPT_CS(r) \
__CHOOSE_MODE(SC_CS(UPT_SC(r)), REGS_CS((r)->skas.regs))
#define UPT_SS(r) \
__CHOOSE_MODE(SC_SS(UPT_SC(r)), REGS_SS((r)->skas.regs))
#define UPT_DS(r) \
__CHOOSE_MODE(SC_DS(UPT_SC(r)), REGS_DS((r)->skas.regs))
#define UPT_ES(r) \
__CHOOSE_MODE(SC_ES(UPT_SC(r)), REGS_ES((r)->skas.regs))
#define UPT_FS(r) \
__CHOOSE_MODE(SC_FS(UPT_SC(r)), REGS_FS((r)->skas.regs))
#define UPT_GS(r) \
__CHOOSE_MODE(SC_GS(UPT_SC(r)), REGS_GS((r)->skas.regs))
#define UPT_IP(r) REGS_IP((r)->skas.regs)
#define UPT_SP(r) REGS_SP((r)->skas.regs)
#define UPT_EFLAGS(r) REGS_EFLAGS((r)->skas.regs)
#define UPT_EAX(r) REGS_EAX((r)->skas.regs)
#define UPT_EBX(r) REGS_EBX((r)->skas.regs)
#define UPT_ECX(r) REGS_ECX((r)->skas.regs)
#define UPT_EDX(r) REGS_EDX((r)->skas.regs)
#define UPT_ESI(r) REGS_ESI((r)->skas.regs)
#define UPT_EDI(r) REGS_EDI((r)->skas.regs)
#define UPT_EBP(r) REGS_EBP((r)->skas.regs)
#define UPT_ORIG_EAX(r) ((r)->skas.syscall)
#define UPT_CS(r) REGS_CS((r)->skas.regs)
#define UPT_SS(r) REGS_SS((r)->skas.regs)
#define UPT_DS(r) REGS_DS((r)->skas.regs)
#define UPT_ES(r) REGS_ES((r)->skas.regs)
#define UPT_FS(r) REGS_FS((r)->skas.regs)
#define UPT_GS(r) REGS_GS((r)->skas.regs)
#define UPT_SYSCALL_ARG1(r) UPT_EBX(r)
#define UPT_SYSCALL_ARG2(r) UPT_ECX(r)
......@@ -111,8 +93,7 @@ union uml_pt_regs {
extern int user_context(unsigned long sp);
#define UPT_IS_USER(r) \
CHOOSE_MODE(user_context(UPT_SP(r)), (r)->skas.is_user)
#define UPT_IS_USER(r) ((r)->skas.is_user)
struct syscall_args {
unsigned long args[6];
......@@ -181,18 +162,14 @@ struct syscall_args {
} while (0)
#define UPT_SET_SYSCALL_RETURN(r, res) \
CHOOSE_MODE(SC_SET_SYSCALL_RETURN(UPT_SC(r), (res)), \
REGS_SET_SYSCALL_RETURN((r)->skas.regs, (res)))
REGS_SET_SYSCALL_RETURN((r)->skas.regs, (res))
#define UPT_RESTART_SYSCALL(r) \
CHOOSE_MODE(SC_RESTART_SYSCALL(UPT_SC(r)), \
REGS_RESTART_SYSCALL((r)->skas.regs))
#define UPT_RESTART_SYSCALL(r) REGS_RESTART_SYSCALL((r)->skas.regs)
#define UPT_ORIG_SYSCALL(r) UPT_EAX(r)
#define UPT_SYSCALL_NR(r) UPT_ORIG_EAX(r)
#define UPT_SYSCALL_RET(r) UPT_EAX(r)
#define UPT_FAULTINFO(r) \
CHOOSE_MODE((&(r)->tt.faultinfo), (&(r)->skas.faultinfo))
#define UPT_FAULTINFO(r) (&(r)->skas.faultinfo)
#endif
......@@ -84,8 +84,6 @@
#define REGS_ERR(r) ((r)->fault_type)
#include "choose-mode.h"
/* XXX */
union uml_pt_regs {
struct skas_regs {
......@@ -99,48 +97,45 @@ union uml_pt_regs {
#define EMPTY_UML_PT_REGS { }
#define UPT_RBX(r) __CHOOSE_MODE(SC_RBX(UPT_SC(r)), REGS_RBX((r)->skas.regs))
#define UPT_RCX(r) __CHOOSE_MODE(SC_RCX(UPT_SC(r)), REGS_RCX((r)->skas.regs))
#define UPT_RDX(r) __CHOOSE_MODE(SC_RDX(UPT_SC(r)), REGS_RDX((r)->skas.regs))
#define UPT_RSI(r) __CHOOSE_MODE(SC_RSI(UPT_SC(r)), REGS_RSI((r)->skas.regs))
#define UPT_RDI(r) __CHOOSE_MODE(SC_RDI(UPT_SC(r)), REGS_RDI((r)->skas.regs))
#define UPT_RBP(r) __CHOOSE_MODE(SC_RBP(UPT_SC(r)), REGS_RBP((r)->skas.regs))
#define UPT_RAX(r) __CHOOSE_MODE(SC_RAX(UPT_SC(r)), REGS_RAX((r)->skas.regs))
#define UPT_R8(r) __CHOOSE_MODE(SC_R8(UPT_SC(r)), REGS_R8((r)->skas.regs))
#define UPT_R9(r) __CHOOSE_MODE(SC_R9(UPT_SC(r)), REGS_R9((r)->skas.regs))
#define UPT_R10(r) __CHOOSE_MODE(SC_R10(UPT_SC(r)), REGS_R10((r)->skas.regs))
#define UPT_R11(r) __CHOOSE_MODE(SC_R11(UPT_SC(r)), REGS_R11((r)->skas.regs))
#define UPT_R12(r) __CHOOSE_MODE(SC_R12(UPT_SC(r)), REGS_R12((r)->skas.regs))
#define UPT_R13(r) __CHOOSE_MODE(SC_R13(UPT_SC(r)), REGS_R13((r)->skas.regs))
#define UPT_R14(r) __CHOOSE_MODE(SC_R14(UPT_SC(r)), REGS_R14((r)->skas.regs))
#define UPT_R15(r) __CHOOSE_MODE(SC_R15(UPT_SC(r)), REGS_R15((r)->skas.regs))
#define UPT_CS(r) __CHOOSE_MODE(SC_CS(UPT_SC(r)), REGS_CS((r)->skas.regs))
#define UPT_RBX(r) REGS_RBX((r)->skas.regs)
#define UPT_RCX(r) REGS_RCX((r)->skas.regs)
#define UPT_RDX(r) REGS_RDX((r)->skas.regs)
#define UPT_RSI(r) REGS_RSI((r)->skas.regs)
#define UPT_RDI(r) REGS_RDI((r)->skas.regs)
#define UPT_RBP(r) REGS_RBP((r)->skas.regs)
#define UPT_RAX(r) REGS_RAX((r)->skas.regs)
#define UPT_R8(r) REGS_R8((r)->skas.regs)
#define UPT_R9(r) REGS_R9((r)->skas.regs)
#define UPT_R10(r) REGS_R10((r)->skas.regs)
#define UPT_R11(r) REGS_R11((r)->skas.regs)
#define UPT_R12(r) REGS_R12((r)->skas.regs)
#define UPT_R13(r) REGS_R13((r)->skas.regs)
#define UPT_R14(r) REGS_R14((r)->skas.regs)
#define UPT_R15(r) REGS_R15((r)->skas.regs)
#define UPT_CS(r) REGS_CS((r)->skas.regs)
#define UPT_FS_BASE(r) \
__CHOOSE_MODE(SC_FS_BASE(UPT_SC(r)), REGS_FS_BASE((r)->skas.regs))
#define UPT_FS(r) __CHOOSE_MODE(SC_FS(UPT_SC(r)), REGS_FS((r)->skas.regs))
REGS_FS_BASE((r)->skas.regs)
#define UPT_FS(r) REGS_FS((r)->skas.regs)
#define UPT_GS_BASE(r) \
__CHOOSE_MODE(SC_GS_BASE(UPT_SC(r)), REGS_GS_BASE((r)->skas.regs))
#define UPT_GS(r) __CHOOSE_MODE(SC_GS(UPT_SC(r)), REGS_GS((r)->skas.regs))
#define UPT_DS(r) __CHOOSE_MODE(SC_DS(UPT_SC(r)), REGS_DS((r)->skas.regs))
#define UPT_ES(r) __CHOOSE_MODE(SC_ES(UPT_SC(r)), REGS_ES((r)->skas.regs))
#define UPT_CS(r) __CHOOSE_MODE(SC_CS(UPT_SC(r)), REGS_CS((r)->skas.regs))
#define UPT_SS(r) __CHOOSE_MODE(SC_SS(UPT_SC(r)), REGS_SS((r)->skas.regs))
#define UPT_ORIG_RAX(r) \
__CHOOSE_MODE((r)->tt.orig_rax, REGS_ORIG_RAX((r)->skas.regs))
#define UPT_IP(r) __CHOOSE_MODE(SC_IP(UPT_SC(r)), REGS_IP((r)->skas.regs))
#define UPT_SP(r) __CHOOSE_MODE(SC_SP(UPT_SC(r)), REGS_SP((r)->skas.regs))
#define UPT_EFLAGS(r) \
__CHOOSE_MODE(SC_EFLAGS(UPT_SC(r)), REGS_EFLAGS((r)->skas.regs))
REGS_GS_BASE((r)->skas.regs)
#define UPT_GS(r) REGS_GS((r)->skas.regs)
#define UPT_DS(r) REGS_DS((r)->skas.regs)
#define UPT_ES(r) REGS_ES((r)->skas.regs)
#define UPT_CS(r) REGS_CS((r)->skas.regs)
#define UPT_SS(r) REGS_SS((r)->skas.regs)
#define UPT_ORIG_RAX(r) REGS_ORIG_RAX((r)->skas.regs)
#define UPT_IP(r) REGS_IP((r)->skas.regs)
#define UPT_SP(r) REGS_SP((r)->skas.regs)
#define UPT_EFLAGS(r) REGS_EFLAGS((r)->skas.regs)
#define UPT_SC(r) ((r)->tt.sc)
#define UPT_SYSCALL_NR(r) __CHOOSE_MODE((r)->tt.syscall, (r)->skas.syscall)
#define UPT_SYSCALL_NR(r) ((r)->skas.syscall)
#define UPT_SYSCALL_RET(r) UPT_RAX(r)
extern int user_context(unsigned long sp);
#define UPT_IS_USER(r) \
CHOOSE_MODE(user_context(UPT_SP(r)), (r)->skas.is_user)
#define UPT_IS_USER(r) ((r)->skas.is_user)
#define UPT_SYSCALL_ARG1(r) UPT_RDI(r)
#define UPT_SYSCALL_ARG2(r) UPT_RSI(r)
......@@ -237,18 +232,12 @@ struct syscall_args {
})
#define UPT_SET_SYSCALL_RETURN(r, res) \
CHOOSE_MODE(SC_SET_SYSCALL_RETURN(UPT_SC(r), (res)), \
REGS_SET_SYSCALL_RETURN((r)->skas.regs, (res)))
REGS_SET_SYSCALL_RETURN((r)->skas.regs, (res))
#define UPT_RESTART_SYSCALL(r) \
CHOOSE_MODE(SC_RESTART_SYSCALL(UPT_SC(r)), \
REGS_RESTART_SYSCALL((r)->skas.regs))
#define UPT_RESTART_SYSCALL(r) REGS_RESTART_SYSCALL((r)->skas.regs)
#define UPT_SEGV_IS_FIXABLE(r) \
CHOOSE_MODE(SC_SEGV_IS_FIXABLE(UPT_SC(r)), \
REGS_SEGV_IS_FIXABLE(&r->skas))
#define UPT_SEGV_IS_FIXABLE(r) REGS_SEGV_IS_FIXABLE(&r->skas)
#define UPT_FAULTINFO(r) \
CHOOSE_MODE((&(r)->tt.faultinfo), (&(r)->skas.faultinfo))
#define UPT_FAULTINFO(r) (&(r)->skas.faultinfo)
#endif
......@@ -7,7 +7,6 @@
#define __ARCH_UM_MMU_H
#include "uml-config.h"
#include "choose-mode.h"
#include "mmu-skas.h"
typedef union mm_context {
......
......@@ -6,8 +6,6 @@
#ifndef __ARCH_UM_UACCESS_H
#define __ARCH_UM_UACCESS_H
#include "choose-mode.h"
#include "uaccess-skas.h"
#include "asm/fixmap.h"
#define __under_task_size(addr, size) \
......@@ -27,20 +25,10 @@
(__addr_range_nowrap(addr, size) && \
(__under_task_size(addr, size) || \
__access_ok_vsyscall(type, addr, size) || \
segment_eq(get_fs(), KERNEL_DS) || \
CHOOSE_MODE_PROC(access_ok_tt, access_ok_skas, type, addr, size)))
segment_eq(get_fs(), KERNEL_DS)))
static inline int copy_from_user(void *to, const void __user *from, int n)
{
return(CHOOSE_MODE_PROC(copy_from_user_tt, copy_from_user_skas, to,
from, n));
}
static inline int copy_to_user(void __user *to, const void *from, int n)
{
return(CHOOSE_MODE_PROC(copy_to_user_tt, copy_to_user_skas, to,
from, n));
}
extern int copy_from_user(void *to, const void __user *from, int n);
extern int copy_to_user(void __user *to, const void *from, int n);
/*
* strncpy_from_user: - Copy a NUL terminated string from userspace.
......@@ -61,11 +49,7 @@ static inline int copy_to_user(void __user *to, const void *from, int n)
* and returns @count.
*/
static inline int strncpy_from_user(char *dst, const char __user *src, int count)
{
return(CHOOSE_MODE_PROC(strncpy_from_user_tt, strncpy_from_user_skas,
dst, src, count));
}
extern int strncpy_from_user(char *dst, const char __user *src, int count);
/*
* __clear_user: - Zero a block of memory in user space, with less checking.
......@@ -78,10 +62,7 @@ static inline int strncpy_from_user(char *dst, const char __user *src, int count
* Returns number of bytes that could not be cleared.
* On success, this will be zero.
*/
static inline int __clear_user(void *mem, int len)
{
return(CHOOSE_MODE_PROC(__clear_user_tt, __clear_user_skas, mem, len));
}
extern int __clear_user(void __user *mem, int len);
/*
* clear_user: - Zero a block of memory in user space.
......@@ -93,10 +74,7 @@ static inline int __clear_user(void *mem, int len)
* Returns number of bytes that could not be cleared.
* On success, this will be zero.
*/
static inline int clear_user(void __user *mem, int len)
{
return(CHOOSE_MODE_PROC(clear_user_tt, clear_user_skas, mem, len));
}
extern int clear_user(void __user *mem, int len);
/*
* strlen_user: - Get the size of a string in user space.
......@@ -109,10 +87,7 @@ static inline int clear_user(void __user *mem, int len)
* On exception, returns 0.
* If the string is too long, returns a value greater than @n.
*/
static inline int strnlen_user(const void __user *str, long len)
{
return(CHOOSE_MODE_PROC(strnlen_user_tt, strnlen_user_skas, str, len));
}
extern int strnlen_user(const void __user *str, int len);
#endif
......
......@@ -18,18 +18,17 @@
#include "irq_user.h"
#include "tlb.h"
#include "os.h"
#include "choose-mode.h"
#include "mode_kern.h"
void flush_thread(void)
{
arch_flush_thread(&current->thread.arch);
CHOOSE_MODE(flush_thread_tt(), flush_thread_skas());
flush_thread_skas();
}
void start_thread(struct pt_regs *regs, unsigned long eip, unsigned long esp)
{
CHOOSE_MODE_PROC(start_thread_tt, start_thread_skas, regs, eip, esp);
start_thread_skas(regs, eip, esp);
}
#ifdef CONFIG_TTY_LOG
......
......@@ -37,11 +37,11 @@ EXPORT_SYMBOL(um_virt_to_phys);
EXPORT_SYMBOL(handle_page_fault);
EXPORT_SYMBOL(find_iomem);
EXPORT_SYMBOL(strnlen_user_skas);
EXPORT_SYMBOL(strncpy_from_user_skas);
EXPORT_SYMBOL(copy_to_user_skas);
EXPORT_SYMBOL(copy_from_user_skas);
EXPORT_SYMBOL(clear_user_skas);
EXPORT_SYMBOL(strnlen_user);
EXPORT_SYMBOL(strncpy_from_user);
EXPORT_SYMBOL(copy_to_user);
EXPORT_SYMBOL(copy_from_user);
EXPORT_SYMBOL(clear_user);
EXPORT_SYMBOL(uml_strdup);
EXPORT_SYMBOL(os_stat_fd);
......
......@@ -61,7 +61,7 @@ static unsigned long kmem_top = 0;
unsigned long get_kmem_end(void)
{
if (kmem_top == 0)
kmem_top = CHOOSE_MODE(kmem_end_tt, kmem_end_skas);
kmem_top = kmem_end_skas;
return kmem_top;
}
......
......@@ -45,7 +45,6 @@
#include "os.h"
#include "mode.h"
#include "mode_kern.h"
#include "choose-mode.h"
/* This is a per-cpu array. A processor only modifies its entry and it only
* cares about its entry, so it's OK if another processor is modifying its
......@@ -55,7 +54,7 @@ struct cpu_task cpu_tasks[NR_CPUS] = { [0 ... NR_CPUS - 1] = { -1, NULL } };
static inline int external_pid(struct task_struct *task)
{
return CHOOSE_MODE_PROC(external_pid_tt, external_pid_skas, task);
return external_pid_skas(task);
}
int pid_to_processor_id(int pid)
......@@ -114,8 +113,8 @@ void *_switch_to(void *prev, void *next, void *last)
set_current(to);
do {
current->thread.saved_task = NULL ;
CHOOSE_MODE_PROC(switch_to_tt, switch_to_skas, prev, next);
current->thread.saved_task = NULL;
switch_to_skas(prev, next);
if(current->thread.saved_task)
show_regs(&(current->thread.regs));
next= current->thread.saved_task;
......@@ -136,7 +135,7 @@ void interrupt_end(void)
void release_thread(struct task_struct *task)
{
CHOOSE_MODE(release_thread_tt(task), release_thread_skas(task));
release_thread_skas(task);
}
void exit_thread(void)
......@@ -155,8 +154,7 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long sp,
int ret;
p->thread = (struct thread_struct) INIT_THREAD;
ret = CHOOSE_MODE_PROC(copy_thread_tt, copy_thread_skas, nr,
clone_flags, sp, stack_top, p, regs);
ret = copy_thread_skas(nr, clone_flags, sp, stack_top, p, regs);
if (ret || !current->thread.forking)
goto out;
......@@ -178,15 +176,12 @@ void initial_thread_cb(void (*proc)(void *), void *arg)
int save_kmalloc_ok = kmalloc_ok;
kmalloc_ok = 0;
CHOOSE_MODE_PROC(initial_thread_cb_tt, initial_thread_cb_skas, proc,
arg);
initial_thread_cb_skas(proc, arg);
kmalloc_ok = save_kmalloc_ok;
}
void default_idle(void)
{
CHOOSE_MODE(uml_idle_timer(), (void) 0);
while(1){
/* endless idle loop with no priority at all */
......@@ -203,7 +198,7 @@ void default_idle(void)
void cpu_idle(void)
{
CHOOSE_MODE(init_idle_tt(), init_idle_skas());
init_idle_skas();
}
void *um_virt_to_phys(struct task_struct *task, unsigned long addr,
......
......@@ -10,13 +10,12 @@
#include "kern.h"
#include "os.h"
#include "mode.h"
#include "choose-mode.h"
void (*pm_power_off)(void);
static void kill_off_processes(void)
{
CHOOSE_MODE(kill_off_processes_tt(), kill_off_processes_skas());
kill_off_processes_skas();
}
void uml_cleanup(void)
......@@ -29,13 +28,13 @@ void uml_cleanup(void)
void machine_restart(char * __unused)
{
uml_cleanup();
CHOOSE_MODE(reboot_tt(), reboot_skas());
reboot_skas();
}
void machine_power_off(void)
{
uml_cleanup();
CHOOSE_MODE(halt_tt(), halt_skas());
halt_skas();
}
void machine_halt(void)
......
......@@ -139,7 +139,7 @@ static int copy_chunk_from_user(unsigned long from, int len, void *arg)
return(0);
}
int copy_from_user_skas(void *to, const void __user *from, int n)
int copy_from_user(void *to, const void __user *from, int n)
{
if(segment_eq(get_fs(), KERNEL_DS)){
memcpy(to, (__force void*)from, n);
......@@ -160,7 +160,7 @@ static int copy_chunk_to_user(unsigned long to, int len, void *arg)
return(0);
}
int copy_to_user_skas(void __user *to, const void *from, int n)
int copy_to_user(void __user *to, const void *from, int n)
{
if(segment_eq(get_fs(), KERNEL_DS)){
memcpy((__force void*)to, from, n);
......@@ -186,7 +186,7 @@ static int strncpy_chunk_from_user(unsigned long from, int len, void *arg)
return(0);
}
int strncpy_from_user_skas(char *dst, const char __user *src, int count)
int strncpy_from_user(char *dst, const char __user *src, int count)
{
int n;
char *ptr = dst;
......@@ -212,12 +212,12 @@ static int clear_chunk(unsigned long addr, int len, void *unused)
return(0);
}
int __clear_user_skas(void __user *mem, int len)
int __clear_user(void __user *mem, int len)
{
return(buffer_op((unsigned long) mem, len, 1, clear_chunk, NULL));
}
int clear_user_skas(void __user *mem, int len)
int clear_user(void __user *mem, int len)
{
if(segment_eq(get_fs(), KERNEL_DS)){
memset((__force void*)mem, 0, len);
......@@ -240,7 +240,7 @@ static int strnlen_chunk(unsigned long str, int len, void *arg)
return(0);
}
int strnlen_user_skas(const void __user *str, int len)
int strnlen_user(const void __user *str, int len)
{
int count = 0, n;
......
......@@ -21,7 +21,6 @@
#include "kern_util.h"
#include "sysdep/syscalls.h"
#include "mode_kern.h"
#include "choose-mode.h"
/* Unlocked, I don't care if this is a bit off */
int nsyscalls = 0;
......
......@@ -181,9 +181,7 @@ void timer_handler(int sig, union uml_pt_regs *regs)
timer_irq(regs);
local_irq_disable();
irq_enter();
update_process_times(CHOOSE_MODE(
(UPT_SC(regs) && user_context(UPT_SP(regs))),
(regs)->skas.is_user));
update_process_times((regs)->skas.is_user);
irq_exit();
local_irq_enable();
}
......@@ -8,7 +8,6 @@
#include "asm/pgalloc.h"
#include "asm/pgtable.h"
#include "asm/tlbflush.h"
#include "choose-mode.h"
#include "mode_kern.h"
#include "as-layout.h"
#include "tlb.h"
......@@ -378,35 +377,31 @@ void flush_tlb_all(void)
void flush_tlb_kernel_range(unsigned long start, unsigned long end)
{
CHOOSE_MODE_PROC(flush_tlb_kernel_range_tt,
flush_tlb_kernel_range_common, start, end);
flush_tlb_kernel_range_common(start, end);
}
void flush_tlb_kernel_vm(void)
{
CHOOSE_MODE(flush_tlb_kernel_vm_tt(),
flush_tlb_kernel_range_common(start_vm, end_vm));