Hello!

This is the second try wish me luck :)

As I also said in the first mail (that probably nobody could read:),
I'd like to thank Philippe for his great work on Xenomai.

The Xenomai system is very flexible, but there is one point that could
be more generic. I mean the processing of the events caught by Adeos
from the Linux kernel. There are two problems, you cannot use the
linux-tasks's ptd to provide own userspace services, without
interfering with the fusion specific handlers defined in shadow. The
second is that there is no interface to change these handlers in
xenomai (of course you can call the adeos functions directly).

A possible, but time consuming, solution could be to provide an
interface to register these handlers, a wrapper around the adeos calls
perhaps, and separate the shadow code into a fusion specific (mapping,
migration, handling of from-linux-kernel-catched-events) and a general
part. This general part could stay in the main xenomai module, whereas
the fusion specific code could be merged into the fusion module. This
would also save memory when not using the shadow/fusion services... (I
know that the seperate fusion module has been abandoned in the fusion
branch.)

As a quick solution and minimal invasive solution I've implemented a
event handler register function. It's a simple wrapper around the
adeos call. The usage can be outlined as follows: By default the
fusion/shadow handlers are active (no code change so far). If you want
to register an alternative handler you simply call a
"xnshadow_register_<EVENT>_handler(...)". That's a simple wrapper
around the appropriate "adeos_catch_event(...)" function. This call
would normally made in the init_module function. In corresponding
cleanup_module function a call to
"xnshadow_unregister_<EVENT>_handler(void)" would restore the default
behaviour (fusion/shadow's event handlers).

Here is the code needed to register a alternative sysentry handler :
(Beside the function prototypes in the appropriate header file :)

------------------------------<code>------------------------------------
int xnshadow_register_realtime_sysentry_handler (void (*handler)(adevinfo_t *))
{
    if (handler) 
       {
       adeos_catch_event_from(&arti_domain,ADEOS_SYSCALL_PROLOGUE,handler);

#if 0
       printk("Xenomai: registered new realtime sysentry handler %p\n",
              handler);
#endif

       return XN_OK;
       }
    else
       return XN_ERROR;
}

int xnshadow_unregister_realtime_sysentry_handler (void)

{
    return 
xnshadow_register_realtime_sysentry_handler(&xnshadow_realtime_sysentry);
}
------------------------------</code>-----------------------------------

As the subject says: Please comment on this!

regards - Marc

-- 
#!/bin/sh
set - `type $0` 'tr "[a-zA-Z]" "[n-za-mN-ZA-M]"';while [ "$2" != "" ];do \
shift;done; echo 'frq -a -rc '`echo "$0"| $1 `'>$UBZR/.`rpub signature|'`\
echo $1|$1`'`;rpub "Jr ner fvtangher bs obet. Erfvfgnapr vf shgvyr!"'|$1|sh

Reply via email to