Changeset 8a496e46 in rtems


Ignore:
Timestamp:
Sep 23, 1998, 1:20:34 PM (23 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
479c86dd
Parents:
362b88e
Message:

Patch from Aleksey (Quality Quorum <qqi@…>):

  1. Finally fixes raw interrupts for pc386
  2. Makes some minor cleanup in console and startup
  3. Makes rtems_termios_dequeue_characters() to return count of outstanding chars - it allows to simplify console isrs a little bit.
  4. pc386 uart modified to be friendlier to termios parameter changes, to have minor performance improvement and to take advantage of of above termios modification.
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • c/src/exec/libcsupport/include/rtems/libio.h

    r362b88e r8a496e46  
    158158rtems_status_code rtems_termios_ioctl (void *arg);
    159159int rtems_termios_enqueue_raw_characters (void *ttyp, char *buf, int len);
    160 void rtems_termios_dequeue_characters (void *ttyp, int len);
     160int rtems_termios_dequeue_characters (void *ttyp, int len);
    161161void rtems_termios_reserve_resources(
    162162  rtems_configuration_table *configuration,
  • c/src/exec/libcsupport/src/termios.c

    r362b88e r8a496e46  
    895895 * The second argument is the number of characters transmitted so far.
    896896 * This value will always be 1 for devices which generate an interrupt
    897  * for each transmitted character.
    898  */
    899 void
     897 * for each transmitted character.
     898 * It returns number of characters left to transmit
     899 */
     900int
    900901rtems_termios_dequeue_characters (void *ttyp, int len)
    901902{
     
    907908                rtems_semaphore_release (tty->rawOutBufSemaphore);
    908909        if ( tty->rawOutBufHead == tty->rawOutBufTail )
    909                 return;
     910                return 0;
    910911        newTail = (tty->rawOutBufTail + len) % RAW_OUTPUT_BUFFER_SIZE;
    911912        if (newTail == tty->rawOutBufHead) {
     
    914915                 */
    915916                tty->rawOutBufState = rob_idle;
     917                nToSend = 0;
    916918        }
    917919        else {
     
    927929        }
    928930        tty->rawOutBufTail = newTail;
    929 }
     931
     932        return nToSend;
     933}
     934
     935
  • c/src/lib/include/rtems/libio.h

    r362b88e r8a496e46  
    158158rtems_status_code rtems_termios_ioctl (void *arg);
    159159int rtems_termios_enqueue_raw_characters (void *ttyp, char *buf, int len);
    160 void rtems_termios_dequeue_characters (void *ttyp, int len);
     160int rtems_termios_dequeue_characters (void *ttyp, int len);
    161161void rtems_termios_reserve_resources(
    162162  rtems_configuration_table *configuration,
  • c/src/lib/libbsp/i386/pc386/console/console.c

    r362b88e r8a496e46  
    5959int PC386ConsolePort = PC386_CONSOLE_PORT_CONSOLE;
    6060
    61 static int conSetAttr(int minor, const struct termios *);
    6261extern BSP_polling_getchar_function_type BSP_poll_char;
    6362
     
    6564| External Prototypes
    6665+--------------------------------------------------------------------------*/
    67 extern void     _IBMPC_keyboard_isr(void);
    68 extern void     _IBMPC_keyboard_isr_on(const rtems_irq_connect_data*);
    69 extern void     _IBMPC_keyboard_isr_off(const rtems_irq_connect_data*);
    70 extern int      _IBMPC_keyboard_isr_is_on(const rtems_irq_connect_data*);
    71 
    72 static rtems_irq_connect_data console_isr_data = {PC_386_KEYBOARD,
    73                                                    _IBMPC_keyboard_isr,
    74                                                    _IBMPC_keyboard_isr_on,
    75                                                    _IBMPC_keyboard_isr_off,
    76                                                    _IBMPC_keyboard_isr_is_on};
    77                                                    
    78 
     66extern void _IBMPC_keyboard_isr(void);
    7967extern rtems_boolean _IBMPC_scankey(char *);  /* defined in 'inch.c' */
    8068extern char BSP_wait_polled_input(void);
    8169extern void _IBMPC_initVideo(void);
     70
     71static int  conSetAttr(int minor, const struct termios *);
     72static void isr_on(const rtems_irq_connect_data *);
     73static void isr_off(const rtems_irq_connect_data *);
     74static int  isr_is_on(const rtems_irq_connect_data *);
     75
     76
     77static rtems_irq_connect_data console_isr_data = {PC_386_KEYBOARD,
     78                                                   _IBMPC_keyboard_isr,
     79                                                   isr_on,
     80                                                   isr_off,
     81                                                   isr_is_on};
     82
     83static void
     84isr_on(const rtems_irq_connect_data *unused)
     85{
     86  return;
     87}
     88                                                   
     89static void
     90isr_off(const rtems_irq_connect_data *unused)
     91{
     92  return;
     93}
     94
     95static int
     96isr_is_on(const rtems_irq_connect_data *irq)
     97{
     98  return pc386_irq_enabled_at_i8259s(irq->name);
     99}
    82100
    83101void console_reserve_resources(rtems_configuration_table *conf)
     
    204222          printk("Initialized console on port COM2 9600-8-N-1\n\n");
    205223        }
    206 #define  PRINTK_ON_SERIAL     
     224#define  PRINTK_ON_SERIAL
    207225#ifdef PRINTK_ON_SERIAL
    208226      /*
     
    222240static int console_open_count = 0;
    223241
    224 static void console_last_close()
     242static int console_last_close(int major, int minor, void *arg)
    225243{
    226244  pc386_remove_rtems_irq_handler (&console_isr_data);
     245
     246  return 0;
    227247}
    228248
     
    295315  else {
    296316    if (--console_open_count == 0) {
    297       console_last_close();
     317      console_last_close(major, minor, arg);
    298318    }
    299319  }
     
    475495BSP_polling_getchar_function_type BSP_poll_char = BSP_wait_polled_input;
    476496
    477 void BSP_emergency_output_init()
    478 {
    479   _IBMPC_initVideo();
    480 }
    481 
    482 
     497
  • c/src/lib/libbsp/i386/pc386/console/inch.c

    r362b88e r8a496e46  
    211211} /* _IBMPC_scankey */
    212212
    213 void _IBMPC_keyboard_isr_on(const rtems_irq_connect_data* unused)
    214 {}
    215 void _IBMPC_keyboard_isr_off(const rtems_irq_connect_data* unused)
    216 {}
    217 
    218 int _IBMPC_keyboard_isr_is_on(const rtems_irq_connect_data* irq)
    219 {
    220   return pc386_irq_enabled_at_i8259s (irq->name);
    221 }
    222 
    223 
    224 
    225213/*-------------------------------------------------------------------------+
    226214|         Function: _IBMPC_keyboard_isr
  • c/src/lib/libbsp/i386/pc386/startup/bspstart.c

    r362b88e r8a496e46  
    3737#include <rtems/libio.h>
    3838#include <libcpu/cpuModel.h>
    39 #include <pc386uart.h>
    4039
    4140/*-------------------------------------------------------------------------+
     
    6564char            *rtems_progname;               /* Program name - from main(). */
    6665
    67 extern void debugPollingGetChar();
    68 
    6966/*-------------------------------------------------------------------------+
    7067| External Prototypes
    7168+--------------------------------------------------------------------------*/
    72 extern void _exit(int);  /* define in exit.c */
    73 extern void _IBMPC_initVideo(void);
    74 extern void rtems_irq_mngt_init();
     69extern void rtems_irq_mngt_init(void);
    7570void bsp_libc_init( void *, unsigned32, int );
    7671void bsp_postdriver_hook(void);
    77 extern void _IBMPC_initVideo(void);
    7872
    7973/*-------------------------------------------------------------------------+
     
    109103        }
    110104
    111       printk("\n");
    112 
    113105      for(i=2; i<=2048; i++)
    114106        {
     
    146138+--------------------------------------------------------------------------*/
    147139void bsp_start( void )
    148   /* Initialize printk channel */
    149   _IBMPC_initVideo();
    150140{
    151 
    152141  /*
    153142   * Calibrate variable for 1ms-loop (see timer.c)
    154143   */
    155144  Calibrate_loop_1ms();
     145
    156146  /*
    157147   * Initialize printk channel
  • c/src/lib/libbsp/i386/pc386/startup/exit.c

    r362b88e r8a496e46  
    3838#include <pc386uart.h>
    3939
    40 void bsp_cleanup()
     40void bsp_cleanup(void)
    4141{
    4242  unsigned char ch;
     
    5757
    5858
     59
     60
     61
  • c/src/lib/libbsp/i386/shared/irq/idt.c

    r362b88e r8a496e46  
    4646
    4747    i386_get_info_from_IDTR (&idt_entry_tbl, &limit);
    48        
    49     /* Convert limit into number of entries */
    50     limit = (limit + 1) >> 3;
    51 
    52     if(index >= limit) {
    53         return 0;
    54     }
    5548       
    5649    /* Convert limit into number of entries */
     
    280273
    281274    /*
    282     return 1;
     275     * Now, reload all segment registers so the limit takes effect.
    283276     */
    284277
  • c/src/lib/libbsp/i386/shared/irq/irq_init.c

    r362b88e r8a496e46  
    117117    int                         i;
    118118    interrupt_gate_descriptor*  idt_entry_tbl;
    119     unsigned                    limit;
     119    unsigned int                limit;
    120120    unsigned int                level;
    121121
    122     i386_get_info_from_IDTR (&idt_entry_tbl, &limit);
    123     /* Convert limit into number of entries */
    124     limit = (limit + 1) / sizeof(interrupt_gate_descriptor);   
     122    i386_get_info_from_IDTR(&idt_entry_tbl, &limit);
     123
     124    /* Convert into number of entries */
     125    limit = (limit + 1)/sizeof(interrupt_gate_descriptor);
     126
     127    if(limit != IDT_SIZE) {
     128       printk("IDT table size mismatch !!! System locked\n");
     129       while(1);
     130    }
     131   
    125132
    126133    _CPU_ISR_Disable(level);
     
    129136     * Init the complete IDT vector table with defaultRawIrq value
    130137     */
    131     for (i = 0; i < limit; i++) {
     138    for (i = 0; i < IDT_SIZE ; i++) {
    132139      idtHdl[i]          = defaultRawIrq;
    133140      idtHdl[i].idtIndex = i;
    134141    }
     142
    135143    raw_initial_config.idtSize = IDT_SIZE;
    136144    raw_initial_config.defaultRawEntry = defaultRawIrq;
  • c/src/lib/libc/libio.h

    r362b88e r8a496e46  
    158158rtems_status_code rtems_termios_ioctl (void *arg);
    159159int rtems_termios_enqueue_raw_characters (void *ttyp, char *buf, int len);
    160 void rtems_termios_dequeue_characters (void *ttyp, int len);
     160int rtems_termios_dequeue_characters (void *ttyp, int len);
    161161void rtems_termios_reserve_resources(
    162162  rtems_configuration_table *configuration,
  • c/src/lib/libc/termios.c

    r362b88e r8a496e46  
    895895 * The second argument is the number of characters transmitted so far.
    896896 * This value will always be 1 for devices which generate an interrupt
    897  * for each transmitted character.
    898  */
    899 void
     897 * for each transmitted character.
     898 * It returns number of characters left to transmit
     899 */
     900int
    900901rtems_termios_dequeue_characters (void *ttyp, int len)
    901902{
     
    907908                rtems_semaphore_release (tty->rawOutBufSemaphore);
    908909        if ( tty->rawOutBufHead == tty->rawOutBufTail )
    909                 return;
     910                return 0;
    910911        newTail = (tty->rawOutBufTail + len) % RAW_OUTPUT_BUFFER_SIZE;
    911912        if (newTail == tty->rawOutBufHead) {
     
    914915                 */
    915916                tty->rawOutBufState = rob_idle;
     917                nToSend = 0;
    916918        }
    917919        else {
     
    927929        }
    928930        tty->rawOutBufTail = newTail;
    929 }
     931
     932        return nToSend;
     933}
     934
     935
  • c/src/lib/libcpu/i386/cpu.c

    r362b88e r8a496e46  
    4646
    4747    i386_get_info_from_IDTR (&idt_entry_tbl, &limit);
    48        
    49     /* Convert limit into number of entries */
    50     limit = (limit + 1) >> 3;
    51 
    52     if(index >= limit) {
    53         return 0;
    54     }
    5548       
    5649    /* Convert limit into number of entries */
     
    280273
    281274    /*
    282     return 1;
     275     * Now, reload all segment registers so the limit takes effect.
    283276     */
    284277
  • c/src/lib/libcpu/i386/idt.c

    r362b88e r8a496e46  
    4646
    4747    i386_get_info_from_IDTR (&idt_entry_tbl, &limit);
    48        
    49     /* Convert limit into number of entries */
    50     limit = (limit + 1) >> 3;
    51 
    52     if(index >= limit) {
    53         return 0;
    54     }
    5548       
    5649    /* Convert limit into number of entries */
     
    280273
    281274    /*
    282     return 1;
     275     * Now, reload all segment registers so the limit takes effect.
    283276     */
    284277
  • cpukit/libcsupport/include/rtems/libio.h

    r362b88e r8a496e46  
    158158rtems_status_code rtems_termios_ioctl (void *arg);
    159159int rtems_termios_enqueue_raw_characters (void *ttyp, char *buf, int len);
    160 void rtems_termios_dequeue_characters (void *ttyp, int len);
     160int rtems_termios_dequeue_characters (void *ttyp, int len);
    161161void rtems_termios_reserve_resources(
    162162  rtems_configuration_table *configuration,
  • cpukit/libcsupport/src/termios.c

    r362b88e r8a496e46  
    895895 * The second argument is the number of characters transmitted so far.
    896896 * This value will always be 1 for devices which generate an interrupt
    897  * for each transmitted character.
    898  */
    899 void
     897 * for each transmitted character.
     898 * It returns number of characters left to transmit
     899 */
     900int
    900901rtems_termios_dequeue_characters (void *ttyp, int len)
    901902{
     
    907908                rtems_semaphore_release (tty->rawOutBufSemaphore);
    908909        if ( tty->rawOutBufHead == tty->rawOutBufTail )
    909                 return;
     910                return 0;
    910911        newTail = (tty->rawOutBufTail + len) % RAW_OUTPUT_BUFFER_SIZE;
    911912        if (newTail == tty->rawOutBufHead) {
     
    914915                 */
    915916                tty->rawOutBufState = rob_idle;
     917                nToSend = 0;
    916918        }
    917919        else {
     
    927929        }
    928930        tty->rawOutBufTail = newTail;
    929 }
     931
     932        return nToSend;
     933}
     934
     935
  • make/target.cfg.in

    r362b88e r8a496e46  
    4040RTEMS_USE_OWN_PDIR = @RTEMS_USE_OWN_PDIR@
    4141RTEMS_HAS_POSIX_API = @RTEMS_HAS_POSIX_API@
     42RTEMS_HAS_POSIX_1H_API = @RTEMS_HAS_POSIX_1H_API@
    4243RTEMS_HAS_NETWORKING = @RTEMS_HAS_NETWORKING@
    4344RTEMS_HAS_CPLUSPLUS = @RTEMS_HAS_CPLUSPLUS@
Note: See TracChangeset for help on using the changeset viewer.