public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* RE: [ECOS] Problems with var_mk_defs.c
@ 2003-10-15 15:45 James Yates
  2003-10-15 15:50 ` Gary Thomas
  0 siblings, 1 reply; 8+ messages in thread
From: James Yates @ 2003-10-15 15:45 UTC (permalink / raw)
  To: Gary Thomas; +Cc: ecos-discuss

After looking at the generated var_mk_defs.s file by adding -save-temps to the global compiler flags, the first line the compiler complains about is:

.equ	HAL_UCACHE_SIZE, #0
.loc 1 82 0

Would I be right in assuming that this should read:

.equ	HAL_UCACHE_SIZE, 0
.loc 1 82 0

The function call that creates this line is:
DEFINE(HAL_UCACHE_SIZE, HAL_UCACHE_SIZE);

The macro itself:
#define DEFINE(sym, val) \
        asm volatile("\n\t.equ\t" #sym ", %0" : : "i" (val))

I guess this is the assembler equivalent of #define HAL_UCACHE_SIZE 0 so that wherever HAL_UCACHE_SIZE is referenced, the value of 0 is used.

However, I am unsure about how to modify the macro, my skill in assembler is extremely poor. Any ideas?

		James Yates

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

^ permalink raw reply	[flat|nested] 8+ messages in thread
* RE: [ECOS] Problems with var_mk_defs.c
@ 2003-10-16  7:55 James Yates
  2003-10-16 12:04 ` Gary Thomas
  0 siblings, 1 reply; 8+ messages in thread
From: James Yates @ 2003-10-16  7:55 UTC (permalink / raw)
  To: Gary Thomas; +Cc: ecos-discuss

I tried removing the hash, as a temporary fix i change DEFINE to:

