public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] Question about the virtual vector? Thanks
@ 2002-11-07 12:53 Qiang Huang
  0 siblings, 0 replies; only message in thread
From: Qiang Huang @ 2002-11-07 12:53 UTC (permalink / raw)
  To: Ecos-Discuss

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-11-07 20:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-11-07 12:53 [ECOS] Question about the virtual vector? Thanks Qiang Huang

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