All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai-core] [PATCH 3/5] Report used timer and clock devices
@ 2007-11-12 23:00 Jan Kiszka
  0 siblings, 0 replies; only message in thread
From: Jan Kiszka @ 2007-11-12 23:00 UTC (permalink / raw)
  To: Xenomai-core


[-- Attachment #1.1: Type: text/plain, Size: 385 bytes --]

Given the current multitude of timer/clock combinations on i386, but
also considering that we may provide HPET clocks on x86 in the future or
may face other archs with multiple options, this patch reports the
configured timer and clock devices via /proc/xenomai/timer. Example:

# cat /proc/xenomai/timer
status=on:setup=0:clock=4413929837202:timerdev=lapic:clockdev=tsc

Jan

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: report-timer-device.patch --]
[-- Type: text/x-patch; name="report-timer-device.patch", Size: 3071 bytes --]

---
 include/asm-generic/hal.h    |    7 +++++++
 include/asm-generic/system.h |    2 ++
 include/asm-x86/hal_32.h     |   10 ++++++++++
 include/asm-x86/hal_64.h     |    2 ++
 ksrc/nucleus/module.c        |    5 +++--
 5 files changed, 24 insertions(+), 2 deletions(-)

Index: xenomai/include/asm-generic/hal.h
===================================================================
--- xenomai.orig/include/asm-generic/hal.h
+++ xenomai/include/asm-generic/hal.h
@@ -49,6 +49,13 @@
 #define RTHAL_CPU_FREQ		(rthal_tunables.cpu_freq)
 #define RTHAL_NR_APCS		BITS_PER_LONG
 
+#ifndef RTHAL_TIMER_DEVICE
+#define RTHAL_TIMER_DEVICE	"<unnamed>"
+#endif
+#ifndef RTHAL_CLOCK_DEVICE
+#define RTHAL_CLOCK_DEVICE	"<unnamed>"
+#endif
+
 #define RTHAL_EVENT_PROPAGATE   0
 #define RTHAL_EVENT_STOP        1
 
Index: xenomai/include/asm-generic/system.h
===================================================================
--- xenomai.orig/include/asm-generic/system.h
+++ xenomai/include/asm-generic/system.h
@@ -125,6 +125,8 @@ typedef struct { atomic_t owner; } xnloc
 
 #define XNARCH_NR_IRQS               RTHAL_NR_IRQS
 #define XNARCH_TIMER_IRQ	     RTHAL_TIMER_IRQ
+#define XNARCH_TIMER_DEVICE          RTHAL_TIMER_DEVICE
+#define XNARCH_CLOCK_DEVICE          RTHAL_CLOCK_DEVICE
 
 #define XNARCH_ROOT_STACKSZ   0	/* Only a placeholder -- no stack */
 
Index: xenomai/include/asm-x86/hal_32.h
===================================================================
--- xenomai.orig/include/asm-x86/hal_32.h
+++ xenomai/include/asm-x86/hal_32.h
@@ -38,6 +38,16 @@
 #define _XENO_ASM_X86_HAL_32_H
 
 #define RTHAL_ARCH_NAME			"i386"
+#ifdef CONFIG_X86_LOCAL_APIC
+# define RTHAL_TIMER_DEVICE		"lapic"
+#else
+# define RTHAL_TIMER_DEVICE		"pit"
+#endif
+#ifdef CONFIG_X86_TSC
+# define RTHAL_CLOCK_DEVICE		"tsc"
+#else
+# define RTHAL_CLOCK_DEVICE		"pit"
+#endif
 
 #include <asm/xenomai/wrappers.h>
 
Index: xenomai/include/asm-x86/hal_64.h
===================================================================
--- xenomai.orig/include/asm-x86/hal_64.h
+++ xenomai/include/asm-x86/hal_64.h
@@ -24,6 +24,8 @@
 #define _XENO_ASM_X86_HAL_64_H
 
 #define RTHAL_ARCH_NAME			"x86_64"
+#define RTHAL_TIMER_DEVICE		"lapic"
+#define RTHAL_CLOCK_DEVICE		"tsc"
 
 #include <asm/xenomai/wrappers.h>
 #include <asm-generic/xenomai/hal.h>    /* Read the generic bits. */
Index: xenomai/ksrc/nucleus/module.c
===================================================================
--- xenomai.orig/ksrc/nucleus/module.c
+++ xenomai/ksrc/nucleus/module.c
@@ -793,9 +793,10 @@ static int timer_read_proc(char *page,
 		tm_status = "off";
 
 	len = sprintf(page,
-		      "status=%s%s:setup=%Lu:clock=%Lu\n",
+		      "status=%s%s:setup=%Lu:clock=%Lu:timerdev=%s:clockdev=%s\n",
 		      tm_status, wd_status, xnarch_tsc_to_ns(nktimerlat),
-		      xntbase_get_rawclock(&nktbase));
+		      xntbase_get_rawclock(&nktbase),
+		      XNARCH_TIMER_DEVICE, XNARCH_CLOCK_DEVICE);
 
 	len -= off;
 	if (len <= off + count)

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 252 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-11-12 23:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-12 23:00 [Xenomai-core] [PATCH 3/5] Report used timer and clock devices Jan Kiszka

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.