Changeset 0ebbf66 in rtems


Ignore:
Timestamp:
Oct 5, 1998, 10:36:06 PM (23 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.

Location:
c/src/lib/libbsp/i386
Files:
9 added
22 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/i386/i386ex/clock/ckinit.c

    r711a2a1 r0ebbf66  
    7878}
    7979
    80 static rtems_irq_connect_data clockIrqData = {PC_386_PERIODIC_TIMER,
     80static rtems_irq_connect_data clockIrqData = {BSP_PERIODIC_TIMER,
    8181                                              Clock_isr,
    8282                                              ClockOn,
     
    115115  outport_byte  ( TMR0   , clock_msb );  /* then MSB       */
    116116 
    117   if (!pc386_install_rtems_irq_handler (&clockIrqData)) {
     117  if (!BSP_install_rtems_irq_handler (&clockIrqData)) {
    118118    printk("Unable to initialize system clock\n");
    119119    rtems_fatal_error_occurred(1);
     
    152152    else if (args->command == rtems_build_name('N', 'E', 'W', ' '))
    153153    {
    154       if (!pc386_install_rtems_irq_handler (&clockIrqData)) {
     154      if (!BSP_install_rtems_irq_handler (&clockIrqData)) {
    155155        printk("Error installing clock interrupt handler!\n");
    156156        rtems_fatal_error_occurred(1);
     
    169169{
    170170  ClockOff(&clockIrqData); 
    171   pc386_remove_rtems_irq_handler (&clockIrqData);
     171  BSP_remove_rtems_irq_handler (&clockIrqData);
    172172}
  • c/src/lib/libbsp/i386/i386ex/console/console.c

    r711a2a1 r0ebbf66  
     1/*-------------------------------------------------------------------------+
     2| console.c v1.1 - i386ex BSP - 1997/08/07
     3+--------------------------------------------------------------------------+
     4| This file contains the i386ex console I/O package. It is just a termios
     5| wrapper.
     6+--------------------------------------------------------------------------+
     7| (C) Copyright 1997 -
     8| - NavIST Group - Real-Time Distributed Systems and Industrial Automation
     9|
     10| http://pandora.ist.utl.pt
     11|
     12| Instituto Superior Tecnico * Lisboa * PORTUGAL
     13+--------------------------------------------------------------------------+
     14| Disclaimer:
     15|
     16| This file is provided "AS IS" without warranty of any kind, either
     17| expressed or implied.
     18+--------------------------------------------------------------------------+
     19| This code is based on:
     20|   console.c,v 1.4 1995/12/19 20:07:23 joel Exp - go32 BSP
     21|   console.c,v 1.15 pc386 BSP
     22| With the following copyright notice:
     23| **************************************************************************
     24| *  COPYRIGHT (c) 1989-1998.
     25| *  On-Line Applications Research Corporation (OAR).
     26| *  Copyright assigned to U.S. Government, 1994.
     27| *
     28| *  The license and distribution terms for this file may be
     29| *  found in found in the file LICENSE in this distribution or at
     30| *  http://www.OARcorp.com/rtems/license.html.
     31| **************************************************************************
     32|
     33|  $Id$
     34+--------------------------------------------------------------------------*/
     35
     36#include <stdio.h>
     37#include <stdlib.h>
     38#include <assert.h>
     39
     40/* workaround for gcc development tools */
     41#undef __assert
     42void __assert (const char *file, int line, const char *msg);
     43
     44#include <bsp.h>
     45#include <irq.h>
     46#include <rtems/libio.h>
     47#include <termios.h>
     48#include <uart.h>
     49#include <libcpu/cpuModel.h>
     50
    151/*
    2  *  This file contains the i386ex console IO package.
    3  *
    4  *  COPYRIGHT (c) 1989-1998.
    5  *  On-Line Applications Research Corporation (OAR).
    6  *  Copyright assigned to U.S. Government, 1994.
    7  *
    8  *  The license and distribution terms for this file may be
    9  *  found in the file LICENSE in this distribution or at
    10  *  http://www.OARcorp.com/rtems/license.html.
    11  *
    12  *  $Id$
     52 * Possible value for console input/output :
     53 *      BSP_UART_COM1
     54 *      BSP_UART_COM2
     55 *  BSP_CONSOLE_PORT_CONSOLE is not valid in this BSP. 
     56 *      All references to either keyboard or video handling have been removed.
    1357 */
    1458
    15 #define F386_INIT
    16 
    17 #include <bsp.h>
    18 #include <rtems/libio.h>
    19 #include <bspIo.h>
    20 #include <stdlib.h>
    21 
    22 #include "../start/80386ex.h"
    23 
    24 /*  console_cleanup
    25  *
    26  *  This routine is called at exit to clean up the console hardware.
    27  *
    28  *  Input parameters: NONE
    29  *
    30  *  Output parameters:  NONE
    31  *
    32  *  Return values:
     59int BSPConsolePort = BSP_UART_COM2;
     60int BSPBaseBaud    = 781250;
     61int BSP_poll_read(int);
     62
     63extern BSP_polling_getchar_function_type BSP_poll_char;
     64
     65static int  conSetAttr(int minor, const struct termios *);
     66static void isr_on(const rtems_irq_connect_data *);
     67static void isr_off(const rtems_irq_connect_data *);
     68static int  isr_is_on(const rtems_irq_connect_data *);
     69
     70/*
     71 * Change references to com2 if required.
    3372 */
    3473
    35 void console_cleanup( void )
    36 {
    37   register rtems_unsigned8 ignored;
    38 
    39 /* clear the read buffer */
    40 
    41    inport_byte( RBR0, ignored );
    42 
    43 }
    44 
    45 /*  console_initialize
    46  *
    47  *  This routine initializes the console IO driver.
    48  *
    49  *  Input parameters: NONE
    50  *
    51  *  Output parameters:  NONE
    52  *
    53  *  Return values:
    54  */
    55 
    56 rtems_device_driver console_initialize(
    57   rtems_device_major_number  major,
    58   rtems_device_minor_number  minor,
    59   void                      *arg
    60 )
     74static rtems_irq_connect_data console_isr_data =
     75{ BSP_UART_COM2_IRQ,
     76  BSP_uart_termios_isr_com2,
     77  isr_on,
     78  isr_off,
     79  isr_is_on};
     80
     81static void
     82isr_on(const rtems_irq_connect_data *unused)
     83{
     84  return;
     85}
     86                                                   
     87static void
     88isr_off(const rtems_irq_connect_data *unused)
     89{
     90  return;
     91}
     92
     93static int
     94isr_is_on(const rtems_irq_connect_data *irq)
     95{
     96  return BSP_irq_enabled_at_i8259s(irq->name);
     97}
     98
     99void console_reserve_resources(rtems_configuration_table *conf)
     100{
     101  rtems_termios_reserve_resources(conf, 1);
     102  return;
     103}
     104
     105void __assert (const char *file, int line, const char *msg)
     106{
     107    static   char exit_msg[] = "EXECUTIVE SHUTDOWN! Any key to reboot...";
     108  unsigned char  ch;
     109   
     110  /*
     111   * Note we cannot call exit or printf from here,
     112   * assert can fail inside ISR too
     113   */
     114
     115   /*
     116   * Close console
     117   */
     118  __rtems_close(2);
     119  __rtems_close(1);
     120  __rtems_close(0);
     121
     122  printk("\nassert failed: %s: ", file);
     123  printk("%d: ", line);
     124  printk("%s\n\n", msg);
     125  printk(exit_msg);
     126  ch = BSP_poll_char();
     127  printk("\nShould jump to reset now!\n");
     128}
     129
     130
     131/*-------------------------------------------------------------------------+
     132| Console device driver INITIALIZE entry point.
     133+--------------------------------------------------------------------------+
     134| Initilizes the I/O console (keyboard + VGA display) driver.
     135+--------------------------------------------------------------------------*/
     136rtems_device_driver
     137console_initialize(rtems_device_major_number major,
     138                   rtems_device_minor_number minor,
     139                   void                      *arg)
    61140{
    62141  rtems_status_code status;
    63142
    64143  /*
    65    *  flush the console now and at exit.  Just in case.
    66    */
    67 
    68   console_cleanup();
    69 
    70   status = rtems_io_register_name(
    71     "/dev/console",
    72     major,
    73     (rtems_device_minor_number) 0
    74   );
     144   * Set up TERMIOS
     145   */
     146  rtems_termios_initialize ();
     147 
     148  /*
     149   * Do device-specific initialization
     150   */
     151 
     152  /* 9600-8-N-1, no hardware flow control */
     153  BSP_uart_init(BSPConsolePort, 9600, 0);
     154 
     155 
     156  /* Set interrupt handler */
     157  if(BSPConsolePort == BSP_UART_COM1)
     158    {
     159      console_isr_data.name = BSP_UART_COM1_IRQ;
     160      console_isr_data.hdl  = BSP_uart_termios_isr_com1;
     161     
     162    }
     163  else
     164    {
     165      assert(BSPConsolePort == BSP_UART_COM2);
     166      console_isr_data.name = BSP_UART_COM2_IRQ;
     167      console_isr_data.hdl  = BSP_uart_termios_isr_com2;
     168    }
     169 
     170  status = BSP_install_rtems_irq_handler(&console_isr_data);
     171 
     172  if (!status){
     173    printk("Error installing serial console interrupt handler!\n");
     174    rtems_fatal_error_occurred(status);
     175  }
     176  /*
     177   * Register the device
     178   */
     179  status = rtems_io_register_name ("/dev/console", major, 0);
     180  if (status != RTEMS_SUCCESSFUL)
     181    {
     182      printk("Error registering console device!\n");
     183      rtems_fatal_error_occurred (status);
     184    }
     185 
     186  if(BSPConsolePort == BSP_UART_COM1)
     187    {
     188      printk("Initialized console on port COM1 9600-8-N-1\n\n");
     189    }
     190  else
     191    {
     192      printk("Initialized console on port COM2 9600-8-N-1\n\n");
     193    }
     194
     195  return RTEMS_SUCCESSFUL;
     196} /* console_initialize */
     197
     198
     199static int console_open_count = 0;
     200
     201static int console_last_close(int major, int minor, void *arg)
     202{
     203  BSP_remove_rtems_irq_handler (&console_isr_data);
     204
     205  return 0;
     206}
     207
     208/*-------------------------------------------------------------------------+
     209| Console device driver OPEN entry point
     210+--------------------------------------------------------------------------*/
     211rtems_device_driver
     212console_open(rtems_device_major_number major,
     213                rtems_device_minor_number minor,
     214                void                      *arg)
     215{
     216  rtems_status_code              status;
     217  static rtems_termios_callbacks cb =
     218  {
     219    NULL,                     /* firstOpen */
     220    console_last_close,       /* lastClose */
     221    NULL,                     /* poll read  */
     222    BSP_uart_termios_write_com2, /* write */
     223    conSetAttr,               /* setAttributes */
     224    NULL,                     /* stopRemoteTx */
     225    NULL,                     /* startRemoteTx */
     226    1                         /* outputUsesInterrupts */
     227  };
     228
     229  if(BSPConsolePort == BSP_UART_COM2)
     230    {
     231      cb.write = BSP_uart_termios_write_com2;
     232    }
     233
     234  status = rtems_termios_open (major, minor, arg, &cb);
     235
     236  if(status != RTEMS_SUCCESSFUL)
     237    {
     238      printk("Error openning console device\n");
     239      return status;
     240    }
     241
     242  /*
     243   * Pass data area info down to driver
     244   */
     245  BSP_uart_termios_set(BSPConsolePort,
     246                         ((rtems_libio_open_close_args_t *)arg)->iop->data1);
     247 
     248  /* Enable interrupts  on channel */
     249  BSP_uart_intr_ctrl(BSPConsolePort, BSP_UART_INTR_CTRL_TERMIOS);
     250
     251  return RTEMS_SUCCESSFUL;
     252}
     253
     254/*-------------------------------------------------------------------------+
     255| Console device driver CLOSE entry point
     256+--------------------------------------------------------------------------*/
     257rtems_device_driver
     258console_close(rtems_device_major_number major,
     259              rtems_device_minor_number minor,
     260              void                      *arg)
     261{
     262
     263  return (rtems_termios_close (arg));
     264 
     265} /* console_close */
     266
    75267 
    76   if (status != RTEMS_SUCCESSFUL)
    77     rtems_fatal_error_occurred(status);
     268/*-------------------------------------------------------------------------+
     269| Console device driver READ entry point.
     270+--------------------------------------------------------------------------+
     271| Read characters from the I/O console. We only have stdin.
     272+--------------------------------------------------------------------------*/
     273rtems_device_driver
     274console_read(rtems_device_major_number major,
     275             rtems_device_minor_number minor,
     276             void                      *arg)
     277{
     278  rtems_status_code sc;
     279  printf("read the console\n");
     280
     281  sc = rtems_termios_read (arg);
     282
     283  if ( sc != RTEMS_SUCCESSFUL )
     284    printf("console_read: fails %s\n",rtems_status_text(sc));
     285
     286  return sc;
     287
     288} /* console_read */
    78289 
    79   atexit( console_cleanup );
    80 
    81   return RTEMS_SUCCESSFUL;
    82 }
    83 
    84 
    85 /*  is_character_ready
    86  *
    87  *  This routine returns TRUE if a character is available.
    88  *
    89  *  Input parameters: NONE
    90  *
    91  *  Output parameters:  NONE
    92  *
    93  *  Return values:
    94  */
    95 
    96 rtems_boolean is_character_ready(
    97   char *ch
    98 )
    99 {
    100   register rtems_unsigned8 status;
    101 
    102   inport_byte( LSR1, status );
    103 
    104   if ( Is_rx_ready( status ) ) {
    105      inport_byte( RBR1,  status );
    106      *ch = status;
    107      return TRUE;
    108   }
    109   return FALSE;
    110 }
    111 
    112 /*
    113  * Wait for an input. May be used before  intr are ON.
    114  */
    115 char BSP_wait_polled_input( void )
    116 {
    117   char c;
    118   while (!is_character_ready(&c))
    119     continue;
    120 
    121   return c;
    122 }
    123      
    124 /*  inbyte
    125  *
    126  *  This routine reads a character from the UART.
    127  *
    128  *  Input parameters: NONE
    129  *
    130  *  Output parameters:  NONE
    131  *
    132  *  Return values:
    133  *    character read from UART
    134  */
    135 
    136 char inbyte( void )
    137 {
    138   register rtems_unsigned8 status;
    139   char                     ch;
    140 
    141   do {
    142     inport_byte( LSR1, status );
    143   } while ( !( status & 0x01 ));/* s/b while ( !( Is_rx_ready( status ) ) ); */
    144 
    145   inport_byte( RBR1, ch );
    146 
    147   return ch;
    148 }
    149 
    150 /*  outbyte
    151  *
    152  *  This routine transmits a character out the port.  It supports
    153  *  XON/XOFF flow control.
    154  *
    155  *  Input parameters:
    156  *    ch  - character to be transmitted
    157  *
    158  *  Output parameters:  NONE
    159  */
    160 
    161 void outbyte(
    162   char ch
    163 )
    164 {
    165   rtems_unsigned8 status;
    166 
    167   do {
    168     inport_byte( LSR1, status );
    169   } while ( ! ( 0x40 & status ) ); /* ( Is_tx_ready( status ) ) );*/
    170 
    171 /*
    172  *  GDB will NOT use XON/XOFF protocol
    173  */
    174 
    175 
    176 #ifdef USE_XON
    177  
    178   while ( is_character_ready( &status ) == TRUE ) {
    179     if ( status == XOFF )
    180       do {
    181         while ( is_character_ready( &status ) == FALSE ) ;
    182       } while ( status != XON );
    183   }
    184 
    185 #endif
    186 
    187   outport_byte( TBR1, ch );
    188 
    189 }
    190 
    191 /*
    192  *  Open entry point
    193  */
     290
     291/*-------------------------------------------------------------------------+
     292| Console device driver WRITE entry point.
     293+--------------------------------------------------------------------------+
     294| Write characters to the I/O console. Stderr and stdout are the same.
     295+--------------------------------------------------------------------------*/
     296rtems_device_driver
     297console_write(rtems_device_major_number major,
     298              rtems_device_minor_number minor,
     299              void                    * arg)
     300{
     301        return rtems_termios_write (arg);
    194302 
    195 rtems_device_driver console_open(
    196   rtems_device_major_number major,
    197   rtems_device_minor_number minor,
    198   void                    * arg
    199 )
    200 {
    201   return RTEMS_SUCCESSFUL;
    202 }
     303} /* console_write */
     304
     305
    203306 
    204307/*
    205  *  Close entry point
     308 * Handle ioctl request.
    206309 */
    207  
    208 rtems_device_driver console_close(
    209   rtems_device_major_number major,
    210   rtems_device_minor_number minor,
    211   void                    * arg
     310rtems_device_driver
     311console_control(rtems_device_major_number major,
     312                rtems_device_minor_number minor,
     313                void                      * arg
    212314)
    213 {
    214   return RTEMS_SUCCESSFUL;
    215 }
    216  
     315{
     316  return rtems_termios_ioctl (arg);
     317}
     318
     319static int
     320conSetAttr(int minor, const struct termios *t)
     321{
     322  int baud;
     323
     324  switch (t->c_cflag & CBAUD)
     325    {
     326    case B50:   
     327      baud = 50;
     328      break;
     329    case B75:   
     330      baud = 75;       
     331      break;
     332    case B110: 
     333      baud = 110;       
     334      break;
     335    case B134: 
     336      baud = 134;       
     337      break;
     338    case B150: 
     339      baud = 150;       
     340      break;
     341    case B200:
     342      baud = 200;       
     343      break;
     344    case B300: 
     345      baud = 300;
     346      break;
     347    case B600: 
     348      baud = 600;       
     349      break;
     350    case B1200:
     351      baud = 1200;
     352      break;
     353    case B1800:
     354      baud = 1800;     
     355      break;
     356    case B2400:
     357      baud = 2400;
     358      break;
     359    case B4800:
     360      baud = 4800;
     361      break;
     362    case B9600:
     363      baud = 9600;
     364      break;
     365    case B19200:
     366      baud = 19200;
     367      break;
     368    case B38400:
     369      baud = 38400;
     370      break;
     371    case B57600:       
     372      baud = 57600;
     373      break;
     374    case B115200:
     375      baud = 115200;
     376      break;
     377    default:
     378      baud = 0;
     379      rtems_fatal_error_occurred (RTEMS_INTERNAL_ERROR);
     380      return 0;
     381    }
     382
     383  BSP_uart_set_baud(BSPConsolePort, baud);
     384
     385  return 0;
     386}
     387
    217388/*
    218  * read bytes from the serial port. We only have stdin.
     389 * BSP initialization
    219390 */
    220  
    221 rtems_device_driver console_read(
    222   rtems_device_major_number major,
    223   rtems_device_minor_number minor,
    224   void                    * arg
    225 )
    226 {
    227   rtems_libio_rw_args_t *rw_args;
    228   char *buffer;
    229   int maximum;
    230   int count = 0;
    231  
    232   rw_args = (rtems_libio_rw_args_t *) arg;
    233  
    234   buffer = rw_args->buffer;
    235   maximum = rw_args->count;
    236  
    237   for (count = 0; count < maximum; count++) {
    238     buffer[ count ] = inbyte();
    239     if (buffer[ count ] == '\n' || buffer[ count ] == '\r') {
    240       buffer[ count++ ]  = '\n';
    241       break;
    242     }
    243   }
    244  
    245   rw_args->bytes_moved = count;
    246   return (count >= 0) ? RTEMS_SUCCESSFUL : RTEMS_UNSATISFIED;
    247 }
    248 
    249 /*
    250  * write bytes to the serial port. Stdout and stderr are the same.
    251  */
    252  
    253 rtems_device_driver console_write(
    254   rtems_device_major_number major,
    255   rtems_device_minor_number minor,
    256   void                    * arg
    257 )
    258 {
    259   int count;
    260   int maximum;
    261   rtems_libio_rw_args_t *rw_args;
    262   char *buffer;
    263  
    264   rw_args = (rtems_libio_rw_args_t *) arg;
    265  
    266   buffer = rw_args->buffer;
    267   maximum = rw_args->count;
    268  
    269   for (count = 0; count < maximum; count++) {
    270     if ( buffer[ count ] == '\n') {
    271       outbyte('\r');
    272     }
    273     outbyte( buffer[ count ] );
    274   }
    275  
    276   rw_args->bytes_moved = maximum;
    277   return 0;
    278 }
    279  
    280 /*
    281  *  IO Control entry point
    282  */
    283  
    284 rtems_device_driver console_control(
    285   rtems_device_major_number major,
    286   rtems_device_minor_number minor,
    287   void                    * arg
    288 )
    289 {
    290   return RTEMS_SUCCESSFUL;
    291 }
    292 
    293 BSP_output_char_function_type           BSP_output_char = outbyte;
    294 BSP_polling_getchar_function_type       BSP_poll_char = BSP_wait_polled_input;
    295 
     391
     392BSP_output_char_function_type BSP_output_char =
     393                       (BSP_output_char_function_type)    BSP_output_char_via_serial;
     394
     395BSP_polling_getchar_function_type BSP_poll_char = 
     396                      (BSP_polling_getchar_function_type) BSP_poll_char_via_serial;
     397
     398int BSP_poll_read(int ttyMinor){
     399 
     400  return BSP_poll_char_via_serial();
     401}
  • c/src/lib/libbsp/i386/i386ex/start/Makefile.in

    r711a2a1 r0ebbf66  
    3737DEFINES  += -DNEXT_GAS
    3838endif
     39
    3940CPPFLAGS +=
    4041CFLAGS   +=
  • c/src/lib/libbsp/i386/i386ex/startup/Makefile.in

    r711a2a1 r0ebbf66  
    55@SET_MAKE@
    66srcdir = @srcdir@
    7 VPATH = @srcdir@:@srcdir@/../../../shared
     7VPATH = @srcdir@:@srcdir@/../../../shared:@srcdir@/../../shared/comm:@srcdir@/../../shared/irq:@srcdir@/../../shared/io
    88RTEMS_ROOT = @top_srcdir@
    99PROJECT_ROOT = @PROJECT_ROOT@
     
    1111PGM=${ARCH}/startup.rel
    1212
    13 IMPORT_SRC=$(srcdir)/../../shared/irq/irq.c \
    14    $(srcdir)/../../shared/irq/irq_init.c $(srcdir)/../../shared/irq/irq_asm.s
     13# C source names, if any, go here -- minus the .c
     14C_PIECES=bspclean bsplibc bsppost bspstart main sbrk irq irq_init i386-stub-glue uart i386-stub
    1515
    16 # C source names, if any, go here -- minus the .c
    17 C_PIECES=bspclean bsplibc bsppost bspstart main sbrk irq irq_init
    1816C_FILES=$(C_PIECES:%=%.c)
    1917C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
     
    3836
    3937#DEFINES  += -DPRINTON
    40 DEFINES  += -I$(srcdir)
     38
     39DEFINES  += -I$(srcdir) -DBSP_IS_I386EX=1
    4140CPPFLAGS +=
    4241CFLAGS   += -g
     
    5756
    5857preinstall:
    59         ${CP} ${IMPORT_SRC} .
     58        $(INSTALL) ${IMPORT_SRC} .
     59
     60#       ${CP} ${IMPORT_SRC} .
    6061
    6162${PGM}: ${SRCS} ${OBJS}
  • c/src/lib/libbsp/i386/i386ex/timer/timer.c

    r711a2a1 r0ebbf66  
    5656   * enable interrrupt at i8259 level
    5757   */
    58   pc386_irq_enable_at_i8259s(used->idtIndex - PC386_IRQ_VECTOR_BASE);
     58  BSP_irq_enable_at_i8259s(used->idtIndex - BSP_IRQ_VECTOR_BASE);
    5959}
    6060
     
    6464     * disable interrrupt at i8259 level
    6565     */
    66      pc386_irq_disable_at_i8259s(used->idtIndex - PC386_IRQ_VECTOR_BASE);
     66     BSP_irq_disable_at_i8259s(used->idtIndex - BSP_IRQ_VECTOR_BASE);
    6767     /* reset timer mode to standard (DOS) value */
    6868}
    6969
    7070static rtems_raw_irq_connect_data timer_raw_irq_data = {
    71   PC_386_RT_TIMER3 + PC386_IRQ_VECTOR_BASE,
     71  BSP_RT_TIMER3 + BSP_IRQ_VECTOR_BASE,
    7272  timerisr,
    7373  TimerOn,
  • c/src/lib/libbsp/i386/pc386/Makefile.in

    r711a2a1 r0ebbf66  
    1818# wrapup is the one that actually builds and installs the library
    1919#  from the individual .rel files built in other directories
    20 SUB_DIRS=include tools start startup clock console timer pc386dev $(NETWORK) \
     20SUB_DIRS=include tools start startup clock console timer $(NETWORK) \
    2121          wrapup
  • c/src/lib/libbsp/i386/pc386/clock/ckinit.c

    r711a2a1 r0ebbf66  
    177177}
    178178
    179 static rtems_irq_connect_data clockIrqData = {PC_386_PERIODIC_TIMER,
     179static rtems_irq_connect_data clockIrqData = {BSP_PERIODIC_TIMER,
    180180                                              clockIsr,
    181181                                              clockOn,
     
    196196{
    197197
    198   if (!pc386_install_rtems_irq_handler (&clockIrqData)) {
     198  if (!BSP_install_rtems_irq_handler (&clockIrqData)) {
    199199    printk("Unable to initialize system clock\n");
    200200    rtems_fatal_error_occurred(1);
     
    230230    else if (args->command == rtems_build_name('N', 'E', 'W', ' '))
    231231    {
    232       if (!pc386_install_rtems_irq_handler (&clockIrqData)) {
     232      if (!BSP_install_rtems_irq_handler (&clockIrqData)) {
    233233        printk("Error installing clock interrupt handler!\n");
    234234        rtems_fatal_error_occurred(1);
     
    242242void Clock_exit()
    243243{
    244   pc386_remove_rtems_irq_handler (&clockIrqData);
     244  BSP_remove_rtems_irq_handler (&clockIrqData);
    245245}
    246246
  • 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;
  • c/src/lib/libbsp/i386/pc386/include/bsp.h

    r711a2a1 r0ebbf66  
    161161void rtemsReboot(void);                  /* from 'exit.c'   */
    162162
    163 /* Definitions for PC386ConsolePort */
    164 #define PC386_CONSOLE_PORT_CONSOLE (-1)
    165 #define PC386_CONSOLE_PORT_COM1    (PC386_UART_COM1)
    166 #define PC386_CONSOLE_PORT_COM2    (PC386_UART_COM2)
     163/* Definitions for BSPConsolePort */
     164#define BSP_CONSOLE_PORT_CONSOLE (-1)
     165#define BSP_CONSOLE_PORT_COM1    (BSP_UART_COM1)
     166#define BSP_CONSOLE_PORT_COM2    (BSP_UART_COM2)
    167167
    168168/* GDB stub stuff */
  • c/src/lib/libbsp/i386/pc386/start/Makefile.in

    r711a2a1 r0ebbf66  
    3434#
    3535
    36 ifeq ($(RTEMS_GAS_CODE16),yes)
     36#ifeq ($(RTEMS_GAS_CODE16),yes)
    3737DEFINES  += -DNEXT_GAS
    38 endif
     38#endif
    3939CPPFLAGS +=
    4040CFLAGS   +=
  • c/src/lib/libbsp/i386/pc386/start/start16.s

    r711a2a1 r0ebbf66  
    3434.set STACKOFF,      0x200-0x10  # offset to load into %esp, from start of image
    3535
    36 /* #define NEW_GAS*/
     36 /* #define NEW_GAS */
    3737/*----------------------------------------------------------------------------+
    3838| CODE section
  • c/src/lib/libbsp/i386/pc386/startup/Makefile.in

    r711a2a1 r0ebbf66  
    55@SET_MAKE@
    66srcdir = @srcdir@
    7 VPATH = @srcdir@:@srcdir@/../../../shared:@srcdir@/../../shared/irq
     7VPATH = @srcdir@:@srcdir@/../../../shared:@srcdir@/../../shared/irq:@srcdir@/../../shared/comm:@srcdir@/../../shared/pci
    88RTEMS_ROOT = @top_srcdir@
    99PROJECT_ROOT = @PROJECT_ROOT@
     
    1212
    1313# C source names, if any, go here -- minus the .c
    14 C_PIECES=bsplibc bsppost bspstart exit irq irq_init main sbrk
     14C_PIECES=bsplibc bsppost bspstart exit irq irq_init main sbrk i386-stub i386-stub-glue uart pcibios
    1515C_FILES=$(C_PIECES:%=%.c)
    1616C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
  • c/src/lib/libbsp/i386/pc386/startup/bspstart.c

    r711a2a1 r0ebbf66  
    147147   * Initialize printk channel
    148148   */
     149 
    149150  _IBMPC_initVideo();
    150151
  • c/src/lib/libbsp/i386/pc386/startup/exit.c

    r711a2a1 r0ebbf66  
    3636#include <bsp.h>
    3737#include <rtems/libio.h>
    38 #include <pc386uart.h>
     38#include <uart.h>
    3939
    4040void bsp_cleanup(void)
  • c/src/lib/libbsp/i386/pc386/startup/linkcmds

    r711a2a1 r0ebbf66  
    6363    _rodata_start = . ;
    6464    *(.rodata)
    65     *(.gnu.linkonce.r*)
    6665    _erodata = ALIGN( 0x10 ) ;
    6766
  • c/src/lib/libbsp/i386/pc386/timer/timer.c

    r711a2a1 r0ebbf66  
    168168     * disable interrrupt at i8259 level
    169169     */
    170      pc386_irq_disable_at_i8259s(used->idtIndex - PC386_IRQ_VECTOR_BASE);
     170     BSP_irq_disable_at_i8259s(used->idtIndex - BSP_IRQ_VECTOR_BASE);
    171171     /* reset timer mode to standard (DOS) value */
    172172     outport_byte(TIMER_MODE, TIMER_SEL0|TIMER_16BIT|TIMER_RATEGEN);
     
    186186     * enable interrrupt at i8259 level
    187187     */
    188      pc386_irq_enable_at_i8259s(used->idtIndex - PC386_IRQ_VECTOR_BASE);
     188     BSP_irq_enable_at_i8259s(used->idtIndex - BSP_IRQ_VECTOR_BASE);
    189189}
    190190
     
    192192timerIsOn(const rtems_raw_irq_connect_data *used)
    193193{
    194      return pc386_irq_enabled_at_i8259s(used->idtIndex - PC386_IRQ_VECTOR_BASE);}
     194     return BSP_irq_enabled_at_i8259s(used->idtIndex - BSP_IRQ_VECTOR_BASE);}
    195195
    196196static rtems_raw_irq_connect_data timer_raw_irq_data = {
    197   PC_386_PERIODIC_TIMER + PC386_IRQ_VECTOR_BASE,
     197  BSP_PERIODIC_TIMER + BSP_IRQ_VECTOR_BASE,
    198198  timerisr,
    199199  timerOn,
  • c/src/lib/libbsp/i386/pc386/wrapup/Makefile.in

    r711a2a1 r0ebbf66  
    1313NETWORK = $(NETWORK_$(HAS_NETWORKING)_V)
    1414
    15 BSP_PIECES=startup clock console timer pc386dev $(NETWORK)
     15BSP_PIECES=startup clock console timer $(NETWORK)
    1616GENERIC_PIECES=
    1717
  • c/src/lib/libbsp/i386/shared/Makefile.in

    r711a2a1 r0ebbf66  
    1313
    1414# Descend into the $(RTEMS_BSP_FAMILY) directory
    15 SUB_DIRS=irq io
     15SUB_DIRS=irq io comm pci
    1616
  • c/src/lib/libbsp/i386/shared/irq/irq.c

    r711a2a1 r0ebbf66  
    2222 * that must be disabled when a particular entry is activated.
    2323 * They will be dynamically computed from teh prioruty table given
    24  * in pc386_rtems_irq_mngt_set();
     24 * in BSP_rtems_irq_mngt_set();
    2525 * CAUTION : this table is accessed directly by interrupt routine
    2626 *           prologue.
    2727 */
    28 rtems_i8259_masks       irq_mask_or_tbl[PC_386_IRQ_LINES_NUMBER];
    29 
    30 /*
    31  * Copy of data given via initial pc386_rtems_irq_mngt_set() for
     28rtems_i8259_masks       irq_mask_or_tbl[BSP_IRQ_LINES_NUMBER];
     29
     30/*
     31 * Copy of data given via initial BSP_rtems_irq_mngt_set() for
    3232 * the sake of efficiency.
    3333 * CAUTION : this table is accessed directly by interrupt routine
    3434 *           prologue.
    3535 */
    36 rtems_irq_hdl           current_irq[PC_386_IRQ_LINES_NUMBER];
     36rtems_irq_hdl           current_irq[BSP_IRQ_LINES_NUMBER];
    3737/*
    3838 * default handler connected on each irq after bsp initialization
     
    5757
    5858/*-------------------------------------------------------------------------+
    59 |         Function:  PC386_irq_disable_at_i8259s
     59|         Function:  BSP_irq_disable_at_i8259s
    6060|      Description: Mask IRQ line in appropriate PIC chip.
    6161| Global Variables: i8259s_cache
     
    6363|          Returns: Nothing.
    6464+--------------------------------------------------------------------------*/
    65 int pc386_irq_disable_at_i8259s    (const rtems_irq_symbolic_name irqLine)
     65int BSP_irq_disable_at_i8259s    (const rtems_irq_symbolic_name irqLine)
    6666{
    6767  unsigned short mask;
    6868  unsigned int  level;
    6969
    70   if ( ((int)irqLine < PC_386_LOWEST_OFFSET) ||
    71        ((int)irqLine > PC_386_MAX_OFFSET )
     70  if ( ((int)irqLine < BSP_LOWEST_OFFSET) ||
     71       ((int)irqLine > BSP_MAX_OFFSET )
    7272       )
    7373    return 1;
     
    9292
    9393/*-------------------------------------------------------------------------+
    94 |         Function:  pc386_irq_enable_at_i8259s
     94|         Function:  BSP_irq_enable_at_i8259s
    9595|      Description: Unmask IRQ line in appropriate PIC chip.
    9696| Global Variables: i8259s_cache
     
    9898|          Returns: Nothing.
    9999+--------------------------------------------------------------------------*/
    100 int pc386_irq_enable_at_i8259s    (const rtems_irq_symbolic_name irqLine)
     100int BSP_irq_enable_at_i8259s    (const rtems_irq_symbolic_name irqLine)
    101101{
    102102  unsigned short mask;
    103103  unsigned int  level;
    104104
    105   if ( ((int)irqLine < PC_386_LOWEST_OFFSET) ||
    106        ((int)irqLine > PC_386_MAX_OFFSET )
     105  if ( ((int)irqLine < BSP_LOWEST_OFFSET) ||
     106       ((int)irqLine > BSP_MAX_OFFSET )
    107107       )
    108108    return 1;
     
    126126} /* mask_irq */
    127127
    128 int pc386_irq_enabled_at_i8259s         (const rtems_irq_symbolic_name irqLine)
     128int BSP_irq_enabled_at_i8259s           (const rtems_irq_symbolic_name irqLine)
    129129{
    130130  unsigned short mask;
    131131
    132   if ( ((int)irqLine < PC_386_LOWEST_OFFSET) ||
    133        ((int)irqLine > PC_386_MAX_OFFSET )
     132  if ( ((int)irqLine < BSP_LOWEST_OFFSET) ||
     133       ((int)irqLine > BSP_MAX_OFFSET )
    134134     )
    135135    return 1;
     
    141141
    142142/*-------------------------------------------------------------------------+
    143 |         Function: pc386_irq_ack_at_i8259s
     143|         Function: BSP_irq_ack_at_i8259s
    144144|      Description: Signal generic End Of Interrupt (EOI) to appropriate PIC.
    145145| Global Variables: None.
     
    147147|          Returns: Nothing.
    148148+--------------------------------------------------------------------------*/
    149 int pc386_irq_ack_at_i8259s     (const rtems_irq_symbolic_name irqLine)
    150 {
    151   if ( ((int)irqLine < PC_386_LOWEST_OFFSET) ||
    152        ((int)irqLine > PC_386_MAX_OFFSET )
     149int BSP_irq_ack_at_i8259s       (const rtems_irq_symbolic_name irqLine)
     150{
     151  if ( ((int)irqLine < BSP_LOWEST_OFFSET) ||
     152       ((int)irqLine > BSP_MAX_OFFSET )
    153153       )
    154154    return 1;
     
    213213static int isValidInterrupt(int irq)
    214214{
    215   if ( (irq < PC_386_LOWEST_OFFSET) || (irq > PC_386_MAX_OFFSET))
     215  if ( (irq < BSP_LOWEST_OFFSET) || (irq > BSP_MAX_OFFSET))
    216216    return 0;
    217217  return 1;
     
    222222 */
    223223
    224 int pc386_install_rtems_irq_handler  (const rtems_irq_connect_data* irq)
     224int BSP_install_rtems_irq_handler  (const rtems_irq_connect_data* irq)
    225225{
    226226    unsigned int level;
     
    252252     * Enable interrupt at PIC level
    253253     */
    254     pc386_irq_enable_at_i8259s (irq->name);
     254    BSP_irq_enable_at_i8259s (irq->name);
    255255    /*
    256256     * Enable interrupt on device
     
    264264
    265265
    266 int pc386_get_current_rtems_irq_handler (rtems_irq_connect_data* irq)
     266int BSP_get_current_rtems_irq_handler   (rtems_irq_connect_data* irq)
    267267{
    268268     if (!isValidInterrupt(irq->name)) {
     
    273273}
    274274
    275 int pc386_remove_rtems_irq_handler  (const rtems_irq_connect_data* irq)
     275int BSP_remove_rtems_irq_handler  (const rtems_irq_connect_data* irq)
    276276{
    277277    unsigned int level;
     
    295295     * disable interrupt at PIC level
    296296     */
    297     pc386_irq_disable_at_i8259s (irq->name);
     297    BSP_irq_disable_at_i8259s (irq->name);
    298298
    299299    /*
     
    318318 */
    319319
    320 int pc386_rtems_irq_mngt_set(rtems_irq_global_settings* config)
     320int BSP_rtems_irq_mngt_set(rtems_irq_global_settings* config)
    321321{
    322322    int i;
     
    338338    for (i=0; i < internal_config->irqNb; i++) {
    339339      if (rtems_hdl_tbl[i].hdl != default_rtems_entry.hdl) {
    340         pc386_irq_enable_at_i8259s (i);
     340        BSP_irq_enable_at_i8259s (i);
    341341        rtems_hdl_tbl[i].on(&rtems_hdl_tbl[i]);
    342342      }
    343343      else {
    344344        rtems_hdl_tbl[i].off(&rtems_hdl_tbl[i]);
    345         pc386_irq_disable_at_i8259s (i);
     345        BSP_irq_disable_at_i8259s (i);
    346346      }
    347347    }
     
    349349     * must disable slave pic anyway
    350350     */
    351     pc386_irq_enable_at_i8259s (2);
     351    BSP_irq_enable_at_i8259s (2);
    352352    _CPU_ISR_Enable(level);
    353353    return 1;
    354354}
    355355
    356 int pc386_rtems_irq_mngt_get(rtems_irq_global_settings** config)
     356int BSP_rtems_irq_mngt_get(rtems_irq_global_settings** config)
    357357{
    358358    *config = internal_config;
  • c/src/lib/libbsp/i386/shared/irq/irq.h

    r711a2a1 r0ebbf66  
    3838typedef enum {
    3939    /* Base vector for our IRQ handlers. */
    40   PC386_IRQ_VECTOR_BASE         =       PC386_ASM_IRQ_VECTOR_BASE,       
    41   PC_386_IRQ_LINES_NUMBER       =       16,
    42   PC_386_LOWEST_OFFSET          =       0,
    43   PC_386_MAX_OFFSET             =       PC_386_IRQ_LINES_NUMBER - 1,
     40  BSP_IRQ_VECTOR_BASE           =       BSP_ASM_IRQ_VECTOR_BASE,       
     41  BSP_IRQ_LINES_NUMBER          =       16,
     42  BSP_LOWEST_OFFSET             =       0,
     43  BSP_MAX_OFFSET                =       BSP_IRQ_LINES_NUMBER - 1,
    4444    /*
    45      * Interrupt offset in comparison to PC386_ASM_IRQ_VECTOR_BASE
    46      * NB : 1) Interrupt vector number in IDT = offset + PC386_ASM_IRQ_VECTOR_BASE
     45     * Interrupt offset in comparison to BSP_ASM_IRQ_VECTOR_BASE
     46     * NB : 1) Interrupt vector number in IDT = offset + BSP_ASM_IRQ_VECTOR_BASE
    4747     *      2) The same name should be defined on all architecture
    4848     *         so that handler connexion can be unchanged.
    4949     */       
    50   PC_386_PERIODIC_TIMER         =       0,
    51 
    52   PC_386_KEYBOARD               =       1,
    53 
    54   PC386_UART_COM2_IRQ           =       3,
    55 
    56   PC386_UART_COM1_IRQ           =       4,
    57 
    58   PC_386_RT_TIMER1              =       8,
     50  BSP_PERIODIC_TIMER            =       0,
     51
     52  BSP_KEYBOARD                  =       1,
     53
     54  BSP_UART_COM2_IRQ             =       3,
     55
     56  BSP_UART_COM1_IRQ             =       4,
     57
     58  BSP_RT_TIMER1         =       8,
    5959 
    60   PC_386_RT_TIMER3              =       10
     60  BSP_RT_TIMER3         =       10
    6161}rtems_irq_symbolic_name;
    6262
     
    128128  rtems_irq_connect_data*       irqHdlTbl;
    129129  /*
    130    * actual value of PC386_IRQ_VECTOR_BASE...
     130   * actual value of BSP_IRQ_VECTOR_BASE...
    131131   */
    132132  rtems_irq_symbolic_name       irqBase;
     
    156156 * not be propagated further to the processor
    157157 */
    158 int pc386_irq_disable_at_i8259s        (const rtems_irq_symbolic_name irqLine);
     158int BSP_irq_disable_at_i8259s        (const rtems_irq_symbolic_name irqLine);
    159159/*
    160160 * function to enable a particular irq at 8259 level. After calling
     
    162162 * be propagated further to the processor
    163163 */
    164 int pc386_irq_enable_at_i8259s          (const rtems_irq_symbolic_name irqLine);
     164int BSP_irq_enable_at_i8259s            (const rtems_irq_symbolic_name irqLine);
    165165/*
    166166 * function to acknoledge a particular irq at 8259 level. After calling
     
    170170 * handlers.
    171171 */
    172 int pc386_irq_ack_at_i8259s             (const rtems_irq_symbolic_name irqLine);
     172int BSP_irq_ack_at_i8259s               (const rtems_irq_symbolic_name irqLine);
    173173/*
    174174 * function to check if a particular irq is enabled at 8259 level. After calling
    175175 */
    176 int pc386_irq_enabled_at_i8259s         (const rtems_irq_symbolic_name irqLine);
     176int BSP_irq_enabled_at_i8259s           (const rtems_irq_symbolic_name irqLine);
    177177/*
    178178 * ------------------------ RTEMS Single Irq Handler Mngt Routines ----------------
     
    212212 *
    213213 */
    214 int pc386_install_rtems_irq_handler     (const rtems_irq_connect_data*);
     214int BSP_install_rtems_irq_handler       (const rtems_irq_connect_data*);
    215215/*
    216216 * function to get the current RTEMS irq handler for ptr->name. It enables to
    217217 * define hanlder chain...
    218218 */
    219 int pc386_get_current_rtems_irq_handler (rtems_irq_connect_data* ptr);
     219int BSP_get_current_rtems_irq_handler   (rtems_irq_connect_data* ptr);
    220220/*
    221221 * function to get disconnect the RTEMS irq handler for ptr->name.
     
    223223 * The user can use the previous function to get it.
    224224 */
    225 int pc386_remove_rtems_irq_handler      (const rtems_irq_connect_data*);
     225int BSP_remove_rtems_irq_handler        (const rtems_irq_connect_data*);
    226226
    227227/*
     
    234234 * handler (config->irqHdlTbl[i].hdl)  different from "config->defaultEntry.hdl"
    235235 * has been individualy connected via
    236  *      pc386_install_rtems_irq_handler(&config->irqHdlTbl[i])
     236 *      BSP_install_rtems_irq_handler(&config->irqHdlTbl[i])
    237237 * And each handler currently equal to config->defaultEntry.hdl
    238238 * has been previously disconnected via
    239  *       pc386_remove_rtems_irq_handler (&config->irqHdlTbl[i])
     239 *       BSP_remove_rtems_irq_handler (&config->irqHdlTbl[i])
    240240 *
    241241 * This is to say that all information given will be used and not just
     
    248248 */
    249249
    250 int pc386_rtems_irq_mngt_set(rtems_irq_global_settings* config);
     250int BSP_rtems_irq_mngt_set(rtems_irq_global_settings* config);
    251251/*
    252252 * (Re) get info on current RTEMS interrupt management.
    253253 */
    254 int pc386_rtems_irq_mngt_get(rtems_irq_global_settings**);
     254int BSP_rtems_irq_mngt_get(rtems_irq_global_settings**);
    255255 
    256256#ifdef __cplusplus
  • c/src/lib/libbsp/i386/shared/irq/irq_asm.h

    r711a2a1 r0ebbf66  
    1616#define __IRQ_ASM_H__
    1717
    18 #define PC386_ASM_IRQ_VECTOR_BASE 0x20
     18#define BSP_ASM_IRQ_VECTOR_BASE 0x20
    1919    /* PIC's command and mask registers */
    2020#define PIC_MASTER_COMMAND_IO_PORT              0x20    /* Master PIC command register */
  • c/src/lib/libbsp/i386/shared/irq/irq_init.c

    r711a2a1 r0ebbf66  
    5656 * Table used to store rtems managed interrupt handlers.
    5757 * Borrow the table to store raw handler entries at the beginning.
    58  * The table will be reinitialized before the call to pc386_rtems_irq_mngt_set().
    59  */
    60 static rtems_irq_connect_data           rtemsIrq[PC_386_IRQ_LINES_NUMBER] = {
     58 * The table will be reinitialized before the call to BSP_rtems_irq_mngt_set().
     59 */
     60static rtems_irq_connect_data           rtemsIrq[BSP_IRQ_LINES_NUMBER] = {
    6161  {0,(rtems_irq_hdl)rtems_irq_prologue_0},
    6262  {0,(rtems_irq_hdl)rtems_irq_prologue_1},
     
    8787};
    8888
    89 static rtems_irq_prio irqPrioTable[PC_386_IRQ_LINES_NUMBER]={
     89static rtems_irq_prio irqPrioTable[BSP_IRQ_LINES_NUMBER]={
    9090  /*
    9191   * actual rpiorities for interrupt :
     
    156156     * with RTEMS prologue.
    157157     */
    158     for (i = 0; i < PC_386_IRQ_LINES_NUMBER; i++) {
     158    for (i = 0; i < BSP_IRQ_LINES_NUMBER; i++) {
    159159      create_interrupt_gate_descriptor(&idtEntry,(rtems_raw_irq_hdl) rtemsIrq[i].hdl);
    160       idt_entry_tbl[i + PC386_ASM_IRQ_VECTOR_BASE] = idtEntry;
     160      idt_entry_tbl[i + BSP_ASM_IRQ_VECTOR_BASE] = idtEntry;
    161161    }
    162162    /*
     
    168168     * re-init the rtemsIrq table
    169169     */
    170     for (i = 0; i < PC_386_IRQ_LINES_NUMBER; i++) {
     170    for (i = 0; i < BSP_IRQ_LINES_NUMBER; i++) {
    171171      rtemsIrq[i]      = defaultIrq;
    172172      rtemsIrq[i].name = i;
     
    175175     * Init initial Interrupt management config
    176176     */
    177     initial_config.irqNb        = PC_386_IRQ_LINES_NUMBER;
     177    initial_config.irqNb        = BSP_IRQ_LINES_NUMBER;
    178178    initial_config.defaultEntry = defaultIrq;
    179179    initial_config.irqHdlTbl    = rtemsIrq;
    180     initial_config.irqBase      = PC386_ASM_IRQ_VECTOR_BASE;
     180    initial_config.irqBase      = BSP_ASM_IRQ_VECTOR_BASE;
    181181    initial_config.irqPrioTbl   = irqPrioTable;
    182182
    183     if (!pc386_rtems_irq_mngt_set(&initial_config)) {
     183    if (!BSP_rtems_irq_mngt_set(&initial_config)) {
    184184      /*
    185185       * put something here that will show the failure...
     
    201201      printk("idt_entry_tbl =  %x Interrupt_descriptor_table addr = %x\n",
    202202             idt_entry_tbl, &Interrupt_descriptor_table);
    203       tmp = (unsigned) get_hdl_from_vector (PC386_ASM_IRQ_VECTOR_BASE + PC_386_PERIODIC_TIMER);
     203      tmp = (unsigned) get_hdl_from_vector (BSP_ASM_IRQ_VECTOR_BASE + BSP_PERIODIC_TIMER);
    204204      printk("clock isr address from idt = %x should be %x\n",
    205205             tmp, (unsigned) rtems_irq_prologue_0);
Note: See TracChangeset for help on using the changeset viewer.