summaryrefslogtreecommitdiffstats
path: root/c/src
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2007-12-11 15:50:22 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2007-12-11 15:50:22 +0000
commitf1c53e8e71e3a6097becbbf38a2b368b6242fd96 (patch)
tree8087aff6b93bb7c471eab3031f60d1f22be371c8 /c/src
parent2007-12-11 Joel Sherrill <joel.sherrill@OARcorp.com> (diff)
downloadrtems-f1c53e8e71e3a6097becbbf38a2b368b6242fd96.tar.bz2
2007-12-11 Joel Sherrill <joel.sherrill@OARcorp.com>
* clock/clockdrv.c, include/bsp.h, startup/bspstart.c: Eliminate copies of the Configuration Table. Use the RTEMS provided accessor macros to obtain configuration fields.
Diffstat (limited to 'c/src')
-rw-r--r--c/src/lib/libbsp/arm/edb7312/ChangeLog6
-rw-r--r--c/src/lib/libbsp/arm/edb7312/clock/clockdrv.c2
-rw-r--r--c/src/lib/libbsp/arm/edb7312/include/bsp.h2
-rw-r--r--c/src/lib/libbsp/arm/edb7312/startup/bspstart.c42
-rw-r--r--c/src/lib/libbsp/arm/gba/ChangeLog6
-rw-r--r--c/src/lib/libbsp/arm/gba/clock/clockdrv.c5
-rw-r--r--c/src/lib/libbsp/arm/gba/include/bsp.h3
-rw-r--r--c/src/lib/libbsp/arm/gba/startup/bspstart.c26
8 files changed, 38 insertions, 54 deletions
diff --git a/c/src/lib/libbsp/arm/edb7312/ChangeLog b/c/src/lib/libbsp/arm/edb7312/ChangeLog
index 0533a63bbb..e963520c48 100644
--- a/c/src/lib/libbsp/arm/edb7312/ChangeLog
+++ b/c/src/lib/libbsp/arm/edb7312/ChangeLog
@@ -1,3 +1,9 @@
+2007-12-11 Joel Sherrill <joel.sherrill@OARcorp.com>
+
+ * clock/clockdrv.c, include/bsp.h, startup/bspstart.c: Eliminate copies
+ of the Configuration Table. Use the RTEMS provided accessor macros to
+ obtain configuration fields.
+
2007-12-04 Joel Sherrill <joel.sherrill@OARcorp.com>
* include/bsp.h, startup/bspstart.c: Move interrupt_stack_size field
diff --git a/c/src/lib/libbsp/arm/edb7312/clock/clockdrv.c b/c/src/lib/libbsp/arm/edb7312/clock/clockdrv.c
index 5e4d9557a5..d78b1efa48 100644
--- a/c/src/lib/libbsp/arm/edb7312/clock/clockdrv.c
+++ b/c/src/lib/libbsp/arm/edb7312/clock/clockdrv.c
@@ -48,7 +48,7 @@ rtems_irq_connect_data clock_isr_data = {BSP_TC1OI,
#define Clock_driver_support_initialize_hardware() \
do { \
*EP7312_SYSCON1 |= EP7312_SYSCON1_TC1_PRESCALE; \
- *EP7312_TC1D =(BSP_Configuration.microseconds_per_tick * 2000)/1000000; \
+ *EP7312_TC1D =(rtems_configuration_get_microseconds_per_tick() * 2000)/1000000; \
*EP7312_TC1EOI = 0xFFFFFFFF; \
} while (0)
diff --git a/c/src/lib/libbsp/arm/edb7312/include/bsp.h b/c/src/lib/libbsp/arm/edb7312/include/bsp.h
index b6df498c9e..9137868ec1 100644
--- a/c/src/lib/libbsp/arm/edb7312/include/bsp.h
+++ b/c/src/lib/libbsp/arm/edb7312/include/bsp.h
@@ -37,8 +37,6 @@ int cs8900_driver_attach (struct rtems_bsdnet_ifconfig *config,
#define CONFIGURE_NUMBER_OF_TERMIOS_PORTS 2
-extern rtems_configuration_table BSP_Configuration;
-
/*
* Network driver configuration
*/
diff --git a/c/src/lib/libbsp/arm/edb7312/startup/bspstart.c b/c/src/lib/libbsp/arm/edb7312/startup/bspstart.c
index 9816bd3fff..ecd2066821 100644
--- a/c/src/lib/libbsp/arm/edb7312/startup/bspstart.c
+++ b/c/src/lib/libbsp/arm/edb7312/startup/bspstart.c
@@ -38,14 +38,6 @@ extern void *_bss_free_start;
unsigned long free_mem_start;
unsigned long free_mem_end;
-/* The original BSP configuration table from the application and our copy of it
- with some changes. */
-
-extern rtems_configuration_table Configuration;
- rtems_configuration_table BSP_Configuration;
-
-char *rtems_progname; /* Program name - from main(). */
-
/*************************************************************/
/* Function prototypes */
/*************************************************************/
@@ -107,13 +99,13 @@ void bsp_pretasking_hook(void)
/* This function also configures the CPU's memory protection unit. */
/* */
/* GLOBALS USED: */
-/* CPU_table */
-/* BSP_Configuration */
-/* free_mem_start */
-/* free_mem_end */
-/* free_mem_nocache_start */
-/* _bss_free_start */
-/* mpu_region_tbl */
+/* CPU_table */
+/* Configuration */
+/* free_mem_start */
+/* free_mem_end */
+/* free_mem_nocache_start */
+/* _bss_free_start */
+/* mpu_region_tbl */
/* */
/* */
/* */
@@ -129,10 +121,10 @@ void bsp_start_default( void )
*EP7312_INTMR2 = 0;
/* Place RTEMS workspace at beginning of free memory. */
- BSP_Configuration.work_space_start = (void *)&_bss_free_start;
+ Configuration.work_space_start = (void *)&_bss_free_start;
free_mem_start = ((uint32_t)&_bss_free_start +
- BSP_Configuration.work_space_size);
+ rtems_configuration_get_work_space_size());
free_mem_end = ((uint32_t)&_sdram_base + (uint32_t)&_sdram_size);
@@ -150,20 +142,16 @@ void bsp_start_default( void )
* The following information is very useful when debugging.
*/
#if 0
- printk( "work_space_size = 0x%x\n", BSP_Configuration.work_space_size );
- printk( "maximum_extensions = 0x%x\n", BSP_Configuration.maximum_extensions );
+ printk( "work_space_size = 0x%x\n",
+ rtems_configuration_get_work_space_size() );
printk( "microseconds_per_tick = 0x%x\n",
- BSP_Configuration.microseconds_per_tick );
+ rtems_configuration_get_microseconds_per_tick() );
printk( "ticks_per_timeslice = 0x%x\n",
- BSP_Configuration.ticks_per_timeslice );
- printk( "number_of_device_drivers = 0x%x\n",
- BSP_Configuration.number_of_device_drivers );
- printk( "Device_driver_table = 0x%x\n",
- BSP_Configuration.Device_driver_table );
+ rtems_configuration_get_ticks_per_timeslice() );
/* printk( "_stack_size = 0x%x\n", _stack_size );*/
- printk( "work_space_start = 0x%x\n", BSP_Configuration.work_space_start );
- printk( "work_space_size = 0x%x\n", BSP_Configuration.work_space_size );
+ printk( "work_space_start = 0x%x\n", Configuration.work_space_start );
+ printk( "work_space_size = 0x%x\n", rtems_configuration_get_work_space_size() );
#endif
} /* bsp_start */
diff --git a/c/src/lib/libbsp/arm/gba/ChangeLog b/c/src/lib/libbsp/arm/gba/ChangeLog
index fd184fe422..5d8fec39dd 100644
--- a/c/src/lib/libbsp/arm/gba/ChangeLog
+++ b/c/src/lib/libbsp/arm/gba/ChangeLog
@@ -1,3 +1,9 @@
+2007-12-11 Joel Sherrill <joel.sherrill@OARcorp.com>
+
+ * clock/clockdrv.c, include/bsp.h, startup/bspstart.c: Eliminate copies
+ of the Configuration Table. Use the RTEMS provided accessor macros to
+ obtain configuration fields.
+
2007-12-04 Joel Sherrill <joel.sherrill@OARcorp.com>
* startup/bspstart.c, startup/cpu.c: Move interrupt_stack_size field
diff --git a/c/src/lib/libbsp/arm/gba/clock/clockdrv.c b/c/src/lib/libbsp/arm/gba/clock/clockdrv.c
index 396addcb7b..604f4ea6b4 100644
--- a/c/src/lib/libbsp/arm/gba/clock/clockdrv.c
+++ b/c/src/lib/libbsp/arm/gba/clock/clockdrv.c
@@ -74,9 +74,6 @@ rtems_irq_connect_data clock_isr_data = {BSP_IRQ_TIMER3,
#define GBA_TMCNT_PS 0x0003
#endif
-
-extern rtems_configuration_table BSP_Configuration;
-
/**
* @brief This function set up the clock hardware
*
@@ -85,7 +82,7 @@ extern rtems_configuration_table BSP_Configuration;
*/
void Clock_driver_support_initialize_hardware()
{
- int tmreload = ((BSP_Configuration.microseconds_per_tick*1000)/__TimTickTime_ns);
+ int tmreload = ((rtems_configuration_get_microseconds_per_tick()*1000)/__TimTickTime_ns);
if (tmreload>0xFFFF) tmreload = 0xFFFF;
GBA_REG_TM3CNT = (GBA_TMCNT_PS);
diff --git a/c/src/lib/libbsp/arm/gba/include/bsp.h b/c/src/lib/libbsp/arm/gba/include/bsp.h
index f328d41aa2..f3f3efc6a5 100644
--- a/c/src/lib/libbsp/arm/gba/include/bsp.h
+++ b/c/src/lib/libbsp/arm/gba/include/bsp.h
@@ -47,9 +47,6 @@ extern "C" {
asm volatile ("0: nop; sub %0, %0, #1; cmp %0,#0; bne 0b" : "=c"(_cnt) : "0"(_cnt)); \
}
-/** Our copy of BSP configuration table from the application. */
-extern rtems_configuration_table BSP_Configuration;
-
/** gba_zero_memory library function in start.S */
extern void gba_zero_memory(int start, int stop);
/** gba_move_memory library function in start.S */
diff --git a/c/src/lib/libbsp/arm/gba/startup/bspstart.c b/c/src/lib/libbsp/arm/gba/startup/bspstart.c
index 34b9414d47..7bf79654d5 100644
--- a/c/src/lib/libbsp/arm/gba/startup/bspstart.c
+++ b/c/src/lib/libbsp/arm/gba/startup/bspstart.c
@@ -50,11 +50,6 @@ extern void __load_stop_iwram;
extern void __bss_start;
extern void __bss_end;
-/** The original BSP configuration table from the application. */
-extern rtems_configuration_table Configuration;
-/** Our copy of BSP configuration table from the application. */
-rtems_configuration_table BSP_Configuration;
-
/* External Prototypes */
extern void bsp_cleanup( void );
extern void rtems_irq_mngt_init(void);
@@ -74,10 +69,6 @@ uint32_t _heap_size = 0;
/** Address of start of free memory - should be updated after creating new partitions or regions.*/
uint32_t rtemsFreeMemStart;
-/** Program name - from main(). */
-char *rtems_progname;
-
-
/**
* @brief BSP pretasking hook.
*
@@ -140,8 +131,8 @@ void bsp_start_default( void )
rtemsFreeMemStart = (uint32_t)&_end;
/* Place RTEMS workspace at beginning of free memory. */
- BSP_Configuration.work_space_start = (void *)rtemsFreeMemStart;
- rtemsFreeMemStart += BSP_Configuration.work_space_size;
+ Configuration.work_space_start = (void *)rtemsFreeMemStart;
+ rtemsFreeMemStart += rtems_configuration_get_work_space_size();
/* Init conio */
gba_textmode(CO60);
@@ -158,12 +149,13 @@ void bsp_start_default( void )
printk("[bsp_start]\n");
printk("rtemsFreeMemStart= 0x%x\n", rtemsFreeMemStart);
printk("__heap_limit = 0x%x\n", (uint32_t)&__heap_limit);
- printk("work_space_start = 0x%x size = 0x%x\n", BSP_Configuration.work_space_start,BSP_Configuration.work_space_size);
- printk("maximum_extensions = 0x%x\n", BSP_Configuration.maximum_extensions);
- printk("microseconds_per_tick = 0x%x\n", BSP_Configuration.microseconds_per_tick);
- printk("ticks_per_timeslice = 0x%x\n", BSP_Configuration.ticks_per_timeslice);
- printk("number_of_device_drivers = 0x%x\n", BSP_Configuration.number_of_device_drivers);
- printk("Device_driver_table = 0x%x\n", BSP_Configuration.Device_driver_table);
+ printk("work_space_start = 0x%x size = 0x%x\n",
+ Configuration.work_space_start,
+ rtems_configuration_get_work_space_size());
+ printk("microseconds_per_tick = 0x%x\n",
+ rtems_configuration_get_microseconds_per_tick());
+ printk("ticks_per_timeslice = 0x%x\n",
+ rtems_configuration_get_ticks_per_timeslice());
#endif
/* Do we have enough memory */