Release 4.10 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 | jeff dike | 29 | 74.36% | 3 | 50.00% |
martin partel | martin partel | 5 | 12.82% | 1 | 16.67% |
gennady sharapov | gennady sharapov | 3 | 7.69% | 1 | 16.67% |
paolo giarrusso | paolo 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 | jeff dike | 7 | 41.18% | 1 | 25.00% |
viresh kumar | viresh kumar | 5 | 29.41% | 1 | 25.00% |
gennady sharapov | gennady sharapov | 4 | 23.53% | 1 | 25.00% |
anton ivanov | 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 | viresh kumar | 14 | 66.67% | 1 | 33.33% |
anton ivanov | anton ivanov | 6 | 28.57% | 1 | 33.33% |
gennady sharapov | 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 | jeff dike | 17 | 80.95% | 1 | 50.00% |
anton ivanov | 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 | anton ivanov | 15 | 78.95% | 1 | 50.00% |
jeff dike | 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,
.min_delta_ns = 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 | anton ivanov | 30 | 54.55% | 1 | 20.00% |
jeff dike | jeff dike | 20 | 36.36% | 2 | 40.00% |
paolo giarrusso | paolo giarrusso | 4 | 7.27% | 1 | 20.00% |
gennady sharapov | 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 | jeff dike | 10 | 58.82% | 2 | 40.00% |
magnus damm | magnus damm | 4 | 23.53% | 1 | 20.00% |
anton ivanov | anton ivanov | 2 | 11.76% | 1 | 20.00% |
thomas gleixner | 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 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 | jeff dike | 73 | 72.28% | 4 | 66.67% |
anton ivanov | anton ivanov | 25 | 24.75% | 1 | 16.67% |
john stultz | john stultz | 3 | 2.97% | 1 | 16.67% |
| Total | 101 | 100.00% | 6 | 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 | jeff dike | 18 | 60.00% | 2 | 40.00% |
john stultz | john stultz | 7 | 23.33% | 1 | 20.00% |
thomas gleixner | thomas gleixner | 4 | 13.33% | 1 | 20.00% |
anton ivanov | 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 = timer_setup;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
john stultz | john stultz | 8 | 53.33% | 1 | 16.67% |
jeff dike | jeff dike | 4 | 26.67% | 3 | 50.00% |
anton ivanov | anton ivanov | 2 | 13.33% | 1 | 16.67% |
paolo giarrusso | paolo giarrusso | 1 | 6.67% | 1 | 16.67% |
| Total | 15 | 100.00% | 6 | 100.00% |
Overall Contributors
| Person | Tokens | Prop | Commits | CommitProp |
jeff dike | jeff dike | 277 | 57.11% | 12 | 48.00% |
anton ivanov | anton ivanov | 122 | 25.15% | 1 | 4.00% |
viresh kumar | viresh kumar | 30 | 6.19% | 1 | 4.00% |
john stultz | john stultz | 18 | 3.71% | 2 | 8.00% |
gennady sharapov | gennady sharapov | 11 | 2.27% | 1 | 4.00% |
paolo giarrusso | paolo giarrusso | 7 | 1.44% | 1 | 4.00% |
thomas gleixner | thomas gleixner | 5 | 1.03% | 2 | 8.00% |
martin partel | martin partel | 5 | 1.03% | 1 | 4.00% |
magnus damm | magnus damm | 4 | 0.82% | 1 | 4.00% |
adrian bunk | adrian bunk | 3 | 0.62% | 1 | 4.00% |
al viro | al viro | 2 | 0.41% | 1 | 4.00% |
rusty russell | rusty russell | 1 | 0.21% | 1 | 4.00% |
| Total | 485 | 100.00% | 25 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.