Changeset 4c740de in rtems


Ignore:
Timestamp:
Aug 2, 2018, 12:13:25 PM (15 months ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
141d502
Parents:
28b8cf9b
Message:

bsp/riscv: Fix build with RTEMS_SMP undefined

Update #3433.

Location:
bsps/riscv/riscv
Files:
3 edited

Legend:

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

    r28b8cf9b r4c740de  
    4141#ifdef RTEMS_SMP
    4242extern uint32_t riscv_hart_count;
    43 
    44 extern uint32_t riscv_hart_phandles[CPU_MAXIMUM_PROCESSORS];
     43#else
     44#define riscv_hart_count 1
     45#endif
    4546
    4647uint32_t riscv_get_hart_index_by_phandle(uint32_t phandle);
    47 #endif
    4848
    4949#if RISCV_ENABLE_HTIF_SUPPORT != 0
  • bsps/riscv/riscv/irq/irq.c

    r28b8cf9b r4c740de  
    117117  volatile RISCV_CLINT_regs *clint;
    118118  int node;
    119 #ifdef RTEMS_SMP
    120119  const uint32_t *val;
    121120  int len;
    122121  int i;
    123 #endif
    124122
    125123  node = fdt_node_offset_by_compatible(fdt, -1, "riscv,clint0");
     
    132130  riscv_clint = clint;
    133131
    134 #ifdef RTEMS_SMP
    135132  val = fdt_getprop(fdt, node, "interrupts-extended", &len);
    136133
     
    148145    cpu->cpu_per_cpu.clint_mtimecmp = &clint->mtimecmp[i / 16];
    149146  }
    150 #endif
    151147}
    152148
  • bsps/riscv/riscv/start/bspstart.c

    r28b8cf9b r4c740de  
    7575uint32_t riscv_hart_count;
    7676
    77 uint32_t riscv_hart_phandles[CPU_MAXIMUM_PROCESSORS];
     77static uint32_t riscv_hart_phandles[CPU_MAXIMUM_PROCESSORS];
     78#else
     79static uint32_t riscv_hart_phandles[1];
     80#endif
    7881
    7982static void riscv_find_harts(void)
     
    101104    hart_index = fdt32_to_cpu(val[0]);
    102105
    103     if (hart_index >= CPU_MAXIMUM_PROCESSORS) {
     106    if (hart_index >= RTEMS_ARRAY_SIZE(riscv_hart_phandles)) {
    104107      continue;
    105108    }
     
    141144  }
    142145
     146#ifdef RTEMS_SMP
    143147  riscv_hart_count = max_hart_index + 1;
     148#endif
    144149}
    145150
     
    156161  return UINT32_MAX;
    157162}
    158 #endif
    159163
    160164void bsp_start(void)
    161165{
    162 #ifdef RTEMS_SMP
    163166  riscv_find_harts();
    164 #endif
    165167  bsp_interrupt_initialize();
    166168}
Note: See TracChangeset for help on using the changeset viewer.