Changeset 4678d1a in rtems


Ignore:
Timestamp:
Jul 24, 2018, 8:50:39 AM (17 months ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
406dd62
Parents:
0d362ff3
git-author:
Sebastian Huber <sebastian.huber@…> (07/24/18 08:50:39)
git-committer:
Sebastian Huber <sebastian.huber@…> (07/25/18 08:07:42)
Message:

bsps: bsp_start_on_secondary_processor()

Pass current processor control as first parameter in
bsp_start_on_secondary_processor() and qoriq_start_thread() to make
dependency more explicit.

Files:
7 edited

Legend:

Unmodified
Added
Removed
  • bsps/include/bsp/bootcard.h

    r0d362ff3 r4678d1a  
    168168void bsp_work_area_initialize(void);
    169169
     170struct Per_CPU_Control;
     171
    170172/**
    171173 * @brief Standard start routine for secondary processors.
     
    176178 * _SMP_Start_multitasking_on_secondary_processor().
    177179 */
    178 void bsp_start_on_secondary_processor(void);
     180void bsp_start_on_secondary_processor(struct Per_CPU_Control *cpu_self);
    179181
    180182/** @} */
  • bsps/powerpc/qoriq/include/bsp.h

    r0d362ff3 r4678d1a  
    106106qoriq_start_spin_table_addr[QORIQ_CPU_COUNT / QORIQ_THREAD_COUNT];
    107107
    108 void qoriq_start_thread(void);
     108struct Per_CPU_Control;
     109
     110void qoriq_start_thread(struct Per_CPU_Control *);
    109111
    110112void qoriq_restart_secondary_processor(
  • bsps/powerpc/qoriq/start/bspsmp.c

    r0d362ff3 r4678d1a  
    4545}
    4646
    47 void qoriq_start_thread(void)
    48 {
    49   const Per_CPU_Control *cpu_self = _Per_CPU_Get();
    50 
     47void qoriq_start_thread(Per_CPU_Control *cpu_self)
     48{
    5149  ppc_exc_initialize_interrupt_stack(
    5250    (uintptr_t) cpu_self->interrupt_stack_low,
     
    8684}
    8785
    88 void bsp_start_on_secondary_processor(void)
    89 {
    90   uint32_t cpu_index_self = _SMP_Get_current_processor();
    91   const Per_CPU_Control *cpu_self = _Per_CPU_Get_by_index(cpu_index_self);
     86void bsp_start_on_secondary_processor(Per_CPU_Control *cpu_self)
     87{
     88  uint32_t cpu_index_self;
    9289
    9390  qoriq_initialize_exceptions(cpu_self->interrupt_stack_low);
    9491  bsp_interrupt_facility_initialize();
    9592
     93  cpu_index_self = _Per_CPU_Get_index(cpu_self);
    9694  start_thread_if_necessary(cpu_index_self);
    9795
  • bsps/powerpc/qoriq/start/start.S

    r0d362ff3 r4678d1a  
    3939#define SAVED_LINK_REGISTER r16
    4040#define FDT_REGISTER r17
     41#define CPU_SELF r18
    4142
    4243        .globl _start
     
    196197#endif
    197198
    198         SET_SELF_CPU_CONTROL    r4, r5
     199        SET_SELF_CPU_CONTROL    CPU_SELF, r5
    199200
    200201        blr
     
    317318
    318319        /* Initialize start stack */
    319         GET_SELF_CPU_CONTROL    r3
    320         PPC_REG_LOAD    r3, PER_CPU_INTERRUPT_STACK_HIGH(r3)
     320        PPC_REG_LOAD    r3, PER_CPU_INTERRUPT_STACK_HIGH(CPU_SELF)
    321321        subi    r1, r3, PPC_MINIMUM_STACK_FRAME_SIZE
    322322        clrrwi  r1, r1, PPC_STACK_ALIGN_POWER
     
    328328#endif
    329329
     330        mr      r3, CPU_SELF
    330331        b       qoriq_start_thread
    331332        PPC64_NOP_FOR_LINKER_TOC_POINTER_RESTORE
     
    340341        li      r3, 0
    341342        bl      .Linitmmu
     343        mr      r3, CPU_SELF
    342344        b       bsp_start_on_secondary_processor
    343345        PPC64_NOP_FOR_LINKER_TOC_POINTER_RESTORE
  • bsps/sparc/leon3/start/bspsmp.c

    r0d362ff3 r4678d1a  
    3636}
    3737
    38 void bsp_start_on_secondary_processor()
     38void bsp_start_on_secondary_processor(Per_CPU_Control *cpu_self)
    3939{
    40   uint32_t cpu_index_self = _CPU_SMP_Get_current_processor();
     40  uint32_t cpu_index_self;
    4141
    4242  /*
     
    5050
    5151  /* Unmask IPI interrupts at Interrupt controller for this CPU */
     52  cpu_index_self = _Per_CPU_Get_index(cpu_self);
    5253  LEON3_IrqCtrl_Regs->mask[cpu_index_self] |= 1U << LEON3_mp_irq;
    5354
  • bsps/sparc/shared/start/start.S

    r0d362ff3 r4678d1a  
    311311        mov     %sp, %fp                ! set frame pointer
    312312
     313        mv      %o0, %g6
    313314        call    SYM(bsp_start_on_secondary_processor) ! does not return
    314315         sub    %sp, SPARC_MINIMUM_STACK_FRAME_SIZE, %sp
  • testsuites/smptests/smpfatal08/init.c

    r0d362ff3 r4678d1a  
    3535 */
    3636
    37 void bsp_start_on_secondary_processor(void)
     37void bsp_start_on_secondary_processor(struct Per_CPU_Control *cpu_self)
    3838{
    3939  /* Provided to avoid multiple definitions of the CPU SMP support functions */
     40  (void) cpu_self;
    4041}
    4142
    4243#if QORIQ_THREAD_COUNT > 1
    43 void qoriq_start_thread(void)
     44void qoriq_start_thread(Per_CPU_Control *cpu_self)
    4445{
    4546  /* Provided to avoid multiple definitions of the CPU SMP support functions */
     47  (void) cpu_self;
    4648}
    4749#endif
Note: See TracChangeset for help on using the changeset viewer.