|
@@ -14,7 +14,7 @@
|
|
#include <sbi/sbi_scratch.h>
|
|
#include <sbi/sbi_scratch.h>
|
|
#include <sbi/sbi_string.h>
|
|
#include <sbi/sbi_string.h>
|
|
|
|
|
|
-u32 last_hartid_having_scratch = SBI_HARTMASK_MAX_BITS;
|
|
|
|
|
|
+u32 last_hartid_having_scratch = SBI_HARTMASK_MAX_BITS - 1;
|
|
struct sbi_scratch *hartid_to_scratch_table[SBI_HARTMASK_MAX_BITS] = { 0 };
|
|
struct sbi_scratch *hartid_to_scratch_table[SBI_HARTMASK_MAX_BITS] = { 0 };
|
|
|
|
|
|
static spinlock_t extra_lock = SPIN_LOCK_INITIALIZER;
|
|
static spinlock_t extra_lock = SPIN_LOCK_INITIALIZER;
|
|
@@ -74,7 +74,7 @@ done:
|
|
spin_unlock(&extra_lock);
|
|
spin_unlock(&extra_lock);
|
|
|
|
|
|
if (ret) {
|
|
if (ret) {
|
|
- for (i = 0; i < sbi_scratch_last_hartid(); i++) {
|
|
|
|
|
|
+ for (i = 0; i <= sbi_scratch_last_hartid(); i++) {
|
|
rscratch = sbi_hartid_to_scratch(i);
|
|
rscratch = sbi_hartid_to_scratch(i);
|
|
if (!rscratch)
|
|
if (!rscratch)
|
|
continue;
|
|
continue;
|