Changeset 67a2288 in rtems


Ignore:
Timestamp:
Jul 23, 1998, 10:02:34 PM (22 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
dbaf51a
Parents:
73452854
Message:

Patch from Eric VALETTE <valette@…>:

Here is a enhanced version of my previous patch. This patch enables
to potentially share the new interrupt management code for all Intel targets
(pc386, go32 and force386) bsp.

Note : this patch is complete only for pc386. It still needs to

be completed for go32 and force386. I carrefully checked
that anything needed is in for force386 (only some function
name changes for IDT manipulation and GDT segment
manipulation). But anyway I will not be able to test any
of theses targets...

Files:
14 added
22 edited

Legend:

Unmodified
Added
Removed
  • Makefile.in

    r73452854 r67a2288  
    3232include $(RTEMS_ROOT)/make/main.cfg
    3333
    34 MTARGETS = all install $(TARGET_VARIANTS) $(TARGET_VARIANTS:%=%_all) \
     34MTARGETS = pre_install_src all install $(TARGET_VARIANTS) $(TARGET_VARIANTS:%=%_all) \
    3535  $(TARGET_VARIANTS:%=%_install) $(TARGET_VARIANTS:%=%_tests) \
    3636  clean_wrapup distclean clean_dirs clean_tools tests clean depend
  • c/Makefile.in

    r73452854 r67a2288  
    5050# Make all/install must include 'env'
    5151# if something is added to TARGET_VARIANTS, then account for it here
    52 all: env
     52make_src_makefiles: Makefile.in Makefile
     53        find . -name Makefile -exec grep -q ^preinstall {} \; -print > make_src_makefiles
     54
     55pre_install_src: env make_src_makefiles
     56        cd build-tools/scripts; $(MAKE)
     57        CURRDIR=`pwd`; \
     58        for i in `cat make_src_makefiles` ; do \
     59                DIR=`dirname $$i`; \
     60                cd $$DIR; \
     61                $(MAKE) preinstall; \
     62                cd $$CURRDIR; \
     63        done
     64all: pre_install_src env
    5365debug: env
    5466profile: env
  • c/src/exec/score/cpu/i386/cpu.c

    r73452854 r67a2288  
    7777}
    7878 
    79 /*PAGE
    80  *
    81  *  _CPU_ISR_install_raw_handler
    82  */
    83  
    84 #if __GO32__
    85 #include <go32.h>
    86 #include <dpmi.h>
    87 #endif /* __GO32__ */
    88 
    89 void _CPU_ISR_install_raw_handler(
    90   unsigned32  vector,
    91   proc_ptr    new_handler,
    92   proc_ptr   *old_handler
    93 )
    94 {
    95 #if __GO32__
    96     _go32_dpmi_seginfo handler_info;
    97  
    98     /* get the address of the old handler */
    99     _go32_dpmi_get_protected_mode_interrupt_vector( vector, &handler_info);
    100  
    101     /* Notice how we're failing to save the pm_segment portion of the */
    102     /* structure here?  That means we might crash the system if we  */
    103     /* try to restore the ISR.  Can't fix this until i386_isr is  */
    104     /* redefined.  XXX [BHC].           */
    105     *old_handler = (proc_ptr *) handler_info.pm_offset;
    106 
    107     handler_info.pm_offset = (u_long) new_handler;
    108     handler_info.pm_selector = _go32_my_cs();
    109 
    110     /* install the IDT entry */
    111     _go32_dpmi_set_protected_mode_interrupt_vector( vector, &handler_info );
    112 #else
    113   i386_IDT_slot idt;
    114   unsigned32    handler;
    115 
    116   *old_handler =  0;    /* XXX not supported */
    117 
    118   handler = (unsigned32) new_handler;
    119 
    120   /* build the IDT entry */
    121   idt.offset_0_15      = handler & 0xffff;
    122   idt.segment_selector = i386_get_cs();
    123   idt.reserved         = 0x00;
    124   idt.p_dpl            = 0x8e;         /* present, ISR */
    125   idt.offset_16_31     = handler >> 16;
    126 
    127   /* install the IDT entry */
    128   i386_Install_idt(
    129     (unsigned32) &idt,
    130     _CPU_Table.interrupt_table_segment,
    131     (unsigned32) _CPU_Table.interrupt_table_offset + (8 * vector)
    132   );
    133 #endif
    134 }
    135 
    136 /*PAGE
    137  *
    138  *  _CPU_ISR_install_vector
    139  *
    140  *  This kernel routine installs the RTEMS handler for the
    141  *  specified vector.
    142  *
    143  *  Input parameters:
    144  *    vector      - interrupt vector number
    145  *    old_handler - former ISR for this vector number
    146  *    new_handler - replacement ISR for this vector number
    147  *
    148  *  Output parameters:  NONE
    149  *
    150  */
    151 
    152 void _ISR_Handler_0(), _ISR_Handler_1();
    153 
    154 #define PER_ISR_ENTRY \
    155     (((unsigned32) _ISR_Handler_1 - (unsigned32) _ISR_Handler_0))
    156 
    157 #define _Interrupt_Handler_entry( _vector ) \
    158    (((unsigned32)_ISR_Handler_0) + ((_vector) * PER_ISR_ENTRY))
    159 
    160 void _CPU_ISR_install_vector(
    161   unsigned32  vector,
    162   proc_ptr    new_handler,
    163   proc_ptr   *old_handler
    164 )
    165 {
    166   proc_ptr      ignored;
    167   unsigned32    unique_handler;
    168 
    169   *old_handler = _ISR_Vector_table[ vector ];
    170 
    171   /* calculate the unique entry point for this vector */
    172   unique_handler = _Interrupt_Handler_entry( vector );
    173 
    174   _CPU_ISR_install_raw_handler( vector, (void *)unique_handler, &ignored );
    175 
    176   _ISR_Vector_table[ vector ] = new_handler;
    177 }
  • c/src/exec/score/cpu/i386/cpu.h

    r73452854 r67a2288  
    2323
    2424#include <rtems/score/i386.h>              /* pick up machine definitions */
     25#include <libcpu/cpu.h>
     26
    2527#ifndef ASM
    2628#include <rtems/score/i386types.h>
  • c/src/exec/score/cpu/i386/cpu_asm.s

    r73452854 r67a2288  
    553553
    554554#ifndef __GO32__
    555 /*PAGE
    556  *
    557  *  void i386_Install_idt(
    558  *    unsigned32 source_offset,
    559  *    unsigned16 destination_segment,
    560  *    unsigned32 destination_offset
    561  *  );
    562  */
    563 
    564         .p2align  2
    565         PUBLIC (i386_Install_idt)
    566 
    567 .set INSTALL_IDT_SAVED_REGS,   8
    568 
    569 .set SOURCE_OFFSET_ARG,        INSTALL_IDT_SAVED_REGS + 4
    570 .set DESTINATION_SEGMENT_ARG,  INSTALL_IDT_SAVED_REGS + 8
    571 .set DESTINATION_OFFSET_ARG,   INSTALL_IDT_SAVED_REGS + 12
    572 
    573 SYM (i386_Install_idt):
    574         push      esi
    575         push      edi
    576 
    577         movl      SOURCE_OFFSET_ARG(esp),esi
    578         movl      DESTINATION_OFFSET_ARG(esp),edi
    579 
    580         pushf                                  # save flags
    581         cli                                    # DISABLE INTERRUPTS!!!
    582 
    583         movw      DESTINATION_SEGMENT_ARG+4(esp),ax
    584         push      es                           # save es
    585         movw      ax,es
    586         movsl                                  # copy 1st half of IDT entry
    587         movsl                                  # copy 2nd half of IDT entry
    588         pop       es                           # restore es
    589 
    590         popf                                   # ENABLE INTERRUPTS!!!
    591 
    592         pop       edi
    593         pop       esi
    594         ret
    595555
    596556/*
  • c/src/exec/score/cpu/i386/i386.h

    r73452854 r67a2288  
    100100
    101101/*
    102  *  Structure which makes it easier to deal with LxDT and SxDT instructions.
    103  */
    104  
    105 typedef struct {
    106   unsigned short limit;
    107   unsigned short physical_address[ 2 ];
    108 } i386_DTR_load_save_format;
    109  
    110 /* See Chapter 5 - Memory Management in i386 manual */
    111  
    112 typedef struct {
    113   unsigned short limit_0_15;
    114   unsigned short base_0_15;
    115   unsigned char  base_16_23;
    116   unsigned char  type_dt_dpl_p;
    117   unsigned char  limit_16_19_granularity;
    118   unsigned char  base_24_31;
    119 }   i386_GDT_slot;
    120  
    121 /* See Chapter 9 - Exceptions and Interrupts in i386 manual
    122  *
    123  *  NOTE: This is the IDT entry for interrupt gates ONLY.
    124  */
    125  
    126 typedef struct {
    127   unsigned short offset_0_15;
    128   unsigned short segment_selector;
    129   unsigned char  reserved;
    130   unsigned char  p_dpl;
    131   unsigned short offset_16_31;
    132 }   i386_IDT_slot;
    133 
    134 /*
    135  *  Interrupt Level Macros
    136  */
    137 
    138 #define i386_disable_interrupts( _level ) \
    139   { \
    140     _level = 0;   /* avoids warnings */ \
    141     asm volatile ( "pushf ; \
    142                     cli ; \
    143                     pop %0" \
    144                     : "=r" ((_level)) : "0" ((_level)) \
    145     ); \
    146   }
    147 
    148 #define i386_enable_interrupts( _level )  \
    149   { \
    150     asm volatile ( "push %0 ; \
    151                     popf" \
    152                     : "=r" ((_level)) : "0" ((_level)) \
    153     ); \
    154   }
    155 
    156 #define i386_flash_interrupts( _level ) \
    157   { \
    158     asm volatile ( "push %0 ; \
    159                     popf ; \
    160                     cli" \
    161                     : "=r" ((_level)) : "0" ((_level)) \
    162     ); \
    163   }
    164 
    165 #define i386_get_interrupt_level( _level ) \
    166   do { \
    167     register unsigned32 _eflags = 0; \
    168     \
    169     asm volatile ( "pushf ; \
    170                     pop %0" \
    171                     : "=r" ((_eflags)) : "0" ((_eflags)) \
    172     ); \
    173     \
    174     _level = (_eflags & 0x0200) ? 0 : 1; \
    175   } while (0)
    176 
    177 /*
    178102 *  The following routine swaps the endian format of an unsigned int.
    179103 *  It must be static so it can be referenced indirectly.
     
    207131
    208132/*
    209  *  Segment Access Routines
    210  *
    211  *  NOTE:  Unfortunately, these are still static inlines even when the
    212  *         "macro" implementation of the generic code is used.
    213  */
    214 
    215 static inline unsigned short i386_get_cs()
    216 {
    217   register unsigned short segment = 0;
    218 
    219   asm volatile ( "movw %%cs,%0" : "=r" (segment) : "0" (segment) );
    220 
    221   return segment;
    222 }
    223 
    224 static inline unsigned short i386_get_ds()
    225 {
    226   register unsigned short segment = 0;
    227 
    228   asm volatile ( "movw %%ds,%0" : "=r" (segment) : "0" (segment) );
    229 
    230   return segment;
    231 }
    232 
    233 static inline unsigned short i386_get_es()
    234 {
    235   register unsigned short segment = 0;
    236 
    237   asm volatile ( "movw %%es,%0" : "=r" (segment) : "0" (segment) );
    238 
    239   return segment;
    240 }
    241 
    242 static inline unsigned short i386_get_ss()
    243 {
    244   register unsigned short segment = 0;
    245 
    246   asm volatile ( "movw %%ss,%0" : "=r" (segment) : "0" (segment) );
    247 
    248   return segment;
    249 }
    250 
    251 static inline unsigned short i386_get_fs()
    252 {
    253   register unsigned short segment = 0;
    254 
    255   asm volatile ( "movw %%fs,%0" : "=r" (segment) : "0" (segment) );
    256 
    257   return segment;
    258 }
    259 
    260 static inline unsigned short i386_get_gs()
    261 {
    262   register unsigned short segment = 0;
    263 
    264   asm volatile ( "movw %%gs,%0" : "=r" (segment) : "0" (segment) );
    265 
    266   return segment;
    267 }
    268 
    269 /*
    270133 *  IO Port Access Routines
    271134 */
     
    328191   }
    329192
    330 /*
    331  *  Descriptor Table helper routines
    332  */
    333 
    334 
    335 #define i386_get_GDTR( _gdtr_address ) \
    336   { \
    337     void *_gdtr = (_gdtr_address); \
    338     \
    339     asm volatile( "sgdt   (%0)" : "=r" (_gdtr) : "0" (_gdtr) ); \
    340   }
    341 
    342 #define i386_get_GDT_slot( _gdtr_base, _segment, _slot_address ) \
    343   { \
    344     register unsigned int   _gdt_slot  = (_gdtr_base) + (_segment); \
    345     register volatile void *_slot      = (_slot_address); \
    346     register unsigned int   _temporary = 0; \
    347     \
    348     asm volatile( "movl %%gs:(%0),%1 ; \
    349                    movl %1,(%2) ; \
    350                    movl %%gs:4(%0),%1 ; \
    351                    movl %1,4(%2)"  \
    352                      : "=r" (_gdt_slot), "=r" (_temporary), "=r" (_slot) \
    353                      : "0"  (_gdt_slot), "1"  (_temporary), "2"  (_slot) \
    354                 );  \
    355   }
    356 
    357 #define i386_set_GDT_slot( _gdtr_base, _segment, _slot_address ) \
    358   { \
    359     register unsigned int   _gdt_slot  = (_gdtr_base) + (_segment); \
    360     register volatile void *_slot      = (_slot_address); \
    361     register unsigned int   _temporary = 0; \
    362     \
    363     asm volatile( "movl (%2),%1 ; \
    364                    movl %1,%%gs:(%0) ; \
    365                    movl 4(%2),%1 ; \
    366                    movl %1,%%gs:4(%0) \
    367                   " \
    368                      : "=r" (_gdt_slot), "=r" (_temporary), "=r" (_slot) \
    369                      : "0"  (_gdt_slot), "1"  (_temporary), "2"  (_slot) \
    370                 );  \
    371   }
    372 
    373 static inline void i386_set_segment(
    374   unsigned short segment,
    375   unsigned int  base,
    376   unsigned int  limit
    377 )
    378 {
    379   i386_DTR_load_save_format         gdtr;
    380   volatile i386_GDT_slot            Gdt_slot;
    381   volatile i386_GDT_slot           *gdt_slot = &Gdt_slot;
    382   unsigned short                    tmp_segment = 0;
    383   unsigned int                      limit_adjusted;
    384 
    385   /* load physical address of the GDT */
    386 
    387   i386_get_GDTR( &gdtr );
    388 
    389   gdt_slot->type_dt_dpl_p  = 0x92;             /* present, dpl=0,      */
    390                                                /* application=1,       */
    391                                                /* type=data read/write */
    392   gdt_slot->limit_16_19_granularity = 0x40;    /* 32 bit segment       */
    393 
    394   limit_adjusted = limit;
    395   if ( limit > 4095 ) {
    396     gdt_slot->limit_16_19_granularity |= 0x80; /* set granularity bit */
    397     limit_adjusted /= 4096;
    398   }
    399 
    400   gdt_slot->limit_16_19_granularity |= (limit_adjusted >> 16) & 0xff;
    401   gdt_slot->limit_0_15               = limit_adjusted & 0xffff;
    402 
    403   gdt_slot->base_0_15  = base & 0xffff;
    404   gdt_slot->base_16_23 = (base >> 16) & 0xff;
    405   gdt_slot->base_24_31 = (base >> 24);
    406 
    407   i386_set_GDT_slot(
    408     gdtr.physical_address[0] + (gdtr.physical_address[1] << 16),
    409     segment,
    410     gdt_slot
    411   );
    412 
    413   /* Now, reload all segment registers so the limit takes effect. */
    414 
    415   asm volatile( "movw %%ds,%0 ; movw %0,%%ds
    416                  movw %%es,%0 ; movw %0,%%es
    417                  movw %%fs,%0 ; movw %0,%%fs
    418                  movw %%gs,%0 ; movw %0,%%gs
    419                  movw %%ss,%0 ; movw %0,%%ss"
    420                    : "=r" (tmp_segment)
    421                    : "0"  (tmp_segment)
    422               );
    423 
    424 }
    425193
    426194/* routines */
     
    448216);
    449217
    450 /*
    451  *  i386_Install_idt
    452  *
    453  *  This routine installs an IDT entry.
    454  */
    455 
    456 void i386_Install_idt(
    457   unsigned int   source_offset,
    458   unsigned short destination_segment,
    459   unsigned int   destination_offset
    460 );
    461218
    462219/*
     
    485242#define inport_long( _port, _value )  i386_inport_long( _port, _value )
    486243 
    487 /* complicated static inline functions */
    488  
    489 #define get_GDTR( _gdtr_address ) \
    490         i386_get_GDTR( _gdtr_address )
    491  
    492 #define get_GDT_slot( _gdtr_base, _segment, _slot_address ) \
    493         i386_get_GDT_slot( _gdtr_base, _segment, _slot_address )
    494  
    495 #define set_GDT_slot( _gdtr_base, _segment, _slot_address ) \
    496         i386_set_GDT_slot( _gdtr_base, _segment, _slot_address )
    497  
    498 #define set_segment( _segment, _base, _limit ) \
    499   i386_set_segment( _segment, _base, _limit )
    500  
    501244
    502245#ifdef __cplusplus
  • c/src/lib/libbsp/i386/Makefile.in

    r73452854 r67a2288  
    1313
    1414# Descend into the $(RTEMS_BSP_FAMILY) directory
    15 SUB_DIRS=$(RTEMS_BSP_FAMILY)
     15SUB_DIRS=shared $(RTEMS_BSP_FAMILY)
  • c/src/lib/libbsp/i386/pc386/clock/ckinit.c

    r73452854 r67a2288  
    4040
    4141/*-------------------------------------------------------------------------+
    42 | Constants
    43 +--------------------------------------------------------------------------*/
    44 #define CLOCK_IRQ  0x00  /* Clock IRQ. */
    45 
    46 /*-------------------------------------------------------------------------+
    4742| Macros
    4843+--------------------------------------------------------------------------*/
     
    6863/*-------------------------------------------------------------------------+
    6964|         Function: clockIsr
    70 |      Description: Interrupt Service Routine for clock (08h) interruption.
     65|      Description: Interrupt Service Routine for clock (0h) interruption.
    7166| Global Variables: Clock_driver_ticks, Clock_isrs.
    7267|        Arguments: vector - standard RTEMS argument - see documentation.
    7368|          Returns: standard return value - see documentation.
    7469+--------------------------------------------------------------------------*/
    75 static rtems_isr
    76 clockIsr(rtems_vector_number vector)
     70static void clockIsr()
    7771{
    7872  /*-------------------------------------------------------------------------+
     
    9993    Clock_isrs--;
    10094
    101   PC386_ackIrq(vector - PC386_IRQ_VECTOR_BASE);
    10295} /* clockIsr */
    103 
    10496
    10597/*-------------------------------------------------------------------------+
     
    111103|          Returns: Nothing.
    112104+--------------------------------------------------------------------------*/
    113 void Clock_exit(void)
     105void clockOff(const rtems_irq_connect_data* unused)
    114106{
    115107  if (BSP_Configuration.ticks_per_timeslice)
     
    130122|          Returns: Nothing.
    131123+--------------------------------------------------------------------------*/
    132 void
    133 Install_clock(rtems_isr_entry isr)
     124static void clockOn(const rtems_irq_connect_data* unused)
    134125{
    135126  rtems_unsigned32  microseconds_per_isr;
    136127
    137   rtems_status_code status;
    138  
    139128#if 0
    140129  /* Initialize clock from on-board real time clock.  This breaks the  */
     
    176165    rtems_unsigned32 count = US_TO_TICK(microseconds_per_isr);
    177166
    178     status = PC386_installRtemsIrqHandler(CLOCK_IRQ, isr);
    179 
    180     if (status != RTEMS_SUCCESSFUL)
    181     {
    182       printk("Error installing clock interrupt handler!\n");
    183       rtems_fatal_error_occurred(status);
    184     }
    185 
    186167    outport_byte(TIMER_MODE, TIMER_SEL0|TIMER_16BIT|TIMER_RATEGEN);
    187168    outport_byte(TIMER_CNTR0, count >> 0 & 0xff);
     
    189170  }
    190171
    191   atexit(Clock_exit);
    192 } /* Install_clock */
    193 
     172}
     173
     174int clockIsOn(const rtems_irq_connect_data* unused)
     175{
     176  return ((i8259s_cache & 0x1) == 0);
     177}
     178
     179static rtems_irq_connect_data clockIrqData = {PC_386_PERIODIC_TIMER,
     180                                              clockIsr,
     181                                              clockOn,
     182                                              clockOff,
     183                                              clockIsOn};
     184                                             
     185                                             
    194186
    195187/*-------------------------------------------------------------------------+
     
    203195                 void                      *pargp)
    204196{
    205   Install_clock(clockIsr); /* Install the interrupt handler */
    206  
     197
     198  if (!pc386_install_rtems_irq_handler (&clockIrqData)) {
     199    printk("Unable to initialize system clock\n");
     200    rtems_fatal_error_occurred(1);
     201  }
    207202  /* make major/minor avail to others such as shared memory driver */
    208203 
     
    213208} /* Clock_initialize */
    214209
    215 
     210                                             
    216211/*-------------------------------------------------------------------------+
    217212| Console device driver CONTROL entry point
     
    232227 
    233228    if      (args->command == rtems_build_name('I', 'S', 'R', ' '))
    234       clockIsr(PC386_IRQ_VECTOR_BASE + CLOCK_IRQ);
     229      clockIsr();
    235230    else if (args->command == rtems_build_name('N', 'E', 'W', ' '))
    236231    {
    237       rtems_status_code status;
    238      
    239       status = PC386_installRtemsIrqHandler(CLOCK_IRQ, clockIsr);
    240 
    241       if (status != RTEMS_SUCCESSFUL)
    242       {
     232      if (!pc386_install_rtems_irq_handler (&clockIrqData)) {
    243233        printk("Error installing clock interrupt handler!\n");
    244         rtems_fatal_error_occurred(status);
     234        rtems_fatal_error_occurred(1);
    245235      }
    246236    }
     
    250240} /* Clock_control */
    251241
     242void Clock_exit()
     243{
     244  pc386_remove_rtems_irq_handler (&clockIrqData);
     245}
    252246
    253247/*-------------------------------------------------------------------------+
  • c/src/lib/libbsp/i386/pc386/console/console.c

    r73452854 r67a2288  
    4747
    4848/*-------------------------------------------------------------------------+
    49 | Constants
    50 +--------------------------------------------------------------------------*/
    51 #define KEYBOARD_IRQ  0x01  /* Keyboard IRQ. */
    52 
    53 
    54 /*-------------------------------------------------------------------------+
    5549| External Prototypes
    5650+--------------------------------------------------------------------------*/
    57 extern rtems_isr _IBMPC_keyboard_isr(rtems_vector_number);
    58        /* keyboard (IRQ 0x01) Interrupt Service Routine (defined in 'inch.c') */
     51extern void     _IBMPC_keyboard_isr(void);
     52extern void     _IBMPC_keyboard_isr_on(const rtems_irq_connect_data*);
     53extern void     _IBMPC_keyboard_isr_off(const rtems_irq_connect_data*);
     54extern int      _IBMPC_keyboard_isr_is_on(const rtems_irq_connect_data*);
     55
     56static rtems_irq_connect_data console_isr_data = {PC_386_KEYBOARD,
     57                                                   _IBMPC_keyboard_isr,
     58                                                   _IBMPC_keyboard_isr_on,
     59                                                   _IBMPC_keyboard_isr_off,
     60                                                   _IBMPC_keyboard_isr_is_on};
     61                                                   
    5962
    6063extern rtems_boolean _IBMPC_scankey(char *);  /* defined in 'inch.c' */
     
    165168
    166169      /* Install keyboard interrupt handler */
    167       status = PC386_installRtemsIrqHandler(KEYBOARD_IRQ, _IBMPC_keyboard_isr);
    168 
    169       if (status != RTEMS_SUCCESSFUL)
     170  status = pc386_install_rtems_irq_handler(&console_isr_data);
     171 
     172  if (!status)
    170173        {
    171174          printk("Error installing keyboard interrupt handler!\n");
     
    199202      if(PC386ConsolePort == PC386_UART_COM1)
    200203        {
    201           status = PC386_installRtemsIrqHandler(PC386_UART_COM1_IRQ,
    202                                                 PC386_uart_termios_isr_com1);
     204          console_isr_data.name = PC386_UART_COM1_IRQ;
     205          console_isr_data.hdl  = PC386_uart_termios_isr_com1;
     206         
    203207        }
    204208      else
    205209        {
    206210          assert(PC386ConsolePort == PC386_UART_COM2);
    207 
    208           status = PC386_installRtemsIrqHandler(PC386_UART_COM2_IRQ,
    209                                                 PC386_uart_termios_isr_com2);
    210         }
     211          console_isr_data.name = PC386_UART_COM2_IRQ;
     212          console_isr_data.hdl  = PC386_uart_termios_isr_com2;
     213        }
     214
     215      status =pc386_install_rtems_irq_handler(&console_isr_data);
    211216      /*
    212217       * Register the device
     
    292297              void                      *arg)
    293298{
     299  rtems_device_driver res = RTEMS_SUCCESSFUL;
     300 
    294301  if(PC386ConsolePort != PC386_CONSOLE_PORT_CONSOLE)
    295302    {
    296       return rtems_termios_close (arg);
    297     }
    298 
    299   return RTEMS_SUCCESSFUL;
     303      res =  rtems_termios_close (arg);
     304    }
     305  pc386_remove_rtems_irq_handler (&console_isr_data);
     306 
     307  return res;
    300308} /* console_close */
    301309
  • c/src/lib/libbsp/i386/pc386/console/inch.c

    r73452854 r67a2288  
    211211} /* _IBMPC_scankey */
    212212
     213void _IBMPC_keyboard_isr_on(const rtems_irq_connect_data* unused)
     214{}
     215void _IBMPC_keyboard_isr_off(const rtems_irq_connect_data* unused)
     216{}
     217
     218int _IBMPC_keyboard_isr_is_on(const rtems_irq_connect_data* irq)
     219{
     220  return pc386_irq_enabled_at_i8259s (irq->name);
     221}
     222
     223
    213224
    214225/*-------------------------------------------------------------------------+
     
    219230|          Returns: standard return value - see documentation.
    220231+--------------------------------------------------------------------------*/
    221 rtems_isr
    222 _IBMPC_keyboard_isr(rtems_vector_number vector)
     232void _IBMPC_keyboard_isr()
    223233{
    224234  if (_IBMPC_scankey(&kbd_buffer[kbd_last]))
     
    232242      }
    233243  }
    234 
    235   PC386_ackIrq(vector - PC386_IRQ_VECTOR_BASE); /* Mark interrupt as handled. */
    236244} /* _IBMPC_keyboard_isr */
    237245
     
    281289    return c;
    282290} /* _IBMPC_inch */
     291
     292 
     293 /*
     294  * Routine that can be used before interrupt management is initialized.
     295  */
     296 
     297char
     298debugPollingGetChar(void)
     299{
     300  char c;
     301  while (!_IBMPC_scankey(&c))
     302    continue;
     303
     304  return c;
     305}
    283306
    284307/*-------------------------------------------------------------------------+
  • c/src/lib/libbsp/i386/pc386/include/Makefile.in

    r73452854 r67a2288  
    99PROJECT_ROOT = @PROJECT_ROOT@
    1010
    11 H_FILES = $(srcdir)/bsp.h $(srcdir)/coverhd.h  $(srcdir)/irq.h \
    12           $(srcdir)/crt.h $(srcdir)/pc386uart.h $(srcdir)/pcibios.h
     11H_FILES = $(srcdir)/bsp.h $(srcdir)/coverhd.h  $(srcdir)/crt.h \
     12        $(srcdir)/pc386uart.h $(srcdir)/pcibios.h
    1313
    1414#
  • c/src/lib/libbsp/i386/pc386/include/bsp.h

    r73452854 r67a2288  
    5252#include <console.h>
    5353#include <clockdrv.h>
    54 
     54#include <libcpu/cpu.h>
     55 
    5556/*-------------------------------------------------------------------------+
    5657| Constants
     
    134135| External Variables.
    135136+--------------------------------------------------------------------------*/
    136 extern i386_IDT_slot Interrupt_descriptor_table[];
    137 extern i386_GDT_slot Global_descriptor_table   [];
     137#define IDT_SIZE 256
     138#define GDT_SIZE 3
     139
     140extern interrupt_gate_descriptor Interrupt_descriptor_table[IDT_SIZE];
     141extern segment_descriptors Global_descriptor_table   [GDT_SIZE];
    138142 
    139143extern rtems_configuration_table BSP_Configuration;
  • c/src/lib/libbsp/i386/pc386/start/start.s

    r73452854 r67a2288  
    105105        addl    $4, esp
    106106
    107         /*call  debugPollingGetChar */
     107        call    debugPollingGetChar
     108       
    108109#endif 
    109110
  • c/src/lib/libbsp/i386/pc386/startup/Makefile.in

    r73452854 r67a2288  
    1212
    1313# C source names, if any, go here -- minus the .c
    14 C_PIECES=bspclean bsplibc bsppost bspstart exit irq main sbrk
     14C_PIECES=bspclean bsplibc bsppost bspstart exit irq irq_init main sbrk
    1515C_FILES=$(C_PIECES:%=%.c)
    1616C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
     
    1919
    2020# Assembly source names, if any, go here -- minus the .s
    21 S_PIECES=ldsegs
     21S_PIECES=ldsegs irq_asm
    2222S_FILES=$(S_PIECES:%=%.s)
    2323S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
     
    5151CLOBBER_ADDITIONS +=
    5252
     53IMPORT_SRC=$(srcdir)/../../shared/irq/irq.c \
     54   $(srcdir)/../../shared/irq/irq_init.c $(srcdir)/../../shared/irq/irq_asm.s
     55
     56preinstall:
     57        ${CP} ${IMPORT_SRC} .
     58
    5359${PGM}: ${SRCS} ${OBJS}
    5460        $(make-rel)
  • c/src/lib/libbsp/i386/pc386/startup/bspstart.c

    r73452854 r67a2288  
    6666void bsp_libc_init( void *, unsigned32, int );
    6767void bsp_postdriver_hook(void);
    68  
     68extern void rtems_irq_mngt_init();
     69
    6970/*-------------------------------------------------------------------------+
    7071|         Function: bsp_pretasking_hook
     
    130131
    131132  /*
     133   * Init trems_interrupt_management
     134   */
     135  rtems_irq_mngt_init();
     136 
     137  /*
    132138   *  The following information is very useful when debugging.
    133139   */
  • c/src/lib/libbsp/i386/pc386/startup/ldsegs.s

    r73452854 r67a2288  
    4646| CODE section
    4747+----------------------------------------------------------------------------*/
    48 
     48EXTERN (rtems_i8259_masks)
     49       
    4950BEGIN_CODE
    5051
    5152        EXTERN (_establish_stack)
    5253        EXTERN (Timer_exit)
    53         EXTERN (Clock_exit)
     54        EXTERN (clockOff)
    5455
    5556        .p2align 4
     
    9697        movw ax, gs
    9798
    98         /* Set default interrupt handler */
    99         movl  $0, ecx
    100         movl  $Interrupt_descriptor_table, eax
    101         movl  $_default_int_handler, ebx
    102         movl  ebx, edx
    103         sarl  $16, edx
    104 loop:
    105         movw  bx, (eax)
    106         movw  $0x8, 2(eax)
    107         movw  $0x8e00, 4(eax)
    108         movw  dx, 8(eax)
    109         addl  $8, eax
    110         addl  $1, ecx
    111         cmpl  $255, ecx
    112         jle   loop
    113        
    114        
    115        
    116 
    11799/*---------------------------------------------------------------------+
    118100| Now we have to reprogram the interrupts :-(. We put them right after
     
    158140        call    SYM(delay)
    159141
     142        movw    $0xFFFB, SYM(i8259s_cache) /* set up same values in cache */
     143       
    160144        jmp     SYM (_establish_stack)  # return to the bsp entry code
    161145
     
    186170        .p2align 4
    187171       
    188         PUBLIC (_default_int_handler)
    189 SYM (_default_int_handler):
    190         iret
    191 
    192172/*---------------------------------------------------------------------------+
    193173| GDT itself
  • c/src/lib/libbsp/i386/pc386/timer/timer.c

    r73452854 r67a2288  
    4444| Constants
    4545+--------------------------------------------------------------------------*/
    46 #define TIMER_IRQ     0x00           /* Timer IRQ.                            */
    4746#define AVG_OVERHEAD  0              /* 0.1 microseconds to start/stop timer. */
    4847#define LEAST_VALID   1              /* Don't trust a value lower than this.  */
     
    5352volatile rtems_unsigned32 Ttimer_val;
    5453         rtems_boolean    Timer_driver_Find_average_overhead = TRUE;
     54
     55/*-------------------------------------------------------------------------+
     56| External Prototypes
     57+--------------------------------------------------------------------------*/
     58extern void timerisr();
     59       /* timer (int 08h) Interrupt Service Routine (defined in 'timerisr.s') */
     60extern int clockIsOn(const rtems_irq_connect_data*);
    5561
    5662/*-------------------------------------------------------------------------+
     
    8793Timer_exit(void)
    8894{
    89   PC386_disableIrq(TIMER_IRQ);
    9095} /* Timer_exit */
    9196
     
    108113
    109114    atexit(Timer_exit); /* Try not to hose the system at exit. */
    110     PC386_enableIrq(TIMER_IRQ);
    111                   /* Disable the programmable timer so ticks don't interfere. */
    112115  }
    113116  Ttimer_val = rdtsc(); /* read starting time */
     
    144147#define US_PER_ISR   250  /* Number of micro-seconds per timer interruption */
    145148
    146 /*-------------------------------------------------------------------------+
    147 | External Prototypes
    148 +--------------------------------------------------------------------------*/
    149 extern rtems_isr timerisr(rtems_vector_number);
    150        /* timer (int 08h) Interrupt Service Routine (defined in 'timerisr.s') */
    151149
    152150/*-------------------------------------------------------------------------+
     
    159157+--------------------------------------------------------------------------*/
    160158void
     159timerOff(const rtems_raw_irq_connect_data* used)
     160{
     161    /*
     162     * disable interrrupt at i8259 level
     163     */
     164     pc386_irq_disable_at_i8259s(used->idtIndex - PC386_IRQ_VECTOR_BASE);
     165     /* reset timer mode to standard (DOS) value */
     166     outport_byte(TIMER_MODE, TIMER_SEL0|TIMER_16BIT|TIMER_RATEGEN);
     167     outport_byte(TIMER_CNTR0, 0);
     168     outport_byte(TIMER_CNTR0, 0);
     169} /* Timer_exit */
     170
     171
     172void timerOn(const rtems_raw_irq_connect_data* used)
     173{
     174     /* load timer for US_PER_ISR microsecond period */
     175     outport_byte(TIMER_MODE, TIMER_SEL0|TIMER_16BIT|TIMER_RATEGEN);
     176     outport_byte(TIMER_CNTR0, US_TO_TICK(US_PER_ISR) >> 0 & 0xff);
     177     outport_byte(TIMER_CNTR0, US_TO_TICK(US_PER_ISR) >> 8 & 0xff);
     178    /*
     179     * disable interrrupt at i8259 level
     180     */
     181     pc386_irq_enable_at_i8259s(used->idtIndex - PC386_IRQ_VECTOR_BASE);
     182}
     183
     184static rtems_raw_irq_connect_data timer_raw_irq_data = {
     185  PC_386_PERIODIC_TIMER + PC386_IRQ_VECTOR_BASE,
     186  timerisr,
     187  timerOn,
     188  timerOff,
     189  clockIsOn
     190};
     191
     192/*-------------------------------------------------------------------------+
     193|         Function: Timer_exit
     194|      Description: Timer cleanup routine at RTEMS exit. NOTE: This routine is
     195|                   not really necessary, since there will be a reset at exit.
     196| Global Variables: None.
     197|        Arguments: None.
     198|          Returns: Nothing.
     199+--------------------------------------------------------------------------*/
     200void
    161201Timer_exit(void)
    162202{
    163   /* reset timer mode to standard (DOS) value */
    164   outport_byte(TIMER_MODE, TIMER_SEL0|TIMER_16BIT|TIMER_RATEGEN);
    165   outport_byte(TIMER_CNTR0, 0);
    166   outport_byte(TIMER_CNTR0, 0);
     203  i386_delete_idt_entry (&timer_raw_irq_data);
    167204} /* Timer_exit */
    168 
    169205
    170206/*-------------------------------------------------------------------------+
     
    185221
    186222    atexit(Timer_exit); /* Try not to hose the system at exit. */
    187 
    188     /* install a raw interrupt handler for timer */
    189     PC386_installRawIrqHandler(TIMER_IRQ, timerisr);
    190 
    191     /* load timer for US_PER_ISR microsecond period */
    192     outport_byte(TIMER_MODE, TIMER_SEL0|TIMER_16BIT|TIMER_RATEGEN);
    193     outport_byte(TIMER_CNTR0, US_TO_TICK(US_PER_ISR) >> 0 & 0xff);
    194     outport_byte(TIMER_CNTR0, US_TO_TICK(US_PER_ISR) >> 8 & 0xff);
     223    if (!i386_set_idt_entry (&timer_raw_irq_data)) {
     224      printk("raw handler connexion failed\n");
     225      rtems_fatal_error_occurred(1);
     226    }
    195227  }
    196228  /* wait for ISR to be called at least once */
  • c/src/lib/wrapup/Makefile.in

    r73452854 r67a2288  
    1717 
    1818SRCS=$(wildcard $(PROJECT_RELEASE)/lib/libbsp$(LIB_VARIANT).a) \
     19     $(PROJECT_RELEASE)/lib/libcpu$(LIB_VARIANT).a \
    1920     $(PROJECT_RELEASE)/lib/librtems$(LIB_VARIANT).a \
    2021     $(wildcard $(PROJECT_RELEASE)/lib/libposix$(LIB_VARIANT).a) \
  • c/src/wrapup/Makefile.in

    r73452854 r67a2288  
    1717 
    1818SRCS=$(wildcard $(PROJECT_RELEASE)/lib/libbsp$(LIB_VARIANT).a) \
     19     $(PROJECT_RELEASE)/lib/libcpu$(LIB_VARIANT).a \
    1920     $(PROJECT_RELEASE)/lib/librtems$(LIB_VARIANT).a \
    2021     $(wildcard $(PROJECT_RELEASE)/lib/libposix$(LIB_VARIANT).a) \
  • configure

    r73452854 r67a2288  
    30133013
    30143014
     3015       
     3016echo $ac_n "checking for Makefile.in in c/src/lib/libbsp/${bspcpudir}shared""... $ac_c" 1>&6
     3017echo "configure:3018: checking for Makefile.in in c/src/lib/libbsp/${bspcpudir}shared" >&5
     3018if test -d $srcdir/c/src/lib/libbsp/${bspcpudir}shared; then
     3019  rtems_av_save_dir=`pwd`;
     3020  cd $srcdir;
     3021  rtems_av_tmp=`find c/src/lib/libbsp/${bspcpudir}shared -name "Makefile.in" -print | sed "s/Makefile\.in/%/" | sort | sed "s/%/Makefile/"`
     3022  makefiles="$makefiles $rtems_av_tmp";
     3023  cd $rtems_av_save_dir;
     3024  echo "$ac_t""done" 1>&6
     3025else
     3026  echo "$ac_t""no" 1>&6
     3027fi
     3028
     3029
    30153030      fi
    30163031    else
     
    30233038
    30243039echo $ac_n "checking for Makefile.in in c/src/lib/libcpu/$target_cpu""... $ac_c" 1>&6
    3025 echo "configure:3026: checking for Makefile.in in c/src/lib/libcpu/$target_cpu" >&5
     3040echo "configure:3041: checking for Makefile.in in c/src/lib/libcpu/$target_cpu" >&5
    30263041if test -d $srcdir/c/src/lib/libcpu/$target_cpu; then
    30273042  rtems_av_save_dir=`pwd`;
     
    30403055 
    30413056echo $ac_n "checking for Makefile.in in c/src/lib/start/$target_cpu""... $ac_c" 1>&6
    3042 echo "configure:3043: checking for Makefile.in in c/src/lib/start/$target_cpu" >&5
     3057echo "configure:3058: checking for Makefile.in in c/src/lib/start/$target_cpu" >&5
    30433058if test -d $srcdir/c/src/lib/start/$target_cpu; then
    30443059  rtems_av_save_dir=`pwd`;
     
    30823097# If the tests are enabled, then find all the test suite Makefiles
    30833098echo $ac_n "checking if the test suites are enabled? ""... $ac_c" 1>&6
    3084 echo "configure:3085: checking if the test suites are enabled? " >&5
     3099echo "configure:3100: checking if the test suites are enabled? " >&5
    30853100tests_enabled=yes
    30863101# Check whether --enable-tests or --disable-tests was given.
     
    31013116
    31023117echo $ac_n "checking for Makefile.in in c/src/tests/tools/$target_cpu""... $ac_c" 1>&6
    3103 echo "configure:3104: checking for Makefile.in in c/src/tests/tools/$target_cpu" >&5
     3118echo "configure:3119: checking for Makefile.in in c/src/tests/tools/$target_cpu" >&5
    31043119if test -d $srcdir/c/src/tests/tools/$target_cpu; then
    31053120  rtems_av_save_dir=`pwd`;
     
    31183133   
    31193134echo $ac_n "checking for Makefile.in in c/src/tests/libtests""... $ac_c" 1>&6
    3120 echo "configure:3121: checking for Makefile.in in c/src/tests/libtests" >&5
     3135echo "configure:3136: checking for Makefile.in in c/src/tests/libtests" >&5
    31213136if test -d $srcdir/c/src/tests/libtests; then
    31223137  rtems_av_save_dir=`pwd`;
     
    31333148   
    31343149echo $ac_n "checking for Makefile.in in c/src/tests/sptests""... $ac_c" 1>&6
    3135 echo "configure:3136: checking for Makefile.in in c/src/tests/sptests" >&5
     3150echo "configure:3151: checking for Makefile.in in c/src/tests/sptests" >&5
    31363151if test -d $srcdir/c/src/tests/sptests; then
    31373152  rtems_av_save_dir=`pwd`;
     
    31483163   
    31493164echo $ac_n "checking for Makefile.in in c/src/tests/tmtests""... $ac_c" 1>&6
    3150 echo "configure:3151: checking for Makefile.in in c/src/tests/tmtests" >&5
     3165echo "configure:3166: checking for Makefile.in in c/src/tests/tmtests" >&5
    31513166if test -d $srcdir/c/src/tests/tmtests; then
    31523167  rtems_av_save_dir=`pwd`;
     
    31633178   
    31643179echo $ac_n "checking for Makefile.in in c/src/tests/mptests""... $ac_c" 1>&6
    3165 echo "configure:3166: checking for Makefile.in in c/src/tests/mptests" >&5
     3180echo "configure:3181: checking for Makefile.in in c/src/tests/mptests" >&5
    31663181if test -d $srcdir/c/src/tests/mptests; then
    31673182  rtems_av_save_dir=`pwd`;
     
    31793194     
    31803195echo $ac_n "checking for Makefile.in in c/src/tests/psxtests""... $ac_c" 1>&6
    3181 echo "configure:3182: checking for Makefile.in in c/src/tests/psxtests" >&5
     3196echo "configure:3197: checking for Makefile.in in c/src/tests/psxtests" >&5
    31823197if test -d $srcdir/c/src/tests/psxtests; then
    31833198  rtems_av_save_dir=`pwd`;
     
    31973212# If the HWAPI is enabled, the find the HWAPI Makefiles
    31983213echo $ac_n "checking if the HWAPI is enabled? ""... $ac_c" 1>&6
    3199 echo "configure:3200: checking if the HWAPI is enabled? " >&5
     3214echo "configure:3215: checking if the HWAPI is enabled? " >&5
    32003215# Check whether --enable-hwapi or --disable-hwapi was given.
    32013216if test "${enable_hwapi+set}" = set; then
     
    32083223           
    32093224echo $ac_n "checking for Makefile.in in c/src/lib/libhwapi/analog""... $ac_c" 1>&6
    3210 echo "configure:3211: checking for Makefile.in in c/src/lib/libhwapi/analog" >&5
     3225echo "configure:3226: checking for Makefile.in in c/src/lib/libhwapi/analog" >&5
    32113226if test -d $srcdir/c/src/lib/libhwapi/analog; then
    32123227  rtems_av_save_dir=`pwd`;
     
    32233238           
    32243239echo $ac_n "checking for Makefile.in in c/src/lib/libhwapi/discrete""... $ac_c" 1>&6
    3225 echo "configure:3226: checking for Makefile.in in c/src/lib/libhwapi/discrete" >&5
     3240echo "configure:3241: checking for Makefile.in in c/src/lib/libhwapi/discrete" >&5
    32263241if test -d $srcdir/c/src/lib/libhwapi/discrete; then
    32273242  rtems_av_save_dir=`pwd`;
     
    32383253           
    32393254echo $ac_n "checking for Makefile.in in c/src/lib/libhwapi/drivers""... $ac_c" 1>&6
    3240 echo "configure:3241: checking for Makefile.in in c/src/lib/libhwapi/drivers" >&5
     3255echo "configure:3256: checking for Makefile.in in c/src/lib/libhwapi/drivers" >&5
    32413256if test -d $srcdir/c/src/lib/libhwapi/drivers; then
    32423257  rtems_av_save_dir=`pwd`;
     
    32533268           
    32543269echo $ac_n "checking for Makefile.in in c/src/lib/libhwapi/non_volatile_memory""... $ac_c" 1>&6
    3255 echo "configure:3256: checking for Makefile.in in c/src/lib/libhwapi/non_volatile_memory" >&5
     3270echo "configure:3271: checking for Makefile.in in c/src/lib/libhwapi/non_volatile_memory" >&5
    32563271if test -d $srcdir/c/src/lib/libhwapi/non_volatile_memory; then
    32573272  rtems_av_save_dir=`pwd`;
     
    32683283           
    32693284echo $ac_n "checking for Makefile.in in c/src/lib/libhwapi/serial""... $ac_c" 1>&6
    3270 echo "configure:3271: checking for Makefile.in in c/src/lib/libhwapi/serial" >&5
     3285echo "configure:3286: checking for Makefile.in in c/src/lib/libhwapi/serial" >&5
    32713286if test -d $srcdir/c/src/lib/libhwapi/serial; then
    32723287  rtems_av_save_dir=`pwd`;
     
    32833298           
    32843299echo $ac_n "checking for Makefile.in in c/src/lib/libhwapi/support""... $ac_c" 1>&6
    3285 echo "configure:3286: checking for Makefile.in in c/src/lib/libhwapi/support" >&5
     3300echo "configure:3301: checking for Makefile.in in c/src/lib/libhwapi/support" >&5
    32863301if test -d $srcdir/c/src/lib/libhwapi/support; then
    32873302  rtems_av_save_dir=`pwd`;
     
    32983313           
    32993314echo $ac_n "checking for Makefile.in in c/src/lib/libhwapi/wrapup""... $ac_c" 1>&6
    3300 echo "configure:3301: checking for Makefile.in in c/src/lib/libhwapi/wrapup" >&5
     3315echo "configure:3316: checking for Makefile.in in c/src/lib/libhwapi/wrapup" >&5
    33013316if test -d $srcdir/c/src/lib/libhwapi/wrapup; then
    33023317  rtems_av_save_dir=`pwd`;
     
    33433358
    33443359echo $ac_n "checking for Makefile.in in c/build-tools""... $ac_c" 1>&6
    3345 echo "configure:3346: checking for Makefile.in in c/build-tools" >&5
     3360echo "configure:3361: checking for Makefile.in in c/build-tools" >&5
    33463361if test -d $srcdir/c/build-tools; then
    33473362  rtems_av_save_dir=`pwd`;
     
    33583373
    33593374echo $ac_n "checking for Makefile.in in make""... $ac_c" 1>&6
    3360 echo "configure:3361: checking for Makefile.in in make" >&5
     3375echo "configure:3376: checking for Makefile.in in make" >&5
    33613376if test -d $srcdir/make; then
    33623377  rtems_av_save_dir=`pwd`;
     
    33733388
    33743389echo $ac_n "checking for Makefile.in in c/src/lib/libmisc""... $ac_c" 1>&6
    3375 echo "configure:3376: checking for Makefile.in in c/src/lib/libmisc" >&5
     3390echo "configure:3391: checking for Makefile.in in c/src/lib/libmisc" >&5
    33763391if test -d $srcdir/c/src/lib/libmisc; then
    33773392  rtems_av_save_dir=`pwd`;
     
    33883403
    33893404echo $ac_n "checking for Makefile.in in c/src/tests/samples""... $ac_c" 1>&6
    3390 echo "configure:3391: checking for Makefile.in in c/src/tests/samples" >&5
     3405echo "configure:3406: checking for Makefile.in in c/src/tests/samples" >&5
    33913406if test -d $srcdir/c/src/tests/samples; then
    33923407  rtems_av_save_dir=`pwd`;
  • configure.in

    r73452854 r67a2288  
    330330        bspdirs="$bspdirs $bspdir"
    331331        RTEMS_CHECK_MAKEFILE(c/src/lib/libbsp/$bspcpudir$bspdir)
     332        RTEMS_CHECK_MAKEFILE(c/src/lib/libbsp/${bspcpudir}shared)
    332333      fi
    333334    else
  • cpukit/score/cpu/i386/cpu.c

    r73452854 r67a2288  
    7777}
    7878 
    79 /*PAGE
    80  *
    81  *  _CPU_ISR_install_raw_handler
    82  */
    83  
    84 #if __GO32__
    85 #include <go32.h>
    86 #include <dpmi.h>
    87 #endif /* __GO32__ */
    88 
    89 void _CPU_ISR_install_raw_handler(
    90   unsigned32  vector,
    91   proc_ptr    new_handler,
    92   proc_ptr   *old_handler
    93 )
    94 {
    95 #if __GO32__
    96     _go32_dpmi_seginfo handler_info;
    97  
    98     /* get the address of the old handler */
    99     _go32_dpmi_get_protected_mode_interrupt_vector( vector, &handler_info);
    100  
    101     /* Notice how we're failing to save the pm_segment portion of the */
    102     /* structure here?  That means we might crash the system if we  */
    103     /* try to restore the ISR.  Can't fix this until i386_isr is  */
    104     /* redefined.  XXX [BHC].           */
    105     *old_handler = (proc_ptr *) handler_info.pm_offset;
    106 
    107     handler_info.pm_offset = (u_long) new_handler;
    108     handler_info.pm_selector = _go32_my_cs();
    109 
    110     /* install the IDT entry */
    111     _go32_dpmi_set_protected_mode_interrupt_vector( vector, &handler_info );
    112 #else
    113   i386_IDT_slot idt;
    114   unsigned32    handler;
    115 
    116   *old_handler =  0;    /* XXX not supported */
    117 
    118   handler = (unsigned32) new_handler;
    119 
    120   /* build the IDT entry */
    121   idt.offset_0_15      = handler & 0xffff;
    122   idt.segment_selector = i386_get_cs();
    123   idt.reserved         = 0x00;
    124   idt.p_dpl            = 0x8e;         /* present, ISR */
    125   idt.offset_16_31     = handler >> 16;
    126 
    127   /* install the IDT entry */
    128   i386_Install_idt(
    129     (unsigned32) &idt,
    130     _CPU_Table.interrupt_table_segment,
    131     (unsigned32) _CPU_Table.interrupt_table_offset + (8 * vector)
    132   );
    133 #endif
    134 }
    135 
    136 /*PAGE
    137  *
    138  *  _CPU_ISR_install_vector
    139  *
    140  *  This kernel routine installs the RTEMS handler for the
    141  *  specified vector.
    142  *
    143  *  Input parameters:
    144  *    vector      - interrupt vector number
    145  *    old_handler - former ISR for this vector number
    146  *    new_handler - replacement ISR for this vector number
    147  *
    148  *  Output parameters:  NONE
    149  *
    150  */
    151 
    152 void _ISR_Handler_0(), _ISR_Handler_1();
    153 
    154 #define PER_ISR_ENTRY \
    155     (((unsigned32) _ISR_Handler_1 - (unsigned32) _ISR_Handler_0))
    156 
    157 #define _Interrupt_Handler_entry( _vector ) \
    158    (((unsigned32)_ISR_Handler_0) + ((_vector) * PER_ISR_ENTRY))
    159 
    160 void _CPU_ISR_install_vector(
    161   unsigned32  vector,
    162   proc_ptr    new_handler,
    163   proc_ptr   *old_handler
    164 )
    165 {
    166   proc_ptr      ignored;
    167   unsigned32    unique_handler;
    168 
    169   *old_handler = _ISR_Vector_table[ vector ];
    170 
    171   /* calculate the unique entry point for this vector */
    172   unique_handler = _Interrupt_Handler_entry( vector );
    173 
    174   _CPU_ISR_install_raw_handler( vector, (void *)unique_handler, &ignored );
    175 
    176   _ISR_Vector_table[ vector ] = new_handler;
    177 }
Note: See TracChangeset for help on using the changeset viewer.