ACE TAO RTEMS build results

Joel Sherrill joel.sherrill at OARcorp.com
Tue Mar 25 17:10:28 UTC 2003


Comments sprinkled.

Jack Cawkwell wrote:
> 
> Hi,
> 
> These are the hacks I made to ACE to make it compile.
> 
> Affected files:
> 
> ACE_Wrappers/ace/Signal.cpp
> ACE_Wrappers/ace/Signal.i
> ACE_Wrappers/ace/config-rtems.h
> 
> file: ACE_Wrappers/ace/Signal.cpp
> ...
> ACE_Sig_Action::ACE_Sig_Action (ACE_SignalHandler sig_handler,
>                                 sigset_t *sig_mask,
>                                 int sig_flags)
> {
>   // ACE_TRACE ("ACE_Sig_Action::ACE_Sig_Action");
>   this->sa_.sa_flags = sig_flags;
> 
>   if (sig_mask == 0)
>     ACE_OS::sigemptyset (&this->sa_.sa_mask);
>   else
>     this->sa_.sa_mask = *sig_mask; // Structure assignment...
> 
> #if defined(RTEMS_HACK)
>   this->sa_.sa_handler = (void (*)()) ACE_SignalHandlerV (sig_handler);
> #else
> #if !defined(ACE_HAS_TANDEM_SIGNALS)
>   this->sa_.sa_handler = ACE_SignalHandlerV (sig_handler);
> #else
>   this->sa_.sa_handler = (void (*)()) ACE_SignalHandlerV (sig_handler);
> #endif /* !ACE_HAS_TANDEM_SIGNALS */
> #endif
> }

Sounds like ACE_SignalHandlerV is not being defined correctly for RTEMS.
It could be a very minor thing if you could find it in the mounds of
source code. :)

> 
> several similar to this follow, then ..
> 
> int
> ACE_Sig_Handler::remove_handler (int signum,
>                                  ACE_Sig_Action *new_disp,
>                                  ACE_Sig_Action *old_disp,
>                                  int)
> {
>   ACE_TRACE ("ACE_Sig_Handler::remove_handler");
>   ACE_MT (ACE_Recursive_Thread_Mutex *lock =
>     ACE_Managed_Object<ACE_Recursive_Thread_Mutex>::get_preallocated_object
>       (ACE_Object_Manager::ACE_SIG_HANDLER_LOCK);
>     ACE_Guard<ACE_Recursive_Thread_Mutex> m (*lock));
> 
>   if (ACE_Sig_Handler::in_range (signum))
>     {
> #if defined(RTEMS_HACK)
>       ACE_Sig_Action sa ((void (*)(int))SIG_DFL, (sigset_t *) 0); //
> Define the default disposition.
> #else
>       ACE_Sig_Action sa (SIG_DFL, (sigset_t *) 0); // Define the default
> disposition.
> #endif
> 
>       if (new_disp == 0)
>         new_disp = &sa;
> 
>       ACE_Sig_Handler::signal_handlers_[signum] = 0;
> 
>       // Register either the new disposition or restore the default.
>       return new_disp->register_action (signum, old_disp);
>     }
>   else
>     return -1;
> }
> 
> and similarly in
> 
> int
> ACE_Sig_Handlers::remove_handler (int signum,
>                                   ACE_Sig_Action *new_disp,
>                                   ACE_Sig_Action *old_disp,
>                                   int sigkey)
> {
> ...
> 
> #if defined(RTEMS_HACK)
>           ACE_Sig_Action sa ((void (*)(int))SIG_DFL, (sigset_t *) 0);
> #else
>           ACE_Sig_Action sa (SIG_DFL, (sigset_t *) 0);
> #endif
> ...
> 
> file: ACE_Wrappers/ace/Signal.i
> 
> ACE_INLINE void
> ACE_Sig_Action::handler (ACE_SignalHandler handler)
> {
>   ACE_TRACE ("ACE_Sig_Action::handler");
> #if defined(RTEMS_HACK)
>   this->sa_.sa_handler = (void (*)()) ACE_SignalHandlerV (handler);
> #else
> #if !defined(ACE_HAS_TANDEM_SIGNALS)
>   this->sa_.sa_handler = ACE_SignalHandlerV (handler);
> #else
>   this->sa_.sa_handler = (void (*)()) ACE_SignalHandlerV (handler);
> #endif /* !ACE_HAS_TANDEM_SIGNALS */
> #endif
> }
> 
> file: ACE_Wrappers/ace/config-rtems.h
> 
> deleted :
> 
> #define ACE_LACKS_UALARM_PROTOTYPE

newlib defines it.  RTEMS doesn't currently implement it.  It needs to
be
implemented as a pair with sleep().  sleep() should be a simple wrapper
for usleep().  But this is a relatively painless one.

> added:
> 
> #define ACE_PSOS_TM
> #define RTEMS_HACK
> 
> As for testing I have found the file ACE_wrappers/tests/rtems_init.c
> and managed to get it to compile. I had to comment out the last call
> to 'exit (0);' which caused a compile/link problem. There is some
> obvious setup stuff to do with network addresses, but I cannot see
> how to execute a test with it?

Unless you are using Till's CEXP dynamic loader, RTEMS executables are 
statically linked bootable images for the target board.  However the
board
boots it is board dependent.  Could be a floppy, TFTP, etc.


-- 
Joel Sherrill, Ph.D.             Director of Research & Development
joel at OARcorp.com                 On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
Support Available                (256) 722-9985



More information about the users mailing list