Changeset cbddf5de in rtems


Ignore:
Timestamp:
03/15/23 13:31:20 (7 months ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
11cc51e
Parents:
e5233057
git-author:
Sebastian Huber <sebastian.huber@…> (03/15/23 13:31:20)
git-committer:
Sebastian Huber <sebastian.huber@…> (03/17/23 06:25:34)
Message:

bsps/riscv: Fix riscv_get_hart_index_by_phandle()

Take a non-zero RISCV_BOOT_HARTID into account.

Location:
bsps/riscv/riscv/start
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • bsps/riscv/riscv/start/bspsmp.c

    re5233057 rcbddf5de  
    4747uint32_t _CPU_SMP_Initialize(void)
    4848{
    49   return riscv_hart_count - RISCV_BOOT_HARTID;
     49  return riscv_hart_count;
    5050}
    5151
  • bsps/riscv/riscv/start/bspstart.c

    re5233057 rcbddf5de  
    112112    hart_index = fdt32_to_cpu(val[0]);
    113113
     114#if RISCV_BOOT_HARTID != 0
     115    if (hart_index < RISCV_BOOT_HARTID) {
     116      continue;
     117    }
     118
     119    hart_index -= RISCV_BOOT_HARTID;
     120#endif
     121
    114122    if (hart_index >= RTEMS_ARRAY_SIZE(riscv_hart_phandles)) {
    115123      continue;
     
    167175  for (hart_index = 0; hart_index < riscv_hart_count; ++hart_index) {
    168176    if (riscv_hart_phandles[hart_index] == phandle) {
    169       return hart_index;
     177      return hart_index + RISCV_BOOT_HARTID;
    170178    }
    171179  }
Note: See TracChangeset for help on using the changeset viewer.