Changeset dbfa3148 in rtems


Ignore:
Timestamp:
07/10/98 15:43:18 (25 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
3a447c3
Parents:
cc8a388a
Message:

Patch from Quality Quorum <qqi@…>. Comments:

c/src/lib/libbsp/i386/pc386/console/console.c

assert() modified so it prints on selected console instead of
PC console

c/src/lib/libbsp/i386/pc386/console/inch.c

inch_sleep() modified, so it does not depend upon tmacros.h

c/src/lib/libbsp/i386/pc386/pc386dev/GDB.HOWTO

description updated

c/src/lib/libbsp/i386/pc386/startup/exit.c

last output before call to exit() will be printed properly on
serial console

c/src/lib/libbsp/i386/pc386/startup/irq.c

re-submitted bug fix for problem in irqs over 7.

Location:
c/src/lib/libbsp/i386/pc386
Files:
3 edited

Legend:

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

    rcc8a388a rdbfa3148  
    3232+--------------------------------------------------------------------------*/
    3333
    34 
     34#include <stdio.h>
    3535#include <stdlib.h>
    3636#include <assert.h>
     
    5858       /* keyboard (IRQ 0x01) Interrupt Service Routine (defined in 'inch.c') */
    5959
     60extern rtems_boolean _IBMPC_scankey(char *);  /* defined in 'inch.c' */
    6061
    6162void console_reserve_resources(rtems_configuration_table *conf)
     
    7071void __assert(const char *file, int line, const char *msg)
    7172{
    72   printk("assert failed: %s: ", file);
    73   printk("%d: ", line);
    74   printk("%s\n", msg);
    75 
    76   exit(1);
    77 
    78   return;
     73  static   char buf[20];
     74  static   char exit_msg[] = "EXECUTIVE SHUTDOWN! Any key to reboot...";
     75  static   char assert_msg[] = "assert failed: ";
     76  unsigned char  ch;
     77  const    unsigned char *cp;
     78       
     79 
     80  /*
     81   * Note we cannot call exit or printf from here,
     82   * assert can fail inside ISR too
     83   */
     84  if(PC386ConsolePort == PC386_CONSOLE_PORT_CONSOLE)
     85    {
     86      printk("\nassert failed: %s: ", file);
     87      printk("%d: ", line);
     88      printk("%s\n\n", msg);
     89      printk(exit_msg);
     90      while(!_IBMPC_scankey(&ch));
     91      printk("\n\n");
     92    }
     93  else
     94    {
     95      PC386_uart_intr_ctrl(PC386ConsolePort, PC386_UART_INTR_CTRL_DISABLE);
     96     
     97      PC386_uart_polled_write(PC386ConsolePort, '\r');
     98      PC386_uart_polled_write(PC386ConsolePort, '\n');
     99     
     100      for(cp=assert_msg; *cp!=0; cp++)
     101        {
     102          PC386_uart_polled_write(PC386ConsolePort, *cp);
     103        }
     104
     105      for(cp=file; *cp!=0; cp++)
     106        {
     107          PC386_uart_polled_write(PC386ConsolePort, *cp);
     108        }
     109     
     110      PC386_uart_polled_write(PC386ConsolePort, ':');
     111      PC386_uart_polled_write(PC386ConsolePort, ' ');
     112
     113      sprintf(buf, "%d: ", line);
     114
     115      for(cp=buf; *cp!=0; cp++)
     116        {
     117          PC386_uart_polled_write(PC386ConsolePort, *cp);
     118        }
     119
     120      for(cp=msg; *cp!=0; cp++)
     121        {
     122          PC386_uart_polled_write(PC386ConsolePort, *cp);
     123        }
     124
     125      PC386_uart_polled_write(PC386ConsolePort, '\r');
     126      PC386_uart_polled_write(PC386ConsolePort, '\n');
     127      PC386_uart_polled_write(PC386ConsolePort, '\r');
     128      PC386_uart_polled_write(PC386ConsolePort, '\n');
     129         
     130      for(cp=exit_msg; *cp != 0; cp++)
     131        {
     132          PC386_uart_polled_write(PC386ConsolePort, *cp);
     133        }
     134
     135      PC386_uart_polled_read(PC386ConsolePort);
     136
     137      PC386_uart_polled_write(PC386ConsolePort, '\r');
     138      PC386_uart_polled_write(PC386ConsolePort, '\n');
     139      PC386_uart_polled_write(PC386ConsolePort, '\r');
     140      PC386_uart_polled_write(PC386ConsolePort, '\n');
     141
     142    }
     143
     144  rtemsReboot();
    79145}
     146
    80147
    81148/*-------------------------------------------------------------------------+
  • c/src/lib/libbsp/i386/pc386/console/inch.c

    rcc8a388a rdbfa3148  
    293293_IBMPC_inch_sleep(void)
    294294{
    295     char c;
    296     extern rtems_interval _TOD_Ticks_per_second; /* XXX should not do this */
    297     rtems_interval ticks_to_delay;
    298 
    299     ticks_to_delay = (_TOD_Ticks_per_second + 24) / 25;
     295    char           c;
     296    rtems_interval ticks_per_second;
     297
     298    ticks_per_second = 0;
    300299
    301300    for(;;)
     
    305304            return c;
    306305          }
    307         rtems_task_wake_after(ticks_to_delay);
     306 
     307        if(ticks_per_second == 0)
     308          {
     309            rtems_clock_get(RTEMS_CLOCK_GET_TICKS_PER_SECOND,
     310                            &ticks_per_second);
     311          }
     312        rtems_task_wake_after((ticks_per_second+24)/25);
    308313      }
    309314       
  • c/src/lib/libbsp/i386/pc386/startup/exit.c

    rcc8a388a rdbfa3148  
    3535#include <stdio.h>
    3636#include <bsp.h>
     37#include <rtems/libio.h>
    3738#include <pc386uart.h>
    3839
     
    7172  else
    7273    {
     74      /* Close console */
     75      __rtems_close(2);
     76      __rtems_close(1);
     77      __rtems_close(0);
     78
    7379      PC386_uart_intr_ctrl(PC386ConsolePort, PC386_UART_INTR_CTRL_DISABLE);
    7480     
Note: See TracChangeset for help on using the changeset viewer.