2007-12-04 Joel Sherrill <joel.sherrill@OARcorp.com>

* amba/amba.c, clock/ckinit.c, console/console.c, include/bsp.h,
	startup/bspstart.c, timer/timer.c: Move interrupt_stack_size field
	from CPU Table to Configuration Table. Eliminate CPU Table from all
	ports. Delete references to CPU Table in all forms.
This commit is contained in:
Joel Sherrill
2007-12-04 22:20:55 +00:00
parent 2804a3e71c
commit 7f3c6cee09
7 changed files with 60 additions and 40 deletions

View File

@@ -1,3 +1,10 @@
2007-12-04 Joel Sherrill <joel.sherrill@OARcorp.com>
* amba/amba.c, clock/ckinit.c, console/console.c, include/bsp.h,
startup/bspstart.c, timer/timer.c: Move interrupt_stack_size field
from CPU Table to Configuration Table. Eliminate CPU Table from all
ports. Delete references to CPU Table in all forms.
2007-12-03 Joel Sherrill <joel.sherrill@OARcorp.com>
* amba/amba.c, startup/bspstart.c: Moved most of the remaining CPU

View File

@@ -58,10 +58,12 @@ void bsp_predriver_hook(void)
if ( i > 0 ){
/* Found APB IRQ_MP Interrupt Controller */
LEON3_IrqCtrl_Regs = (volatile LEON3_IrqCtrl_Regs_Map *) dev.start;
if (Configuration.User_multiprocessing_table != NULL) {
#if defined(RTEMS_MULTIPROCESSING)
if (rtems_configuration_get_user_multiprocessing_table() != NULL) {
tmp = getasr17();
LEON3_Cpu_Index = (tmp >> 28) & 3;
}
#endif
}
/* find GP Timer */

View File

@@ -33,8 +33,13 @@
extern rtems_configuration_table Configuration;
#if defined(RTEMS_MULTIPROCESSING)
#define LEON3_CLOCK_INDEX \
(Configuration.User_multiprocessing_table ? LEON3_Cpu_Index : 0)
(rtems_configuration_get_user_multiprocessing_table() ? LEON3_Cpu_Index : 0)
#else
#define LEON3_CLOCK_INDEX 0
#endif
volatile LEON3_Timer_Regs_Map *LEON3_Timer_Regs = 0;
static int clkirq;
@@ -43,6 +48,17 @@ static int clkirq;
#define Clock_driver_support_at_tick()
#if defined(RTEMS_MULTIPROCESSING)
#define Adjust_clkirq_for_node() \
do { \
if (rtems_configuration_get_user_multiprocessing_table() != NULL) { \
clkirq += LEON3_Cpu_Index; \
} \
} while(0)
#else
#define Adjust_clkirq_for_node()
#endif
#define Clock_driver_support_find_timer() \
do { \
int cnt; \
@@ -55,9 +71,7 @@ static int clkirq;
LEON3_Timer_Regs = (volatile LEON3_Timer_Regs_Map *) dev.start; \
clkirq = (LEON3_Timer_Regs->status & 0xfc) >> 3; \
\
if (Configuration.User_multiprocessing_table != NULL) { \
clkirq += LEON3_Cpu_Index; \
} \
Adjust_clkirq_for_node(); \
} \
} while (0)

View File

@@ -97,7 +97,8 @@ int scan_uarts() {
if (isinit == 0) {
i = 0; uarts = 0;
uarts = amba_find_apbslvs(&amba_conf,VENDOR_GAISLER,GAISLER_APBUART,apbuarts,LEON3_APBUARTS);
uarts = amba_find_apbslvs(
&amba_conf, VENDOR_GAISLER, GAISLER_APBUART, apbuarts, LEON3_APBUARTS);
for(i=0; i<uarts; i++){
LEON3_Console_Uart[i] = (volatile LEON3_UART_Regs_Map *)apbuarts[i].start;
}
@@ -122,10 +123,12 @@ rtems_device_driver console_initialize(
/* Find UARTs */
scan_uarts();
if (Configuration.User_multiprocessing_table != NULL)
uart0 = LEON3_Cpu_Index;
else
/* default to zero and override if multiprocessing */
uart0 = 0;
#if defined(RTEMS_MULTIPROCESSING)
if (rtems_configuration_get_user_multiprocessing_table() != NULL)
uart0 = LEON3_Cpu_Index;
#endif
/* Register Device Names */
@@ -145,14 +148,17 @@ rtems_device_driver console_initialize(
/*
* Initialize Hardware
* Initialize Hardware if ONLY CPU or first CPU in MP system
*/
if ((Configuration.User_multiprocessing_table == NULL) ||
((Configuration.User_multiprocessing_table)->node == 1))
#if defined(RTEMS_MULTIPROCESSING)
if ((rtems_configuration_get_user_multiprocessing_table())->node == 1))
#endif
{
for (i = uart0; i < uarts; i++)
{
LEON3_Console_Uart[i]->ctrl |= LEON_REG_UART_CTRL_RE | LEON_REG_UART_CTRL_TE;
LEON3_Console_Uart[i]->ctrl |=
LEON_REG_UART_CTRL_RE | LEON_REG_UART_CTRL_TE;
LEON3_Console_Uart[i]->status = 0;
}
}

View File

@@ -43,7 +43,6 @@ extern "C" {
*/
#define CONFIGURE_NUMBER_OF_TERMIOS_PORTS 2
#define CONFIGURE_INTERRUPT_STACK_MEMORY (16 * 1024)
/*
* Network driver configuration
@@ -122,8 +121,6 @@ void bsp_spurious_initialize( void );
extern rtems_configuration_table BSP_Configuration; /* owned by BSP */
extern rtems_cpu_table Cpu_table; /* owned by BSP */
#ifdef __cplusplus
}
#endif

View File

@@ -34,8 +34,6 @@
extern rtems_configuration_table Configuration;
rtems_configuration_table BSP_Configuration;
rtems_cpu_table Cpu_table;
/*
* Tells us where to put the workspace in case remote debugger is present.
*/
@@ -112,11 +110,6 @@ void bsp_start( void )
{
unsigned char *work_space_start;
/*
* This should be enough interrupt stack.
*/
Cpu_table.interrupt_stack_size = CONFIGURE_INTERRUPT_STACK_MEMORY;
work_space_start =
(unsigned char *)rdb_start - BSP_Configuration.work_space_size;

View File

@@ -22,12 +22,13 @@
#include <bsp.h>
extern rtems_configuration_table Configuration;
#if defined(RTEMS_MULTIPROCESSING)
#define LEON3_TIMER_INDEX \
(Configuration.User_multiprocessing_table ? \
(Configuration.User_multiprocessing_table)->maximum_nodes + \
(Configuration.User_multiprocessing_table)->node - 1 : 1)
(rtems_configuration_get_user_multiprocessing_table() ? : \
(rtems_configuration_get_user_multiprocessing_table()->node) - 1 : 1)
#else
#define LEON3_TIMER_INDEX 0
#endif
rtems_boolean Timer_driver_Find_average_overhead;