Add coreinit OSGetSystemInfo.

This commit is contained in:
James Benton 2016-06-08 00:20:34 +01:00
parent e831f3c399
commit 95c2610b04
2 changed files with 42 additions and 0 deletions

View 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
/** @} */

View File

@ -214,6 +214,9 @@ EXPORT(OSUninterruptibleSpinLock_TryAcquire);
EXPORT(OSUninterruptibleSpinLock_TryAcquireWithTimeout);
EXPORT(OSUninterruptibleSpinLock_Release);
// coreinit/systeminfo.h
EXPORT(OSGetSystemInfo);
// coreinit/taskqueue.h
EXPORT(MPInitTaskQ);
EXPORT(MPTermTaskQ);