mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-21 20:42:44 +02:00
Implement kernelAbove600()
This commit is contained in:
parent
81d56a9e23
commit
6ef26bff1a
@ -15,5 +15,7 @@ bool kernelAbove300(void);
|
||||
bool kernelAbove400(void);
|
||||
/// Returns true if the kernel version is equal to or above 5.0.0.
|
||||
bool kernelAbove500(void);
|
||||
/// Returns true if the kernel version is equal to or above 6.0.0.
|
||||
bool kernelAbove600(void);
|
||||
/// Returns true if the process has a debugger attached.
|
||||
bool detectDebugger(void);
|
||||
|
@ -8,6 +8,7 @@ static bool g_IsAbove200;
|
||||
static bool g_IsAbove300;
|
||||
static bool g_IsAbove400;
|
||||
static bool g_IsAbove500;
|
||||
static bool g_IsAbove600;
|
||||
static bool g_HasCached = 0;
|
||||
static Mutex g_Mutex;
|
||||
|
||||
@ -28,7 +29,9 @@ static void _CacheValues(void)
|
||||
g_IsAbove300 = (svcGetInfo(&tmp, 18, INVALID_HANDLE, 0) != 0xF001);
|
||||
g_IsAbove400 = (svcGetInfo(&tmp, 19, INVALID_HANDLE, 0) != 0xF001);
|
||||
g_IsAbove500 = (svcGetInfo(&tmp, 20, INVALID_HANDLE, 0) != 0xF001);
|
||||
g_IsAbove600 = (svcGetInfo(&tmp, 21, INVALID_HANDLE, 0) != 0xF001);
|
||||
|
||||
g_IsAbove500 |= g_IsAbove600;
|
||||
g_IsAbove400 |= g_IsAbove500;
|
||||
g_IsAbove300 |= g_IsAbove400;
|
||||
g_IsAbove200 |= g_IsAbove300;
|
||||
@ -58,6 +61,11 @@ bool kernelAbove500(void) {
|
||||
return g_IsAbove500;
|
||||
}
|
||||
|
||||
bool kernelAbove600(void) {
|
||||
_CacheValues();
|
||||
return g_IsAbove600;
|
||||
}
|
||||
|
||||
bool detectDebugger(void) {
|
||||
u64 tmp;
|
||||
svcGetInfo(&tmp, 8, 0, 0);
|
||||
|
Loading…
Reference in New Issue
Block a user