cregit-Linux how code gets into the kernel

Release 4.14 arch/um/kernel/time.c

Directory: arch/um/kernel
/*
 * 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

PersonTokensPropCommitsCommitProp
Jeff Dike2974.36%350.00%
Martin Pärtel512.82%116.67%
Gennady Sharapov37.69%116.67%
Paolo 'Blaisorblade' Giarrusso25.13%116.67%
Total39100.00%6100.00%


static int itimer_shutdown(struct clock_event_device *evt) { os_timer_disable(); return 0; }

Contributors

PersonTokensPropCommitsCommitProp
Jeff Dike741.18%125.00%
Viresh Kumar529.41%125.00%
Gennady Sharapov423.53%125.00%
Anton Ivanov15.88%125.00%
Total17100.00%4100.00%


static int itimer_set_periodic(struct clock_event_device *evt) { os_timer_set_interval(NULL, NULL); return 0; }

Contributors

PersonTokensPropCommitsCommitProp
Viresh Kumar1466.67%133.33%
Anton Ivanov628.57%133.33%
Gennady Sharapov14.76%133.33%
Total21100.00%3100.00%


static int itimer_next_event(unsigned long delta, struct clock_event_device *evt) { return os_timer_one_shot(delta); }

Contributors

PersonTokensPropCommitsCommitProp
Jeff Dike1780.95%150.00%
Anton Ivanov419.05%150.00%
Total21100.00%2100.00%


static int itimer_one_shot(struct clock_event_device *evt) { os_timer_one_shot(1); return 0; }

Contributors

PersonTokensPropCommitsCommitProp
Anton Ivanov1578.95%150.00%
Jeff Dike421.05%150.00%
Total19100.00%2100.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

PersonTokensPropCommitsCommitProp
Anton Ivanov3054.55%120.00%
Jeff Dike2036.36%240.00%
Paolo 'Blaisorblade' Giarrusso47.27%120.00%
Gennady Sharapov11.82%120.00%
Total55100.00%5100.00%


static u64 timer_read(struct clocksource *cs) { return os_nsecs() / TIMER_MULTIPLIER; }

Contributors

PersonTokensPropCommitsCommitProp
Jeff Dike1058.82%240.00%
Magnus Damm423.53%120.00%
Anton Ivanov211.76%120.00%
Thomas Gleixner15.88%120.00%
Total17100.00%5100.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

PersonTokensPropCommitsCommitProp
Jeff Dike7372.28%457.14%
Anton Ivanov2423.76%114.29%
John Stultz32.97%114.29%
Thomas Gleixner10.99%114.29%
Total101100.00%7100.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

PersonTokensPropCommitsCommitProp
Jeff Dike1860.00%240.00%
John Stultz723.33%120.00%
Thomas Gleixner413.33%120.00%
Anton Ivanov13.33%120.00%
Total30100.00%5100.00%


void __init time_init(void) { timer_set_signal_handler(); late_time_init = um_timer_setup; }

Contributors

PersonTokensPropCommitsCommitProp
John Stultz853.33%114.29%
Jeff Dike426.67%342.86%
Paolo 'Blaisorblade' Giarrusso16.67%114.29%
Anton Ivanov16.67%114.29%
Thomas Gleixner16.67%114.29%
Total15100.00%7100.00%


Overall Contributors

PersonTokensPropCommitsCommitProp
Jeff Dike27956.36%1346.43%
Anton Ivanov11924.04%13.57%
Viresh Kumar306.06%13.57%
John Stultz183.64%27.14%
Nicolai Stange112.22%13.57%
Gennady Sharapov91.82%13.57%
Thomas Gleixner71.41%310.71%
Paolo 'Blaisorblade' Giarrusso71.41%13.57%
Martin Pärtel51.01%13.57%
Magnus Damm40.81%13.57%
Adrian Bunk30.61%13.57%
Al Viro20.40%13.57%
Rusty Russell10.20%13.57%
Total495100.00%28100.00%
Directory: arch/um/kernel
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
Created with cregit.