Release 4.14 arch/um/kernel/time.c
/*
* Copyright (C) 2015 Anton Ivanov (aivanov@{brocade.com,kot-begemot.co.uk})
* Copyright (C) 2015 Thomas Meyer (thomas@m3y3r.de)
* Copyright (C) 2012-2014 Cisco Systems
* Copyright (C) 2000 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
* Licensed under the GPL
*/
#include <linux/clockchips.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/jiffies.h>
#include <linux/mm.h>
#include <linux/sched.h>
#include <linux/spinlock.h>
#include <linux/threads.h>
#include <asm/irq.h>
#include <asm/param.h>
#include <kern_util.h>
#include <os.h>
#include <timer-internal.h>
void timer_handler(int sig, struct siginfo *unused_si, struct uml_pt_regs *regs)
{
unsigned long flags;
local_irq_save(flags);
do_IRQ(TIMER_IRQ, regs);
local_irq_restore(flags);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Jeff Dike | 29 | 74.36% | 3 | 50.00% |
Martin Pärtel | 5 | 12.82% | 1 | 16.67% |
Gennady Sharapov | 3 | 7.69% | 1 | 16.67% |
Paolo 'Blaisorblade' Giarrusso | 2 | 5.13% | 1 | 16.67% |
Total | 39 | 100.00% | 6 | 100.00% |
static int itimer_shutdown(struct clock_event_device *evt)
{
os_timer_disable();
return 0;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Jeff Dike | 7 | 41.18% | 1 | 25.00% |
Viresh Kumar | 5 | 29.41% | 1 | 25.00% |
Gennady Sharapov | 4 | 23.53% | 1 | 25.00% |
Anton Ivanov | 1 | 5.88% | 1 | 25.00% |
Total | 17 | 100.00% | 4 | 100.00% |
static int itimer_set_periodic(struct clock_event_device *evt)
{
os_timer_set_interval(NULL, NULL);
return 0;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Viresh Kumar | 14 | 66.67% | 1 | 33.33% |
Anton Ivanov | 6 | 28.57% | 1 | 33.33% |
Gennady Sharapov | 1 | 4.76% | 1 | 33.33% |
Total | 21 | 100.00% | 3 | 100.00% |
static int itimer_next_event(unsigned long delta,
struct clock_event_device *evt)
{
return os_timer_one_shot(delta);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Jeff Dike | 17 | 80.95% | 1 | 50.00% |
Anton Ivanov | 4 | 19.05% | 1 | 50.00% |
Total | 21 | 100.00% | 2 | 100.00% |
static int itimer_one_shot(struct clock_event_device *evt)
{
os_timer_one_shot(1);
return 0;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Anton Ivanov | 15 | 78.95% | 1 | 50.00% |
Jeff Dike | 4 | 21.05% | 1 | 50.00% |
Total | 19 | 100.00% | 2 | 100.00% |
static struct clock_event_device timer_clockevent = {
.name = "posix-timer",
.rating = 250,
.cpumask = cpu_all_mask,
.features = CLOCK_EVT_FEAT_PERIODIC |
CLOCK_EVT_FEAT_ONESHOT,
.set_state_shutdown = itimer_shutdown,
.set_state_periodic = itimer_set_periodic,
.set_state_oneshot = itimer_one_shot,
.set_next_event = itimer_next_event,
.shift = 0,
.max_delta_ns = 0xffffffff,
.max_delta_ticks = 0xffffffff,
.min_delta_ns = TIMER_MIN_DELTA,
.min_delta_ticks = TIMER_MIN_DELTA, // microsecond resolution should be enough for anyone, same as 640K RAM
.irq = 0,
.mult = 1,
};
static irqreturn_t um_timer(int irq, void *dev)
{
if (get_current()->mm != NULL)
{
/* userspace - relay signal, results in correct userspace timers */
os_alarm_process(get_current()->mm->context.id.u.pid);
}
(*timer_clockevent.event_handler)(&timer_clockevent);
return IRQ_HANDLED;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Anton Ivanov | 30 | 54.55% | 1 | 20.00% |
Jeff Dike | 20 | 36.36% | 2 | 40.00% |
Paolo 'Blaisorblade' Giarrusso | 4 | 7.27% | 1 | 20.00% |
Gennady Sharapov | 1 | 1.82% | 1 | 20.00% |
Total | 55 | 100.00% | 5 | 100.00% |
static u64 timer_read(struct clocksource *cs)
{
return os_nsecs() / TIMER_MULTIPLIER;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Jeff Dike | 10 | 58.82% | 2 | 40.00% |
Magnus Damm | 4 | 23.53% | 1 | 20.00% |
Anton Ivanov | 2 | 11.76% | 1 | 20.00% |
Thomas Gleixner | 1 | 5.88% | 1 | 20.00% |
Total | 17 | 100.00% | 5 | 100.00% |
static struct clocksource timer_clocksource = {
.name = "timer",
.rating = 300,
.read = timer_read,
.mask = CLOCKSOURCE_MASK(64),
.flags = CLOCK_SOURCE_IS_CONTINUOUS,
};
static void __init um_timer_setup(void)
{
int err;
err = request_irq(TIMER_IRQ, um_timer, IRQF_TIMER, "hr timer", NULL);
if (err != 0)
printk(KERN_ERR "register_timer : request_irq failed - "
"errno = %d\n", -err);
err = os_timer_create(NULL);
if (err != 0) {
printk(KERN_ERR "creation of timer failed - errno = %d\n", -err);
return;
}
err = clocksource_register_hz(&timer_clocksource, NSEC_PER_SEC/TIMER_MULTIPLIER);
if (err) {
printk(KERN_ERR "clocksource_register_hz returned %d\n", err);
return;
}
clockevents_register_device(&timer_clockevent);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Jeff Dike | 73 | 72.28% | 4 | 57.14% |
Anton Ivanov | 24 | 23.76% | 1 | 14.29% |
John Stultz | 3 | 2.97% | 1 | 14.29% |
Thomas Gleixner | 1 | 0.99% | 1 | 14.29% |
Total | 101 | 100.00% | 7 | 100.00% |
void read_persistent_clock(struct timespec *ts)
{
long long nsecs = os_persistent_clock_emulation();
set_normalized_timespec(ts, nsecs / NSEC_PER_SEC,
nsecs % NSEC_PER_SEC);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Jeff Dike | 18 | 60.00% | 2 | 40.00% |
John Stultz | 7 | 23.33% | 1 | 20.00% |
Thomas Gleixner | 4 | 13.33% | 1 | 20.00% |
Anton Ivanov | 1 | 3.33% | 1 | 20.00% |
Total | 30 | 100.00% | 5 | 100.00% |
void __init time_init(void)
{
timer_set_signal_handler();
late_time_init = um_timer_setup;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
John Stultz | 8 | 53.33% | 1 | 14.29% |
Jeff Dike | 4 | 26.67% | 3 | 42.86% |
Paolo 'Blaisorblade' Giarrusso | 1 | 6.67% | 1 | 14.29% |
Anton Ivanov | 1 | 6.67% | 1 | 14.29% |
Thomas Gleixner | 1 | 6.67% | 1 | 14.29% |
Total | 15 | 100.00% | 7 | 100.00% |
Overall Contributors
Person | Tokens | Prop | Commits | CommitProp |
Jeff Dike | 279 | 56.36% | 13 | 46.43% |
Anton Ivanov | 119 | 24.04% | 1 | 3.57% |
Viresh Kumar | 30 | 6.06% | 1 | 3.57% |
John Stultz | 18 | 3.64% | 2 | 7.14% |
Nicolai Stange | 11 | 2.22% | 1 | 3.57% |
Gennady Sharapov | 9 | 1.82% | 1 | 3.57% |
Thomas Gleixner | 7 | 1.41% | 3 | 10.71% |
Paolo 'Blaisorblade' Giarrusso | 7 | 1.41% | 1 | 3.57% |
Martin Pärtel | 5 | 1.01% | 1 | 3.57% |
Magnus Damm | 4 | 0.81% | 1 | 3.57% |
Adrian Bunk | 3 | 0.61% | 1 | 3.57% |
Al Viro | 2 | 0.40% | 1 | 3.57% |
Rusty Russell | 1 | 0.20% | 1 | 3.57% |
Total | 495 | 100.00% | 28 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.