Changeset e644155a in rtems


Ignore:
Timestamp:
Feb 14, 2014, 8:20:08 AM (7 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, 5, master
Children:
88ef740e
Parents:
ad56361
git-author:
Sebastian Huber <sebastian.huber@…> (02/14/14 08:20:08)
git-committer:
Sebastian Huber <sebastian.huber@…> (02/14/14 09:28:30)
Message:

bsp/leon3: Do not define RTEMS_DEBUG

Move vital code out of debug section. Harmonize variable names with
other implementations.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/sparc/leon3/smp/smp_leon3.c

    rad56361 re644155a  
    1919#include <rtems/bspsmp.h>
    2020#include <stdlib.h>
    21 
    22 #define RTEMS_DEBUG
    2321
    2422static inline void sparc_leon3_set_cctrl( unsigned int val )
     
    5250uint32_t bsp_smp_initialize( uint32_t configured_cpu_count )
    5351{
     52  uint32_t max_cpu_count;
     53  uint32_t used_cpu_count;
    5454  uint32_t cpu;
    55   uint32_t found_cpus = 0;
    5655
    5756  sparc_leon3_set_cctrl( 0x80000F );
    58   found_cpus =
     57
     58  max_cpu_count =
    5959    ((LEON3_IrqCtrl_Regs->mpstat >> LEON3_IRQMPSTATUS_CPUNR) & 0xf)  + 1;
     60  used_cpu_count = configured_cpu_count < max_cpu_count ?
     61    configured_cpu_count : max_cpu_count;
    6062
    6163  #if defined(RTEMS_DEBUG)
    62     printk( "Found %d CPUs\n", found_cpus );
     64    printk( "Found %d CPUs\n", max_cpu_count );
    6365
    64     if ( found_cpus > configured_cpu_count ) {
     66    if ( max_cpu_count > configured_cpu_count ) {
    6567      printk(
    6668        "%d CPUs IS MORE THAN CONFIGURED -- ONLY USING %d\n",
    67         found_cpus,
     69        max_cpu_count,
    6870        configured_cpu_count
    6971      );
    70       found_cpus = configured_cpu_count;
    7172    }
    7273  #endif
    7374
    74   if ( found_cpus > 1 ) {
     75  if ( used_cpu_count > 1 ) {
    7576    LEON_Unmask_interrupt(LEON3_MP_IRQ);
    7677    set_vector(bsp_ap_ipi_isr, LEON_TRAP_TYPE(LEON3_MP_IRQ), 1);
    7778  }
    7879
    79   for ( cpu = 1 ; cpu < found_cpus ; ++cpu ) {
     80  for ( cpu = 1 ; cpu < used_cpu_count ; ++cpu ) {
    8081    #if defined(RTEMS_DEBUG)
    8182      printk( "Waking CPU %d\n", cpu );
     
    8586  }
    8687
    87   return found_cpus;
     88  return used_cpu_count;
    8889}
    8990
Note: See TracChangeset for help on using the changeset viewer.