[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

trap tt=0x80 using the connect() socket routine



Hi all,

I am trying to use TCP sockets for LEON2 processor. I got a C++ class
(working perfectly under linue) wrapping all the network calls for
sockets. The problem is that when I use this class over RTEMS, i got
the tt=0x80 trap (which i think is the floating unit exception) within
the connect() call. The code is:

bool Socket::connect ( const std::string host, const int port )
{
	assert(m_sock != -1);

	if ( ! is_valid() ) return false;

	m_addr.sin_family = AF_INET;
	m_addr.sin_port = htons ( port );

	int status = inet_pton ( AF_INET, host.c_str(), &m_addr.sin_addr );

	if ( errno == EAFNOSUPPORT ) return false;

	status = ::connect ( m_sock, ( sockaddr * ) &m_addr, sizeof ( m_addr
) );  <------------------- inside this routine the trap is raised

	if ( status == 0 )
		return true;
	else
		return false;
}

Looks like the connect() function performs some operations where the
FPU is needed and the FPU on the LEON2 processor is not activated and
so the exception is raised. I don't know how RTEMS manage the FPU. I
guess it is deactivated at the beginning but, is it activated in the
first FPU trap? Do I have to activate it explicity? Do I have to
inform RTEMS such a way that my application is using the FPU?

Cheers,

Aitor