Skip to contentSkip to conversation

UML - Move libc-dependent time code

PATCH In review Jeff Dike 1 participant 1 message Jan 15, 2006 User-mode Linux (UML)

lore
Share & tools
lore

Jeff Dike

author
#0 lore raw

PATCH 3/11 UML - Move libc-dependent time code

From: Gennady Sharapov <[email protected]>

The serial UML OS-abstraction layer patch (um/kernel dir).

This moves all systemcalls from time.c file under os-Linux dir and joins time.c and tine_kernel.c files

arch/um/include/os.h +11 -1
Index: linux-2.6.15-mm/arch/um/include/os.h
===================================================================
@@ -190,7 +190,6 @@ extern int os_protect_memory(void *addr,
 			     int r, int w, int x);
 extern int os_unmap_memory(void *addr, int len);
 extern void os_flush_stdout(void);
-extern unsigned long long os_usecs(void);
 
 /* tt.c
  * for tt mode only (will be deleted in future...)
@@ -245,4 +244,15 @@ extern void setup_machinename(char *mach
 extern void setup_hostinfo(void);
 extern int setjmp_wrapper(void (*proc)(void *, void *), ...);
 
+/* time.c */
+#define BILLION (1000 * 1000 * 1000)
+
+extern void switch_timers(int to_real);
+extern void idle_sleep(int secs);
+extern void enable_timer(void);
+extern void disable_timer(void);
+extern void user_time_init(void);
+extern void uml_idle_timer(void);
+extern unsigned long long os_nsecs(void);
+
 #endif
arch/um/include/time_user.h deleted +0 -19
Index: linux-2.6.15-mm/arch/um/include/time_user.h
===================================================================
@@ -1,19 +0,0 @@
-/* 
- * Copyright (C) 2002 Jeff Dike ([email protected])
- * Licensed under the GPL
- */
-
-#ifndef __TIME_USER_H__
-#define __TIME_USER_H__
-
-extern void timer(void);
-extern void switch_timers(int to_real);
-extern void idle_sleep(int secs);
-extern void enable_timer(void);
-extern void prepare_timer(void * ptr);
-extern void disable_timer(void);
-extern unsigned long time_lock(void);
-extern void time_unlock(unsigned long);
-extern void user_time_init(void);
-
-#endif
arch/um/kernel/Makefile +2 -2
Index: linux-2.6.15-mm/arch/um/kernel/Makefile
===================================================================
@@ -9,7 +9,7 @@ clean-files :=
 obj-y = config.o exec_kern.o exitcode.o \
 	init_task.o irq.o irq_user.o ksyms.o mem.o physmem.o \
 	process_kern.o ptrace.o reboot.o resource.o sigio_user.o sigio_kern.o \
-	signal_kern.o smp.o syscall_kern.o sysrq.o time.o \
+	signal_kern.o smp.o syscall_kern.o sysrq.o \
 	time_kern.o tlb.o trap_kern.o uaccess.o um_arch.o umid.o
 
 obj-$(CONFIG_BLK_DEV_INITRD) += initrd.o
@@ -23,7 +23,7 @@ obj-$(CONFIG_MODE_SKAS) += skas/
 
 user-objs-$(CONFIG_TTY_LOG) += tty_log.o
 
-USER_OBJS := $(user-objs-y) config.o time.o tty_log.o
+USER_OBJS := $(user-objs-y) config.o tty_log.o
 
 include arch/um/scripts/Makefile.rules
 
arch/um/kernel/exec_kern.c +0 -1
Index: linux-2.6.15-mm/arch/um/kernel/exec_kern.c
===================================================================
@@ -17,7 +17,6 @@
 #include "irq_user.h"
 #include "tlb.h"
 #include "os.h"
-#include "time_user.h"
 #include "choose-mode.h"
 #include "mode_kern.h"
 
arch/um/kernel/process_kern.c +0 -1
Index: linux-2.6.15-mm/arch/um/kernel/process_kern.c
===================================================================
@@ -39,7 +39,6 @@
 #include "init.h"
 #include "irq_user.h"
 #include "mem_user.h"
-#include "time_user.h"
 #include "tlb.h"
 #include "frame_kern.h"
 #include "sigcontext.h"
