aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/os-Linux
diff options
context:
space:
mode:
authorJeff Dike <jdike@addtoit.com>2007-10-16 04:26:56 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-16 12:43:05 -0400
commit6aa802ce6acc9b1f0b34114b3f7c21c84872cc3a (patch)
tree74523303349693ef482dec4a1d803566b69c6abd /arch/um/os-Linux
parent4c9e13851315a25a705e7a686116e491041ca228 (diff)
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 'arch/um/os-Linux')
-rw-r--r--arch/um/os-Linux/aio.c5
-rw-r--r--arch/um/os-Linux/main.c10
-rw-r--r--arch/um/os-Linux/signal.c6
-rw-r--r--arch/um/os-Linux/start_up.c1
-rw-r--r--arch/um/os-Linux/trap.c1
5 files changed, 5 insertions, 18 deletions
diff --git a/arch/um/os-Linux/aio.c b/arch/um/os-Linux/aio.c
index 59348359f9ab..c8f5b7a2c1c6 100644
--- a/arch/um/os-Linux/aio.c
+++ b/arch/um/os-Linux/aio.c
@@ -320,11 +320,6 @@ static int init_aio(void)
320{ 320{
321 int err; 321 int err;
322 322
323 CHOOSE_MODE(({ if(!aio_24){
324 printk("Disabling 2.6 AIO in tt mode\n");
325 aio_24 = 1;
326 } }), (void) 0);
327
328 if(!aio_24){ 323 if(!aio_24){
329 err = init_aio_26(); 324 err = init_aio_26();
330 if(err && (errno == ENOSYS)){ 325 if(err && (errno == ENOSYS)){
diff --git a/arch/um/os-Linux/main.c b/arch/um/os-Linux/main.c
index 425aa8960649..bfabb883daae 100644
--- a/arch/um/os-Linux/main.c
+++ b/arch/um/os-Linux/main.c
@@ -19,7 +19,6 @@
19#include "user.h" 19#include "user.h"
20#include "init.h" 20#include "init.h"
21#include "mode.h" 21#include "mode.h"
22#include "choose-mode.h"
23#include "uml-config.h" 22#include "uml-config.h"
24#include "os.h" 23#include "os.h"
25#include "um_malloc.h" 24#include "um_malloc.h"
@@ -189,16 +188,13 @@ int __init main(int argc, char **argv, char **envp)
189 return uml_exitcode; 188 return uml_exitcode;
190} 189}
191 190
192#define CAN_KMALLOC() \
193 (kmalloc_ok && CHOOSE_MODE((os_getpid() != tracing_pid), 1))
194
195extern void *__real_malloc(int); 191extern void *__real_malloc(int);
196 192
197void *__wrap_malloc(int size) 193void *__wrap_malloc(int size)
198{ 194{
199 void *ret; 195 void *ret;
200 196
201 if(!CAN_KMALLOC()) 197 if(!kmalloc_ok)
202 return __real_malloc(size); 198 return __real_malloc(size);
203 else if(size <= UM_KERN_PAGE_SIZE) 199 else if(size <= UM_KERN_PAGE_SIZE)
204 /* finding contiguous pages can be hard*/ 200 /* finding contiguous pages can be hard*/
@@ -251,11 +247,11 @@ void __wrap_free(void *ptr)
251 */ 247 */
252 248
253 if((addr >= uml_physmem) && (addr < high_physmem)){ 249 if((addr >= uml_physmem) && (addr < high_physmem)){
254 if(CAN_KMALLOC()) 250 if(kmalloc_ok)
255 kfree(ptr); 251 kfree(ptr);
256 } 252 }
257 else if((addr >= start_vm) && (addr < end_vm)){ 253 else if((addr >= start_vm) && (addr < end_vm)){
258 if(CAN_KMALLOC()) 254 if(kmalloc_ok)
259 vfree(ptr); 255 vfree(ptr);
260 } 256 }
261 else __real_free(ptr); 257 else __real_free(ptr);
diff --git a/arch/um/os-Linux/signal.c b/arch/um/os-Linux/signal.c
index b98f7ea2d2f6..0d6122adb8a7 100644
--- a/arch/um/os-Linux/signal.c
+++ b/arch/um/os-Linux/signal.c
@@ -53,8 +53,7 @@ void sig_handler(int sig, struct sigcontext *sc)
53 53
54 block_signals(); 54 block_signals();
55 55
56 CHOOSE_MODE_PROC(sig_handler_common_tt, sig_handler_common_skas, 56 sig_handler_common_skas(sig, sc);
57 sig, sc);
58 57
59 set_signals(enabled); 58 set_signals(enabled);
60} 59}
@@ -257,8 +256,7 @@ void unblock_signals(void)
257 * back here. 256 * back here.
258 */ 257 */
259 if(save_pending & SIGIO_MASK) 258 if(save_pending & SIGIO_MASK)
260 CHOOSE_MODE_PROC(sig_handler_common_tt, 259 sig_handler_common_skas(SIGIO, NULL);
261 sig_handler_common_skas, SIGIO, NULL);
262 260
263 if(save_pending & SIGALRM_MASK) 261 if(save_pending & SIGALRM_MASK)
264 real_alarm_handler(SIGALRM, NULL); 262 real_alarm_handler(SIGALRM, NULL);
diff --git a/arch/um/os-Linux/start_up.c b/arch/um/os-Linux/start_up.c
index acf52ea4ff52..da5c90df5c9e 100644
--- a/arch/um/os-Linux/start_up.c
+++ b/arch/um/os-Linux/start_up.c
@@ -31,7 +31,6 @@
31#include "init.h" 31#include "init.h"
32#include "os.h" 32#include "os.h"
33#include "uml-config.h" 33#include "uml-config.h"
34#include "choose-mode.h"
35#include "mode.h" 34#include "mode.h"
36#include "tempfile.h" 35#include "tempfile.h"
37#include "kern_constants.h" 36#include "kern_constants.h"
diff --git a/arch/um/os-Linux/trap.c b/arch/um/os-Linux/trap.c
index 295da657931a..b17f546c3655 100644
--- a/arch/um/os-Linux/trap.c
+++ b/arch/um/os-Linux/trap.c
@@ -12,7 +12,6 @@
12 12
13void usr2_handler(int sig, union uml_pt_regs *regs) 13void usr2_handler(int sig, union uml_pt_regs *regs)
14{ 14{
15 CHOOSE_MODE(syscall_handler_tt(sig, regs), (void) 0);
16} 15}
17 16
18/* Initialized from linux_main() */ 17/* Initialized from linux_main() */