Changeset a1f9265c in rtems


Ignore:
Timestamp:
Jul 3, 2020, 12:31:47 PM (5 weeks ago)
Author:
Jan Sommer <jan.sommer@…>
Branches:
5
Children:
849d7418
Parents:
46c23871
git-author:
Jan Sommer <jan.sommer@…> (07/03/20 12:31:47)
git-committer:
Joel Sherrill <joel@…> (07/16/20 13:08:09)
Message:

bsps/pc386: Fix IPI for non-consecutive APICIDs

  • properly use the cpu <-> apic maps for IPIs

Closes #4028.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • bsps/i386/pc386/start/smp-imps.c

    r46c23871 ra1f9265c  
    227227send_ipi(unsigned int dst, unsigned int v)
    228228{
    229   int to, send_status;
    230 
    231   IMPS_LAPIC_WRITE(LAPIC_ICR+0x10, (dst << 24));
     229  int to, send_status, apicid;
     230
     231  apicid = imps_cpu_apic_map[dst];
     232
     233  IMPS_LAPIC_WRITE(LAPIC_ICR+0x10, (apicid << 24));
    232234  IMPS_LAPIC_WRITE(LAPIC_ICR, v);
    233235
     
    252254{
    253255  int apicid = proc->apic_id, success = 1;
     256  int cpuid;
    254257  unsigned bootaddr;
    255258  unsigned bios_reset_vector = PHYS_TO_VIRTUAL(BIOS_RESET_VECTOR);
    256259
     260  cpuid = imps_apic_cpu_map[apicid];
    257261  /*
    258262   * Copy boot code for secondary CPUs here.  Find it in between
     
    277281   * see startAP.S for location */
    278282  reset[1] = (uint32_t)secondary_cpu_initialize;
    279   reset[2] = (uint32_t)_Per_CPU_Get_by_index(apicid)->interrupt_stack_high;
     283  reset[2] = (uint32_t)_Per_CPU_Get_by_index(cpuid)->interrupt_stack_high;
    280284  memcpy(
    281285        (char*) &reset[3],
     
    296300  /* assert INIT IPI */
    297301  send_ipi(
    298     apicid,
     302    cpuid,
    299303    LAPIC_ICR_TM_LEVEL | LAPIC_ICR_LEVELASSERT | LAPIC_ICR_DM_INIT
    300304  );
     
    302306
    303307  /* de-assert INIT IPI */
    304   send_ipi(apicid, LAPIC_ICR_TM_LEVEL | LAPIC_ICR_DM_INIT);
     308  send_ipi(cpuid, LAPIC_ICR_TM_LEVEL | LAPIC_ICR_DM_INIT);
    305309
    306310  UDELAY(10000);
     
    313317    int i;
    314318    for (i = 1; i <= 2; i++) {
    315       send_ipi(apicid, LAPIC_ICR_DM_SIPI | ((bootaddr >> 12) & 0xFF));
     319      send_ipi(cpuid, LAPIC_ICR_DM_SIPI | ((bootaddr >> 12) & 0xFF));
    316320      UDELAY(1000);
    317321    }
Note: See TracChangeset for help on using the changeset viewer.