2024-08-07 06:35:06 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "types.h"
|
|
|
|
|
2024-08-07 15:37:55 +02:00
|
|
|
/** Mutual exclusion spin lock */
|
2006-07-12 11:10:25 +02:00
|
|
|
struct spinlock {
|
2024-06-15 16:55:06 +02:00
|
|
|
u32 locked; // Is the lock held?
|
2016-08-25 15:13:00 +02:00
|
|
|
|
2006-09-07 16:12:30 +02:00
|
|
|
// For debugging:
|
2024-06-15 16:55:06 +02:00
|
|
|
char *name; // Name of lock.
|
|
|
|
struct cpu *cpu; // The cpu holding the lock.
|
2006-07-12 11:10:25 +02:00
|
|
|
};
|