This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Question about the virtual vector? Thanks
- From: "Qiang Huang" <jameshq at liverpool dot ac dot uk>
- To: "Ecos-Discuss" <ecos-discuss at sources dot redhat dot com>
- Date: Thu, 7 Nov 2002 20:51:15 -0000
- Subject: [ECOS] Question about the virtual vector? Thanks
Hi all:
I got confused by the virtual vector, can anyone give me some help?
Thanks a lot.
e.g.
hal_if.h
__call_voidCOMM1(IF_PUTC, void, __comm_if_putc_t, cyg_uint8)
#define CYGACC_COMM_IF_PUTC(_t_, _c_) \
__call_COMM_IF_PUTC(_t_,_c_)
// expanded as following
static __inline__ void __call_COMM_IF_PUTC(hal_virtual_comm_table_t t,
cyg_uint8 _p1_) \
{ \
void *dp = (__comm_if_ch_data_t)t[CYGNUM_COMM_IF_CH_DATA]; \
_ENTER_MONITOR(); \
((__comm_if_putc_t)(t[CYGNUM_COMM_IF_PUTC]))(dp, _p1_);
\
_EXIT_MONITOR(); \
}
// fill the virtual vector table
#define CYGACC_COMM_IF_PUTC_SET(_t_, _x_) \
(_t_)[CYGNUM_COMM_IF_PUTC]=(CYG_ADDRWORD)(_x_)
in
"void cyg_hal_diag_mangler_gdb_init(void)" function
CYGACC_COMM_IF_PUTC_SET(*comm, cyg_hal_diag_mangler_gdb_putc);
expanded to:
(*comm)[3] = (CYG_ADDRWORD)(cyg_hal_diag_mangler_gdb_putc)
so when called to 1). CYGACC_COMM_IF_PUTC --> 2). __call_COMM_IF_PUTC -->
3). call the function in the virtual vector table entry [3] --> 4).
cyg_hal_diag_mangler_gdb_putc() --> 5).
cyg_hal_diag_mangler_gdb_flush( ) --> 6). CYGACC_COMM_IF_PUTC(*__chan,
'#'); CYGACC_COMM_IF_PUTC(*__chan, hex[(csum>>4)&0xF]); etc. are called
**** back to 1)****??
**Question** Will this cause recursive call?? (I looked in the document
about virtual vector but can't find out whether the recursive call will
happen or not?)
BTW for implementing virtual vector table mechanism what HAL function should
I provided??
Thanks a lot.
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss