summaryrefslogtreecommitdiffstats
path: root/src/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/common')
-rw-r--r--src/common/CMakeLists.txt1
-rw-r--r--src/common/common_sizes.h43
-rw-r--r--src/common/logging/backend.cpp1
-rw-r--r--src/common/logging/log.h1
-rw-r--r--src/common/threadsafe_queue.h10
5 files changed, 55 insertions, 1 deletions
diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt
index 66931ac97..9f8dafa3b 100644
--- a/src/common/CMakeLists.txt
+++ b/src/common/CMakeLists.txt
@@ -110,6 +110,7 @@ add_library(common STATIC
cityhash.h
common_funcs.h
common_paths.h
+ common_sizes.h
common_types.h
concepts.h
div_ceil.h
diff --git a/src/common/common_sizes.h b/src/common/common_sizes.h
new file mode 100644
index 000000000..7e9fd968b
--- /dev/null
+++ b/src/common/common_sizes.h
@@ -0,0 +1,43 @@
+// Copyright 2021 yuzu Emulator Project
+// Licensed under GPLv2 or any later version
+// Refer to the license.txt file included.
+
+#pragma once
+
+#include <limits>
+
+#include "common/common_types.h"
+
+namespace Common {
+
+enum : u64 {
+ Size_1_KB = 0x400ULL,
+ Size_64_KB = 64ULL * Size_1_KB,
+ Size_128_KB = 128ULL * Size_1_KB,
+ Size_1_MB = 0x100000ULL,
+ Size_2_MB = 2ULL * Size_1_MB,
+ Size_4_MB = 4ULL * Size_1_MB,
+ Size_5_MB = 5ULL * Size_1_MB,
+ Size_14_MB = 14ULL * Size_1_MB,
+ Size_32_MB = 32ULL * Size_1_MB,
+ Size_33_MB = 33ULL * Size_1_MB,
+ Size_128_MB = 128ULL * Size_1_MB,
+ Size_448_MB = 448ULL * Size_1_MB,
+ Size_507_MB = 507ULL * Size_1_MB,
+ Size_562_MB = 562ULL * Size_1_MB,
+ Size_1554_MB = 1554ULL * Size_1_MB,
+ Size_2048_MB = 2048ULL * Size_1_MB,
+ Size_2193_MB = 2193ULL * Size_1_MB,
+ Size_3285_MB = 3285ULL * Size_1_MB,
+ Size_4916_MB = 4916ULL * Size_1_MB,
+ Size_1_GB = 0x40000000ULL,
+ Size_2_GB = 2ULL * Size_1_GB,
+ Size_4_GB = 4ULL * Size_1_GB,
+ Size_6_GB = 6ULL * Size_1_GB,
+ Size_8_GB = 8ULL * Size_1_GB,
+ Size_64_GB = 64ULL * Size_1_GB,
+ Size_512_GB = 512ULL * Size_1_GB,
+ Size_Invalid = std::numeric_limits<u64>::max(),
+};
+
+} // namespace Common
diff --git a/src/common/logging/backend.cpp b/src/common/logging/backend.cpp
index 2d4d2e9e7..4575df24d 100644
--- a/src/common/logging/backend.cpp
+++ b/src/common/logging/backend.cpp
@@ -212,6 +212,7 @@ void DebuggerBackend::Write(const Entry& entry) {
SUB(Service, ARP) \
SUB(Service, BCAT) \
SUB(Service, BPC) \
+ SUB(Service, BGTC) \
SUB(Service, BTDRV) \
SUB(Service, BTM) \
SUB(Service, Capture) \
diff --git a/src/common/logging/log.h b/src/common/logging/log.h
index 835894918..3d7b7dab7 100644
--- a/src/common/logging/log.h
+++ b/src/common/logging/log.h
@@ -66,6 +66,7 @@ enum class Class : ClassType {
Service_ARP, ///< The ARP service
Service_Audio, ///< The Audio (Audio control) service
Service_BCAT, ///< The BCAT service
+ Service_BGTC, ///< The BGTC (Background Task Controller) service
Service_BPC, ///< The BPC service
Service_BTDRV, ///< The Bluetooth driver service
Service_BTM, ///< The BTM service
diff --git a/src/common/threadsafe_queue.h b/src/common/threadsafe_queue.h
index a4647314a..ad04df8ca 100644
--- a/src/common/threadsafe_queue.h
+++ b/src/common/threadsafe_queue.h
@@ -83,11 +83,15 @@ public:
return true;
}
- T PopWait() {
+ void Wait() {
if (Empty()) {
std::unique_lock lock{cv_mutex};
cv.wait(lock, [this]() { return !Empty(); });
}
+ }
+
+ T PopWait() {
+ Wait();
T t;
Pop(t);
return t;
@@ -156,6 +160,10 @@ public:
return spsc_queue.Pop(t);
}
+ void Wait() {
+ spsc_queue.Wait();
+ }
+
T PopWait() {
return spsc_queue.PopWait();
}