Changeset 7ec8d95 in rtems


Ignore:
Timestamp:
Feb 19, 2014, 3:42:23 PM (6 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
07713db6
Parents:
4fe6759e
git-author:
Sebastian Huber <sebastian.huber@…> (02/19/14 15:42:23)
git-committer:
Sebastian Huber <sebastian.huber@…> (02/21/14 08:38:56)
Message:

bsp/leon3: Add and use leon3_get_cpu_count()

Location:
c/src/lib/libbsp/sparc/leon3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/sparc/leon3/include/leon.h

    r4fe6759e r7ec8d95  
    335335void leon3_power_down_loop(void) RTEMS_COMPILER_NO_RETURN_ATTRIBUTE;
    336336
     337static inline uint32_t leon3_get_cpu_count(
     338  volatile struct irqmp_regs *irqmp
     339)
     340{
     341  uint32_t mpstat = irqmp->mpstat;
     342
     343  return ((mpstat >> LEON3_IRQMPSTATUS_CPUNR) & 0xf)  + 1;
     344}
     345
    337346#endif /* !ASM */
    338347
  • c/src/lib/libbsp/sparc/leon3/smp/smp_leon3.c

    r4fe6759e r7ec8d95  
    5656  sparc_leon3_set_cctrl( 0x80000F );
    5757
    58   max_cpu_count =
    59     ((LEON3_IrqCtrl_Regs->mpstat >> LEON3_IRQMPSTATUS_CPUNR) & 0xf)  + 1;
     58  max_cpu_count = leon3_get_cpu_count(LEON3_IrqCtrl_Regs);
    6059  used_cpu_count = configured_cpu_count < max_cpu_count ?
    6160    configured_cpu_count : max_cpu_count;
Note: See TracChangeset for help on using the changeset viewer.