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]

RedBoot/hal_diag.c confusion


I've added virtual vector support to my HAL, and it works when
building stand-alone eCos applications. 

With CYGSEM_HAL_VIRTUAL_VECTOR_DIAG set, it uses the virtual
vector table. With it unset, it uses old-style diagnostic I/O
routines.

However, when I build RedBoot, it somehow seems to use both.

The output I get when I start RedBoot looks like (some white
space elided):

    ARM RPSH HAL (no virtual vectors)
    Memory Config:
    [...]
    ARM RPSH HAL (with virtual vectors)
    Memory Config:
    [...]
    +
    RReeddBBoooott((ttmm))  ddeebbuugg  eennvviirroonnmmeenntt  --  bbuuiilltt  1122::4444::1188,,  JJaann  1111  22000011
    PPllaattffoorrmm::  CCoommttrrooll  RRPPSSHH22  ((AARRMM  77TTDDMMII))  
    CCooppyyrriigghhtt  ((CC))  22000000,,  RReedd  HHaatt,,  IInncc..

    RRAAMM::  00xx0000000000000000--00xx0000008800000000
    RReeddBBoooott>>  

At that point, I hit <enter> and get the normal prompt and
everything seems OK:

    RedBoot> help
    help
    Manage machine caches
       cache [ON | OFF]
    [...]
    RedBoot>

my hal_diag.c file is structured like this:


#if defined(CYGPRI_HAL_IMPLEMENTS_IF_SERVICES)
[...]
void cyg_hal_plf_serial_putc(void *__ch_data, char c)
[...]
static void cyg_hal_plf_serial_init(void)
{
  hal_virtual_comm_table_t* comm;
  int cur = CYGACC_CALL_IF_SET_CONSOLE_COMM(CYGNUM_CALL_IF_SET_COMM_ID_QUERY_CURRENT);

  HAL_INTERRUPT_MASK(rpsh_ser_channels[0].isr_vector);
  cyg_hal_plf_serial_init_channel(&rpsh_ser_channels[0]);
  CYGACC_CALL_IF_SET_CONSOLE_COMM(0);
  comm = CYGACC_CALL_IF_CONSOLE_PROCS();
  CYGACC_COMM_IF_CH_DATA_SET(*comm, &rpsh_ser_channels[0]);
  [...]
  diag_printf("\nARM RPSH HAL (with virtual vectors)\n");
  [...]
}
void cyg_hal_plf_comms_init(void)
{
  [...]
  cyg_hal_plf_serial_init();
}
#endif //CYGPRI_HAL_IMPLEMENTS_IF_SERVICES

#ifndef CYGSEM_HAL_VIRTUAL_VECTOR_DIAG
// old style I/O routines
void hald_diag_write_char(char c)
{
  static int init;
  if (!init)
    {
    [...]
    diag_printf("\nARM RPSH HAL (no virtual vectors)\n");
    init = 1;
    }
}
#endif //CYGSEM_HAL_VIRTUAL_VECTOR_DIAG


I've checked the header files:

  CYGPRI_HAL_IMPLEMENTS_IF_SERVICES is defined
  CYGSEM_HAL_VIRTUAL_VECTOR_DIAG is not defined

Therefore, both sections of hal_diag.c are getting compiled.
Apparently Redboot is calling both hal_diag_write_char()
and the newer virtual vector table routines.

Since CYGSEM_HAL_VIRTUAL_VECTOR_DIAG is not defined, why is
Redboot using the virtual vector table routines?

If I set CYGSEM_HAL_VIRTUAL_VECTOR_DIAG to 1 in ecos.ecc, then
RedBoot crashes.  I'm confused...

-- 
Grant Edwards
grante@visi.com

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