summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/i386/shared/irq
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1998-10-05 22:36:06 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1998-10-05 22:36:06 +0000
commit0ebbf66b0ee518763ee38b4ac28c7d3b6feaadf1 (patch)
tree4092e08f36cef683d4eb0b38687023b93f33b63c /c/src/lib/libbsp/i386/shared/irq
parentNew file based on information from Eric Norum <eric@skatter.usask.ca>. (diff)
downloadrtems-0ebbf66b0ee518763ee38b4ac28c7d3b6feaadf1.tar.bz2
Large patch from Erik Ivanenko <erik.ivanenko@utoronto.ca> which
moves pieces of the pc386 bsp up to a shared level for all i386 BSPs and modifies the i386ex BSP to use those shared pieces. Serial remote debugging is included for both targets. Erik's notes: There are several workarounds in it: 1) #define NEXT_GAS is hardcoded in pc386/start/start.s 2) #define NEXT_GAS is hardcoded in i386ex/start/start.s 3) #define NEW_GAS is hardcoded in pc386/start16.s 4) #undef __assert and redeclare _assert hardcoded in console.c for both pc386 and i386ex due to my egcs1.1b ~ newlib problem. Should have modified t-rtems.cfg ( no time ) I've tested pc386 with both video and serial consoles and GDB remote. All work fine, except that GDB acts weird. ( re: other posting) I hope this will work for you. It took quite some time to locate the autoconf error. The remainder was just grunt work. Unfortunately, I think I've unwound the removal of the IBMPCInitVideo stuff. Sorry. I REALLY can't spend more time... I've been at this conversion to 4.0 locally and updating the release since Sept. 8th, and have yet to compile my network driver.... This is as much as I can do right now. I look forward to the next patch to really test i368ex. I did make sure that the sample tests worked for pc386.
Diffstat (limited to '')
-rw-r--r--c/src/lib/libbsp/i386/shared/irq/irq.c60
-rw-r--r--c/src/lib/libbsp/i386/shared/irq/irq.h48
-rw-r--r--c/src/lib/libbsp/i386/shared/irq/irq_asm.h2
-rw-r--r--c/src/lib/libbsp/i386/shared/irq/irq_init.c20
4 files changed, 65 insertions, 65 deletions
diff --git a/c/src/lib/libbsp/i386/shared/irq/irq.c b/c/src/lib/libbsp/i386/shared/irq/irq.c
index 9dea372e0f..cd38ec51c4 100644
--- a/c/src/lib/libbsp/i386/shared/irq/irq.c
+++ b/c/src/lib/libbsp/i386/shared/irq/irq.c
@@ -21,19 +21,19 @@
* pointer to the mask representing the additionnal irq vectors
* that must be disabled when a particular entry is activated.
* They will be dynamically computed from teh prioruty table given
- * in pc386_rtems_irq_mngt_set();
+ * in BSP_rtems_irq_mngt_set();
* CAUTION : this table is accessed directly by interrupt routine
* prologue.
*/
-rtems_i8259_masks irq_mask_or_tbl[PC_386_IRQ_LINES_NUMBER];
+rtems_i8259_masks irq_mask_or_tbl[BSP_IRQ_LINES_NUMBER];
/*
- * Copy of data given via initial pc386_rtems_irq_mngt_set() for
+ * Copy of data given via initial BSP_rtems_irq_mngt_set() for
* the sake of efficiency.
* CAUTION : this table is accessed directly by interrupt routine
* prologue.
*/
-rtems_irq_hdl current_irq[PC_386_IRQ_LINES_NUMBER];
+rtems_irq_hdl current_irq[BSP_IRQ_LINES_NUMBER];
/*
* default handler connected on each irq after bsp initialization
*/
@@ -56,19 +56,19 @@ static rtems_irq_connect_data* rtems_hdl_tbl;
rtems_i8259_masks i8259s_cache;
/*-------------------------------------------------------------------------+
-| Function: PC386_irq_disable_at_i8259s
+| Function: BSP_irq_disable_at_i8259s
| Description: Mask IRQ line in appropriate PIC chip.
| Global Variables: i8259s_cache
| Arguments: vector_offset - number of IRQ line to mask.
| Returns: Nothing.
+--------------------------------------------------------------------------*/
-int pc386_irq_disable_at_i8259s (const rtems_irq_symbolic_name irqLine)
+int BSP_irq_disable_at_i8259s (const rtems_irq_symbolic_name irqLine)
{
unsigned short mask;
unsigned int level;
- if ( ((int)irqLine < PC_386_LOWEST_OFFSET) ||
- ((int)irqLine > PC_386_MAX_OFFSET )
+ if ( ((int)irqLine < BSP_LOWEST_OFFSET) ||
+ ((int)irqLine > BSP_MAX_OFFSET )
)
return 1;
@@ -91,19 +91,19 @@ int pc386_irq_disable_at_i8259s (const rtems_irq_symbolic_name irqLine)
}
/*-------------------------------------------------------------------------+
-| Function: pc386_irq_enable_at_i8259s
+| 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.
+--------------------------------------------------------------------------*/
-int pc386_irq_enable_at_i8259s (const rtems_irq_symbolic_name irqLine)
+int BSP_irq_enable_at_i8259s (const rtems_irq_symbolic_name irqLine)
{
unsigned short mask;
unsigned int level;
- if ( ((int)irqLine < PC_386_LOWEST_OFFSET) ||
- ((int)irqLine > PC_386_MAX_OFFSET )
+ if ( ((int)irqLine < BSP_LOWEST_OFFSET) ||
+ ((int)irqLine > BSP_MAX_OFFSET )
)
return 1;
@@ -125,12 +125,12 @@ int pc386_irq_enable_at_i8259s (const rtems_irq_symbolic_name irqLine)
return 0;
} /* mask_irq */
-int pc386_irq_enabled_at_i8259s (const rtems_irq_symbolic_name irqLine)
+int BSP_irq_enabled_at_i8259s (const rtems_irq_symbolic_name irqLine)
{
unsigned short mask;
- if ( ((int)irqLine < PC_386_LOWEST_OFFSET) ||
- ((int)irqLine > PC_386_MAX_OFFSET )
+ if ( ((int)irqLine < BSP_LOWEST_OFFSET) ||
+ ((int)irqLine > BSP_MAX_OFFSET )
)
return 1;
@@ -140,16 +140,16 @@ int pc386_irq_enabled_at_i8259s (const rtems_irq_symbolic_name irqLine)
/*-------------------------------------------------------------------------+
-| Function: pc386_irq_ack_at_i8259s
+| 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.
+--------------------------------------------------------------------------*/
-int pc386_irq_ack_at_i8259s (const rtems_irq_symbolic_name irqLine)
+int BSP_irq_ack_at_i8259s (const rtems_irq_symbolic_name irqLine)
{
- if ( ((int)irqLine < PC_386_LOWEST_OFFSET) ||
- ((int)irqLine > PC_386_MAX_OFFSET )
+ if ( ((int)irqLine < BSP_LOWEST_OFFSET) ||
+ ((int)irqLine > BSP_MAX_OFFSET )
)
return 1;
@@ -212,7 +212,7 @@ static void make_copy_of_handlers ()
static int isValidInterrupt(int irq)
{
- if ( (irq < PC_386_LOWEST_OFFSET) || (irq > PC_386_MAX_OFFSET))
+ if ( (irq < BSP_LOWEST_OFFSET) || (irq > BSP_MAX_OFFSET))
return 0;
return 1;
}
@@ -221,7 +221,7 @@ static int isValidInterrupt(int irq)
* ------------------------ RTEMS Single Irq Handler Mngt Routines ----------------
*/
-int pc386_install_rtems_irq_handler (const rtems_irq_connect_data* irq)
+int BSP_install_rtems_irq_handler (const rtems_irq_connect_data* irq)
{
unsigned int level;
@@ -251,7 +251,7 @@ int pc386_install_rtems_irq_handler (const rtems_irq_connect_data* irq)
/*
* Enable interrupt at PIC level
*/
- pc386_irq_enable_at_i8259s (irq->name);
+ BSP_irq_enable_at_i8259s (irq->name);
/*
* Enable interrupt on device
*/
@@ -263,7 +263,7 @@ int pc386_install_rtems_irq_handler (const rtems_irq_connect_data* irq)
}
-int pc386_get_current_rtems_irq_handler (rtems_irq_connect_data* irq)
+int BSP_get_current_rtems_irq_handler (rtems_irq_connect_data* irq)
{
if (!isValidInterrupt(irq->name)) {
return 0;
@@ -272,7 +272,7 @@ int pc386_get_current_rtems_irq_handler (rtems_irq_connect_data* irq)
return 1;
}
-int pc386_remove_rtems_irq_handler (const rtems_irq_connect_data* irq)
+int BSP_remove_rtems_irq_handler (const rtems_irq_connect_data* irq)
{
unsigned int level;
@@ -294,7 +294,7 @@ int pc386_remove_rtems_irq_handler (const rtems_irq_connect_data* irq)
/*
* disable interrupt at PIC level
*/
- pc386_irq_disable_at_i8259s (irq->name);
+ BSP_irq_disable_at_i8259s (irq->name);
/*
* Disable interrupt on device
@@ -317,7 +317,7 @@ int pc386_remove_rtems_irq_handler (const rtems_irq_connect_data* irq)
* ------------------------ RTEMS Global Irq Handler Mngt Routines ----------------
*/
-int pc386_rtems_irq_mngt_set(rtems_irq_global_settings* config)
+int BSP_rtems_irq_mngt_set(rtems_irq_global_settings* config)
{
int i;
unsigned int level;
@@ -337,23 +337,23 @@ int pc386_rtems_irq_mngt_set(rtems_irq_global_settings* config)
for (i=0; i < internal_config->irqNb; i++) {
if (rtems_hdl_tbl[i].hdl != default_rtems_entry.hdl) {
- pc386_irq_enable_at_i8259s (i);
+ BSP_irq_enable_at_i8259s (i);
rtems_hdl_tbl[i].on(&rtems_hdl_tbl[i]);
}
else {
rtems_hdl_tbl[i].off(&rtems_hdl_tbl[i]);
- pc386_irq_disable_at_i8259s (i);
+ BSP_irq_disable_at_i8259s (i);
}
}
/*
* must disable slave pic anyway
*/
- pc386_irq_enable_at_i8259s (2);
+ BSP_irq_enable_at_i8259s (2);
_CPU_ISR_Enable(level);
return 1;
}
-int pc386_rtems_irq_mngt_get(rtems_irq_global_settings** config)
+int BSP_rtems_irq_mngt_get(rtems_irq_global_settings** config)
{
*config = internal_config;
return 0;
diff --git a/c/src/lib/libbsp/i386/shared/irq/irq.h b/c/src/lib/libbsp/i386/shared/irq/irq.h
index 5d628af83b..8bb6ce6f85 100644
--- a/c/src/lib/libbsp/i386/shared/irq/irq.h
+++ b/c/src/lib/libbsp/i386/shared/irq/irq.h
@@ -37,27 +37,27 @@ extern "C" {
typedef enum {
/* Base vector for our IRQ handlers. */
- PC386_IRQ_VECTOR_BASE = PC386_ASM_IRQ_VECTOR_BASE,
- PC_386_IRQ_LINES_NUMBER = 16,
- PC_386_LOWEST_OFFSET = 0,
- PC_386_MAX_OFFSET = PC_386_IRQ_LINES_NUMBER - 1,
+ 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,
/*
- * Interrupt offset in comparison to PC386_ASM_IRQ_VECTOR_BASE
- * NB : 1) Interrupt vector number in IDT = offset + PC386_ASM_IRQ_VECTOR_BASE
+ * Interrupt offset in comparison to BSP_ASM_IRQ_VECTOR_BASE
+ * 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.
*/
- PC_386_PERIODIC_TIMER = 0,
+ BSP_PERIODIC_TIMER = 0,
- PC_386_KEYBOARD = 1,
+ BSP_KEYBOARD = 1,
- PC386_UART_COM2_IRQ = 3,
+ BSP_UART_COM2_IRQ = 3,
- PC386_UART_COM1_IRQ = 4,
+ BSP_UART_COM1_IRQ = 4,
- PC_386_RT_TIMER1 = 8,
+ BSP_RT_TIMER1 = 8,
- PC_386_RT_TIMER3 = 10
+ BSP_RT_TIMER3 = 10
}rtems_irq_symbolic_name;
@@ -127,7 +127,7 @@ typedef struct {
*/
rtems_irq_connect_data* irqHdlTbl;
/*
- * actual value of PC386_IRQ_VECTOR_BASE...
+ * actual value of BSP_IRQ_VECTOR_BASE...
*/
rtems_irq_symbolic_name irqBase;
/*
@@ -155,13 +155,13 @@ typedef struct {
* this function, even if the device asserts the interrupt line it will
* not be propagated further to the processor
*/
-int pc386_irq_disable_at_i8259s (const rtems_irq_symbolic_name irqLine);
+int BSP_irq_disable_at_i8259s (const rtems_irq_symbolic_name irqLine);
/*
* function to enable a particular irq at 8259 level. After calling
* this function, if the device asserts the interrupt line it will
* be propagated further to the processor
*/
-int pc386_irq_enable_at_i8259s (const rtems_irq_symbolic_name irqLine);
+int BSP_irq_enable_at_i8259s (const rtems_irq_symbolic_name irqLine);
/*
* function to acknoledge a particular irq at 8259 level. After calling
* this function, if a device asserts an enabled interrupt line it will
@@ -169,11 +169,11 @@ int pc386_irq_enable_at_i8259s (const rtems_irq_symbolic_name irqLine);
* writting raw handlers as this is automagically done for rtems managed
* handlers.
*/
-int pc386_irq_ack_at_i8259s (const rtems_irq_symbolic_name irqLine);
+int BSP_irq_ack_at_i8259s (const rtems_irq_symbolic_name irqLine);
/*
* function to check if a particular irq is enabled at 8259 level. After calling
*/
-int pc386_irq_enabled_at_i8259s (const rtems_irq_symbolic_name irqLine);
+int BSP_irq_enabled_at_i8259s (const rtems_irq_symbolic_name irqLine);
/*
* ------------------------ RTEMS Single Irq Handler Mngt Routines ----------------
*/
@@ -211,18 +211,18 @@ int pc386_irq_enabled_at_i8259s (const rtems_irq_symbolic_name irqLine);
* 6) restore initial execution flow
*
*/
-int pc386_install_rtems_irq_handler (const rtems_irq_connect_data*);
+int BSP_install_rtems_irq_handler (const rtems_irq_connect_data*);
/*
* function to get the current RTEMS irq handler for ptr->name. It enables to
* define hanlder chain...
*/
-int pc386_get_current_rtems_irq_handler (rtems_irq_connect_data* ptr);
+int BSP_get_current_rtems_irq_handler (rtems_irq_connect_data* ptr);
/*
* function to get disconnect the RTEMS irq handler for ptr->name.
* This function checks that the value given is the current one for safety reason.
* The user can use the previous function to get it.
*/
-int pc386_remove_rtems_irq_handler (const rtems_irq_connect_data*);
+int BSP_remove_rtems_irq_handler (const rtems_irq_connect_data*);
/*
* ------------------------ RTEMS Global Irq Handler Mngt Routines ----------------
@@ -233,10 +233,10 @@ int pc386_remove_rtems_irq_handler (const rtems_irq_connect_data*);
* The result of calling this function will be the same as if each individual
* handler (config->irqHdlTbl[i].hdl) different from "config->defaultEntry.hdl"
* has been individualy connected via
- * pc386_install_rtems_irq_handler(&config->irqHdlTbl[i])
+ * BSP_install_rtems_irq_handler(&config->irqHdlTbl[i])
* And each handler currently equal to config->defaultEntry.hdl
* has been previously disconnected via
- * pc386_remove_rtems_irq_handler (&config->irqHdlTbl[i])
+ * BSP_remove_rtems_irq_handler (&config->irqHdlTbl[i])
*
* This is to say that all information given will be used and not just
* only the space.
@@ -247,11 +247,11 @@ int pc386_remove_rtems_irq_handler (const rtems_irq_connect_data*);
* not be modified or declared on a stack.
*/
-int pc386_rtems_irq_mngt_set(rtems_irq_global_settings* config);
+int BSP_rtems_irq_mngt_set(rtems_irq_global_settings* config);
/*
* (Re) get info on current RTEMS interrupt management.
*/
-int pc386_rtems_irq_mngt_get(rtems_irq_global_settings**);
+int BSP_rtems_irq_mngt_get(rtems_irq_global_settings**);
#ifdef __cplusplus
}
diff --git a/c/src/lib/libbsp/i386/shared/irq/irq_asm.h b/c/src/lib/libbsp/i386/shared/irq/irq_asm.h
index bf6bb17e8e..af1289fb8f 100644
--- a/c/src/lib/libbsp/i386/shared/irq/irq_asm.h
+++ b/c/src/lib/libbsp/i386/shared/irq/irq_asm.h
@@ -15,7 +15,7 @@
#ifndef __IRQ_ASM_H__
#define __IRQ_ASM_H__
-#define PC386_ASM_IRQ_VECTOR_BASE 0x20
+#define BSP_ASM_IRQ_VECTOR_BASE 0x20
/* PIC's command and mask registers */
#define PIC_MASTER_COMMAND_IO_PORT 0x20 /* Master PIC command register */
#define PIC_SLAVE_COMMAND_IO_PORT 0xa0 /* Slave PIC command register */
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 ee6967d8d9..73cdf2e8c1 100644
--- a/c/src/lib/libbsp/i386/shared/irq/irq_init.c
+++ b/c/src/lib/libbsp/i386/shared/irq/irq_init.c
@@ -55,9 +55,9 @@ static rtems_raw_irq_connect_data idtHdl[IDT_SIZE];
/*
* Table used to store rtems managed interrupt handlers.
* Borrow the table to store raw handler entries at the beginning.
- * The table will be reinitialized before the call to pc386_rtems_irq_mngt_set().
+ * The table will be reinitialized before the call to BSP_rtems_irq_mngt_set().
*/
-static rtems_irq_connect_data rtemsIrq[PC_386_IRQ_LINES_NUMBER] = {
+static rtems_irq_connect_data rtemsIrq[BSP_IRQ_LINES_NUMBER] = {
{0,(rtems_irq_hdl)rtems_irq_prologue_0},
{0,(rtems_irq_hdl)rtems_irq_prologue_1},
{0,(rtems_irq_hdl)rtems_irq_prologue_2},
@@ -86,7 +86,7 @@ static rtems_irq_connect_data defaultIrq = {
0, nop_func , nop_func , nop_func , not_connected
};
-static rtems_irq_prio irqPrioTable[PC_386_IRQ_LINES_NUMBER]={
+static rtems_irq_prio irqPrioTable[BSP_IRQ_LINES_NUMBER]={
/*
* actual rpiorities for interrupt :
* 0 means that only current interrupt is masked
@@ -155,9 +155,9 @@ void rtems_irq_mngt_init()
* Patch the entry that will be used by RTEMS for interrupt management
* with RTEMS prologue.
*/
- for (i = 0; i < PC_386_IRQ_LINES_NUMBER; i++) {
+ for (i = 0; i < BSP_IRQ_LINES_NUMBER; i++) {
create_interrupt_gate_descriptor(&idtEntry,(rtems_raw_irq_hdl) rtemsIrq[i].hdl);
- idt_entry_tbl[i + PC386_ASM_IRQ_VECTOR_BASE] = idtEntry;
+ idt_entry_tbl[i + BSP_ASM_IRQ_VECTOR_BASE] = idtEntry;
}
/*
* At this point we have completed the initialization of IDT
@@ -167,20 +167,20 @@ void rtems_irq_mngt_init()
/*
* re-init the rtemsIrq table
*/
- for (i = 0; i < PC_386_IRQ_LINES_NUMBER; i++) {
+ for (i = 0; i < BSP_IRQ_LINES_NUMBER; i++) {
rtemsIrq[i] = defaultIrq;
rtemsIrq[i].name = i;
}
/*
* Init initial Interrupt management config
*/
- initial_config.irqNb = PC_386_IRQ_LINES_NUMBER;
+ initial_config.irqNb = BSP_IRQ_LINES_NUMBER;
initial_config.defaultEntry = defaultIrq;
initial_config.irqHdlTbl = rtemsIrq;
- initial_config.irqBase = PC386_ASM_IRQ_VECTOR_BASE;
+ initial_config.irqBase = BSP_ASM_IRQ_VECTOR_BASE;
initial_config.irqPrioTbl = irqPrioTable;
- if (!pc386_rtems_irq_mngt_set(&initial_config)) {
+ if (!BSP_rtems_irq_mngt_set(&initial_config)) {
/*
* put something here that will show the failure...
*/
@@ -200,7 +200,7 @@ void rtems_irq_mngt_init()
printk("idt_entry_tbl = %x Interrupt_descriptor_table addr = %x\n",
idt_entry_tbl, &Interrupt_descriptor_table);
- tmp = (unsigned) get_hdl_from_vector (PC386_ASM_IRQ_VECTOR_BASE + PC_386_PERIODIC_TIMER);
+ tmp = (unsigned) get_hdl_from_vector (BSP_ASM_IRQ_VECTOR_BASE + BSP_PERIODIC_TIMER);
printk("clock isr address from idt = %x should be %x\n",
tmp, (unsigned) rtems_irq_prologue_0);
}