arch/um/kernel/skas/process.c +0 -1
Index: linux-2.6.15-mm/arch/um/kernel/skas/process.c
===================================================================
@@ -18,7 +18,6 @@
 #include <asm/types.h>
 #include "user.h"
 #include "ptrace_user.h"
-#include "time_user.h"
 #include "sysdep/ptrace.h"
 #include "user_util.h"
 #include "kern_util.h"
arch/um/kernel/skas/process_kern.c +0 -1
Index: linux-2.6.15-mm/arch/um/kernel/skas/process_kern.c
===================================================================
@@ -13,7 +13,6 @@
 #include "asm/uaccess.h"
 #include "asm/atomic.h"
 #include "kern_util.h"
-#include "time_user.h"
 #include "skas.h"
 #include "os.h"
 #include "user_util.h"
arch/um/kernel/syscall.c +2 -2
Index: linux-2.6.15-mm/arch/um/kernel/syscall.c
===================================================================
@@ -25,12 +25,12 @@ int record_syscall_start(int syscall)
 	syscall_record[index].syscall = syscall;
 	syscall_record[index].pid = current_pid();
 	syscall_record[index].result = 0xdeadbeef;
-	syscall_record[index].start = os_usecs();
+	syscall_record[index].start = os_nsecs();
 	return(index);
 }
 
 void record_syscall_end(int index, long result)
 {
 	syscall_record[index].result = result;
-	syscall_record[index].end = os_usecs();
+	syscall_record[index].end = os_nsecs();
 }
arch/um/kernel/time_kern.c +76 -48

202 lines not on this page · raw message

arch/um/kernel/tt/exec_kern.c +0 -1
Index: linux-2.6.15-mm/arch/um/kernel/tt/exec_kern.c
===================================================================
@@ -13,7 +13,6 @@
 #include "user_util.h"
 #include "kern_util.h"
 #include "irq_user.h"
-#include "time_user.h"
 #include "mem_user.h"
 #include "os.h"
 #include "tlb.h"
arch/um/kernel/tt/process_kern.c +0 -1
Index: linux-2.6.15-mm/arch/um/kernel/tt/process_kern.c
===================================================================
@@ -18,7 +18,6 @@
 #include "os.h"
 #include "kern.h"
 #include "sigcontext.h"
-#include "time_user.h"
 #include "mem_user.h"
 #include "tlb.h"
 #include "mode.h"
arch/um/os-Linux/main.c +0 -1
Index: linux-2.6.15-mm/arch/um/os-Linux/main.c
===================================================================
@@ -16,7 +16,6 @@
 #include "user_util.h"
 #include "kern_util.h"
 #include "mem_user.h"
-#include "time_user.h"
 #include "irq_user.h"
 #include "user.h"
 #include "init.h"
arch/um/os-Linux/signal.c +1 -1
Index: linux-2.6.15-mm/arch/um/os-Linux/signal.c
===================================================================
@@ -18,8 +18,8 @@
 #include "sysdep/sigcontext.h"
 #include "sysdep/signal.h"
 #include "sigcontext.h"
-#include "time_user.h"
 #include "mode.h"
+#include "os.h"
 
 void sig_handler(ARCH_SIGHDLR_PARAM)
 {
arch/um/os-Linux/start_up.c +0 -1
Index: linux-2.6.15-mm/arch/um/os-Linux/start_up.c
===================================================================
@@ -29,7 +29,6 @@
 #include "irq_user.h"
 #include "ptrace_user.h"
 #include "mem_user.h"
-#include "time_user.h"
 #include "init.h"
 #include "os.h"
 #include "uml-config.h"
arch/um/os-Linux/time.c +119 -12

140 lines not on this page · raw message

arch/um/os-Linux/tt.c +0 -1
Index: linux-2.6.15-mm/arch/um/os-Linux/tt.c
===================================================================
@@ -27,7 +27,6 @@
 #include "sysdep/sigcontext.h"
 #include "irq_user.h"
 #include "ptrace_user.h"
-#include "time_user.h"
 #include "init.h"
 #include "os.h"
 #include "uml-config.h"

-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel