Browse Source

Rename HART_MASK to DISABLED_HART_MASK to clarify polarity

pull/53/head
Andrew Waterman 9 years ago
parent
commit
dce2b7dd8e
  1. 2
      bbl/bbl.c
  2. 4
      machine/mentry.S
  3. 2
      machine/minit.c
  4. 2
      machine/mtrap.c
  5. 2
      machine/mtrap.h

2
bbl/bbl.c

@ -23,7 +23,7 @@ static void filter_dtb(uintptr_t source)
memcpy((void*)dest, (void*)source, size);
// Remove information from the chained FDT
filter_harts(dest, HART_MASK);
filter_harts(dest, DISABLED_HART_MASK);
filter_plic(dest);
filter_compat(dest, "riscv,clint0");
filter_compat(dest, "riscv,debug-013");

4
machine/mentry.S

@ -258,7 +258,7 @@ do_reset:
add sp, sp, a2
# Boot on the first unmasked hart
li a4, (~HART_MASK & (HART_MASK+1))
li a4, (~DISABLED_HART_MASK & (DISABLED_HART_MASK+1))
srl a4, a4, a3
andi a4, a4, 1
bnez a4, init_first_hart
@ -273,7 +273,7 @@ do_reset:
wfi
# masked harts never start
li a4, HART_MASK
li a4, DISABLED_HART_MASK
srl a4, a4, a3
andi a4, a4, 1
bnez a4, .LmultiHart

2
machine/minit.c

@ -124,7 +124,7 @@ static void hart_plic_init()
static void wake_harts()
{
for (int hart = 0; hart < MAX_HARTS; ++hart)
if ((((~HART_MASK & hart_mask) >> hart) & 1))
if ((((~DISABLED_HART_MASK & hart_mask) >> hart) & 1))
*OTHER_HLS(hart)->ipi = 1; // wakeup the hart
}

2
machine/mtrap.c

@ -50,7 +50,7 @@ void printm(const char* s, ...)
static void send_ipi(uintptr_t recipient, int event)
{
if (((HART_MASK >> recipient) & 1)) return;
if (((DISABLED_HART_MASK >> recipient) & 1)) return;
atomic_or(&OTHER_HLS(recipient)->mipi_pending, event);
mb();
*OTHER_HLS(recipient)->ipi = 1;

2
machine/mtrap.h

@ -10,7 +10,7 @@
#endif
// These harts will be prevented from booting beyond bbl
#define HART_MASK 0x0UL
#define DISABLED_HART_MASK 0x0UL
#ifndef __ASSEMBLER__

Loading…
Cancel
Save