[PATCH 7/11] UML - clocksource support

2007-09-19 Thread Jeff Dike
Add clocksource support.

Signed-off-by: Jeff Dike <[EMAIL PROTECTED]>
---
 arch/um/kernel/time.c |   21 +
 1 file changed, 21 insertions(+)

Index: linux-2.6.20/arch/um/kernel/time.c
===
--- linux-2.6.20.orig/arch/um/kernel/time.c 2007-09-19 12:25:07.0 
-0400
+++ linux-2.6.20/arch/um/kernel/time.c  2007-09-19 12:25:07.0 -0400
@@ -97,6 +97,21 @@ static irqreturn_t um_timer(int irq, voi
return IRQ_HANDLED;
 }
 
+static cycle_t itimer_read(void)
+{
+   return os_nsecs();
+}
+
+static struct clocksource itimer_clocksource = {
+   .name   = "itimer",
+   .rating = 300,
+   .read   = itimer_read,
+   .mask   = CLOCKSOURCE_MASK(64),
+   .mult   = 1,
+   .shift  = 0,
+   .flags  = CLOCK_SOURCE_IS_CONTINUOUS,
+};
+
 static void __init setup_itimer(void)
 {
int err;
@@ -106,6 +121,12 @@ static void __init setup_itimer(void)
printk(KERN_ERR "register_timer : request_irq failed - "
   "errno = %d\n", -err);
 
+   err = clocksource_register(_clocksource);
+   if (err) {
+   printk(KERN_ERR "clocksource_register returned %d\n", err);
+   return;
+   }
+
itimer_clockevent.mult = div_sc(HZ, NSEC_PER_SEC, 32);
itimer_clockevent.max_delta_ns =
clockevent_delta2ns(60 * HZ, _clockevent);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 7/11] UML - clocksource support

2007-09-19 Thread Jeff Dike
Add clocksource support.

Signed-off-by: Jeff Dike [EMAIL PROTECTED]
---
 arch/um/kernel/time.c |   21 +
 1 file changed, 21 insertions(+)

Index: linux-2.6.20/arch/um/kernel/time.c
===
--- linux-2.6.20.orig/arch/um/kernel/time.c 2007-09-19 12:25:07.0 
-0400
+++ linux-2.6.20/arch/um/kernel/time.c  2007-09-19 12:25:07.0 -0400
@@ -97,6 +97,21 @@ static irqreturn_t um_timer(int irq, voi
return IRQ_HANDLED;
 }
 
+static cycle_t itimer_read(void)
+{
+   return os_nsecs();
+}
+
+static struct clocksource itimer_clocksource = {
+   .name   = itimer,
+   .rating = 300,
+   .read   = itimer_read,
+   .mask   = CLOCKSOURCE_MASK(64),
+   .mult   = 1,
+   .shift  = 0,
+   .flags  = CLOCK_SOURCE_IS_CONTINUOUS,
+};
+
 static void __init setup_itimer(void)
 {
int err;
@@ -106,6 +121,12 @@ static void __init setup_itimer(void)
printk(KERN_ERR register_timer : request_irq failed - 
   errno = %d\n, -err);
 
+   err = clocksource_register(itimer_clocksource);
+   if (err) {
+   printk(KERN_ERR clocksource_register returned %d\n, err);
+   return;
+   }
+
itimer_clockevent.mult = div_sc(HZ, NSEC_PER_SEC, 32);
itimer_clockevent.max_delta_ns =
clockevent_delta2ns(60 * HZ, itimer_clockevent);
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 7/11] UML - clocksource support

2007-09-12 Thread Jeff Dike
Add clocksource support.

Signed-off-by: Jeff Dike <[EMAIL PROTECTED]>
--
 arch/um/kernel/time.c |   21 +
 1 file changed, 21 insertions(+)

Index: linux-2.6.22/arch/um/kernel/time.c
===
--- linux-2.6.22.orig/arch/um/kernel/time.c 2007-09-12 15:12:11.0 
-0400
+++ linux-2.6.22/arch/um/kernel/time.c  2007-09-12 15:12:35.0 -0400
@@ -97,6 +97,21 @@ static irqreturn_t um_timer(int irq, voi
return IRQ_HANDLED;
 }
 
+static cycle_t itimer_read(void)
+{
+   return os_nsecs();
+}
+
+static struct clocksource itimer_clocksource = {
+   .name   = "itimer",
+   .rating = 300,
+   .read   = itimer_read,
+   .mask   = CLOCKSOURCE_MASK(64),
+   .mult   = 1,
+   .shift  = 0,
+   .flags  = CLOCK_SOURCE_IS_CONTINUOUS,
+};
+
 static void __init setup_itimer(void)
 {
int err;
@@ -108,6 +123,12 @@ static void __init setup_itimer(void)
printk(KERN_ERR "register_timer : request_irq failed - "
   "errno = %d\n", -err);
 
+   err = clocksource_register(_clocksource);
+   if (err) {
+   printk(KERN_ERR "clocksource_register returned %d\n", err);
+   return;
+   }
+
itimer_clockevent.mult = div_sc(HZ, NSEC_PER_SEC, 32);
itimer_clockevent.max_delta_ns =
clockevent_delta2ns(60 * HZ, _clockevent);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 7/11] UML - clocksource support

2007-09-12 Thread Jeff Dike
Add clocksource support.

Signed-off-by: Jeff Dike [EMAIL PROTECTED]
--
 arch/um/kernel/time.c |   21 +
 1 file changed, 21 insertions(+)

Index: linux-2.6.22/arch/um/kernel/time.c
===
--- linux-2.6.22.orig/arch/um/kernel/time.c 2007-09-12 15:12:11.0 
-0400
+++ linux-2.6.22/arch/um/kernel/time.c  2007-09-12 15:12:35.0 -0400
@@ -97,6 +97,21 @@ static irqreturn_t um_timer(int irq, voi
return IRQ_HANDLED;
 }
 
+static cycle_t itimer_read(void)
+{
+   return os_nsecs();
+}
+
+static struct clocksource itimer_clocksource = {
+   .name   = itimer,
+   .rating = 300,
+   .read   = itimer_read,
+   .mask   = CLOCKSOURCE_MASK(64),
+   .mult   = 1,
+   .shift  = 0,
+   .flags  = CLOCK_SOURCE_IS_CONTINUOUS,
+};
+
 static void __init setup_itimer(void)
 {
int err;
@@ -108,6 +123,12 @@ static void __init setup_itimer(void)
printk(KERN_ERR register_timer : request_irq failed - 
   errno = %d\n, -err);
 
+   err = clocksource_register(itimer_clocksource);
+   if (err) {
+   printk(KERN_ERR clocksource_register returned %d\n, err);
+   return;
+   }
+
itimer_clockevent.mult = div_sc(HZ, NSEC_PER_SEC, 32);
itimer_clockevent.max_delta_ns =
clockevent_delta2ns(60 * HZ, itimer_clockevent);
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/