This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Free BSD ioctl problem (Renesas EDOSK2674)


Hello,

i tried to get the FreeBSD network stack working for Renesas EDOSK2674.
Network support for EDOSK2674 Redboot works well but when tried to run the
networking tests for an eCos configuration with FreeBSD stack, I recived the
following messages during initialisation (init_all_network_interfaces).:

...
       hw_addr: ff:ff:ff:ff:ff:ff
     client IP: 130.100.80.12
         my IP: 130.100.80.12
     server IP: 130.100.80.1
    gateway IP: 130.100.80.1
  options:
        subnet mask: 255.255.255.0
       IP broadcast: 130.100.80.255
            gateway: 130.100.80.1
SIOCIFADDR: Operation not supported
Network initialization failed for eth0.

Now I started debugging and found that the problem is caused by the folowing
function in file io.cxx:

__externC int ioctl( int fd, CYG_ADDRWORD com, CYG_ADDRWORD data )
{
    ...
}

The function is declared in various header files (i.e. ioctl.h) in the
following way:

int ioctl __P((int, unsigned long, ...));

Single stepping the assembler code before the ioctl function call was the
solution. The function arguments where pushed onto stack because of a
function declaration with variable argument list. But the function itself
does not have a variable argument list and expected the arguments in
registers er0, er1, er2 - so it simply received the wrong arguments.

Now I changed the function declaration this way:

int ioctl __P((int, unsigned long, unsigned lon));

Now the network initialisation works well and I could successfull complete
the ping_test for the FreeBSD network stack.

So my question is: Why differs the declaration of ioctl function from
definition in file io.cxx and did I found the right solution or do I have to
chnge something different.

Thank you very much and regards, Uwe


eCos port for Renesas H8S family
http://www.htwm.de/ukindler/ecos


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]