Changeset 5023c874 in rtems


Ignore:
Timestamp:
Dec 11, 2007, 3:46:33 PM (12 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.9, master
Children:
ed5ba1c9
Parents:
7f6bb8c
Message:

2007-12-11 Joel Sherrill <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.
Location:
c/src/lib/libbsp/powerpc/gen5200
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/powerpc/gen5200/ChangeLog

    r7f6bb8c r5023c874  
     12007-12-11      Joel Sherrill <joel.sherrill@OARcorp.com>
     2
     3        * bsp_specs, clock/clock.c, include/bsp.h, irq/irq.c,
     4        startup/bspclean.c, startup/bspstart.c: Eliminate copies of the
     5        Configuration Table. Use the RTEMS provided accessor macros to obtain
     6        configuration fields.
     7
    182007-12-06      Joel Sherrill <joel.sherrill@oarcorp.com>
    29
  • c/src/lib/libbsp/powerpc/gen5200/bsp_specs

    r7f6bb8c r5023c874  
    44
    55*startfile:
    6 %{!qrtems: %(old_startfile)} %{!nostdlib: %{qrtems:  ecrti%O%s rtems_crti%O%s  crtbegin.o%s  \
     6%{!qrtems: %(old_startfile)} %{!nostdlib: %{qrtems:  ecrti%O%s rtems_crti%O%s \
    77%{!qrtems_debug: start.o%s} \
    88%{qrtems_debug: start_g.o%s}}}
    99
    1010*endfile:
    11 %{!qrtems: %(old_endfile)} %{qrtems: crtend.o%s ecrtn.o%s}
     11%{!qrtems: %(old_endfile)} %{qrtems: ecrtn.o%s}
    1212
    1313*link:
  • c/src/lib/libbsp/powerpc/gen5200/clock/clock.c

    r7f6bb8c r5023c874  
    131131
    132132  if (ClockInitialized  && (status & GPT_STATUS_TEXP)) {
    133     gpt->status |= GPT_STATUS_TEXP;
     133    gpt->status |= GPT_STATUS_RESET;
    134134    Clock_last_TBR = PPC_Get_timebase_register();
    135135
     
    329329    \
    330330    if (ClockInitialized  && (status & GPT_STATUS_TEXP)) {               \
    331       gpt->status |= GPT_STATUS_TEXP;                                    \
     331      gpt->status |= GPT_STATUS_RESET;                                   \
    332332      Clock_last_TBR = PPC_Get_timebase_register();                      \
    333333    }                                                                    \
  • c/src/lib/libbsp/powerpc/gen5200/include/bsp.h

    r7f6bb8c r5023c874  
    152152/* miscellaneous stuff assumed to exist */
    153153
    154 extern rtems_configuration_table BSP_Configuration;
    155154/*
    156155 * We need to decide how much memory will be non-cacheable. This
  • c/src/lib/libbsp/powerpc/gen5200/irq/irq.c

    r7f6bb8c r5023c874  
    632632}
    633633
     634#include <stdio.h>
     635uint64_t BSP_Starting_TBR;
     636uint64_t BSP_Total_in_ISR;
     637uint32_t BSP_ISR_Count;
     638uint32_t BSP_Worst_ISR;
     639#define BSP_COUNTED_IRQ 16
     640uint32_t BSP_ISR_Count_Per[BSP_COUNTED_IRQ + 1];
     641
     642void BSP_initialize_IRQ_Timing(void)
     643{
     644  int i;
     645  BSP_Starting_TBR = PPC_Get_timebase_register();
     646  BSP_Total_in_ISR = 0;
     647  BSP_ISR_Count = 0;
     648  BSP_Worst_ISR = 0;
     649  for ( i=0 ; i<BSP_COUNTED_IRQ ; i++ )
     650    BSP_ISR_Count_Per[i] = 0;
     651}
     652
     653static const char * u64tostring(
     654  char *buffer,
     655  uint64_t v
     656)
     657{
     658  sprintf( buffer, "%lld %lld usecs", v, (v / 33) );
     659  return buffer;
     660}
     661void BSP_report_IRQ_Timing(void)
     662{
     663  uint64_t now;
     664  char buffer[96];
     665  int i;
     666
     667  now = PPC_Get_timebase_register();
     668  printk( "Started at: %s\n", u64tostring(buffer, BSP_Starting_TBR) );
     669  printk( "Current   : %s\n", u64tostring(buffer, now) );
     670  printk( "System up : %s\n", u64tostring(buffer, now - BSP_Starting_TBR) );
     671  printk( "ISRs      : %d\n", BSP_ISR_Count );
     672  printk( "ISRs ran  : %s\n", u64tostring(buffer, BSP_Total_in_ISR) );
     673  printk( "Worst ISR : %s\n", u64tostring(buffer, BSP_Worst_ISR) );
     674  for ( i=0 ; i<BSP_COUNTED_IRQ ; i++ )
     675    printk( "IRQ %d: %d\n", i, BSP_ISR_Count_Per[i] );
     676  printk( "Ticks     : %d\n",  Clock_driver_ticks );
     677}
    634678
    635679/*
     
    643687  register unsigned int pmce;
    644688  register unsigned int crit_pri_main_mask, per_mask;
     689  uint64_t start, stop, thisTime;
     690
     691  start = PPC_Get_timebase_register();
     692  BSP_ISR_Count++;
     693  if ( excNum < BSP_COUNTED_IRQ )
     694    BSP_ISR_Count_Per[excNum]++;
     695  else
     696    printk( "not counting %d\n", excNum);
    645697
    646698  switch (excNum) {
  • c/src/lib/libbsp/powerpc/gen5200/startup/bspclean.c

    r7f6bb8c r5023c874  
    2121void bsp_cleanup( void )
    2222{
     23 
     24  {
     25    extern void BSP_report_IRQ_Timing(void);
     26    BSP_report_IRQ_Timing();
     27  }
     28 
    2329  #if defined(BSP_PRESS_KEY_FOR_RESET)
    2430    printk( "\nEXECUTIVE SHUTDOWN! Any key to reboot..." );
  • c/src/lib/libbsp/powerpc/gen5200/startup/bspstart.c

    r7f6bb8c r5023c874  
    121121SPR_RW(SPRG1)
    122122
    123 /*
    124  *  The original table from the application (in ROM) and our copy of it with
    125  *  some changes. Configuration is defined in <confdefs.h>. Make sure that
    126  *  our configuration tables are uninitialized so that they get allocated in
    127  *  the .bss section (RAM).
    128  */
    129 extern rtems_configuration_table Configuration;
    130123extern unsigned long intrStackPtr;
    131 rtems_configuration_table  BSP_Configuration;
    132 char *rtems_progname;
    133124
    134125/*
     
    306297
    307298  /*
    308    *  Allocate the memory for the RTEMS Work Space.  This can come from
    309    *  a variety of places: hard coded address, malloc'ed from outside
    310    *  RTEMS world (e.g. simulator or primitive memory manager), or (as
    311    *  typically done by stock BSPs) by subtracting the required amount
    312    *  of work space from the last physical address on the CPU board.
    313    */
    314 
    315   /*
    316299   *  Need to "allocate" the memory for the RTEMS Workspace and
    317300   *  tell the RTEMS configuration where it is.  This memory is
    318301   *  not malloc'ed.  It is just "pulled from the air".
    319302   */
    320   BSP_Configuration.work_space_start = (void *)&_WorkspaceBase;
    321 
    322 
    323   /*
    324   BSP_Configuration.microseconds_per_tick  = 1000;
    325   */
     303  Configuration.work_space_start = (void *)&_WorkspaceBase;
    326304
    327305  /*
     
    329307   */
    330308  BSP_rtems_irq_mng_init(0);
     309
     310  {
     311    void BSP_initialize_IRQ_Timing(void);
     312    BSP_initialize_IRQ_Timing();
     313  }
    331314
    332315#ifdef SHOW_MORE_INIT_SETTINGS
     
    345328 *
    346329 */
    347 Thread _Thread_Idle_body(uint32_t ignored )
    348   {
    349 
    350   for(;;)
    351     {
    352 
    353     asm volatile("mfmsr 3; oris 3,3,4; sync; mtmsr 3; isync; ori 3,3,0; ori 3,3,0");
    354 
    355     }
    356 
     330Thread _Thread_Idle_body(uint32_t ignored)
     331{
     332  for(;;) {
     333    asm volatile(
     334      "mfmsr 3; oris 3,3,4; sync; mtmsr 3; isync; ori 3,3,0; ori 3,3,0"
     335     );
     336  }
    357337  return 0;
    358 
    359   }
    360 
     338}
     339
Note: See TracChangeset for help on using the changeset viewer.