3 ms·
I'm not sure if Thread local would work since i'm not certain if the bootloader can handle a TLS section in the ELF file, my kernel cannot do this either as I'v
by zaarn 8y ago
I'm not sure if Thread local would work since i'm not certain if the bootloader can handle a TLS section in the ELF file, my kernel cannot do this either as I've yet to implement threading.
Reentrance is not the issue here, I guard this inside the data structure, interrupts will be worst case reentrance most of the time.
- eddyb 8y agoThen you can use the techniques in the thread I linked. But without guarding mutability behind some way to indicate interrupts are disabled, or an outright lock, and without guaranteeing no data races (Sync), it's not actually safe. And the compiler can't make `static mut` safe to use as any of those requirements could be broken and then it's not safe at all anymore.