public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Grant Edwards <grante@visi.com>
To: ecos-discuss@sources.redhat.com
Subject: [ECOS] RedBoot/hal_diag.c confusion
Date: Thu, 11 Jan 2001 11:23:00 -0000	[thread overview]
Message-ID: <20010111132721.A11557@visi.com> (raw)

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

             reply	other threads:[~2001-01-11 11:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-01-11 11:23 Grant Edwards [this message]
2001-01-11 15:01 ` Grant Edwards

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20010111132721.A11557@visi.com \
    --to=grante@visi.com \
    --cc=ecos-discuss@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).