From: Jan Kiszka <jan.kiszka@domain.hid>
To: xenomai-core <xenomai@xenomai.org>
Subject: Re: [Xenomai-core] [PATCH] reduce config complexity of intr.c
Date: Sat, 07 Jul 2007 09:28:27 +0200 [thread overview]
Message-ID: <468F409B.7090805@domain.hid> (raw)
In-Reply-To: <468ED509.8060105@domain.hid>
[-- Attachment #1.1: Type: text/plain, Size: 302 bytes --]
Jan Kiszka wrote:
> ...
> Then I reordered some code to avoid warnings for the non-shared non-SMP
> case AND to fix a probable compilation issue of the simulator (due to
> unknown ____cacheline_aligned_in_smp).
And this add-on patch is needed to make the simulator really build again.
Jan
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: xnintr-sim-fix.patch --]
[-- Type: text/x-patch; name="xnintr-sim-fix.patch", Size: 3402 bytes --]
---
include/asm-generic/system.h | 1 +
include/asm-sim/system.h | 2 ++
ksrc/nucleus/intr.c | 10 +++++-----
ksrc/nucleus/module.c | 4 ++--
4 files changed, 10 insertions(+), 7 deletions(-)
Index: xenomai/include/asm-generic/system.h
===================================================================
--- xenomai.orig/include/asm-generic/system.h
+++ xenomai/include/asm-generic/system.h
@@ -123,6 +123,7 @@ typedef struct { atomic_t owner; } xnloc
#define XNARCH_NR_CPUS RTHAL_NR_CPUS
+#define XNARCH_NR_IRQS RTHAL_NR_IRQS
#define XNARCH_TIMER_IRQ RTHAL_TIMER_IRQ
#define XNARCH_ROOT_STACKSZ 0 /* Only a placeholder -- no stack */
Index: xenomai/include/asm-sim/system.h
===================================================================
--- xenomai.orig/include/asm-sim/system.h
+++ xenomai/include/asm-sim/system.h
@@ -85,6 +85,8 @@ typedef unsigned long xnlock_t;
#define XNARCH_NR_CPUS 1
+#define XNARCH_NR_IRQS 256
+
/* Should be equal to the value used for creating the mvmtimer object (mvm_start_timer). */
#define XNARCH_TIMER_IRQ 1
Index: xenomai/ksrc/nucleus/intr.c
===================================================================
--- xenomai.orig/ksrc/nucleus/intr.c
+++ xenomai/ksrc/nucleus/intr.c
@@ -141,7 +141,7 @@ typedef struct xnintr_irq {
} ____cacheline_aligned_in_smp xnintr_irq_t;
-static xnintr_irq_t xnirqs[RTHAL_NR_IRQS];
+static xnintr_irq_t xnirqs[XNARCH_NR_IRQS];
/*
* Low-level interrupt handler dispatching the user-defined ISRs for
@@ -292,7 +292,7 @@ static inline int xnintr_irq_attach(xnin
xnintr_t *prev, **p = &shirq->handlers;
int err;
- if (intr->irq >= RTHAL_NR_IRQS)
+ if (intr->irq >= XNARCH_NR_IRQS)
return -EINVAL;
if (__testbits(intr->flags, XN_ISR_ATTACHED))
@@ -346,7 +346,7 @@ static inline int xnintr_irq_detach(xnin
xnintr_t *e, **p = &shirq->handlers;
int err = 0;
- if (intr->irq >= RTHAL_NR_IRQS)
+ if (intr->irq >= XNARCH_NR_IRQS)
return -EINVAL;
if (!__testbits(intr->flags, XN_ISR_ATTACHED))
@@ -386,7 +386,7 @@ typedef struct xnintr_irq {
} ____cacheline_aligned_in_smp xnintr_irq_t;
-static xnintr_irq_t xnirqs[RTHAL_NR_IRQS];
+static xnintr_irq_t xnirqs[XARCH_NR_IRQS];
#endif /* CONFIG_SMP */
static inline int xnintr_irq_attach(xnintr_t *intr)
@@ -477,7 +477,7 @@ static void xnintr_irq_handler(unsigned
int xnintr_mount(void)
{
int i;
- for (i = 0; i < RTHAL_NR_IRQS; ++i)
+ for (i = 0; i < XNARCH_NR_IRQS; ++i)
xnlock_init(&xnirqs[i].lock);
return 0;
}
Index: xenomai/ksrc/nucleus/module.c
===================================================================
--- xenomai.orig/ksrc/nucleus/module.c
+++ xenomai/ksrc/nucleus/module.c
@@ -438,7 +438,7 @@ static int stat_seq_open(struct inode *i
}
/* Iterate over all IRQ numbers, ... */
- for (irq = 0; irq < RTHAL_NR_IRQS; irq++) {
+ for (irq = 0; irq < XNARCH_NR_IRQS; irq++) {
xnintr_t *prev = NULL;
int cpu = 0;
int err;
@@ -865,7 +865,7 @@ static int irq_read_proc(char *page,
p += sprintf(p, " CPU%d", cpu);
}
- for (irq = 0; irq < RTHAL_NR_IRQS; irq++) {
+ for (irq = 0; irq < XNARCH_NR_IRQS; irq++) {
if (rthal_irq_handler(&rthal_domain, irq) == NULL)
continue;
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 249 bytes --]
next prev parent reply other threads:[~2007-07-07 7:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-06 23:49 [Xenomai-core] [PATCH] reduce config complexity of intr.c Jan Kiszka
2007-07-07 7:28 ` Jan Kiszka [this message]
2007-07-08 10:11 ` Jan Kiszka
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=468F409B.7090805@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.