#define DEFINE(sym, val) \
        asm volatile("\n\t.equ\t" #sym ",0" : : "i" (val))

Which effectively then outputs :

 .equ	HAL_UCACHE_SIZE, 0
 .loc 1 82 0

However, this seemed to cause other problems. The compiler bombed after this with the following:

sh-elf-gcc -mb -m2 -O2 -save-temps -Wall -Wpointer-arith -Wstrict-prototypes -Winline -Wundef -Woverloaded-virtual -ggdb -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -fvtable-gc -finit-priority -Wa,-am  -I/ecos-d/Dev/eCos/builds/current/pc388_install/include -I/ecos-d/ecos/ecos/packages/hal/sh/sh2/current -I/ecos-d/ecos/ecos/packages/hal/sh/sh2/current/src -I/ecos-d/ecos/ecos/packages/hal/sh/sh2/current/tests -I. -Wp,-MD,sh2_offsets.tmp -o var_mk_defs.tmp /ecos-d/ecos/ecos/packages/hal/sh/sh2/current/src/var_mk_defs.c
/opt/ecos_new/gnutools/sh-elf/bin/../lib/gcc-lib/sh-elf/3.2.1/../../../../sh-elf/bin/ld: cannot find -
make[1]: Leaving directory `/ecos-d/Dev/eCos/builds/current/pc388_build/hal/sh/sh2/current'
lc
make: Leaving directory `/ecos-d/Dev/eCos/builds/current/pc388_build'
collect2: ld returned 1 exit status
make[1]: *** [/ecos-d/Dev/eCos/builds/current/pc388_install/include/cyg/hal/sh2_offsets.inc] Error 1
make: *** [build] Error 2

I can only assume that this must be a compiler problem. I am currently building the latest gcc v3.3.1 for the sh-elf platform to see if this fixes the problem. Apart from that I am completely stuck.

	
		James Yates

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

^ permalink raw reply	[flat|nested] 8+ messages in thread
* RE: [ECOS] Problems with var_mk_defs.c
@ 2003-10-15 15:02 James Yates
  2003-10-15 15:09 ` Gary Thomas
  0 siblings, 1 reply; 8+ messages in thread
From: James Yates @ 2003-10-15 15:02 UTC (permalink / raw)
  To: Gary Thomas; +Cc: ecos-discuss

Gary,

When I compile the following is output:

make -r -C hal/sh/arch/current /ecos-d/Dev/eCos/builds/current/pc388_install/include/cyg/hal/sh_offsets.inc
make[1]: Entering directory `/ecos-d/Dev/eCos/builds/current/pc388_build/hal/sh/arch/current'
sh-elf-gcc -mb -m2 -O2 -Wall -Wpointer-arith -Wstrict-prototypes -Winline -Wundef -Woverloaded-virtual -ggdb -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -fvtable-gc -finit-priority  -I/ecos-d/Dev/eCos/builds/current/pc388_install/include -I/ecos-d/ecos/ecos/packages/hal/sh/arch/current -I/ecos-d/ecos/ecos/packages/hal/sh/arch/current/src -I/ecos-d/ecos/ecos/packages/hal/sh/arch/current/tests -I. -Wp,-MD,sh_offsets.tmp -o hal_mk_defs.tmp -S /ecos-d/ecos/ecos/packages/hal/sh/arch/current/src/hal_mk_defs.c
fgrep .equ hal_mk_defs.tmp | sed s/#// > /ecos-d/Dev/eCos/builds/current/pc388_install/include/cyg/hal/sh_offsets.inc
make[1]: Leaving directory `/ecos-d/Dev/eCos/builds/current/pc388_build/hal/sh/arch/current'
make -r -C hal/sh/sh2/current /ecos-d/Dev/eCos/builds/current/pc388_install/include/cyg/hal/sh2_offsets.inc
make[1]: Entering directory `/ecos-d/Dev/eCos/builds/current/pc388_build/hal/sh/sh2/current'
sh-elf-gcc -mb -m2 -O2 -Wall -Wpointer-arith -Wstrict-prototypes -Winline -Wundef -Woverloaded-virtual -ggdb -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -fvtable-gc -finit-priority  -I/ecos-d/Dev/eCos/builds/current/pc388_install/include -I/ecos-d/ecos/ecos/packages/hal/sh/sh2/current -I/ecos-d/ecos/ecos/packages/hal/sh/sh2/current/src -I/ecos-d/ecos/ecos/packages/hal/sh/sh2/current/tests -I. -Wp,-MD,sh2_offsets.tmp -o var_mk_defs.tmp /ecos-d/ecos/ecos/packages/hal/sh/sh2/current/src/var_mk_defs.c
make[1]: Leaving directory `/ecos-d/Dev/eCos/builds/current/pc388_build/hal/sh/sh2/current'
/ecos-c/temp/ccmMeZK9.s: Assembler messages:
make: Leaving directory `/ecos-d/Dev/eCos/builds/current/pc388_build'
/ecos-c/temp/ccmMeZK9.s:26: Error: bad expression
/ecos-c/temp/ccmMeZK9.s:26: Warning: rest of line ignored; first ignored character is `0'
/ecos-c/temp/ccmMeZK9.s:29: Error: bad expression
/ecos-c/temp/ccmMeZK9.s:29: Warning: rest of line ignored; first ignored character is `0'
/ecos-c/temp/ccmMeZK9.s:32: Error: bad expression
/ecos-c/temp/ccmMeZK9.s:32: Warning: rest of line ignored; first ignored character is `0'
/ecos-c/temp/ccmMeZK9.s:35: Error: bad expression
/ecos-c/temp/ccmMeZK9.s:35: Warning: rest of line ignored; first ignored character is `6'
/ecos-c/temp/ccmMeZK9.s:38: Error: bad expression
/ecos-c/temp/ccmMeZK9.s:38: Warning: rest of line ignored; first ignored character is `1'
/ecos-c/temp/ccmMeZK9.s:41: Error: bad expression
/ecos-c/temp/ccmMeZK9.s:41: Warning: rest of line ignored; first ignored character is `8'
/ecos-c/temp/ccmMeZK9.s:44: Error: bad expression
/ecos-c/temp/ccmMeZK9.s:44: Warning: rest of line ignored; first ignored character is `0'
/ecos-c/temp/ccmMeZK9.s:47: Error: bad expression
/ecos-c/temp/ccmMeZK9.s:47: Warning: rest of line ignored; first ignored character is `3'
/ecos-c/temp/ccmMeZK9.s:50: Error: bad expression
/ecos-c/temp/ccmMeZK9.s:50: Warning: rest of line ignored; first ignored character is `3'
make[1]: *** [/ecos-d/Dev/eCos/builds/current/pc388_install/include/cyg/hal/sh2_offsets.inc] Error 1
make: *** [build] Error 2


For the code in var_mk_defs.c:
HAL_UCACHE_SIZE = 0, HAL_UCACHE_WAYS = 0, HAL_UCACHE_LINE_SIZE = 0, CYGNUM_HAL_ISR_MAX = 62 and so on.

As for my port, the processor it is for has a much larger vector table. The SH2 7044 variant I based this on has exception vectors for the custom interrupt layout going up to 93 in var_intr.h whereas the SH2 7145 hash exception vectors going up to 129. Could the size of the vector table be causing a problem.

The 7145 also has no cache so I have used another cache definition file mod_regs_cac_3.h which specifies cache sizes as 0 and all addresses. Could this also be contributing. I am pretty new to eCos and there is some funky stuff which I don't as yet understand. It has been quite hard work performing a variant and platform port for board.

   Any help greatfully received. Many thanks.

		James

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

^ permalink raw reply	[flat|nested] 8+ messages in thread
* [ECOS] Problems with var_mk_defs.c
@ 2003-10-15 14:34 James Yates
  2003-10-15 14:41 ` Gary Thomas
  0 siblings, 1 reply; 8+ messages in thread
From: James Yates @ 2003-10-15 14:34 UTC (permalink / raw)
  To: ecos-discuss

In the SH Hal architecture I am getting build problems relating to var_mk_defs.c.  If I comment out the code within int main(void), the compile problems go away. When included, every call to DEFINE throws up a bad expression. Can anyone explain to me what this file is actually doing, or indeed why it isn't working as I am completely stuck.

#define DEFINE(sym, val) \
        asm volatile("\n\t.equ\t" #sym ",%0" : : "i" (val))

int main(void)
{
    // Caching details
    DEFINE(HAL_UCACHE_SIZE, HAL_UCACHE_SIZE);
    DEFINE(HAL_UCACHE_WAYS, HAL_UCACHE_WAYS);
    DEFINE(HAL_UCACHE_LINE_SIZE, HAL_UCACHE_LINE_SIZE);

    // Interrupt details
    DEFINE(CYGNUM_HAL_ISR_MAX, CYGNUM_HAL_ISR_MAX);
    DEFINE(CYGNUM_HAL_INTERRUPT_LVL0, CYGNUM_HAL_INTERRUPT_LVL0);
    DEFINE(CYGNUM_HAL_INTERRUPT_LVL_MAX, CYGNUM_HAL_INTERRUPT_LVL_MAX);
#ifdef CYGNUM_HAL_INTERRUPT_LVL14
    DEFINE(CYGNUM_HAL_INTERRUPT_LVL14, CYGNUM_HAL_INTERRUPT_LVL14);
#endif
    DEFINE(CYGNUM_HAL_INTERRUPT_NMI, CYGNUM_HAL_INTERRUPT_NMI);
    DEFINE(CYGNUM_HAL_VECTOR_TRAP, CYGNUM_HAL_VECTOR_TRAP);
    DEFINE(CYGNUM_HAL_VECTOR_INTERRUPT, CYGNUM_HAL_VECTOR_INTERRUPT);

    return 0;
}


Many Thanks in advance

	James Yates

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

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

end of thread, other threads:[~2003-10-16 12:04 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-10-15 15:45 [ECOS] Problems with var_mk_defs.c James Yates
2003-10-15 15:50 ` Gary Thomas
  -- strict thread matches above, loose matches on Subject: below --
2003-10-16  7:55 James Yates
2003-10-16 12:04 ` Gary Thomas
2003-10-15 15:02 James Yates
2003-10-15 15:09 ` Gary Thomas
2003-10-15 14:34 James Yates
2003-10-15 14:41 ` Gary Thomas

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).