diff options
Diffstat (limited to 'src/include/smp.h')
-rw-r--r-- | src/include/smp.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/include/smp.h b/src/include/smp.h index c4a675a..f4e3aa8 100644 --- a/src/include/smp.h +++ b/src/include/smp.h @@ -1,4 +1,26 @@ #ifndef SMP_INCLUDED #define SMP_INCLUDED +#include <stdint.h> void smp_boot(); +extern uint8_t corecount; + +static inline void lock(uint8_t *lock) { + asm("mov al, 1\n" + "spinlock:\n" + "lock xchgb [%0], al\n" + "test al, al\n" + "pause\n" + "jnz spinlock\n" + ::"r"(lock):"al"); +} + +static inline void unlock(uint8_t *lock) { + asm("lock andb [%0], 0"::"r"(lock)); +} + +static inline void waitup(uint8_t *loto) { +} + +#define CREATE_LOTO(name) + #endif |