diff options
Diffstat (limited to 'machine/fdt.c')
-rw-r--r-- | machine/fdt.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/machine/fdt.c b/machine/fdt.c index 34ff87b..cfa7ee9 100644 --- a/machine/fdt.c +++ b/machine/fdt.c @@ -239,7 +239,6 @@ static void hart_done(const struct fdt_scan_node *node, void *extra) if (scan->hart < MAX_HARTS) { hart_phandles[scan->hart] = scan->phandle; hart_mask |= 1 << scan->hart; - if (scan->hart >= num_harts) num_harts = scan->hart + 1; hls_init(scan->hart); } } @@ -266,9 +265,10 @@ void query_harts(uintptr_t fdt) cb.close= hart_close; cb.extra = &scan; - num_harts = 0; fdt_scan(fdt, &cb); - assert (num_harts > 0); + + // The current hart should have been detected + assert ((hart_mask >> read_csr(mhartid)) != 0); } ///////////////////////////////////////////// CLINT SCAN ///////////////////////////////////////// |