diff options
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/core_timing.cpp | 4 | ||||
| -rw-r--r-- | src/core/hle/kernel/thread.cpp | 5 | ||||
| -rw-r--r-- | src/core/hw/gpu.h | 11 |
3 files changed, 5 insertions, 15 deletions
diff --git a/src/core/core_timing.cpp b/src/core/core_timing.cpp index cabe2a074..6f716b1ca 100644 --- a/src/core/core_timing.cpp +++ b/src/core/core_timing.cpp | |||
| @@ -147,7 +147,7 @@ void RestoreRegisterEvent(int event_type, const char* name, TimedCallback callba | |||
| 147 | 147 | ||
| 148 | void UnregisterAllEvents() { | 148 | void UnregisterAllEvents() { |
| 149 | if (first) | 149 | if (first) |
| 150 | PanicAlert("Cannot unregister events with events pending"); | 150 | LOG_ERROR(Core_Timing, "Cannot unregister events with events pending"); |
| 151 | event_types.clear(); | 151 | event_types.clear(); |
| 152 | } | 152 | } |
| 153 | 153 | ||
| @@ -535,7 +535,7 @@ std::string GetScheduledEventsSummary() { | |||
| 535 | while (event) { | 535 | while (event) { |
| 536 | unsigned int t = event->type; | 536 | unsigned int t = event->type; |
| 537 | if (t >= event_types.size()) | 537 | if (t >= event_types.size()) |
| 538 | PanicAlert("Invalid event type"); // %i", t); | 538 | LOG_ERROR(Core_Timing, "Invalid event type"); // %i", t); |
| 539 | const char* name = event_types[event->type].name; | 539 | const char* name = event_types[event->type].name; |
| 540 | if (!name) | 540 | if (!name) |
| 541 | name = "[unknown]"; | 541 | name = "[unknown]"; |
diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp index f8c834a8d..be1aed615 100644 --- a/src/core/hle/kernel/thread.cpp +++ b/src/core/hle/kernel/thread.cpp | |||
| @@ -7,6 +7,7 @@ | |||
| 7 | #include <vector> | 7 | #include <vector> |
| 8 | 8 | ||
| 9 | #include "common/common.h" | 9 | #include "common/common.h" |
| 10 | #include "common/math_util.h" | ||
| 10 | #include "common/thread_queue_list.h" | 11 | #include "common/thread_queue_list.h" |
| 11 | 12 | ||
| 12 | #include "core/arm/arm_interface.h" | 13 | #include "core/arm/arm_interface.h" |
| @@ -339,7 +340,7 @@ static void DebugThreadQueue() { | |||
| 339 | ResultVal<SharedPtr<Thread>> Thread::Create(std::string name, VAddr entry_point, s32 priority, | 340 | ResultVal<SharedPtr<Thread>> Thread::Create(std::string name, VAddr entry_point, s32 priority, |
| 340 | u32 arg, s32 processor_id, VAddr stack_top) { | 341 | u32 arg, s32 processor_id, VAddr stack_top) { |
| 341 | if (priority < THREADPRIO_HIGHEST || priority > THREADPRIO_LOWEST) { | 342 | if (priority < THREADPRIO_HIGHEST || priority > THREADPRIO_LOWEST) { |
| 342 | s32 new_priority = CLAMP(priority, THREADPRIO_HIGHEST, THREADPRIO_LOWEST); | 343 | s32 new_priority = MathUtil::Clamp<s32>(priority, THREADPRIO_HIGHEST, THREADPRIO_LOWEST); |
| 343 | LOG_WARNING(Kernel_SVC, "(name=%s): invalid priority=%d, clamping to %d", | 344 | LOG_WARNING(Kernel_SVC, "(name=%s): invalid priority=%d, clamping to %d", |
| 344 | name.c_str(), priority, new_priority); | 345 | name.c_str(), priority, new_priority); |
| 345 | // TODO(bunnei): Clamping to a valid priority is not necessarily correct behavior... Confirm | 346 | // TODO(bunnei): Clamping to a valid priority is not necessarily correct behavior... Confirm |
| @@ -387,7 +388,7 @@ static void ClampPriority(const Thread* thread, s32* priority) { | |||
| 387 | if (*priority < THREADPRIO_HIGHEST || *priority > THREADPRIO_LOWEST) { | 388 | if (*priority < THREADPRIO_HIGHEST || *priority > THREADPRIO_LOWEST) { |
| 388 | DEBUG_ASSERT_MSG(false, "Application passed an out of range priority. An error should be returned."); | 389 | DEBUG_ASSERT_MSG(false, "Application passed an out of range priority. An error should be returned."); |
| 389 | 390 | ||
| 390 | s32 new_priority = CLAMP(*priority, THREADPRIO_HIGHEST, THREADPRIO_LOWEST); | 391 | s32 new_priority = MathUtil::Clamp<s32>(*priority, THREADPRIO_HIGHEST, THREADPRIO_LOWEST); |
| 391 | LOG_WARNING(Kernel_SVC, "(name=%s): invalid priority=%d, clamping to %d", | 392 | LOG_WARNING(Kernel_SVC, "(name=%s): invalid priority=%d, clamping to %d", |
| 392 | thread->name.c_str(), *priority, new_priority); | 393 | thread->name.c_str(), *priority, new_priority); |
| 393 | // TODO(bunnei): Clamping to a valid priority is not necessarily correct behavior... Confirm | 394 | // TODO(bunnei): Clamping to a valid priority is not necessarily correct behavior... Confirm |
diff --git a/src/core/hw/gpu.h b/src/core/hw/gpu.h index df9aa0d71..75f524465 100644 --- a/src/core/hw/gpu.h +++ b/src/core/hw/gpu.h | |||
| @@ -34,13 +34,6 @@ namespace GPU { | |||
| 34 | // MMIO region 0x1EFxxxxx | 34 | // MMIO region 0x1EFxxxxx |
| 35 | struct Regs { | 35 | struct Regs { |
| 36 | 36 | ||
| 37 | // helper macro to properly align structure members. | ||
| 38 | // Calling INSERT_PADDING_WORDS will add a new member variable with a name like "pad121", | ||
| 39 | // depending on the current source line to make sure variable names are unique. | ||
| 40 | #define INSERT_PADDING_WORDS_HELPER1(x, y) x ## y | ||
| 41 | #define INSERT_PADDING_WORDS_HELPER2(x, y) INSERT_PADDING_WORDS_HELPER1(x, y) | ||
| 42 | #define INSERT_PADDING_WORDS(num_words) u32 INSERT_PADDING_WORDS_HELPER2(pad, __LINE__)[(num_words)] | ||
| 43 | |||
| 44 | // helper macro to make sure the defined structures are of the expected size. | 37 | // helper macro to make sure the defined structures are of the expected size. |
| 45 | #if defined(_MSC_VER) | 38 | #if defined(_MSC_VER) |
| 46 | // TODO: MSVC does not support using sizeof() on non-static data members even though this | 39 | // TODO: MSVC does not support using sizeof() on non-static data members even though this |
| @@ -238,10 +231,6 @@ struct Regs { | |||
| 238 | 231 | ||
| 239 | INSERT_PADDING_WORDS(0x9c3); | 232 | INSERT_PADDING_WORDS(0x9c3); |
| 240 | 233 | ||
| 241 | #undef INSERT_PADDING_WORDS_HELPER1 | ||
| 242 | #undef INSERT_PADDING_WORDS_HELPER2 | ||
| 243 | #undef INSERT_PADDING_WORDS | ||
| 244 | |||
| 245 | static inline size_t NumIds() { | 234 | static inline size_t NumIds() { |
| 246 | return sizeof(Regs) / sizeof(u32); | 235 | return sizeof(Regs) / sizeof(u32); |
| 247 | } | 236 | } |