ia64/linux-2.6.18-xen.hg

view arch/m68k/hp300/time.c @ 452:c7ed6fe5dca0

kexec: dont initialise regions in reserve_memory()

There is no need to initialise efi_memmap_res and boot_param_res in
reserve_memory() for the initial xen domain as it is done in
machine_kexec_setup_resources() using values from the kexec hypercall.

Signed-off-by: Simon Horman <horms@verge.net.au>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Feb 28 10:55:18 2008 +0000 (2008-02-28)
parents 831230e53067
children
line source
1 /*
2 * linux/arch/m68k/hp300/time.c
3 *
4 * Copyright (C) 1998 Philip Blundell <philb@gnu.org>
5 *
6 * This file contains the HP300-specific time handling code.
7 */
9 #include <asm/ptrace.h>
10 #include <linux/types.h>
11 #include <linux/init.h>
12 #include <linux/sched.h>
13 #include <linux/kernel_stat.h>
14 #include <linux/interrupt.h>
15 #include <asm/machdep.h>
16 #include <asm/irq.h>
17 #include <asm/io.h>
18 #include <asm/system.h>
19 #include <asm/traps.h>
20 #include <asm/blinken.h>
22 /* Clock hardware definitions */
24 #define CLOCKBASE 0xf05f8000
26 #define CLKCR1 0x1
27 #define CLKCR2 0x3
28 #define CLKCR3 CLKCR1
29 #define CLKSR CLKCR2
30 #define CLKMSB1 0x5
31 #define CLKMSB2 0x9
32 #define CLKMSB3 0xD
34 /* This is for machines which generate the exact clock. */
35 #define USECS_PER_JIFFY (1000000/HZ)
37 #define INTVAL ((10000 / 4) - 1)
39 static irqreturn_t hp300_tick(int irq, void *dev_id, struct pt_regs *regs)
40 {
41 unsigned long tmp;
42 irqreturn_t (*vector)(int, void *, struct pt_regs *) = dev_id;
43 in_8(CLOCKBASE + CLKSR);
44 asm volatile ("movpw %1@(5),%0" : "=d" (tmp) : "a" (CLOCKBASE));
45 /* Turn off the network and SCSI leds */
46 blinken_leds(0, 0xe0);
47 return vector(irq, NULL, regs);
48 }
50 unsigned long hp300_gettimeoffset(void)
51 {
52 /* Read current timer 1 value */
53 unsigned char lsb, msb1, msb2;
54 unsigned short ticks;
56 msb1 = in_8(CLOCKBASE + 5);
57 lsb = in_8(CLOCKBASE + 7);
58 msb2 = in_8(CLOCKBASE + 5);
59 if (msb1 != msb2)
60 /* A carry happened while we were reading. Read it again */
61 lsb = in_8(CLOCKBASE + 7);
62 ticks = INTVAL - ((msb2 << 8) | lsb);
63 return (USECS_PER_JIFFY * ticks) / INTVAL;
64 }
66 void __init hp300_sched_init(irqreturn_t (*vector)(int, void *, struct pt_regs *))
67 {
68 out_8(CLOCKBASE + CLKCR2, 0x1); /* select CR1 */
69 out_8(CLOCKBASE + CLKCR1, 0x1); /* reset */
71 asm volatile(" movpw %0,%1@(5)" : : "d" (INTVAL), "a" (CLOCKBASE));
73 request_irq(IRQ_AUTO_6, hp300_tick, IRQ_FLG_STD, "timer tick", vector);
75 out_8(CLOCKBASE + CLKCR2, 0x1); /* select CR1 */
76 out_8(CLOCKBASE + CLKCR1, 0x40); /* enable irq */
77 }