diff options
author | Jeff Dike <jdike@addtoit.com> | 2007-10-16 08:27:25 (GMT) |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-16 16:43:08 (GMT) |
commit | d2753a6d199791a6abc75d9f657e3457fe61705f (patch) | |
tree | c4cda30f216d6c045ca2b83bee1fa6bc4dfc3de3 /arch/um/os-Linux/skas | |
parent | 791a644a8d73a9b95515f074afbb3caa0a9964fa (diff) | |
download | linux-fsl-qoriq-d2753a6d199791a6abc75d9f657e3457fe61705f.tar.xz |
uml: tickless support
Enable tickless support.
CONFIG_TICK_ONESHOT and CONFIG_NO_HZ are enabled.
itimer_clockevent gets CLOCK_EVT_FEAT_ONESHOT and an implementation of
.set_next_event.
CONFIG_UML_REAL_TIME_CLOCK goes away because it only makes sense when there is
a clock ticking away all the time. timer_handler now just calls do_IRQ once
without trying to figure out how many ticks to emulate.
The idle loop now needs to turn ticking on and off.
Userspace ticks keep happening as usual. However, the userspace loop keep
track of when the next wakeup should happen and suppresses process ticks until
that happens.
Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
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/skas')
-rw-r--r-- | arch/um/os-Linux/skas/process.c | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/arch/um/os-Linux/skas/process.c b/arch/um/os-Linux/skas/process.c index 0036164..3e64814 100644 --- a/arch/um/os-Linux/skas/process.c +++ b/arch/um/os-Linux/skas/process.c @@ -287,10 +287,18 @@ int start_userspace(unsigned long stub_stack) void userspace(struct uml_pt_regs *regs) { + struct itimerval timer; + unsigned long long nsecs, now; int err, status, op, pid = userspace_pid[0]; /* To prevent races if using_sysemu changes under us.*/ int local_using_sysemu; + if (getitimer(ITIMER_VIRTUAL, &timer)) + printk("Failed to get itimer, errno = %d\n", errno); + nsecs = timer.it_value.tv_sec * BILLION + + timer.it_value.tv_usec * 1000; + nsecs += os_nsecs(); + while (1) { restore_registers(pid, regs); @@ -333,8 +341,18 @@ void userspace(struct uml_pt_regs *regs) case SIGTRAP: relay_signal(SIGTRAP, regs); break; - case SIGIO: case SIGVTALRM: + now = os_nsecs(); + if(now < nsecs) + break; + block_signals(); + (*sig_info[sig])(sig, regs); + unblock_signals(); + nsecs = timer.it_value.tv_sec * BILLION + + timer.it_value.tv_usec * 1000; + nsecs += os_nsecs(); + break; + case SIGIO: case SIGILL: case SIGBUS: case SIGFPE: @@ -378,6 +396,7 @@ __initcall(init_thread_regs); int copy_context_skas0(unsigned long new_stack, int pid) { + struct timeval tv = { .tv_sec = 0, .tv_usec = 1000000 / UM_HZ }; int err; unsigned long current_stack = current_stub_stack(); struct stub_data *data = (struct stub_data *) current_stack; @@ -392,9 +411,9 @@ int copy_context_skas0(unsigned long new_stack, int pid) *data = ((struct stub_data) { .offset = MMAP_OFFSET(new_offset), .fd = new_fd, .timer = ((struct itimerval) - { { 0, 1000000 / UM_HZ }, - { 0, 1000000 / UM_HZ }}) - }); + { .it_value = tv, + .it_interval = tv }) }); + err = ptrace_setregs(pid, thread_regs); if (err < 0) panic("copy_context_skas0 : PTRACE_SETREGS failed, " |