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]

Re: Re: Wrong declaration of idle_thread_stack


To allign a character array, will this work?

static char stack01[16] __attribute__ ((aligned (4)));
static char stack02[15] __attribute__ ((aligned (4)));
static char stack03[14] __attribute__ ((aligned (4)));
static char stack04[3] __attribute__ ((aligned (4)));
static char stack05[4] __attribute__ ((aligned (4)));



----- Original Message ----- 
From: "Uwe Kindler" <ukindler@htwm.de>
To: <ecos-discuss@sources.redhat.com>
Cc: "Andrew Lunn" <andrew@lunn.ch>
Sent: Wednesday, January 21, 2004 8:16 PM
Subject: [ECOS] Re: Wrong declaration of idle_thread_stack


Hello Andrew,

> assertion never goes off. If this were not true, all the targets in
> eCosCentrics test farm would be failing this test at regular

Do you have an Hitachi H8300 or H8S in your testfarm? - I develop for the
Renesas EDOSK-2674 board with H8S/2674 processor.

> Now, is this really a compiler issue? I think it probably is.  I
> suspect there is lots of code out there in general that assumes a char
> array starts on a word boundary. We could apply your patch, but i
> suspect you will run into trouble some where else. I think maybe you

Well, I executed the h8300-elf-nm command on the file tm_basic after
building the eCos kernel tests. Here are some lines:

0074ef60 b ___mangler_line
0074efc4 B _hal_saved_interrupt_state
0074efc8 B __cyg_hal_compiler_dummy
0074efcc b _cyg_dummy_diag_init_obj
0074efcd b _ZZ9trim_funcPKcE4fbuf
0074f031 b _idle_thread_stack
0074f834 B _idle_thread_loops
0074f838 B _idle_thread
0074f8d8 B __ZN10Cyg_Thread17exception_controlE

The idle thread stack starts at address 0x74f031 - so the assertions will
fail (and they do fail). Now I compiled a very simple and small application
(nothing eCos related):

static char stack01[16];
static char stack02[15];
static char stack03[14];
static char stack04[3];
static char stack05[4];

int main (void)
{
  for (count=0; count<12; count++)

After building I executed the h8300-elf-nm command again - this is the
result:

00ffc00c b _stack01
00ffc01c b _stack02
00ffc02b b _stack03
00ffc039 b _stack04
00ffc03c b _stack05
0000026e T _start

So the h8300 compiler/linker does not align char arrays to CYG_WORD
boundary. So what can I do?

Regards, Uwe


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



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


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