From: Jan Kiszka <jan.kiszka@domain.hid>
To: xenomai-core <xenomai@xenomai.org>
Subject: [Xenomai-core] [PATCH] optimise rthal_timer locking
Date: Wed, 21 Jun 2006 23:26:18 +0200 [thread overview]
Message-ID: <4499B97A.5040800@domain.hid> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 329 bytes --]
Hi,
long pending in my tree, I finally decided to role this one out as it is
quite lone-standing:
This patch avoids to additionally switch off the local IRQs in
rthal_timer_program_shot for the PIPELINE_HEAD case - the caller is
expected to hold the nucleus lock with IRQs off anyway. Applies to i386
and ia64.
Jan
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: rthal-timer-locking.patch --]
[-- Type: text/x-patch; name="rthal-timer-locking.patch", Size: 1968 bytes --]
Index: include/asm-i386/hal.h
===================================================================
--- include/asm-i386/hal.h (Revision 1135)
+++ include/asm-i386/hal.h (Arbeitskopie)
@@ -177,9 +177,13 @@ rthal_time_t rthal_get_8254_tsc(void);
static inline void rthal_timer_program_shot (unsigned long delay)
{
+/* With head-optimization, callers are expected to have switched off
+ hard-IRQs already -- no need for additional protection in this case. */
+#ifndef CONFIG_XENO_OPT_PIPELINE_HEAD
unsigned long flags;
rthal_local_irq_save_hw(flags);
+#endif /* CONFIG_XENO_OPT_PIPELINE_HEAD */
#ifdef CONFIG_X86_LOCAL_APIC
if (!delay) {
/* Kick the timer interrupt immediately. */
@@ -201,7 +205,9 @@ static inline void rthal_timer_program_s
outb(delay >> 8,0x40);
}
#endif /* CONFIG_X86_LOCAL_APIC */
+#ifndef CONFIG_XENO_OPT_PIPELINE_HEAD
rthal_local_irq_restore_hw(flags);
+#endif /* CONFIG_XENO_OPT_PIPELINE_HEAD */
}
static const char *const rthal_fault_labels[] = {
Index: include/asm-ia64/hal.h
===================================================================
--- include/asm-ia64/hal.h (Revision 1135)
+++ include/asm-ia64/hal.h (Arbeitskopie)
@@ -65,11 +65,18 @@ static inline unsigned long long rthal_r
static inline void rthal_timer_program_shot (unsigned long delay)
{
+/* With head-optimization, callers are expected to have switched off
+ hard-IRQs already -- no need for additional protection in this case. */
+#ifndef CONFIG_XENO_OPT_PIPELINE_HEAD
unsigned long flags;
- if (!delay) { delay = 10; }
+
rthal_local_irq_save_hw(flags);
+#endif /* CONFIG_XENO_OPT_PIPELINE_HEAD */
+ if (!delay) { delay = 10; }
ia64_set_itm(ia64_get_itc() + delay);
+#ifndef CONFIG_XENO_OPT_PIPELINE_HEAD
rthal_local_irq_restore_hw(flags);
+#endif /* CONFIG_XENO_OPT_PIPELINE_HEAD */
}
/* Private interface -- Internal use only */
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 249 bytes --]
next reply other threads:[~2006-06-21 21:26 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-21 21:26 Jan Kiszka [this message]
2006-06-21 21:37 ` [Xenomai-core] [PATCH] optimise rthal_timer locking Philippe Gerum
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=4499B97A.5040800@domain.hid \
--to=jan.kiszka@domain.hid \
--cc=xenomai@xenomai.org \
/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.