Merge pull request #588 from archshift/somebranch
Sweeping cleanup of Common
This commit is contained in:
commit
5f9939070e
19 changed files with 47 additions and 1422 deletions
|
@ -147,7 +147,7 @@ void RestoreRegisterEvent(int event_type, const char* name, TimedCallback callba
|
|||
|
||||
void UnregisterAllEvents() {
|
||||
if (first)
|
||||
PanicAlert("Cannot unregister events with events pending");
|
||||
LOG_ERROR(Core_Timing, "Cannot unregister events with events pending");
|
||||
event_types.clear();
|
||||
}
|
||||
|
||||
|
@ -535,7 +535,7 @@ std::string GetScheduledEventsSummary() {
|
|||
while (event) {
|
||||
unsigned int t = event->type;
|
||||
if (t >= event_types.size())
|
||||
PanicAlert("Invalid event type"); // %i", t);
|
||||
LOG_ERROR(Core_Timing, "Invalid event type"); // %i", t);
|
||||
const char* name = event_types[event->type].name;
|
||||
if (!name)
|
||||
name = "[unknown]";
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#include <vector>
|
||||
|
||||
#include "common/common.h"
|
||||
#include "common/math_util.h"
|
||||
#include "common/thread_queue_list.h"
|
||||
|
||||
#include "core/arm/arm_interface.h"
|
||||
|
@ -339,7 +340,7 @@ static void DebugThreadQueue() {
|
|||
ResultVal<SharedPtr<Thread>> Thread::Create(std::string name, VAddr entry_point, s32 priority,
|
||||
u32 arg, s32 processor_id, VAddr stack_top) {
|
||||
if (priority < THREADPRIO_HIGHEST || priority > THREADPRIO_LOWEST) {
|
||||
s32 new_priority = CLAMP(priority, THREADPRIO_HIGHEST, THREADPRIO_LOWEST);
|
||||
s32 new_priority = MathUtil::Clamp<s32>(priority, THREADPRIO_HIGHEST, THREADPRIO_LOWEST);
|
||||
LOG_WARNING(Kernel_SVC, "(name=%s): invalid priority=%d, clamping to %d",
|
||||
name.c_str(), priority, new_priority);
|
||||
// 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) {
|
|||
if (*priority < THREADPRIO_HIGHEST || *priority > THREADPRIO_LOWEST) {
|
||||
DEBUG_ASSERT_MSG(false, "Application passed an out of range priority. An error should be returned.");
|
||||
|
||||
s32 new_priority = CLAMP(*priority, THREADPRIO_HIGHEST, THREADPRIO_LOWEST);
|
||||
s32 new_priority = MathUtil::Clamp<s32>(*priority, THREADPRIO_HIGHEST, THREADPRIO_LOWEST);
|
||||
LOG_WARNING(Kernel_SVC, "(name=%s): invalid priority=%d, clamping to %d",
|
||||
thread->name.c_str(), *priority, new_priority);
|
||||
// TODO(bunnei): Clamping to a valid priority is not necessarily correct behavior... Confirm
|
||||
|
|
|
@ -34,13 +34,6 @@ namespace GPU {
|
|||
// MMIO region 0x1EFxxxxx
|
||||
struct Regs {
|
||||
|
||||
// helper macro to properly align structure members.
|
||||
// Calling INSERT_PADDING_WORDS will add a new member variable with a name like "pad121",
|
||||
// depending on the current source line to make sure variable names are unique.
|
||||
#define INSERT_PADDING_WORDS_HELPER1(x, y) x ## y
|
||||
#define INSERT_PADDING_WORDS_HELPER2(x, y) INSERT_PADDING_WORDS_HELPER1(x, y)
|
||||
#define INSERT_PADDING_WORDS(num_words) u32 INSERT_PADDING_WORDS_HELPER2(pad, __LINE__)[(num_words)]
|
||||
|
||||
// helper macro to make sure the defined structures are of the expected size.
|
||||
#if defined(_MSC_VER)
|
||||
// TODO: MSVC does not support using sizeof() on non-static data members even though this
|
||||
|
@ -238,10 +231,6 @@ struct Regs {
|
|||
|
||||
INSERT_PADDING_WORDS(0x9c3);
|
||||
|
||||
#undef INSERT_PADDING_WORDS_HELPER1
|
||||
#undef INSERT_PADDING_WORDS_HELPER2
|
||||
#undef INSERT_PADDING_WORDS
|
||||
|
||||
static inline size_t NumIds() {
|
||||
return sizeof(Regs) / sizeof(u32);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue