mirror of
https://github.com/wiiu-env/wut.git
synced 2025-01-07 23:40:44 +01:00
Add coreinit OSGetSystemInfo.
This commit is contained in:
parent
e831f3c399
commit
95c2610b04
39
include/coreinit/systeminfo.h
Normal file
39
include/coreinit/systeminfo.h
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
#pragma once
|
||||||
|
#include <wut.h>
|
||||||
|
#include "time.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \defgroup coreinit_systeminfo System Info
|
||||||
|
* \ingroup coreinit
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
typedef struct OSSystemInfo OSSystemInfo;
|
||||||
|
|
||||||
|
struct OSSystemInfo
|
||||||
|
{
|
||||||
|
uint32_t clockSpeed;
|
||||||
|
UNKNOWN(0x4);
|
||||||
|
OSTime baseTime;
|
||||||
|
UNKNOWN(0x10);
|
||||||
|
};
|
||||||
|
CHECK_OFFSET(OSSystemInfo, 0x0, clockSpeed);
|
||||||
|
CHECK_OFFSET(OSSystemInfo, 0x8, baseTime);
|
||||||
|
CHECK_SIZE(OSSystemInfo, 0x20);
|
||||||
|
|
||||||
|
|
||||||
|
#define OSOneSecond ((OSGetSystemInfo()->clockSpeed) / 4)
|
||||||
|
#define OSMilliseconds(val) ((((uint64_t)(val)) * (uint64_t)(OSOneSecond)) / 1000ull)
|
||||||
|
|
||||||
|
OSSystemInfo *
|
||||||
|
OSGetSystemInfo();
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/** @} */
|
@ -214,6 +214,9 @@ EXPORT(OSUninterruptibleSpinLock_TryAcquire);
|
|||||||
EXPORT(OSUninterruptibleSpinLock_TryAcquireWithTimeout);
|
EXPORT(OSUninterruptibleSpinLock_TryAcquireWithTimeout);
|
||||||
EXPORT(OSUninterruptibleSpinLock_Release);
|
EXPORT(OSUninterruptibleSpinLock_Release);
|
||||||
|
|
||||||
|
// coreinit/systeminfo.h
|
||||||
|
EXPORT(OSGetSystemInfo);
|
||||||
|
|
||||||
// coreinit/taskqueue.h
|
// coreinit/taskqueue.h
|
||||||
EXPORT(MPInitTaskQ);
|
EXPORT(MPInitTaskQ);
|
||||||
EXPORT(MPTermTaskQ);
|
EXPORT(MPTermTaskQ);
|
||||||
|
Loading…
Reference in New Issue
Block a user