Changeset aa19873 in rtems


Ignore:
Timestamp:
Apr 24, 2017, 2:39:49 PM (2 years ago)
Author:
Martin Aberg <maberg@…>
Branches:
master
Children:
8670c464
Parents:
039edd2a
git-author:
Martin Aberg <maberg@…> (04/24/17 14:39:49)
git-committer:
Daniel Hellstrom <daniel@…> (05/14/17 10:31:59)
Message:

leon: allow SMP boot from any CPU

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

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/sparc/leon3/startup/bspstart.c

    r039edd2a raa19873  
    3636/* Index of CPU, in an AMP system CPU-index may be non-zero */
    3737uint32_t LEON3_Cpu_Index = 0;
     38
     39#if defined(RTEMS_SMP)
     40/* Index of the boot CPU. Set by the first CPU at boot to its CPU ID. */
     41int LEON3_Boot_Cpu = -1;
     42#endif
    3843
    3944/*
  • c/src/lib/libbsp/sparc/shared/start/start.S

    r039edd2a raa19873  
    282282        srl     %o0, LEON3_ASR17_PROCESSOR_INDEX_SHIFT, %o0
    283283
    284         cmp     %o0, 0
    285         beq     cpu0
    286          nop
    287 
    288284        sll     %o0, PER_CPU_CONTROL_SIZE_LOG2, %l0
    289285        add     %g6, %l0, %g6
     286
     287        /* If LEON3_Boot_Cpu < 0 then assign us as boot CPU and continue. */
     288        set     SYM(LEON3_Boot_Cpu), %o1
     289        ld      [%o1], %o2
     290        tst     %o2
     291        bneg    .Lbootcpu
     292         nop
    290293
    291294        ld      [%g6 + PER_CPU_INTERRUPT_STACK_HIGH], %sp ! set stack pointer
     
    296299        call    SYM(bsp_start_on_secondary_processor) ! does not return
    297300         sub    %sp, SPARC_MINIMUM_STACK_FRAME_SIZE, %sp
    298 cpu0:
     301.Lbootcpu:
     302        st      %o0, [%o1]
    299303#endif
    300304
Note: See TracChangeset for help on using the changeset viewer.