9 #define SYSCLOCK_SOC (16756991u)
11 #define SYSCLOCK_SYS (SYSCLOCK_SOC * 2)
13 #define SYSCLOCK_SDMMC (SYSCLOCK_SYS * 2)
15 #define SYSCLOCK_ARM9 (SYSCLOCK_SYS * 4)
17 #define SYSCLOCK_ARM11 (SYSCLOCK_ARM9 * 2)
19 #define SYSCLOCK_ARM11_LGR1 (SYSCLOCK_ARM11 * 2)
21 #define SYSCLOCK_ARM11_LGR2 (SYSCLOCK_ARM11 * 3)
23 #define SYSCLOCK_ARM11_NEW SYSCLOCK_ARM11_LGR2
25 #define CPU_TICKS_PER_MSEC (SYSCLOCK_ARM11 / 1000.0)
26 #define CPU_TICKS_PER_USEC (SYSCLOCK_ARM11 / 1000000.0)
29 #define SYSTEM_VERSION(major, minor, revision) \
30 (((major)<<24)|((minor)<<16)|((revision)<<8))
33 #define GET_VERSION_MAJOR(version) ((version) >>24)
36 #define GET_VERSION_MINOR(version) (((version)>>16)&0xFF)
39 #define GET_VERSION_REVISION(version) (((version)>> 8)&0xFF)
41 #define OS_HEAP_AREA_BEGIN 0x08000000
42 #define OS_HEAP_AREA_END 0x0E000000
44 #define OS_MAP_AREA_BEGIN 0x10000000
45 #define OS_MAP_AREA_END 0x14000000
47 #define OS_OLD_FCRAM_VADDR 0x14000000
48 #define OS_OLD_FCRAM_PADDR 0x20000000
49 #define OS_OLD_FCRAM_SIZE 0x8000000
51 #define OS_QTMRAM_VADDR 0x1E800000
52 #define OS_QTMRAM_PADDR 0x1F000000
53 #define OS_QTMRAM_SIZE 0x400000
55 #define OS_MMIO_VADDR 0x1EC00000
56 #define OS_MMIO_PADDR 0x10100000
57 #define OS_MMIO_SIZE 0x400000
59 #define OS_VRAM_VADDR 0x1F000000
60 #define OS_VRAM_PADDR 0x18000000
61 #define OS_VRAM_SIZE 0x600000
63 #define OS_DSPRAM_VADDR 0x1FF00000
64 #define OS_DSPRAM_PADDR 0x1FF00000
65 #define OS_DSPRAM_SIZE 0x80000
67 #define OS_KERNELCFG_VADDR 0x1FF80000
68 #define OS_SHAREDCFG_VADDR 0x1FF81000
70 #define OS_FCRAM_VADDR 0x30000000
71 #define OS_FCRAM_PADDR 0x20000000
72 #define OS_FCRAM_SIZE 0x10000000
74 #define OS_KernelConfig ((osKernelConfig_s const*)OS_KERNELCFG_VADDR)
75 #define OS_SharedConfig ((osSharedConfig_s*)OS_SHAREDCFG_VADDR)
83 u32 kernel_syscore_ver;
88 u32 kernel_ctrsdk_ver;
122 volatile float slider_3d;
131 vu8 headset_connected;
u64 osGetTime(void)
Gets the current time.
const char * osStrError(Result error)
Retrieves basic information about a service error.
#define OS_KernelConfig
Pointer to the kernel configuration page (see osKernelConfig_s)
Definition: os.h:74
static u32 osGetKernelVersion(void)
Gets the system's kernel version.
Definition: os.h:197
static u32 osGetMemRegionFree(MemRegion region)
Gets the number of free bytes within the specified memory region.
Definition: os.h:245
static void osTickCounterUpdate(TickCounter *cnt)
Updates the elapsed time in a tick counter.
Definition: os.h:275
static u32 osGetApplicationMemType(void)
Gets the system's memory layout ID (0-5 on Old 3DS, 6-8 on New 3DS)
Definition: os.h:209
static u32 osGetFirmVersion(void)
Gets the system's FIRM version.
Definition: os.h:182
static float osGet3DSliderState(void)
Gets the state of the 3D slider.
Definition: os.h:313
void * osConvertOldLINEARMemToNew(const void *vaddr)
Converts 0x14* vmem to 0x30*.
osTimeRef_s osGetTimeRef(void)
Reads the latest reference timepoint published by PTM.
double osTickCounterRead(const TickCounter *cnt)
Reads the elapsed time in a tick counter.
void osSetSpeedupEnable(bool enable)
Configures the New 3DS speedup.
static u32 osGetMemRegionSize(MemRegion region)
Gets the size of the specified memory region.
Definition: os.h:219
static u32 osGetSystemCoreVersion(void)
Gets the system's "core version" (2 on NATIVE_FIRM, 3 on SAFE_FIRM, etc.)
Definition: os.h:203
static bool osIsHeadsetConnected(void)
Checks whether a headset is connected.
Definition: os.h:322
static u32 osGetMemRegionUsed(MemRegion region)
Gets the number of used bytes within the specified memory region.
Definition: os.h:233
static u8 osGetWifiStrength(void)
Gets the current Wifi signal strength.
Definition: os.h:304
Result osGetSystemVersionDataString(OS_VersionBin *nver_versionbin, OS_VersionBin *cver_versionbin, char *sysverstr, u32 sysverstr_maxsize)
This is a wrapper for osGetSystemVersionData.
Result osGetSystemVersionData(OS_VersionBin *nver_versionbin, OS_VersionBin *cver_versionbin)
Gets the NAND system-version stored in NVer/CVer.
#define OS_SharedConfig
Pointer to the shared system configuration page (see osSharedConfig_s)
Definition: os.h:75
u32 osConvertVirtToPhys(const void *vaddr)
Converts an address from virtual (process) memory to physical memory.
static void osTickCounterStart(TickCounter *cnt)
Starts a tick counter.
Definition: os.h:266
OS_VersionBin. Format of the system version: "<major>.<minor>.<build>-<nupver><region>".
Definition: os.h:143
Tick counter.
Definition: os.h:136
u64 elapsed
Elapsed CPU ticks between measurements.
Definition: os.h:137
u64 reference
Point in time used as reference.
Definition: os.h:138
Kernel configuration page (read-only).
Definition: os.h:79
Shared system configuration page structure (read-only or read-write depending on exheader).
Definition: os.h:112
Time reference information struct (filled in by PTM).
Definition: os.h:103
s64 sysclock_hz
System clock frequency in Hz adjusted using RTC measurements (usually around SYSCLOCK_ARM11)
Definition: os.h:106
s64 drift_ms
Measured time drift of the system clock (according to the RTC) in milliseconds since the last update.
Definition: os.h:107
u64 value_ms
Milliseconds elapsed since January 1900 when this structure was last updated.
Definition: os.h:104
u64 value_tick
System ticks elapsed since boot when this structure was last updated.
Definition: os.h:105
u64 svcGetSystemTick(void)
Gets the current system tick.
Result svcGetSystemInfo(s64 *out, u32 type, s32 param)
Gets the system info.
MemRegion
Memory regions.
Definition: svc.h:67
@ MEMREGION_SYSTEM
SYSTEM memory.
Definition: svc.h:70
@ MEMREGION_BASE
BASE memory.
Definition: svc.h:71
@ MEMREGION_ALL
All regions.
Definition: svc.h:68
@ MEMREGION_APPLICATION
APPLICATION memory.
Definition: svc.h:69
volatile u8 vu8
8-bit volatile unsigned integer.
Definition: types.h:31
int64_t s64
64-bit signed integer
Definition: types.h:29
uint64_t u64
64-bit unsigned integer
Definition: types.h:24
uint8_t u8
would be nice if newlib had this already
Definition: types.h:21
volatile u32 vu32
32-bit volatile unsigned integer.
Definition: types.h:33
s32 Result
Function result.
Definition: types.h:42
volatile u64 vu64
64-bit volatile unsigned integer.
Definition: types.h:34
uint32_t u32
32-bit unsigned integer
Definition: types.h:23