Hello,

over the days the tryd to use namespaces for kernel:
namespace Linux {
        extern "C" {
#               include <xx.h>
        }
}
etc.

The first was Kernel for the linux kernel related files the other was Rtlinux
for rtl (another could be Rthal) . There occoured some problems. One example is
the rtf_create macro. The problem is related to __this_module which comes from
the Kernel namespace. To solve I had to use a hack:
namespace Rtl {
  extern int  Rtl::__rtf_create(unsigned int fifo, int size, struct Kernel::module 
*mod);
  int rtf_create_wrapper(unsigned int fifo, int size) {
    return Rtl::__rtf_create(fifo, size, &__this_module); }
}                                                                                      
                  

Well, no good solution. Normally the gcc should inline a small C function like a
macro:

int rtf_create(unsigned int fifo, int size) { return _rtf_create(fifo, size, 
&__this_module); }

This wouldn't solve the problem with namespace. Well, does someone see an
advantage of using two namespaces like Linux and Rtlinux ? My point of view is
to use only one namespace at moment - to avoid such hacks, any comments?

Another question is related to __this_module. In module.h is only defined as
extern. Where does the symbol comes from ?? Sometimes the symbol is in the
objects files sometimes isn't - I can't reproduce it.

Thanks
Olaf
-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/rtlinux/

Reply via email to