Ignore:
Timestamp:
10/05/98 22:36:06 (24 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
dc6763c8
Parents:
711a2a1
Message:

Large patch from Erik Ivanenko <erik.ivanenko@…> which
moves pieces of the pc386 bsp up to a shared level for all i386 BSPs
and modifies the i386ex BSP to use those shared pieces. Serial remote
debugging is included for both targets. Erik's notes:

There are several workarounds in it:

1) #define NEXT_GAS is hardcoded in pc386/start/start.s
2) #define NEXT_GAS is hardcoded in i386ex/start/start.s
3) #define NEW_GAS is hardcoded in pc386/start16.s
4) #undef assert and redeclare _assert hardcoded in console.c for

both pc386 and i386ex due to my egcs1.1b ~ newlib problem. Should have
modified t-rtems.cfg ( no time )

I've tested pc386 with both video and serial consoles and GDB remote.
All work fine, except that GDB acts weird. ( re: other posting)

I hope this will work for you. It took quite some time to locate the
autoconf error. The remainder was just grunt work.
Unfortunately, I think I've unwound the removal of the IBMPCInitVideo
stuff. Sorry. I REALLY can't spend more time... I've been at this
conversion to 4.0 locally and updating the release since Sept. 8th, and
have yet to compile my network driver.... This is as much as I can do
right now.

