public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] Free BSD ioctl problem (Renesas EDOSK2674)
@ 2004-06-04 17:49 Uwe Kindler
  2004-06-04 21:09 ` Andrew Lunn
  0 siblings, 1 reply; 9+ messages in thread
From: Uwe Kindler @ 2004-06-04 17:49 UTC (permalink / raw)
  To: ecos-discuss

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

^ permalink raw reply	[flat|nested] 9+ messages in thread
* Re: [ECOS] Free BSD ioctl problem (Renesas EDOSK2674)
@ 2004-06-10  6:04 Uwe Kindler
  0 siblings, 0 replies; 9+ messages in thread
From: Uwe Kindler @ 2004-06-10  6:04 UTC (permalink / raw)
  To: ecos-discuss; +Cc: Andrew Lunn

Hello Andrew,

just for your information. I have mailed the H8S IOCTL call problem we have
talked about to www.kpitgnutools.com and received the following answer.

------------------------------------------------------
Hi,

Thank you for using the GNUH8 tool chain.
We accept that gcc does not behave as per the documentation in
http://www.gnu.org/software/libc/manual/html_node/Why-Variadic.html#Why%20Va
riadic
We will file a bug report on this to the GCC mailing list.

Regards,
GNU Support.
----------------------------------------------------------

So there is another issue you should keep in mind when offering H8S support
:o(.
As a workaround for my H8S port of eCos I think about making the ioctl
function definition in io.cxx variadic so that it matches the declaration.

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2004-06-30 21:21 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-06-04 17:49 [ECOS] Free BSD ioctl problem (Renesas EDOSK2674) Uwe Kindler
2004-06-04 21:09 ` Andrew Lunn
2004-06-05  8:47   ` Uwe Kindler
2004-06-05 12:50     ` Andrew Lunn
2004-06-23 17:18       ` Uwe Kindler
2004-06-23 20:07         ` Andrew Lunn
2004-06-29 20:44         ` Andrew Lunn
2004-06-30 21:21           ` Uwe Kindler
2004-06-10  6:04 Uwe Kindler

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).