1c1b40e44SStuart Menefy /* 2c1b40e44SStuart Menefy * drivers/clocksource/arm_global_timer.c 3c1b40e44SStuart Menefy * 4c1b40e44SStuart Menefy * Copyright (C) 2013 STMicroelectronics (R&D) Limited. 5c1b40e44SStuart Menefy * Author: Stuart Menefy <[email protected]> 6c1b40e44SStuart Menefy * Author: Srinivas Kandagatla <[email protected]> 7c1b40e44SStuart Menefy * 8c1b40e44SStuart Menefy * This program is free software; you can redistribute it and/or modify 9c1b40e44SStuart Menefy * it under the terms of the GNU General Public License version 2 as 10c1b40e44SStuart Menefy * published by the Free Software Foundation. 11c1b40e44SStuart Menefy */ 12c1b40e44SStuart Menefy 13c1b40e44SStuart Menefy #include <linux/init.h> 14c1b40e44SStuart Menefy #include <linux/interrupt.h> 15c1b40e44SStuart Menefy #include <linux/clocksource.h> 16c1b40e44SStuart Menefy #include <linux/clockchips.h> 17c1b40e44SStuart Menefy #include <linux/cpu.h> 18c1b40e44SStuart Menefy #include <linux/clk.h> 19bbaa0670SRabin Vincent #include <linux/delay.h> 20c1b40e44SStuart Menefy #include <linux/err.h> 21c1b40e44SStuart Menefy #include <linux/io.h> 22c1b40e44SStuart Menefy #include <linux/of.h> 23c1b40e44SStuart Menefy #include <linux/of_irq.h> 24c1b40e44SStuart Menefy #include <linux/of_address.h> 25c1b40e44SStuart Menefy #include <linux/sched_clock.h> 26c1b40e44SStuart Menefy 27c1b40e44SStuart Menefy #include <asm/cputype.h> 28c1b40e44SStuart Menefy 29c1b40e44SStuart Menefy #define GT_COUNTER0 0x00 30c1b40e44SStuart Menefy #define GT_COUNTER1 0x04 31c1b40e44SStuart Menefy 32c1b40e44SStuart Menefy #define GT_CONTROL 0x08 33c1b40e44SStuart Menefy #define GT_CONTROL_TIMER_ENABLE BIT(0) /* this bit is NOT banked */ 34c1b40e44SStuart Menefy #define GT_CONTROL_COMP_ENABLE BIT(1) /* banked */ 35c1b40e44SStuart Menefy #define GT_CONTROL_IRQ_ENABLE BIT(2) /* banked */ 36c1b40e44SStuart Menefy #define GT_CONTROL_AUTO_INC BIT(3) /* banked */ 37c1b40e44SStuart Menefy 38c1b40e44SStuart Menefy #define GT_INT_STATUS 0x0c 39c1b40e44SStuart Menefy #define GT_INT_STATUS_EVENT_FLAG BIT(0) 40c1b40e44SStuart Menefy 41c1b40e44SStuart Menefy #define GT_COMP0 0x10 42c1b40e44SStuart Menefy #define GT_COMP1 0x14 43c1b40e44SStuart Menefy #define GT_AUTO_INC 0x18 44c1b40e44SStuart Menefy 45c1b40e44SStuart Menefy /* 46c1b40e44SStuart Menefy * We are expecting to be clocked by the ARM peripheral clock. 47c1b40e44SStuart Menefy * 48c1b40e44SStuart Menefy * Note: it is assumed we are using a prescaler value of zero, so this is 49c1b40e44SStuart Menefy * the units for all operations. 50c1b40e44SStuart Menefy */ 51c1b40e44SStuart Menefy static void __iomem *gt_base; 52c1b40e44SStuart Menefy static unsigned long gt_clk_rate; 53c1b40e44SStuart Menefy static int gt_ppi; 54c1b40e44SStuart Menefy static struct clock_event_device __percpu *gt_evt; 55c1b40e44SStuart Menefy 56c1b40e44SStuart Menefy /* 57c1b40e44SStuart Menefy * To get the value from the Global Timer Counter register proceed as follows: 58c1b40e44SStuart Menefy * 1. Read the upper 32-bit timer counter register 59c1b40e44SStuart Menefy * 2. Read the lower 32-bit timer counter register 60c1b40e44SStuart Menefy * 3. Read the upper 32-bit timer counter register again. If the value is 61c1b40e44SStuart Menefy * different to the 32-bit upper value read previously, go back to step 2. 62c1b40e44SStuart Menefy * Otherwise the 64-bit timer counter value is correct. 63c1b40e44SStuart Menefy */ 64d6df3576SJisheng Zhang static u64 notrace _gt_counter_read(void) 65c1b40e44SStuart Menefy { 66c1b40e44SStuart Menefy u64 counter; 67c1b40e44SStuart Menefy u32 lower; 68c1b40e44SStuart Menefy u32 upper, old_upper; 69c1b40e44SStuart Menefy 70c1b40e44SStuart Menefy upper = readl_relaxed(gt_base + GT_COUNTER1); 71c1b40e44SStuart Menefy do { 72c1b40e44SStuart Menefy old_upper = upper; 73c1b40e44SStuart Menefy lower = readl_relaxed(gt_base + GT_COUNTER0); 74c1b40e44SStuart Menefy upper = readl_relaxed(gt_base + GT_COUNTER1); 75c1b40e44SStuart Menefy } while (upper != old_upper); 76c1b40e44SStuart Menefy 77c1b40e44SStuart Menefy counter = upper; 78c1b40e44SStuart Menefy counter <<= 32; 79c1b40e44SStuart Menefy counter |= lower; 80c1b40e44SStuart Menefy return counter; 81c1b40e44SStuart Menefy } 82c1b40e44SStuart Menefy 83d6df3576SJisheng Zhang static u64 gt_counter_read(void) 84d6df3576SJisheng Zhang { 85d6df3576SJisheng Zhang return _gt_counter_read(); 86d6df3576SJisheng Zhang } 87d6df3576SJisheng Zhang 88c1b40e44SStuart Menefy /** 89c1b40e44SStuart Menefy * To ensure that updates to comparator value register do not set the 90c1b40e44SStuart Menefy * Interrupt Status Register proceed as follows: 91c1b40e44SStuart Menefy * 1. Clear the Comp Enable bit in the Timer Control Register. 92c1b40e44SStuart Menefy * 2. Write the lower 32-bit Comparator Value Register. 93c1b40e44SStuart Menefy * 3. Write the upper 32-bit Comparator Value Register. 94c1b40e44SStuart Menefy * 4. Set the Comp Enable bit and, if necessary, the IRQ enable bit. 95c1b40e44SStuart Menefy */ 96c1b40e44SStuart Menefy static void gt_compare_set(unsigned long delta, int periodic) 97c1b40e44SStuart Menefy { 98c1b40e44SStuart Menefy u64 counter = gt_counter_read(); 99c1b40e44SStuart Menefy unsigned long ctrl; 100c1b40e44SStuart Menefy 101c1b40e44SStuart Menefy counter += delta; 102c1b40e44SStuart Menefy ctrl = GT_CONTROL_TIMER_ENABLE; 10308e4b448SJisheng Zhang writel_relaxed(ctrl, gt_base + GT_CONTROL); 10408e4b448SJisheng Zhang writel_relaxed(lower_32_bits(counter), gt_base + GT_COMP0); 10508e4b448SJisheng Zhang writel_relaxed(upper_32_bits(counter), gt_base + GT_COMP1); 106c1b40e44SStuart Menefy 107c1b40e44SStuart Menefy if (periodic) { 10808e4b448SJisheng Zhang writel_relaxed(delta, gt_base + GT_AUTO_INC); 109c1b40e44SStuart Menefy ctrl |= GT_CONTROL_AUTO_INC; 110c1b40e44SStuart Menefy } 111c1b40e44SStuart Menefy 112c1b40e44SStuart Menefy ctrl |= GT_CONTROL_COMP_ENABLE | GT_CONTROL_IRQ_ENABLE; 11308e4b448SJisheng Zhang writel_relaxed(ctrl, gt_base + GT_CONTROL); 114c1b40e44SStuart Menefy } 115c1b40e44SStuart Menefy 116e511e6c3SViresh Kumar static int gt_clockevent_shutdown(struct clock_event_device *evt) 117c1b40e44SStuart Menefy { 118c1b40e44SStuart Menefy unsigned long ctrl; 119c1b40e44SStuart Menefy 120c1b40e44SStuart Menefy ctrl = readl(gt_base + GT_CONTROL); 121e511e6c3SViresh Kumar ctrl &= ~(GT_CONTROL_COMP_ENABLE | GT_CONTROL_IRQ_ENABLE | 122e511e6c3SViresh Kumar GT_CONTROL_AUTO_INC); 123c1b40e44SStuart Menefy writel(ctrl, gt_base + GT_CONTROL); 124e511e6c3SViresh Kumar return 0; 125c1b40e44SStuart Menefy } 126e511e6c3SViresh Kumar 127e511e6c3SViresh Kumar static int gt_clockevent_set_periodic(struct clock_event_device *evt) 128e511e6c3SViresh Kumar { 129e511e6c3SViresh Kumar gt_compare_set(DIV_ROUND_CLOSEST(gt_clk_rate, HZ), 1); 130e511e6c3SViresh Kumar return 0; 131c1b40e44SStuart Menefy } 132c1b40e44SStuart Menefy 133c1b40e44SStuart Menefy static int gt_clockevent_set_next_event(unsigned long evt, 134c1b40e44SStuart Menefy struct clock_event_device *unused) 135c1b40e44SStuart Menefy { 136c1b40e44SStuart Menefy gt_compare_set(evt, 0); 137c1b40e44SStuart Menefy return 0; 138c1b40e44SStuart Menefy } 139c1b40e44SStuart Menefy 140c1b40e44SStuart Menefy static irqreturn_t gt_clockevent_interrupt(int irq, void *dev_id) 141c1b40e44SStuart Menefy { 142c1b40e44SStuart Menefy struct clock_event_device *evt = dev_id; 143c1b40e44SStuart Menefy 144c1b40e44SStuart Menefy if (!(readl_relaxed(gt_base + GT_INT_STATUS) & 145c1b40e44SStuart Menefy GT_INT_STATUS_EVENT_FLAG)) 146c1b40e44SStuart Menefy return IRQ_NONE; 147c1b40e44SStuart Menefy 148c1b40e44SStuart Menefy /** 149c1b40e44SStuart Menefy * ERRATA 740657( Global Timer can send 2 interrupts for 150c1b40e44SStuart Menefy * the same event in single-shot mode) 151c1b40e44SStuart Menefy * Workaround: 152c1b40e44SStuart Menefy * Either disable single-shot mode. 153c1b40e44SStuart Menefy * Or 154c1b40e44SStuart Menefy * Modify the Interrupt Handler to avoid the 155c1b40e44SStuart Menefy * offending sequence. This is achieved by clearing 156c1b40e44SStuart Menefy * the Global Timer flag _after_ having incremented 157c1b40e44SStuart Menefy * the Comparator register value to a higher value. 158c1b40e44SStuart Menefy */ 159e511e6c3SViresh Kumar if (clockevent_state_oneshot(evt)) 160c1b40e44SStuart Menefy gt_compare_set(ULONG_MAX, 0); 161c1b40e44SStuart Menefy 162c1b40e44SStuart Menefy writel_relaxed(GT_INT_STATUS_EVENT_FLAG, gt_base + GT_INT_STATUS); 163c1b40e44SStuart Menefy evt->event_handler(evt); 164c1b40e44SStuart Menefy 165c1b40e44SStuart Menefy return IRQ_HANDLED; 166c1b40e44SStuart Menefy } 167c1b40e44SStuart Menefy 1688c37bb3aSPaul Gortmaker static int gt_clockevents_init(struct clock_event_device *clk) 169c1b40e44SStuart Menefy { 170c1b40e44SStuart Menefy int cpu = smp_processor_id(); 171c1b40e44SStuart Menefy 172c1b40e44SStuart Menefy clk->name = "arm_global_timer"; 1736661039dSSoren Brinkmann clk->features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT | 1746661039dSSoren Brinkmann CLOCK_EVT_FEAT_PERCPU; 175e511e6c3SViresh Kumar clk->set_state_shutdown = gt_clockevent_shutdown; 176e511e6c3SViresh Kumar clk->set_state_periodic = gt_clockevent_set_periodic; 177e511e6c3SViresh Kumar clk->set_state_oneshot = gt_clockevent_shutdown; 1783effa3ceSViresh Kumar clk->set_state_oneshot_stopped = gt_clockevent_shutdown; 179c1b40e44SStuart Menefy clk->set_next_event = gt_clockevent_set_next_event; 180c1b40e44SStuart Menefy clk->cpumask = cpumask_of(cpu); 181c1b40e44SStuart Menefy clk->rating = 300; 182c1b40e44SStuart Menefy clk->irq = gt_ppi; 183c1b40e44SStuart Menefy clockevents_config_and_register(clk, gt_clk_rate, 184c1b40e44SStuart Menefy 1, 0xffffffff); 185c1b40e44SStuart Menefy enable_percpu_irq(clk->irq, IRQ_TYPE_NONE); 186c1b40e44SStuart Menefy return 0; 187c1b40e44SStuart Menefy } 188c1b40e44SStuart Menefy 189c1b40e44SStuart Menefy static void gt_clockevents_stop(struct clock_event_device *clk) 190c1b40e44SStuart Menefy { 191e511e6c3SViresh Kumar gt_clockevent_shutdown(clk); 192c1b40e44SStuart Menefy disable_percpu_irq(clk->irq); 193c1b40e44SStuart Menefy } 194c1b40e44SStuart Menefy 195c1b40e44SStuart Menefy static cycle_t gt_clocksource_read(struct clocksource *cs) 196c1b40e44SStuart Menefy { 197c1b40e44SStuart Menefy return gt_counter_read(); 198c1b40e44SStuart Menefy } 199c1b40e44SStuart Menefy 2009c9ae5ffSGrygorii Strashko static void gt_resume(struct clocksource *cs) 2019c9ae5ffSGrygorii Strashko { 2029c9ae5ffSGrygorii Strashko unsigned long ctrl; 2039c9ae5ffSGrygorii Strashko 2049c9ae5ffSGrygorii Strashko ctrl = readl(gt_base + GT_CONTROL); 2059c9ae5ffSGrygorii Strashko if (!(ctrl & GT_CONTROL_TIMER_ENABLE)) 2069c9ae5ffSGrygorii Strashko /* re-enable timer on resume */ 2079c9ae5ffSGrygorii Strashko writel(GT_CONTROL_TIMER_ENABLE, gt_base + GT_CONTROL); 2089c9ae5ffSGrygorii Strashko } 2099c9ae5ffSGrygorii Strashko 210c1b40e44SStuart Menefy static struct clocksource gt_clocksource = { 211c1b40e44SStuart Menefy .name = "arm_global_timer", 212c1b40e44SStuart Menefy .rating = 300, 213c1b40e44SStuart Menefy .read = gt_clocksource_read, 214c1b40e44SStuart Menefy .mask = CLOCKSOURCE_MASK(64), 215c1b40e44SStuart Menefy .flags = CLOCK_SOURCE_IS_CONTINUOUS, 2169c9ae5ffSGrygorii Strashko .resume = gt_resume, 217c1b40e44SStuart Menefy }; 218c1b40e44SStuart Menefy 219c1b40e44SStuart Menefy #ifdef CONFIG_CLKSRC_ARM_GLOBAL_TIMER_SCHED_CLOCK 220af066fceSStephen Boyd static u64 notrace gt_sched_clock_read(void) 221c1b40e44SStuart Menefy { 222d6df3576SJisheng Zhang return _gt_counter_read(); 223c1b40e44SStuart Menefy } 224c1b40e44SStuart Menefy #endif 225c1b40e44SStuart Menefy 226bbaa0670SRabin Vincent static unsigned long gt_read_long(void) 227bbaa0670SRabin Vincent { 228bbaa0670SRabin Vincent return readl_relaxed(gt_base + GT_COUNTER0); 229bbaa0670SRabin Vincent } 230bbaa0670SRabin Vincent 231bbaa0670SRabin Vincent static struct delay_timer gt_delay_timer = { 232bbaa0670SRabin Vincent .read_current_timer = gt_read_long, 233bbaa0670SRabin Vincent }; 234bbaa0670SRabin Vincent 235bbaa0670SRabin Vincent static void __init gt_delay_timer_init(void) 236bbaa0670SRabin Vincent { 237bbaa0670SRabin Vincent gt_delay_timer.freq = gt_clk_rate; 238bbaa0670SRabin Vincent register_current_timer_delay(>_delay_timer); 239bbaa0670SRabin Vincent } 240bbaa0670SRabin Vincent 241*5a54c187SDaniel Lezcano static int __init gt_clocksource_init(void) 242c1b40e44SStuart Menefy { 243c1b40e44SStuart Menefy writel(0, gt_base + GT_CONTROL); 244c1b40e44SStuart Menefy writel(0, gt_base + GT_COUNTER0); 245c1b40e44SStuart Menefy writel(0, gt_base + GT_COUNTER1); 246c1b40e44SStuart Menefy /* enables timer on all the cores */ 247c1b40e44SStuart Menefy writel(GT_CONTROL_TIMER_ENABLE, gt_base + GT_CONTROL); 248c1b40e44SStuart Menefy 249c1b40e44SStuart Menefy #ifdef CONFIG_CLKSRC_ARM_GLOBAL_TIMER_SCHED_CLOCK 250af066fceSStephen Boyd sched_clock_register(gt_sched_clock_read, 64, gt_clk_rate); 251c1b40e44SStuart Menefy #endif 252*5a54c187SDaniel Lezcano return clocksource_register_hz(>_clocksource, gt_clk_rate); 253c1b40e44SStuart Menefy } 254c1b40e44SStuart Menefy 2558c37bb3aSPaul Gortmaker static int gt_cpu_notify(struct notifier_block *self, unsigned long action, 2568c37bb3aSPaul Gortmaker void *hcpu) 257c1b40e44SStuart Menefy { 258c1b40e44SStuart Menefy switch (action & ~CPU_TASKS_FROZEN) { 259c1b40e44SStuart Menefy case CPU_STARTING: 260c1b40e44SStuart Menefy gt_clockevents_init(this_cpu_ptr(gt_evt)); 261c1b40e44SStuart Menefy break; 262c1b40e44SStuart Menefy case CPU_DYING: 263c1b40e44SStuart Menefy gt_clockevents_stop(this_cpu_ptr(gt_evt)); 264c1b40e44SStuart Menefy break; 265c1b40e44SStuart Menefy } 266c1b40e44SStuart Menefy 267c1b40e44SStuart Menefy return NOTIFY_OK; 268c1b40e44SStuart Menefy } 2698c37bb3aSPaul Gortmaker static struct notifier_block gt_cpu_nb = { 270c1b40e44SStuart Menefy .notifier_call = gt_cpu_notify, 271c1b40e44SStuart Menefy }; 272c1b40e44SStuart Menefy 273*5a54c187SDaniel Lezcano static int __init global_timer_of_register(struct device_node *np) 274c1b40e44SStuart Menefy { 275c1b40e44SStuart Menefy struct clk *gt_clk; 276c1b40e44SStuart Menefy int err = 0; 277c1b40e44SStuart Menefy 278c1b40e44SStuart Menefy /* 2792cf2ff9fSMatthew Leach * In A9 r2p0 the comparators for each processor with the global timer 280c1b40e44SStuart Menefy * fire when the timer value is greater than or equal to. In previous 281c1b40e44SStuart Menefy * revisions the comparators fired when the timer value was equal to. 282c1b40e44SStuart Menefy */ 283af040ffcSRussell King if (read_cpuid_part() == ARM_CPU_PART_CORTEX_A9 2842cf2ff9fSMatthew Leach && (read_cpuid_id() & 0xf0000f) < 0x200000) { 285c1b40e44SStuart Menefy pr_warn("global-timer: non support for this cpu version.\n"); 286*5a54c187SDaniel Lezcano return -ENOSYS; 287c1b40e44SStuart Menefy } 288c1b40e44SStuart Menefy 289c1b40e44SStuart Menefy gt_ppi = irq_of_parse_and_map(np, 0); 290c1b40e44SStuart Menefy if (!gt_ppi) { 291c1b40e44SStuart Menefy pr_warn("global-timer: unable to parse irq\n"); 292*5a54c187SDaniel Lezcano return -EINVAL; 293c1b40e44SStuart Menefy } 294c1b40e44SStuart Menefy 295c1b40e44SStuart Menefy gt_base = of_iomap(np, 0); 296c1b40e44SStuart Menefy if (!gt_base) { 297c1b40e44SStuart Menefy pr_warn("global-timer: invalid base address\n"); 298*5a54c187SDaniel Lezcano return -ENXIO; 299c1b40e44SStuart Menefy } 300c1b40e44SStuart Menefy 301c1b40e44SStuart Menefy gt_clk = of_clk_get(np, 0); 302c1b40e44SStuart Menefy if (!IS_ERR(gt_clk)) { 303c1b40e44SStuart Menefy err = clk_prepare_enable(gt_clk); 304c1b40e44SStuart Menefy if (err) 305c1b40e44SStuart Menefy goto out_unmap; 306c1b40e44SStuart Menefy } else { 307c1b40e44SStuart Menefy pr_warn("global-timer: clk not found\n"); 308c1b40e44SStuart Menefy err = -EINVAL; 309c1b40e44SStuart Menefy goto out_unmap; 310c1b40e44SStuart Menefy } 311c1b40e44SStuart Menefy 312c1b40e44SStuart Menefy gt_clk_rate = clk_get_rate(gt_clk); 313c1b40e44SStuart Menefy gt_evt = alloc_percpu(struct clock_event_device); 314c1b40e44SStuart Menefy if (!gt_evt) { 315c1b40e44SStuart Menefy pr_warn("global-timer: can't allocate memory\n"); 316c1b40e44SStuart Menefy err = -ENOMEM; 317c1b40e44SStuart Menefy goto out_clk; 318c1b40e44SStuart Menefy } 319c1b40e44SStuart Menefy 320c1b40e44SStuart Menefy err = request_percpu_irq(gt_ppi, gt_clockevent_interrupt, 321c1b40e44SStuart Menefy "gt", gt_evt); 322c1b40e44SStuart Menefy if (err) { 323c1b40e44SStuart Menefy pr_warn("global-timer: can't register interrupt %d (%d)\n", 324c1b40e44SStuart Menefy gt_ppi, err); 325c1b40e44SStuart Menefy goto out_free; 326c1b40e44SStuart Menefy } 327c1b40e44SStuart Menefy 328c1b40e44SStuart Menefy err = register_cpu_notifier(>_cpu_nb); 329c1b40e44SStuart Menefy if (err) { 330c1b40e44SStuart Menefy pr_warn("global-timer: unable to register cpu notifier.\n"); 331c1b40e44SStuart Menefy goto out_irq; 332c1b40e44SStuart Menefy } 333c1b40e44SStuart Menefy 334c1b40e44SStuart Menefy /* Immediately configure the timer on the boot CPU */ 335*5a54c187SDaniel Lezcano err = gt_clocksource_init(); 336*5a54c187SDaniel Lezcano if (err) 337*5a54c187SDaniel Lezcano goto out_irq; 338*5a54c187SDaniel Lezcano 339*5a54c187SDaniel Lezcano err = gt_clockevents_init(this_cpu_ptr(gt_evt)); 340*5a54c187SDaniel Lezcano if (err) 341*5a54c187SDaniel Lezcano goto out_irq; 342*5a54c187SDaniel Lezcano 343bbaa0670SRabin Vincent gt_delay_timer_init(); 344c1b40e44SStuart Menefy 345*5a54c187SDaniel Lezcano return 0; 346c1b40e44SStuart Menefy 347c1b40e44SStuart Menefy out_irq: 348c1b40e44SStuart Menefy free_percpu_irq(gt_ppi, gt_evt); 349c1b40e44SStuart Menefy out_free: 350c1b40e44SStuart Menefy free_percpu(gt_evt); 351c1b40e44SStuart Menefy out_clk: 352c1b40e44SStuart Menefy clk_disable_unprepare(gt_clk); 353c1b40e44SStuart Menefy out_unmap: 354c1b40e44SStuart Menefy iounmap(gt_base); 355c1b40e44SStuart Menefy WARN(err, "ARM Global timer register failed (%d)\n", err); 356*5a54c187SDaniel Lezcano 357*5a54c187SDaniel Lezcano return err; 358c1b40e44SStuart Menefy } 359c1b40e44SStuart Menefy 360c1b40e44SStuart Menefy /* Only tested on r2p2 and r3p0 */ 361*5a54c187SDaniel Lezcano CLOCKSOURCE_OF_DECLARE_RET(arm_gt, "arm,cortex-a9-global-timer", 362c1b40e44SStuart Menefy global_timer_of_register); 363