I look forward to the next patch to really test i368ex. I did make sure
that the sample tests worked for pc386.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/i386/pc386/console/console.c

    r711a2a1 r0ebbf66  
    3535#include <stdlib.h>
    3636#include <assert.h>
     37#undef __assert
     38void __assert (const char *file, int line, const char *msg);
    3739
    3840#include <bsp.h>
     
    4042#include <rtems/libio.h>
    4143#include <termios.h>
    42 #include <pc386uart.h>
     44#include <uart.h>
    4345#include <libcpu/cpuModel.h>
    4446
    4547/*
    4648 * Possible value for console input/output :
    47  *      PC386_CONSOLE_PORT_CONSOLE
    48  *      PC386_UART_COM1
    49  *      PC386_UART_COM2
     49 *      BSP_CONSOLE_PORT_CONSOLE
     50 *      BSP_UART_COM1
     51 *      BSP_UART_COM2
    5052 */
    5153
    5254/*
    5355 * Possible value for console input/output :
    54  *      PC386_CONSOLE_PORT_CONSOLE
    55  *      PC386_UART_COM1
    56  *      PC386_UART_COM2
     56 *      BSP_CONSOLE_PORT_CONSOLE
     57 *      BSP_UART_COM1
     58 *      BSP_UART_COM2
    5759 */
    5860
    59 int PC386ConsolePort = PC386_CONSOLE_PORT_CONSOLE;
     61int BSPConsolePort = BSP_CONSOLE_PORT_CONSOLE;
     62
     63/* int BSPConsolePort = BSP_UART_COM2;  */
     64int BSPBaseBaud    = 115200;
    6065
    6166extern BSP_polling_getchar_function_type BSP_poll_char;
     
    6772extern rtems_boolean _IBMPC_scankey(char *);  /* defined in 'inch.c' */
    6873extern char BSP_wait_polled_input(void);
     74extern void _IBMPC_initVideo(void);
    6975
    7076static int  conSetAttr(int minor, const struct termios *);
     
    7480
    7581
    76 static rtems_irq_connect_data console_isr_data = {PC_386_KEYBOARD,
     82static rtems_irq_connect_data console_isr_data = {BSP_KEYBOARD,
    7783                                                   _IBMPC_keyboard_isr,
    7884                                                   isr_on,
     
    95101isr_is_on(const rtems_irq_connect_data *irq)
    96102{
    97   return pc386_irq_enabled_at_i8259s(irq->name);
     103  return BSP_irq_enabled_at_i8259s(irq->name);
    98104}
    99105
    100106void console_reserve_resources(rtems_configuration_table *conf)
    101107{
    102   if(PC386ConsolePort != PC386_CONSOLE_PORT_CONSOLE)
     108    if(BSPConsolePort != BSP_CONSOLE_PORT_CONSOLE)
    103109    {
    104110      rtems_termios_reserve_resources(conf, 1);
    105111    }
     112   
    106113  return;
    107114}
    108115
    109 void __assert(const char *file, int line, const char *msg)
    110 {
    111   static   char exit_msg[] = "EXECUTIVE SHUTDOWN! Any key to reboot...";
     116void __assert (const char *file, int line, const char *msg)
     117{
     118    static   char exit_msg[] = "EXECUTIVE SHUTDOWN! Any key to reboot...";
    112119  unsigned char  ch;
    113  
     120  
    114121  /*
    115122   * Note we cannot call exit or printf from here,
    116123   * assert can fail inside ISR too
    117124   */
    118   /*
     125
     126   /*
    119127   * Close console
    120128   */
     
    130138  printk("\n\n");
    131139  rtemsReboot();
     140
    132141}
    133142
     
    150159   */
    151160
    152   if(PC386ConsolePort == PC386_CONSOLE_PORT_CONSOLE)
    153     {
    154 
     161
     162  if(BSPConsolePort == BSP_CONSOLE_PORT_CONSOLE)
     163    {
    155164      /* Install keyboard interrupt handler */
    156       status = pc386_install_rtems_irq_handler(&console_isr_data);
     165      status = BSP_install_rtems_irq_handler(&console_isr_data);
    157166 
    158167      if (!status)
     
    182191     
    183192      /* 9600-8-N-1 */
    184       PC386_uart_init(PC386ConsolePort, 9600, 0);
     193      BSP_uart_init(BSPConsolePort, 9600, 0);
    185194     
    186195     
    187196      /* Set interrupt handler */
    188       if(PC386ConsolePort == PC386_UART_COM1)
    189         {
    190           console_isr_data.name = PC386_UART_COM1_IRQ;
    191           console_isr_data.hdl  = PC386_uart_termios_isr_com1;
     197      if(BSPConsolePort == BSP_UART_COM1)
     198        {
     199          console_isr_data.name = BSP_UART_COM1_IRQ;
     200          console_isr_data.hdl  = BSP_uart_termios_isr_com1;
    192201         
    193202        }
    194203      else
    195204        {
    196           assert(PC386ConsolePort == PC386_UART_COM2);
    197           console_isr_data.name = PC386_UART_COM2_IRQ;
    198           console_isr_data.hdl  = PC386_uart_termios_isr_com2;
    199         }
    200 
    201       status = pc386_install_rtems_irq_handler(&console_isr_data);
     205          assert(BSPConsolePort == BSP_UART_COM2);
     206          console_isr_data.name = BSP_UART_COM2_IRQ;
     207          console_isr_data.hdl  = BSP_uart_termios_isr_com2;
     208        }
     209
     210      status = BSP_install_rtems_irq_handler(&console_isr_data);
    202211
    203212      if (!status){
     
    215224        }
    216225
    217       if(PC386ConsolePort == PC386_UART_COM1)
     226      if(BSPConsolePort == BSP_UART_COM1)
    218227        {
    219228          printk("Initialized console on port COM1 9600-8-N-1\n\n");
     
    230239       * This may be convenient to debug the serial line driver itself...
    231240       */
    232       printk("Warning : This will be the last message displayed on console\n");
     241      /*      printk("Warning : This will be the last message displayed on console\n");*/
    233242      BSP_output_char = (BSP_output_char_function_type) BSP_output_char_via_serial;
    234243      BSP_poll_char   = (BSP_polling_getchar_function_type) BSP_poll_char_via_serial;
     
    243252static int console_last_close(int major, int minor, void *arg)
    244253{
    245   pc386_remove_rtems_irq_handler (&console_isr_data);
     254  BSP_remove_rtems_irq_handler (&console_isr_data);
    246255
    247256  return 0;
     
    262271    console_last_close,       /* lastClose */
    263272    NULL,                     /* pollRead */
    264     PC386_uart_termios_write_com1, /* write */
     273    BSP_uart_termios_write_com1, /* write */
    265274    conSetAttr,               /* setAttributes */
    266275    NULL,                     /* stopRemoteTx */
     
    269278  };
    270279
    271   if(PC386ConsolePort == PC386_CONSOLE_PORT_CONSOLE)
     280  if(BSPConsolePort == BSP_CONSOLE_PORT_CONSOLE)
    272281    {
    273282      ++console_open_count;
     
    275284    }
    276285
    277   if(PC386ConsolePort == PC386_UART_COM2)
    278     {
    279       cb.write = PC386_uart_termios_write_com2;
     286  if(BSPConsolePort == BSP_UART_COM2)
     287    {
     288      cb.write = BSP_uart_termios_write_com2;
    280289    }
    281290
     
    291300   * Pass data area info down to driver
    292301   */
    293   PC386_uart_termios_set(PC386ConsolePort,
     302  BSP_uart_termios_set(BSPConsolePort,
    294303                         ((rtems_libio_open_close_args_t *)arg)->iop->data1);
    295304 
    296305  /* Enable interrupts  on channel */
    297   PC386_uart_intr_ctrl(PC386ConsolePort, PC386_UART_INTR_CTRL_TERMIOS);
     306  BSP_uart_intr_ctrl(BSPConsolePort, BSP_UART_INTR_CTRL_TERMIOS);
    298307
    299308  return RTEMS_SUCCESSFUL;
     
    310319  rtems_device_driver res = RTEMS_SUCCESSFUL;
    311320
    312   if(PC386ConsolePort != PC386_CONSOLE_PORT_CONSOLE)
     321  if(BSPConsolePort != BSP_CONSOLE_PORT_CONSOLE)
    313322    {
    314323      res =  rtems_termios_close (arg);
     
    338347  int            count, maximum  = rw_args->count;
    339348
    340   if(PC386ConsolePort != PC386_CONSOLE_PORT_CONSOLE)
     349  if(BSPConsolePort != BSP_CONSOLE_PORT_CONSOLE)
    341350    {
    342351      return rtems_termios_read (arg);
     
    383392  int            count, maximum  = rw_args->count;
    384393
    385   if(PC386ConsolePort != PC386_CONSOLE_PORT_CONSOLE)
     394  if(BSPConsolePort != BSP_CONSOLE_PORT_CONSOLE)
    386395    {
    387396      return rtems_termios_write (arg);
     
    410419)
    411420{
    412   if(PC386ConsolePort != PC386_CONSOLE_PORT_CONSOLE)
     421  if(BSPConsolePort != BSP_CONSOLE_PORT_CONSOLE)
    413422    {
    414423      return rtems_termios_ioctl (arg);
     
    482491    }
    483492
    484   PC386_uart_set_baud(PC386ConsolePort, baud);
     493  BSP_uart_set_baud(BSPConsolePort, baud);
    485494
    486495  return 0;
Note: See TracChangeset for help on using the changeset viewer.