os-k/src/kaleid/common/atomic.h

30 lines
1014 B
C
Raw Normal View History

//----------------------------------------------------------------------------//
// GNU GPL OS/K //
// //
// Authors: spectral` //
// NeoX //
// //
// Desc: Atomic stuff //
//----------------------------------------------------------------------------//
2018-12-24 18:13:58 +01:00
#ifndef _KALCOMM_ATOMIC_H
#define _KALCOMM_ATOMIC_H
2018-12-25 19:09:58 +01:00
#ifndef _KALCOMM_COMMON_H
#error "don't include common/types.h without common/common.h"
#endif
// atomic_t defined in common/types.h
2018-12-24 22:38:14 +01:00
#ifdef _KALEID_KERNEL
// only available in the kernel
2018-12-24 18:13:58 +01:00
#define cli() asm volatile ("cli")
#define sti() asm volatile ("sti")
#define hlt() asm volatile ("hlt")
#endif
2018-12-24 22:38:14 +01:00
#endif