Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #9707 from JosJuice/remove-atomic-header
Remove Atomic.h
  • Loading branch information
lioncash committed May 14, 2021
2 parents 16e9117 + b93983b commit 964fed7
Show file tree
Hide file tree
Showing 13 changed files with 178 additions and 319 deletions.
16 changes: 0 additions & 16 deletions Source/Core/Common/Atomic.h

This file was deleted.

86 changes: 0 additions & 86 deletions Source/Core/Common/Atomic_GCC.h

This file was deleted.

94 changes: 0 additions & 94 deletions Source/Core/Common/Atomic_Win32.h

This file was deleted.

1 change: 0 additions & 1 deletion Source/Core/Common/CMakeLists.txt
Expand Up @@ -2,7 +2,6 @@ add_library(common
Analytics.cpp
Analytics.h
Assert.h
Atomic.h
BitField.h
BitSet.h
BitUtils.h
Expand Down
4 changes: 2 additions & 2 deletions Source/Core/Common/ChunkFile.h
Expand Up @@ -221,10 +221,10 @@ class PointerWrap
template <typename T>
void Do(std::atomic<T>& atomic)
{
T temp = atomic.load();
T temp = atomic.load(std::memory_order_relaxed);
Do(temp);
if (mode == MODE_READ)
atomic.store(temp);
atomic.store(temp, std::memory_order_relaxed);
}

template <typename T>
Expand Down
12 changes: 8 additions & 4 deletions Source/Core/Core/HW/MMIO.h
Expand Up @@ -5,11 +5,13 @@
#pragma once

#include <array>
#include <atomic>
#include <string>
#include <tuple>
#include <type_traits>

#include "Common/Assert.h"
#include "Common/BitUtils.h"
#include "Common/CommonTypes.h"
#include "Core/ConfigManager.h"
#include "Core/HW/MMIOHandlers.h"
Expand Down Expand Up @@ -79,17 +81,19 @@ inline u16* LowPart(u32* ptr)
{
return (u16*)ptr;
}
inline u16* LowPart(volatile u32* ptr)
inline u16* LowPart(std::atomic<u32>* ptr)
{
return (u16*)ptr;
static_assert(std::atomic<u32>::is_always_lock_free && sizeof(std::atomic<u32>) == sizeof(u32));
return LowPart(Common::BitCast<u32*>(ptr));
}
inline u16* HighPart(u32* ptr)
{
return LowPart(ptr) + 1;
}
inline u16* HighPart(volatile u32* ptr)
inline u16* HighPart(std::atomic<u32>* ptr)
{
return LowPart(ptr) + 1;
static_assert(std::atomic<u32>::is_always_lock_free && sizeof(std::atomic<u32>) == sizeof(u32));
return HighPart(Common::BitCast<u32*>(ptr));
}
} // namespace Utils

Expand Down
1 change: 0 additions & 1 deletion Source/Core/Core/HW/SystemTimers.cpp
Expand Up @@ -49,7 +49,6 @@ IPC_HLE_PERIOD: For the Wii Remote this is the call schedule:
#include <cmath>
#include <cstdlib>

#include "Common/Atomic.h"
#include "Common/CommonTypes.h"
#include "Common/Logging/Log.h"
#include "Common/Thread.h"
Expand Down
3 changes: 0 additions & 3 deletions Source/Core/DolphinLib.props
Expand Up @@ -16,9 +16,6 @@
<ClInclude Include="Common\Align.h" />
<ClInclude Include="Common\Analytics.h" />
<ClInclude Include="Common\Assert.h" />
<ClInclude Include="Common\Atomic_GCC.h" />
<ClInclude Include="Common\Atomic_Win32.h" />
<ClInclude Include="Common\Atomic.h" />
<ClInclude Include="Common\BitField.h" />
<ClInclude Include="Common\BitSet.h" />
<ClInclude Include="Common\BitUtils.h" />
Expand Down
1 change: 0 additions & 1 deletion Source/Core/VideoBackends/OGL/OGLRender.cpp
Expand Up @@ -11,7 +11,6 @@
#include <memory>
#include <string>

#include "Common/Atomic.h"
#include "Common/CommonTypes.h"
#include "Common/GL/GLContext.h"
#include "Common/GL/GLUtil.h"
Expand Down

0 comments on commit 964fed7

Please sign in to comment.