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]

cyg_thread vs. Cyg_Thread


On Tue, Sep 04, 2001 at 06:49:05PM +0200, Andrew Lunn wrote:
> The assertion is saying that the C struct cyg_thread, as defined in
> kapidata.h is a different size to the C++ clase Cyg_Thread as defined
> in thread.hxx. These two should be identical, member for member. 

I have a snapshot from 30-Jul-2001(it works)
and from 04-Sep-2001 (doesn't work).
(MPC860T based platform, MBX based port, gcc 2.95.2)

Fact is that both versions of thread.hxx
(where Cyg_Thread is defined) files are identical.

In the working twothreads application (i get no asserts)
sizeof( cyg_thread ) is 176 and sizeof( Cyg_Thread ) must
be the same.

In the not-working application (version 04-Sep)
sizeof( cyg_thread ) is 186.

Since thread.hxx didn't change beetween the two versions its
clear that i get the an assert on
CYG_ASSERT_SIZES( cyg_thread, Cyg_Thread ); (186 != 176).

maybe there is problem in how the compiler packs the struct
cyg_thread.

30-Jul: install/include/cyg/kernel/kapidata.h

struct cyg_thread
{
    cyg_hardwarethread  hwthread;
    :
    .
}
here we have the struct cyg_hardwarethread as first member
of cyg_thread.


vs. 04-Sep: install/include/cyg/kernel/kapidata.h

struct cyg_thread
{
    CYG_ADDRESS         stack_base;   /* pointer to base of stack area */    \
    cyg_uint32          stack_size;   /* size of stack area in bytes */      \
    CYG_HARDWARETHREAD_STACK_LIMIT_MEMBER                                    \
    CYG_ADDRESS         stack_ptr;    /* pointer to saved state on stack */  \
    CYG_ADDRWORD        entry_point;  /* main entry point (code pointer!) */ \
    CYG_ADDRWORD        entry_data;   /* entry point argument */             \
    CYG_HARDWARETHREAD_SAVED_CONTEXT_MEMBER
    :
    .
}

Am i the only one experiencing such problems?
Thanks for any suggestions.

regards, christoph
-- 


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