Changeset 67a2288 in rtems for c/src/exec/score/cpu/i386/cpu.c
- Timestamp:
- 07/23/98 22:02:34 (25 years ago)
- Branches:
- 4.10, 4.11, 4.8, 4.9, 5, master
- Children:
- dbaf51a
- Parents:
- 73452854
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
c/src/exec/score/cpu/i386/cpu.c
r73452854 r67a2288 77 77 } 78 78 79 /*PAGE80 *81 * _CPU_ISR_install_raw_handler82 */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_handler93 )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 #else113 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 #endif134 }135 136 /*PAGE137 *138 * _CPU_ISR_install_vector139 *140 * This kernel routine installs the RTEMS handler for the141 * specified vector.142 *143 * Input parameters:144 * vector - interrupt vector number145 * old_handler - former ISR for this vector number146 * new_handler - replacement ISR for this vector number147 *148 * Output parameters: NONE149 *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_handler164 )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.