Dynamic IRQ handling
This commit is contained in:
@@ -32,7 +32,10 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include <libk/stdatomic.h>
|
||||
#include <libk/string.h>
|
||||
#include <sync/spinlock.h>
|
||||
#include <sys/cpu.h>
|
||||
|
||||
#if defined(__i386__)
|
||||
#include <sys/cpu.h>
|
||||
#endif
|
||||
|
||||
void sl_init(struct spinlock *sl, const char *name) {
|
||||
if (strlen(name) > SPINLOCK_NAME_MAX) {
|
||||
@@ -46,7 +49,9 @@ void sl_init(struct spinlock *sl, const char *name) {
|
||||
void sl_lock(struct spinlock *sl) {
|
||||
intr_save();
|
||||
while (atomic_flag_test_and_set_explicit(&sl->flag, memory_order_acquire)) {
|
||||
#if defined(__i386__)
|
||||
cpu_relax();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user