diff options
author | Ralf Corsepius <ralf.corsepius@rtems.org> | 2004-04-21 10:43:04 +0000 |
---|---|---|
committer | Ralf Corsepius <ralf.corsepius@rtems.org> | 2004-04-21 10:43:04 +0000 |
commit | 6128a4aa5e791ed4e0a655bfd346a52d92da7883 (patch) | |
tree | af53ca3f67ce405b6fbc6c98399c8e0c87e01a9e /c/src/lib/libbsp/i386/shared/irq | |
parent | 2004-04-20 Ralf Corsepius <ralf_corsepius@rtems.org> (diff) | |
download | rtems-6128a4aa5e791ed4e0a655bfd346a52d92da7883.tar.bz2 |
Remove stray white spaces.
Diffstat (limited to 'c/src/lib/libbsp/i386/shared/irq')
-rw-r--r-- | c/src/lib/libbsp/i386/shared/irq/idt.c | 38 | ||||
-rw-r--r-- | c/src/lib/libbsp/i386/shared/irq/irq.c | 32 | ||||
-rw-r--r-- | c/src/lib/libbsp/i386/shared/irq/irq.h | 20 | ||||
-rw-r--r-- | c/src/lib/libbsp/i386/shared/irq/irq_asm.S | 34 | ||||
-rw-r--r-- | c/src/lib/libbsp/i386/shared/irq/irq_init.c | 12 |
5 files changed, 68 insertions, 68 deletions
diff --git a/c/src/lib/libbsp/i386/shared/irq/idt.c b/c/src/lib/libbsp/i386/shared/irq/idt.c index ea6490f157..a81c6358c6 100644 --- a/c/src/lib/libbsp/i386/shared/irq/idt.c +++ b/c/src/lib/libbsp/i386/shared/irq/idt.c @@ -30,9 +30,9 @@ void create_interrupt_gate_descriptor (interrupt_gate_descriptor* idtEntry, rtems_raw_irq_hdl hdl) { idtEntry->low_offsets_bits = (((unsigned) hdl) & 0xffff); - idtEntry->segment_selector = i386_get_cs(); + idtEntry->segment_selector = i386_get_cs(); idtEntry->fixed_value_bits = 0; - idtEntry->gate_type = 0xe; + idtEntry->gate_type = 0xe; idtEntry->privilege = 0; idtEntry->present = 1; idtEntry->high_offsets_bits = ((((unsigned) hdl) >> 16) & 0xffff); @@ -45,15 +45,15 @@ rtems_raw_irq_hdl get_hdl_from_vector(rtems_vector_offset index) unsigned limit; i386_get_info_from_IDTR (&idt_entry_tbl, &limit); - + /* Convert limit into number of entries */ limit = (limit + 1) / sizeof(interrupt_gate_descriptor); - + if(index >= limit) { return 0; } - * ((unsigned int*) &hdl) = (idt_entry_tbl[index].low_offsets_bits | + * ((unsigned int*) &hdl) = (idt_entry_tbl[index].low_offsets_bits | (idt_entry_tbl[index].high_offsets_bits << 16)); return hdl; } @@ -64,7 +64,7 @@ int i386_set_idt_entry (const rtems_raw_irq_connect_data* irq) unsigned limit; unsigned int level; - + i386_get_info_from_IDTR (&idt_entry_tbl, &limit); /* Convert limit into number of entries */ @@ -85,11 +85,11 @@ int i386_set_idt_entry (const rtems_raw_irq_connect_data* irq) } _CPU_ISR_Disable(level); - + raw_irq_table [irq->idtIndex] = *irq; create_interrupt_gate_descriptor (&idt_entry_tbl[irq->idtIndex], irq->hdl); irq->on(irq); - + _CPU_ISR_Enable(level); return 1; } @@ -102,7 +102,7 @@ void _CPU_ISR_install_vector (unsigned vector, unsigned limit; interrupt_gate_descriptor new; unsigned int level; - + i386_get_info_from_IDTR (&idt_entry_tbl, &limit); /* Convert limit into number of entries */ @@ -120,7 +120,7 @@ void _CPU_ISR_install_vector (unsigned vector, _CPU_ISR_Enable(level); } - + int i386_get_current_idt_entry (rtems_raw_irq_connect_data* irq) { interrupt_gate_descriptor* idt_entry_tbl; @@ -135,9 +135,9 @@ int i386_get_current_idt_entry (rtems_raw_irq_connect_data* irq) return 0; } raw_irq_table [irq->idtIndex].hdl = get_hdl_from_vector(irq->idtIndex); - + *irq = raw_irq_table [irq->idtIndex]; - + return 1; } @@ -146,7 +146,7 @@ int i386_delete_idt_entry (const rtems_raw_irq_connect_data* irq) interrupt_gate_descriptor* idt_entry_tbl; unsigned limit; unsigned int level; - + i386_get_info_from_IDTR (&idt_entry_tbl, &limit); /* Convert limit into number of entries */ @@ -170,12 +170,12 @@ int i386_delete_idt_entry (const rtems_raw_irq_connect_data* irq) idt_entry_tbl[irq->idtIndex] = default_idt_entry; irq->off(irq); - + raw_irq_table[irq->idtIndex] = default_raw_irq_entry; raw_irq_table[irq->idtIndex].idtIndex = irq->idtIndex; _CPU_ISR_Enable(level); - + return 1; } @@ -188,12 +188,12 @@ int i386_init_idt (rtems_raw_irq_global_settings* config) unsigned i; unsigned level; interrupt_gate_descriptor* idt_entry_tbl; - + i386_get_info_from_IDTR (&idt_entry_tbl, &limit); /* Convert limit into number of entries */ limit = (limit + 1) / sizeof(interrupt_gate_descriptor); - + if (config->idtSize != limit) { return 0; } @@ -241,7 +241,7 @@ int i386_set_gdt_entry (unsigned short segment_selector, unsigned base, unsigned int limit_adjusted; segment_descriptors* gdt_entry_tbl; - + i386_get_info_from_GDTR (&gdt_entry_tbl, &gdt_limit); if (segment_selector > limit) { @@ -283,6 +283,6 @@ int i386_set_gdt_entry (unsigned short segment_selector, unsigned base, : "=r" (tmp_segment) : "0" (tmp_segment) ); - + return 1; } diff --git a/c/src/lib/libbsp/i386/shared/irq/irq.c b/c/src/lib/libbsp/i386/shared/irq/irq.c index ad04ac314e..1fae59f777 100644 --- a/c/src/lib/libbsp/i386/shared/irq/irq.c +++ b/c/src/lib/libbsp/i386/shared/irq/irq.c @@ -60,7 +60,7 @@ rtems_i8259_masks i8259s_cache = 0xFFFB; | Description: Mask IRQ line in appropriate PIC chip. | Global Variables: i8259s_cache | Arguments: vector_offset - number of IRQ line to mask. -| Returns: Nothing. +| Returns: Nothing. +--------------------------------------------------------------------------*/ int BSP_irq_disable_at_i8259s (const rtems_irq_symbolic_name irqLine) { @@ -71,12 +71,12 @@ int BSP_irq_disable_at_i8259s (const rtems_irq_symbolic_name irqLine) ((int)irqLine > BSP_MAX_OFFSET ) ) return 1; - + _CPU_ISR_Disable(level); - + mask = 1 << irqLine; i8259s_cache |= mask; - + if (irqLine < 8) { outport_byte(PIC_MASTER_IMR_IO_PORT, i8259s_cache & 0xff); @@ -88,14 +88,14 @@ int BSP_irq_disable_at_i8259s (const rtems_irq_symbolic_name irqLine) _CPU_ISR_Enable (level); return 0; -} +} /*-------------------------------------------------------------------------+ | Function: BSP_irq_enable_at_i8259s | Description: Unmask IRQ line in appropriate PIC chip. | Global Variables: i8259s_cache | Arguments: irqLine - number of IRQ line to mask. -| Returns: Nothing. +| Returns: Nothing. +--------------------------------------------------------------------------*/ int BSP_irq_enable_at_i8259s (const rtems_irq_symbolic_name irqLine) { @@ -108,10 +108,10 @@ int BSP_irq_enable_at_i8259s (const rtems_irq_symbolic_name irqLine) return 1; _CPU_ISR_Disable(level); - + mask = ~(1 << irqLine); i8259s_cache &= mask; - + if (irqLine < 8) { outport_byte(PIC_MASTER_IMR_IO_PORT, i8259s_cache & 0xff); @@ -137,14 +137,14 @@ int BSP_irq_enabled_at_i8259s (const rtems_irq_symbolic_name irqLine) mask = (1 << irqLine); return (~(i8259s_cache & mask)); } - + /*-------------------------------------------------------------------------+ | Function: BSP_irq_ack_at_i8259s | Description: Signal generic End Of Interrupt (EOI) to appropriate PIC. | Global Variables: None. | Arguments: irqLine - number of IRQ line to acknowledge. -| Returns: Nothing. +| Returns: Nothing. +--------------------------------------------------------------------------*/ int BSP_irq_ack_at_i8259s (const rtems_irq_symbolic_name irqLine) { @@ -165,7 +165,7 @@ int BSP_irq_ack_at_i8259s (const rtems_irq_symbolic_name irqLine) /* * ------------------------ RTEMS Irq helper functions ---------------- */ - + /* * Caution : this function assumes the variable "internal_config" * is already set and that the tables it contains are still valid @@ -224,7 +224,7 @@ static int isValidInterrupt(int irq) int BSP_install_rtems_irq_handler (const rtems_irq_connect_data* irq) { unsigned int level; - + if (!isValidInterrupt(irq->name)) { return 0; } @@ -257,7 +257,7 @@ int BSP_install_rtems_irq_handler (const rtems_irq_connect_data* irq) * Enable interrupt on device */ irq->on(irq); - + _CPU_ISR_Enable(level); return 1; @@ -280,7 +280,7 @@ int BSP_get_current_rtems_irq_handler (rtems_irq_connect_data* irq) int BSP_remove_rtems_irq_handler (const rtems_irq_connect_data* irq) { unsigned int level; - + if (!isValidInterrupt(irq->name)) { return 0; } @@ -313,7 +313,7 @@ int BSP_remove_rtems_irq_handler (const rtems_irq_connect_data* irq) rtems_hdl_tbl[irq->name] = default_rtems_entry; current_irq[irq->name] = default_rtems_entry.hdl; - + _CPU_ISR_Enable(level); return 1; @@ -363,7 +363,7 @@ int BSP_rtems_irq_mngt_get(rtems_irq_global_settings** config) { *config = internal_config; return 0; -} +} void _ThreadProcessSignalsFromIrq (CPU_Exception_frame* ctx) { diff --git a/c/src/lib/libbsp/i386/shared/irq/irq.h b/c/src/lib/libbsp/i386/shared/irq/irq.h index fa82c0233d..3a1add8355 100644 --- a/c/src/lib/libbsp/i386/shared/irq/irq.h +++ b/c/src/lib/libbsp/i386/shared/irq/irq.h @@ -28,7 +28,7 @@ extern "C" { /* * Include some preprocessor value also used by assember code */ - + #include <irq_asm.h> #include <rtems.h> /*-------------------------------------------------------------------------+ @@ -37,7 +37,7 @@ extern "C" { typedef enum { /* Base vector for our IRQ handlers. */ - BSP_IRQ_VECTOR_BASE = BSP_ASM_IRQ_VECTOR_BASE, + BSP_IRQ_VECTOR_BASE = BSP_ASM_IRQ_VECTOR_BASE, BSP_IRQ_LINES_NUMBER = 16, BSP_LOWEST_OFFSET = 0, BSP_MAX_OFFSET = BSP_IRQ_LINES_NUMBER - 1, @@ -46,7 +46,7 @@ typedef enum { * NB : 1) Interrupt vector number in IDT = offset + BSP_ASM_IRQ_VECTOR_BASE * 2) The same name should be defined on all architecture * so that handler connexion can be unchanged. - */ + */ BSP_PERIODIC_TIMER = 0, BSP_KEYBOARD = 1, @@ -56,11 +56,11 @@ typedef enum { BSP_UART_COM1_IRQ = 4, BSP_RT_TIMER1 = 8, - + BSP_RT_TIMER3 = 10 } rtems_irq_symbolic_name; - + /* @@ -94,9 +94,9 @@ typedef struct __rtems_irq_connect_data__ { * It is usually called immediately AFTER connecting the interrupt handler. * RTEMS may well need such a function when restoring normal interrupt * processing after a debug session. - * + * */ - rtems_irq_enable on; + rtems_irq_enable on; /* * function for disabling interrupts at device level (ONLY!). * The code will disable it at i8259s level. RATIONALE : anyway @@ -132,7 +132,7 @@ typedef struct { rtems_irq_symbolic_name irqBase; /* * software priorities associated with interrupts. - * if irqPrio [i] > intrPrio [j] it means that + * if irqPrio [i] > intrPrio [j] it means that * interrupt handler hdl connected for interrupt name i * will not be interrupted by the handler connected for interrupt j * The interrupt source will be physically masked at i8259 level. @@ -209,7 +209,7 @@ int BSP_irq_enabled_at_i8259s (const rtems_irq_symbolic_name irqLine); * 4) perform rescheduling when necessary, * 5) restore the C scratch registers... * 6) restore initial execution flow - * + * */ int BSP_install_rtems_irq_handler (const rtems_irq_connect_data*); /* @@ -252,7 +252,7 @@ int BSP_rtems_irq_mngt_set(rtems_irq_global_settings* config); * (Re) get info on current RTEMS interrupt management. */ int BSP_rtems_irq_mngt_get(rtems_irq_global_settings**); - + #ifdef __cplusplus } #endif diff --git a/c/src/lib/libbsp/i386/shared/irq/irq_asm.S b/c/src/lib/libbsp/i386/shared/irq/irq_asm.S index a4bc1a2299..9c5e327379 100644 --- a/c/src/lib/libbsp/i386/shared/irq/irq_asm.S +++ b/c/src/lib/libbsp/i386/shared/irq/irq_asm.S @@ -15,8 +15,8 @@ #include <irq_asm.h> BEGIN_CODE - -SYM (_ISR_Handler): + +SYM (_ISR_Handler): /* * Before this was point is reached the vectors unique * entry point did the following: @@ -77,7 +77,7 @@ SYM (_ISR_Handler): outb $PIC_SLAVE_COMMAND_IO_PORT .master: outb $PIC_MASTER_COMMAND_IO_PORT - + .check_stack_switch: pushl ebp movl esp, ebp /* ebp = previous stack pointer */ @@ -100,12 +100,12 @@ nested: * interrupt source is now masked via i8259 */ sti - + /* * ECX is preloaded with the vector number but it is a scratch register * so we must save it again. */ - + pushl ecx /* push vector number */ mov SYM (current_irq) (,ecx,4),eax /* eax = Users handler */ @@ -129,8 +129,8 @@ nested: outb $PIC_MASTER_IMR_IO_PORT movb ah, al outb $PIC_SLAVE_IMR_IO_PORT - - + + decl SYM (_ISR_Nest_level) /* one less ISR nest level */ /* If interrupts are nested, */ /* then dispatching is disabled */ @@ -149,13 +149,13 @@ nested: /* while in interrupt handler? */ je .exit /* No, exit */ - + .bframe: movl $0, SYM (_ISR_Signals_to_thread_executing) /* * This code is the less critical path. In order to have a single - * Thread Context, we take the same frame than the one pushed on - * exceptions. This makes sense because Signal is a software + * Thread Context, we take the same frame than the one pushed on + * exceptions. This makes sense because Signal is a software * exception. */ popl edx @@ -172,11 +172,11 @@ nested: popa addl $8, esp iret - + .schedule: /* * the scratch registers have already been saved and we are already - * back on the thread system stack. So we can call _Thread_Displatch + * back on the thread system stack. So we can call _Thread_Displatch * directly */ call _Thread_Dispatch @@ -203,7 +203,7 @@ nested: popl eax iret - + #define DISTINCT_INTERRUPT_ENTRY(_vector) \ .p2align 4 ; \ PUBLIC (rtems_irq_prologue_ ## _vector ) ; \ @@ -230,21 +230,21 @@ DISTINCT_INTERRUPT_ENTRY(12) DISTINCT_INTERRUPT_ENTRY(13) DISTINCT_INTERRUPT_ENTRY(14) DISTINCT_INTERRUPT_ENTRY(15) - + /* * routine used to initialize the IDT by default */ - + PUBLIC (default_raw_idt_handler) PUBLIC (raw_idt_notify) - + SYM (default_raw_idt_handler): pusha cld call raw_idt_notify popa iret - + END_CODE END diff --git a/c/src/lib/libbsp/i386/shared/irq/irq_init.c b/c/src/lib/libbsp/i386/shared/irq/irq_init.c index 128a474462..7a54329082 100644 --- a/c/src/lib/libbsp/i386/shared/irq/irq_init.c +++ b/c/src/lib/libbsp/i386/shared/irq/irq_init.c @@ -99,9 +99,9 @@ static rtems_irq_prio irqPrioTable[BSP_IRQ_LINES_NUMBER]={ 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; - - + + static interrupt_gate_descriptor idtEntry; static rtems_irq_global_settings initial_config; @@ -128,7 +128,7 @@ void rtems_irq_mngt_init() printk("IDT table size mismatch !!! System locked\n"); while(1); } - + _CPU_ISR_Disable(level); @@ -143,7 +143,7 @@ void rtems_irq_mngt_init() raw_initial_config.idtSize = IDT_SIZE; raw_initial_config.defaultRawEntry = defaultRawIrq; raw_initial_config.rawIrqHdlTbl = idtHdl; - + if (!i386_init_idt (&raw_initial_config)) { /* * put something here that will show the failure... @@ -189,7 +189,7 @@ void rtems_irq_mngt_init() } /* - * #define DEBUG + * #define DEBUG */ #ifdef DEBUG { @@ -206,5 +206,5 @@ void rtems_irq_mngt_init() } printk("i8259s_cache = %x\n", * (unsigned short*) &i8259s_cache); BSP_wait_polled_input(); -#endif +#endif } |