forked from Imagelibrary/rtems
2007-12-11 Joel Sherrill <joel.sherrill@OARcorp.com>
* clock/clock.c, include/bsp.h, startup/bspstart.c: Eliminate copies of the Configuration Table. Use the RTEMS provided accessor macros to obtain configuration fields.
This commit is contained in:
@@ -1,3 +1,9 @@
|
|||||||
|
2007-12-11 Joel Sherrill <joel.sherrill@OARcorp.com>
|
||||||
|
|
||||||
|
* clock/clock.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>
|
2007-12-04 Joel Sherrill <joel.sherrill@OARcorp.com>
|
||||||
|
|
||||||
* include/bsp.h, startup/bspstart.c: Move interrupt_stack_size field
|
* include/bsp.h, startup/bspstart.c: Move interrupt_stack_size field
|
||||||
|
|||||||
@@ -36,12 +36,12 @@ void Clock_driver_support_initialize_hardware()
|
|||||||
|
|
||||||
tmpi = ((int) &_ClockFrequency) * 1000000; /* ClockFrequency is in Mhz */
|
tmpi = ((int) &_ClockFrequency) * 1000000; /* ClockFrequency is in Mhz */
|
||||||
tmp = (float) tmpi / 2.0;
|
tmp = (float) tmpi / 2.0;
|
||||||
tmp = ((float) BSP_Configuration.microseconds_per_tick / 1000000.0) * (tmp);
|
tmp = ((float) rtems_configuration_get_microseconds_per_tick() / 1000000.0) * (tmp);
|
||||||
|
|
||||||
Clock_counter_register_value = (unsigned int) tmp;
|
Clock_counter_register_value = (unsigned int) tmp;
|
||||||
#if 0
|
#if 0
|
||||||
Clock_counter_register_value =
|
Clock_counter_register_value =
|
||||||
(uint32_t) ((float) BSP_Configuration.microseconds_per_tick /
|
(uint32_t) ((float) rtems_configuration_get_microseconds_per_tick() /
|
||||||
((float)_ClockFrequency / 2.0)));
|
((float)_ClockFrequency / 2.0)));
|
||||||
#endif
|
#endif
|
||||||
c4x_timer_stop( C4X_TIMER_0 );
|
c4x_timer_stop( C4X_TIMER_0 );
|
||||||
|
|||||||
@@ -64,10 +64,6 @@ void BSP_fatal_return( void );
|
|||||||
|
|
||||||
void bsp_spurious_initialize( void );
|
void bsp_spurious_initialize( void );
|
||||||
|
|
||||||
extern rtems_configuration_table BSP_Configuration; /* owned by BSP */
|
|
||||||
|
|
||||||
extern uint32_t bsp_isr_level;
|
|
||||||
|
|
||||||
#endif /* ASM */
|
#endif /* ASM */
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|||||||
@@ -20,14 +20,6 @@
|
|||||||
#include <rtems/libio.h>
|
#include <rtems/libio.h>
|
||||||
#include <rtems/libcsupport.h>
|
#include <rtems/libcsupport.h>
|
||||||
|
|
||||||
/*
|
|
||||||
* The original table from the application and our copy of it with
|
|
||||||
* some changes.
|
|
||||||
*/
|
|
||||||
|
|
||||||
extern rtems_configuration_table Configuration;
|
|
||||||
rtems_configuration_table BSP_Configuration;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Use the shared implementations of the following routines
|
* Use the shared implementations of the following routines
|
||||||
*/
|
*/
|
||||||
@@ -74,10 +66,10 @@ void bsp_start( void )
|
|||||||
extern void *_WorkspaceBase;
|
extern void *_WorkspaceBase;
|
||||||
extern uint32_t _WorkspaceMax;
|
extern uint32_t _WorkspaceMax;
|
||||||
|
|
||||||
BSP_Configuration.work_space_start = (void *)&_WorkspaceBase;
|
Configuration.work_space_start = (void *)&_WorkspaceBase;
|
||||||
/* XXX check to see if satisfying small memory model */
|
/* XXX check to see if satisfying small memory model */
|
||||||
|
|
||||||
if ( BSP_Configuration.work_space_size > (int) &_WorkspaceMax )
|
if ( rtems_configuration_get_work_space_size() > (int) &_WorkspaceMax )
|
||||||
rtems_fatal_error_occurred( 0x43218765 );
|
rtems_fatal_error_occurred( 0x43218765 );
|
||||||
|
|
||||||
BSP_output_char = C4X_BSP_output_char;
|
BSP_output_char = C4X_BSP_output_char;
|
||||||
|
|||||||
@@ -1,3 +1,9 @@
|
|||||||
|
2007-12-11 Joel Sherrill <joel.sherrill@OARcorp.com>
|
||||||
|
|
||||||
|
* clock/clock.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>
|
2007-12-04 Joel Sherrill <joel.sherrill@OARcorp.com>
|
||||||
|
|
||||||
* include/bsp.h, startup/bspstart.c: Move interrupt_stack_size field
|
* include/bsp.h, startup/bspstart.c: Move interrupt_stack_size field
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ static unsigned long nsec;
|
|||||||
extern int m360_clock_rate; \
|
extern int m360_clock_rate; \
|
||||||
unsigned long nsec_per_chip_tick = 1000000000 / m360_clock_rate; \
|
unsigned long nsec_per_chip_tick = 1000000000 / m360_clock_rate; \
|
||||||
unsigned long nsec_per_pit_tick = 512 * nsec_per_chip_tick; \
|
unsigned long nsec_per_pit_tick = 512 * nsec_per_chip_tick; \
|
||||||
rtems_nsec_per_tick = BSP_Configuration.microseconds_per_tick * 1000; \
|
rtems_nsec_per_tick = rtems_configuration_get_microseconds_per_tick() * 1000; \
|
||||||
divisor = rtems_nsec_per_tick / nsec_per_pit_tick; \
|
divisor = rtems_nsec_per_tick / nsec_per_pit_tick; \
|
||||||
if (divisor > 255) \
|
if (divisor > 255) \
|
||||||
divisor = 255; \
|
divisor = 255; \
|
||||||
|
|||||||
@@ -79,8 +79,6 @@ extern int rtems_scc1_driver_attach (struct rtems_bsdnet_ifconfig *config, int a
|
|||||||
|
|
||||||
/* miscellaneous stuff assumed to exist */
|
/* miscellaneous stuff assumed to exist */
|
||||||
|
|
||||||
extern rtems_configuration_table BSP_Configuration;
|
|
||||||
|
|
||||||
extern m68k_isr_entry M68Kvec[]; /* vector table address */
|
extern m68k_isr_entry M68Kvec[]; /* vector table address */
|
||||||
|
|
||||||
/* functions */
|
/* functions */
|
||||||
|
|||||||
@@ -20,15 +20,6 @@
|
|||||||
#include <rtems/libio.h>
|
#include <rtems/libio.h>
|
||||||
#include <rtems/libcsupport.h>
|
#include <rtems/libcsupport.h>
|
||||||
|
|
||||||
/*
|
|
||||||
* The original 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;
|
|
||||||
|
|
||||||
/* Amount of RAM on this board. Dynamically set in start.S */
|
/* Amount of RAM on this board. Dynamically set in start.S */
|
||||||
unsigned long _M68K_RamSize;
|
unsigned long _M68K_RamSize;
|
||||||
|
|
||||||
@@ -70,5 +61,5 @@ void bsp_start( void )
|
|||||||
* not malloc'ed. It is just "pulled from the air".
|
* not malloc'ed. It is just "pulled from the air".
|
||||||
*/
|
*/
|
||||||
|
|
||||||
BSP_Configuration.work_space_start = (void *)&_WorkspaceBase;
|
Configuration.work_space_start = (void *)&_WorkspaceBase;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,9 @@
|
|||||||
|
2007-12-11 Joel Sherrill <joel.sherrill@OARcorp.com>
|
||||||
|
|
||||||
|
* clock/clock.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>
|
2007-12-04 Joel Sherrill <joel.sherrill@OARcorp.com>
|
||||||
|
|
||||||
* Makefile.am, startup/bspstart.c: Move interrupt_stack_size field from
|
* Makefile.am, startup/bspstart.c: Move interrupt_stack_size field from
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ uint32_t bsp_clock_nanoseconds_since_last_tick(void)
|
|||||||
MCF5282_PIT_PCSR_OVW | \
|
MCF5282_PIT_PCSR_OVW | \
|
||||||
MCF5282_PIT_PCSR_PIE | \
|
MCF5282_PIT_PCSR_PIE | \
|
||||||
MCF5282_PIT_PCSR_RLD; \
|
MCF5282_PIT_PCSR_RLD; \
|
||||||
MCF5282_PIT3_PMR = BSP_Configuration.microseconds_per_tick - 1; \
|
MCF5282_PIT3_PMR = rtems_configuration_get_microseconds_per_tick() - 1; \
|
||||||
MCF5282_PIT3_PCSR = MCF5282_PIT_PCSR_PRE(preScaleCode) | \
|
MCF5282_PIT3_PCSR = MCF5282_PIT_PCSR_PRE(preScaleCode) | \
|
||||||
MCF5282_PIT_PCSR_PIE | \
|
MCF5282_PIT_PCSR_PIE | \
|
||||||
MCF5282_PIT_PCSR_RLD | \
|
MCF5282_PIT_PCSR_RLD | \
|
||||||
|
|||||||
@@ -56,8 +56,6 @@ extern int rtems_fec_driver_attach (struct rtems_bsdnet_ifconfig *config, int at
|
|||||||
|
|
||||||
/* miscellaneous stuff assumed to exist */
|
/* miscellaneous stuff assumed to exist */
|
||||||
|
|
||||||
extern rtems_configuration_table BSP_Configuration;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Device Driver Table Entries
|
* Device Driver Table Entries
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -26,14 +26,6 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
/*
|
|
||||||
* The original 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;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Location of 'VME' access
|
* Location of 'VME' access
|
||||||
*/
|
*/
|
||||||
@@ -263,7 +255,7 @@ void bsp_start( void )
|
|||||||
* not malloc'ed. It is just "pulled from the air".
|
* not malloc'ed. It is just "pulled from the air".
|
||||||
*/
|
*/
|
||||||
|
|
||||||
BSP_Configuration.work_space_start = (void *)_WorkspaceBase;
|
Configuration.work_space_start = (void *)_WorkspaceBase;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Invalidate the cache and disable it
|
* Invalidate the cache and disable it
|
||||||
|
|||||||
@@ -1,3 +1,9 @@
|
|||||||
|
2007-12-11 Joel Sherrill <joel.sherrill@OARcorp.com>
|
||||||
|
|
||||||
|
* clock/clock.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>
|
2007-12-04 Joel Sherrill <joel.sherrill@OARcorp.com>
|
||||||
|
|
||||||
* console/console.c, include/bsp.h, startup/bspstart.c: Move
|
* console/console.c, include/bsp.h, startup/bspstart.c: Move
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ void Clock_driver_support_initialize_hardware(void)
|
|||||||
|
|
||||||
CLOCK_REGS->control = ALTERA_AVALON_TIMER_CONTROL_STOP_MSK;
|
CLOCK_REGS->control = ALTERA_AVALON_TIMER_CONTROL_STOP_MSK;
|
||||||
|
|
||||||
period = (CLOCK_FREQ/1000000L)*BSP_Configuration.microseconds_per_tick - 1;
|
period = (CLOCK_FREQ/1000000L)*rtems_configuration_get_microseconds_per_tick() - 1;
|
||||||
CLOCK_REGS->period_hi = period >> 16;
|
CLOCK_REGS->period_hi = period >> 16;
|
||||||
CLOCK_REGS->period_lo = period & 0xFFFF;
|
CLOCK_REGS->period_lo = period & 0xFFFF;
|
||||||
|
|
||||||
|
|||||||
@@ -132,8 +132,6 @@ altera_avalon_jtag_uart_regs;
|
|||||||
|
|
||||||
/* miscellaneous stuff assumed to exist */
|
/* miscellaneous stuff assumed to exist */
|
||||||
|
|
||||||
extern rtems_configuration_table BSP_Configuration;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Device Driver Table Entries
|
* Device Driver Table Entries
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -22,21 +22,12 @@
|
|||||||
#include <rtems/libio.h>
|
#include <rtems/libio.h>
|
||||||
#include <rtems/libcsupport.h>
|
#include <rtems/libcsupport.h>
|
||||||
|
|
||||||
/*
|
|
||||||
* The original table from the application and our copy of it with
|
|
||||||
* some changes.
|
|
||||||
*/
|
|
||||||
|
|
||||||
extern rtems_configuration_table Configuration;
|
|
||||||
rtems_configuration_table BSP_Configuration;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Use the shared implementations of the following routines
|
* Use the shared implementations of the following routines
|
||||||
*/
|
*/
|
||||||
|
|
||||||
extern void bsp_postdriver_hook(void);
|
extern void bsp_postdriver_hook(void);
|
||||||
extern void bsp_libc_init( void *, uint32_t, int );
|
extern void bsp_libc_init( void *, uint32_t, int );
|
||||||
extern rtems_configuration_table BSP_Configuration;
|
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
extern char _RAMBase[];
|
extern char _RAMBase[];
|
||||||
@@ -69,8 +60,8 @@ void bsp_pretasking_hook(void)
|
|||||||
#endif
|
#endif
|
||||||
unsigned long ramSpace;
|
unsigned long ramSpace;
|
||||||
|
|
||||||
heapStart = (unsigned long)BSP_Configuration.work_space_start
|
heapStart = (unsigned long)Configuration.work_space_start
|
||||||
+ BSP_Configuration.work_space_size;
|
+ rtems_configuration_get_work_space_size();
|
||||||
|
|
||||||
if (heapStart & (CPU_ALIGNMENT-1))
|
if (heapStart & (CPU_ALIGNMENT-1))
|
||||||
heapStart = (heapStart + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
|
heapStart = (heapStart + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
|
||||||
@@ -121,9 +112,9 @@ void bsp_start( void )
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
BSP_Configuration.work_space_start = (void *)_WorkspaceBase;
|
Configuration.work_space_start = (void *)_WorkspaceBase;
|
||||||
#else
|
#else
|
||||||
BSP_Configuration.work_space_start = (void *)__alt_heap_start;
|
Configuration.work_space_start = (void *)__alt_heap_start;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user