mirror of
https://github.com/switchbrew/libnx.git
synced 2025-08-07 00:29:23 +02:00
runtime/newlib.c: use armGetSystemTick instead of svcGetSystemTick
This commit is contained in:
parent
b26bb6ce76
commit
7f8b6af64c
@ -8,6 +8,7 @@
|
|||||||
#include "../internal.h"
|
#include "../internal.h"
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
#include "runtime/env.h"
|
#include "runtime/env.h"
|
||||||
|
#include "arm/counter.h"
|
||||||
#include "kernel/mutex.h"
|
#include "kernel/mutex.h"
|
||||||
#include "kernel/svc.h"
|
#include "kernel/svc.h"
|
||||||
#include "services/fatal.h"
|
#include "services/fatal.h"
|
||||||
@ -40,7 +41,7 @@ void __libnx_init_time(void) {
|
|||||||
if (R_FAILED(rc)) {
|
if (R_FAILED(rc)) {
|
||||||
__boottime = UINT64_MAX;
|
__boottime = UINT64_MAX;
|
||||||
} else {
|
} else {
|
||||||
__bootticks = svcGetSystemTick();
|
__bootticks = armGetSystemTick();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -68,7 +69,7 @@ int __libnx_clock_gettime(clockid_t clock_id, struct timespec *tp) {
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if(tp) {
|
if(tp) {
|
||||||
u64 now=svcGetSystemTick() - __bootticks;
|
u64 now=armGetSystemTick() - __bootticks;
|
||||||
|
|
||||||
u64 __bootsecs = now / 19200000ULL;
|
u64 __bootsecs = now / 19200000ULL;
|
||||||
|
|
||||||
@ -95,7 +96,7 @@ int __libnx_gtod(struct _reent *ptr, struct timeval *tp, struct timezone *tz) {
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
u64 now=svcGetSystemTick() - __bootticks;
|
u64 now=armGetSystemTick() - __bootticks;
|
||||||
|
|
||||||
u64 __bootsecs = now / 19200000ULL;
|
u64 __bootsecs = now / 19200000ULL;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user