Michael Neuhauser schrieb:
On Mon, 2005-03-21 at 17:54, Jan Kiszka wrote:
rtai_oldnames.h in magma-CVS is broken. This patch fixes it for x86,
other architectures may require a check as well.
With this patch applied, RTnet at least loads on top of magma now.
Jan
[...]
-- rtai_oldnames.h 5 Jan 2005 16:48:31 -0000 1.4
+++ rtai_oldnames.h 21 Mar 2005 16:36:29 -0000
@@ -37,9 +37,9 @@
#define IFLAG RTAI_IFLAG
#define hard_cli() rtai_cli()
#define hard_sti() rtai_sti()
-#define hard_save_flags_and_cli(x) rtai_local_irq_save(x)
-#define hard_restore_flags(x) rtai_local_irq_restore(x)
-#define hard_save_flags(x) rtai_local_irq_flags(x)
+#define hard_save_flags_and_cli(x) rtai_save_flags_and_cli(x)
+#define hard_restore_flags(x) rtai_restore_flags(x)
+#define hard_save_flags(x) rtai_save_flags(x)
#define hard_cpu_id adeos_processor_id
#endif /* __KERNEL__ */
Hm, there is definitely something wrong here (rtai_local_irq_*() are not
defined for i386). But I'm not sure if your patch is correct either.
It lets RTnet compile, isn't this enough? ;)
Seriously:
What is expected from the hard_*() macros? (I'm not so familiar with
"historical" RTAI but would like to get it right for ARM.) If they
should disable the CPU's interrupt enabled flag (as their name suggests)
then it should be
#define hard_cli() rtai_hw_cli()
#define hard_sti() rtai_hw_sti()
#define hard_save_flags_and_cli() rtai_hw_save_flags_and_cli()
...
I think hard_* were originally (rthal) intended to touch the hardware
directly. With adeos, it's sufficient (I think it's actually the only
correct way) to stall the pipeline in front of RTAI. In fact, that's ok
for the use case RTnet.
Your patch is only correct if the hard_*() macros are expected to
prevent interrupts to be delivered to RTAI, but nothing more, i.e. you
can't use them to protect time-critical hardware operations (if only the
RTAI pipeline is stalled, interrupts are still handled by Adeos, they
are just not dispatched to RTAI).
So, let's walk the #define chain of x86-vesuvio (assuming it is correct):
hard_cli() -> rtai_cli() -> adeos_stall_pipeline_from(&rtai_domain)
That's what I did to fiddle out the hopefully correct meaning for my patch.
Jan