Usb: Implement state waits.

See #11067 - implementing in hopes of reducing spin.
This commit is contained in:
Unknown W. Brackets
2021-02-15 13:43:05 -08:00
parent 5d62610a93
commit cfbeadccc7
3 changed files with 131 additions and 33 deletions
+7 -13
View File
@@ -50,11 +50,10 @@
#include "Core/HLE/KernelWaitHelpers.h"
#include "Core/HLE/ThreadQueueList.h"
typedef struct
{
struct WaitTypeNames {
WaitType type;
const char *name;
} WaitTypeNames;
};
const WaitTypeNames waitTypeNames[] = {
{ WAITTYPE_NONE, "None" },
@@ -83,18 +82,13 @@ const WaitTypeNames waitTypeNames[] = {
{ WAITTYPE_ASYNCIO, "AsyncIO" },
{ WAITTYPE_MICINPUT, "Microphone input"},
{ WAITTYPE_NET, "Network"},
{ WAITTYPE_USB, "USB" },
};
const char *getWaitTypeName(WaitType type)
{
int waitTypeNamesAmount = sizeof(waitTypeNames)/sizeof(WaitTypeNames);
for (int i = 0; i < waitTypeNamesAmount; i++)
{
if (waitTypeNames[i].type == type)
{
return waitTypeNames[i].name;
}
const char *getWaitTypeName(WaitType type) {
for (WaitTypeNames info : waitTypeNames) {
if (info.type == type)
return info.name;
}
return "Unknown";