Purpose: Esp. for printing, but ultimately for any shared resource we want to prevent concurrency issues and race conditions. Therefore, we may want to implement a very simple synchronisation barrier.
Implementation: Maybe some simple asm wfe and sev instructions wrapped in a function, maybe some simple inter-thread communication. It's okay if it's not general purpose code but only put around shared resources. Putting a construct similar to uart_init into macros might be enough
Testing: Print concurrently and see what happens. Maybe remove any existing synchronisation from kernel_main and see if each processor prints one after another
Purpose: Esp. for printing, but ultimately for any shared resource we want to prevent concurrency issues and race conditions. Therefore, we may want to implement a very simple synchronisation barrier.
Implementation: Maybe some simple asm
wfeandsevinstructions wrapped in a function, maybe some simple inter-thread communication. It's okay if it's not general purpose code but only put around shared resources. Putting a construct similar to uart_init into macros might be enoughTesting: Print concurrently and see what happens. Maybe remove any existing synchronisation from kernel_main and see if each processor prints one after another