Browse Source

Fix for missing supervisor mode when running on E51 (#96)

The E51 core on the U54-MC lacks supervisor mode, thus the plic_s_ie and plic_s_thresh are NULL when running on this core. This adds checks for this case.
pull/106/head
Jim Straus 8 years ago
committed by Wesley W. Terpstra
parent
commit
94bcafff6a
  1. 13
      machine/minit.c

13
machine/minit.c

@ -124,10 +124,17 @@ static void hart_plic_init()
return;
size_t ie_words = plic_ndevs / sizeof(uintptr_t) + 1;
for (size_t i = 0; i < ie_words; i++)
HLS()->plic_s_ie[i] = ULONG_MAX;
for (size_t i = 0; i < ie_words; i++) {
if (HLS()->plic_s_ie) {
// Supervisor not always present
HLS()->plic_s_ie[i] = ULONG_MAX;
}
}
*HLS()->plic_m_thresh = 1;
*HLS()->plic_s_thresh = 0;
if (HLS()->plic_s_thresh) {
// Supervisor not always present
*HLS()->plic_s_thresh = 0;
}
}
static void wake_harts()

Loading…
Cancel
Save