The code that you're using says this:
```
#define PLIC_HART0_ENABLE_BASE_ADDR 0x0
#define PLIC_HART1_ENABLE_BASE_ADDR 0x80
```
implying that the hart0 enable is at offset 0x0 and the hart1 enable is at offset 0x80.
And it only mentions 2 harts so it's unclear how that code is dealing with 4.