[ECOS] SH build - Odd Link Error
Nick - eCos Developer
n_ecos@targus.net
Tue Mar 6 12:54:00 GMT 2001
Using: GCC built for target sh: "gcc version 2.95.1 19990816 (release)"
running on Linux. Although I can get the same error on NT.
I get the link error: undefined reference to 'dsr_disable_counter'
implicating the declaration near line 60 drv_api.c:
(Complete path "ecos/packages/hal/common/current/src/drv_api.c")
Line 60+ from drv_api.c
<snip>
//--------------------------------------------------------------------------
// Statics
static volatile cyg_int32 isr_disable_counter = 1; // ISR disable counter
volatile cyg_int32 dsr_disable_counter asm("cyg_scheduler_sched_lock"); //
DSR disable counter
static cyg_interrupt* volatile dsr_list; // List of pending DSRs
<snip>
The middle declaration seems to be declaring space for
cyg_scheduler_sched_lock and simultaneously giving it the alias
dsr_disable_counter, so If I simplify this FROM:
volatile cyg_int32 dsr_disable_counter asm("cyg_scheduler_sched_lock");
TO:
volatile cyg_int32 cyg_scheduler_sched_lock;
#define dsr_disable_counter cyg_scheduler_sched_lock // DSR disable counter
It will compile and "seems" to work. Am I correct in assuming that the
original line allocated space for cyg_scheduler_sched_lock and made
dsr_disable_counter an alias for it in this file. (Other files (some
assembler) refer only to the name cyg_scheduler_sched_lock.
What is this and why the complex syntax? Is my hack equivalent?
More information about the Ecos-discuss
mailing list