diff --git a/c/src/lib/libbsp/powerpc/gen5200/ChangeLog b/c/src/lib/libbsp/powerpc/gen5200/ChangeLog index 403cda39b9..064b8cc79e 100644 --- a/c/src/lib/libbsp/powerpc/gen5200/ChangeLog +++ b/c/src/lib/libbsp/powerpc/gen5200/ChangeLog @@ -1,3 +1,10 @@ +2007-12-11 Joel Sherrill + + * bsp_specs, clock/clock.c, include/bsp.h, irq/irq.c, + startup/bspclean.c, startup/bspstart.c: Eliminate copies of the + Configuration Table. Use the RTEMS provided accessor macros to obtain + configuration fields. + 2007-12-06 Joel Sherrill * include/mpc5200.h: Expand tabs. diff --git a/c/src/lib/libbsp/powerpc/gen5200/bsp_specs b/c/src/lib/libbsp/powerpc/gen5200/bsp_specs index d750e714d9..15998a67db 100644 --- a/c/src/lib/libbsp/powerpc/gen5200/bsp_specs +++ b/c/src/lib/libbsp/powerpc/gen5200/bsp_specs @@ -3,12 +3,12 @@ %rename link old_link *startfile: -%{!qrtems: %(old_startfile)} %{!nostdlib: %{qrtems: ecrti%O%s rtems_crti%O%s crtbegin.o%s \ +%{!qrtems: %(old_startfile)} %{!nostdlib: %{qrtems: ecrti%O%s rtems_crti%O%s \ %{!qrtems_debug: start.o%s} \ %{qrtems_debug: start_g.o%s}}} *endfile: -%{!qrtems: %(old_endfile)} %{qrtems: crtend.o%s ecrtn.o%s} +%{!qrtems: %(old_endfile)} %{qrtems: ecrtn.o%s} *link: %{!qrtems: %(old_link)} %{qrtems: -dc -dp -u __vectors -N -u start -e start} diff --git a/c/src/lib/libbsp/powerpc/gen5200/clock/clock.c b/c/src/lib/libbsp/powerpc/gen5200/clock/clock.c index 9200eb3d6a..298d0cee19 100644 --- a/c/src/lib/libbsp/powerpc/gen5200/clock/clock.c +++ b/c/src/lib/libbsp/powerpc/gen5200/clock/clock.c @@ -130,7 +130,7 @@ void mpc5200_gpt_clock_isr(rtems_irq_hdl_param handle) status = gpt->status; if (ClockInitialized && (status & GPT_STATUS_TEXP)) { - gpt->status |= GPT_STATUS_TEXP; + gpt->status |= GPT_STATUS_RESET; Clock_last_TBR = PPC_Get_timebase_register(); Clock_driver_ticks++; @@ -328,7 +328,7 @@ int BSP_connect_clock_handler (uint32_t gpt_no) status = gpt->status; \ \ if (ClockInitialized && (status & GPT_STATUS_TEXP)) { \ - gpt->status |= GPT_STATUS_TEXP; \ + gpt->status |= GPT_STATUS_RESET; \ Clock_last_TBR = PPC_Get_timebase_register(); \ } \ } while(0) diff --git a/c/src/lib/libbsp/powerpc/gen5200/include/bsp.h b/c/src/lib/libbsp/powerpc/gen5200/include/bsp.h index 63d7744511..099a494e15 100644 --- a/c/src/lib/libbsp/powerpc/gen5200/include/bsp.h +++ b/c/src/lib/libbsp/powerpc/gen5200/include/bsp.h @@ -151,7 +151,6 @@ extern int rtems_mpc5200_fec_driver_attach_detach (struct rtems_bsdnet_ifconfig /* miscellaneous stuff assumed to exist */ -extern rtems_configuration_table BSP_Configuration; /* * We need to decide how much memory will be non-cacheable. This * will mainly be memory that will be used in DMA (network and serial diff --git a/c/src/lib/libbsp/powerpc/gen5200/irq/irq.c b/c/src/lib/libbsp/powerpc/gen5200/irq/irq.c index 2914452f23..b792ca5fe7 100644 --- a/c/src/lib/libbsp/powerpc/gen5200/irq/irq.c +++ b/c/src/lib/libbsp/powerpc/gen5200/irq/irq.c @@ -631,6 +631,50 @@ int BSP_rtems_irq_mngt_get(rtems_irq_global_settings** config) return 0; } +#include +uint64_t BSP_Starting_TBR; +uint64_t BSP_Total_in_ISR; +uint32_t BSP_ISR_Count; +uint32_t BSP_Worst_ISR; +#define BSP_COUNTED_IRQ 16 +uint32_t BSP_ISR_Count_Per[BSP_COUNTED_IRQ + 1]; + +void BSP_initialize_IRQ_Timing(void) +{ + int i; + BSP_Starting_TBR = PPC_Get_timebase_register(); + BSP_Total_in_ISR = 0; + BSP_ISR_Count = 0; + BSP_Worst_ISR = 0; + for ( i=0 ; i. Make sure that - * our configuration tables are uninitialized so that they get allocated in - * the .bss section (RAM). - */ -extern rtems_configuration_table Configuration; extern unsigned long intrStackPtr; -rtems_configuration_table BSP_Configuration; -char *rtems_progname; /* * Driver configuration parameters @@ -304,31 +295,23 @@ void bsp_start(void) rtems_cache_enable_data(); #endif - /* - * Allocate the memory for the RTEMS Work Space. This can come from - * a variety of places: hard coded address, malloc'ed from outside - * RTEMS world (e.g. simulator or primitive memory manager), or (as - * typically done by stock BSPs) by subtracting the required amount - * of work space from the last physical address on the CPU board. - */ - /* * Need to "allocate" the memory for the RTEMS Workspace and * tell the RTEMS configuration where it is. This memory is * not malloc'ed. It is just "pulled from the air". */ - BSP_Configuration.work_space_start = (void *)&_WorkspaceBase; - - - /* - BSP_Configuration.microseconds_per_tick = 1000; - */ + Configuration.work_space_start = (void *)&_WorkspaceBase; /* * Initalize RTEMS IRQ system */ BSP_rtems_irq_mng_init(0); + { + void BSP_initialize_IRQ_Timing(void); + BSP_initialize_IRQ_Timing(); + } + #ifdef SHOW_MORE_INIT_SETTINGS printk("Exit from bspstart\n"); #endif @@ -344,17 +327,13 @@ void bsp_start(void) * defined in HID0. HID0 is set during starup in start.S. * */ -Thread _Thread_Idle_body(uint32_t ignored ) - { - - for(;;) - { - - asm volatile("mfmsr 3; oris 3,3,4; sync; mtmsr 3; isync; ori 3,3,0; ori 3,3,0"); - - } - - return 0; - +Thread _Thread_Idle_body(uint32_t ignored) +{ + for(;;) { + asm volatile( + "mfmsr 3; oris 3,3,4; sync; mtmsr 3; isync; ori 3,3,0; ori 3,3,0" + ); } + return 0; +}