Skip to content

Commit

Permalink
Use atomic variable tsc_synced
Browse files Browse the repository at this point in the history
  • Loading branch information
lvs1974 committed Aug 4, 2020
1 parent 36ab49e commit a04ef45
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ CpuTscSync Changelog

#### v1.0.2
- Compatibility for macOS BigSur 11.0
- Use atomic variable tsc_synced
2 changes: 1 addition & 1 deletion CpuTscSync/VoodooTSCSync.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

OSDefineMetaClassAndStructors(VoodooTSCSync, IOService)

bool VoodooTSCSync::tsc_synced {false};
_Atomic(bool) VoodooTSCSync::tsc_synced = false;

//stamp the tsc
extern "C" void stamp_tsc(void *tscp)
Expand Down
4 changes: 3 additions & 1 deletion CpuTscSync/VoodooTSCSync.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
*
*/

#include <Headers/kern_atomic.hpp>

#include <Library/LegacyIOService.h>
#include <IOKit/IOLib.h>
#include <i386/proc_reg.h>
Expand Down Expand Up @@ -31,5 +33,5 @@ class VoodooTSCSync : public IOService
virtual IOReturn setPowerState(unsigned long powerStateOrdinal, IOService* whatDevice) override;

protected:
static bool tsc_synced;
static _Atomic(bool) tsc_synced;
};

0 comments on commit a04ef45

Please sign in to comment.