All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@domain.hid>
To: Xenomai-core@domain.hid
Subject: [Xenomai-core] [PATCH 3/5] Report used timer and clock devices
Date: Tue, 13 Nov 2007 00:00:27 +0100	[thread overview]
Message-ID: <4738DB0B.2090807@domain.hid> (raw)


[-- 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 --]

                 reply	other threads:[~2007-11-12 23:00 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4738DB0B.2090807@domain.hid \
    --to=jan.kiszka@domain.hid \
    --cc=Xenomai-core@domain.hid \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.