Make clock_gettime() faster on FreeBSD

This commit is contained in:
Justine Tunney 2022-06-11 00:05:06 -07:00
parent 5deda43766
commit 5ea618f0af
15 changed files with 67 additions and 18 deletions

View file

@ -0,0 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon clock,CLOCK_MONOTONIC_FAST,1,1,12,3,3,1

View file

@ -0,0 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon clock,CLOCK_MONOTONIC_PRECISE,-1,-1,11,-1,-1,-1

View file

@ -0,0 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon clock,CLOCK_REALTIME_FAST,0,0,10,0,0,0

View file

@ -0,0 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon clock,CLOCK_REALTIME_PRECISE,-1,-1,9,-1,-1,-1

View file

@ -0,0 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon clock,CLOCK_SECOND,-1,-1,13,-1,-1,-1

View file

@ -0,0 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon clock,CLOCK_UPTIME,-1,-1,5,5,-1,-1

View file

@ -0,0 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon clock,CLOCK_UPTIME_FAST,-1,-1,8,-1,-1,-1

View file

@ -0,0 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon clock,CLOCK_UPTIME_PRECISE,-1,-1,7,-1,-1,-1

View file

@ -8,29 +8,45 @@ extern const long CLOCK_BOOTTIME;
extern const long CLOCK_BOOTTIME_ALARM;
extern const long CLOCK_MONOTONIC;
extern const long CLOCK_MONOTONIC_COARSE;
extern const long CLOCK_MONOTONIC_FAST;
extern const long CLOCK_MONOTONIC_PRECISE;
extern const long CLOCK_MONOTONIC_RAW;
extern const long CLOCK_PROCESS_CPUTIME_ID;
extern const long CLOCK_PROF;
extern const long CLOCK_REALTIME;
extern const long CLOCK_REALTIME_ALARM;
extern const long CLOCK_REALTIME_COARSE;
extern const long CLOCK_REALTIME_FAST;
extern const long CLOCK_REALTIME_PRECISE;
extern const long CLOCK_SECOND;
extern const long CLOCK_TAI;
extern const long CLOCK_THREAD_CPUTIME_ID;
extern const long CLOCK_UPTIME;
extern const long CLOCK_UPTIME_FAST;
extern const long CLOCK_UPTIME_PRECISE;
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#define CLOCK_REALTIME LITERALLY(0)
#define CLOCK_BOOTTIME SYMBOLIC(CLOCK_BOOTTIME)
#define CLOCK_BOOTTIME_ALARM SYMBOLIC(CLOCK_BOOTTIME_ALARM)
#define CLOCK_MONOTONIC SYMBOLIC(CLOCK_MONOTONIC)
#define CLOCK_MONOTONIC_COARSE SYMBOLIC(CLOCK_MONOTONIC_COARSE)
#define CLOCK_MONOTONIC_FAST SYMBOLIC(CLOCK_MONOTONIC_FAST)
#define CLOCK_MONOTONIC_PRECISE SYMBOLIC(CLOCK_MONOTONIC_PRECISE)
#define CLOCK_MONOTONIC_RAW SYMBOLIC(CLOCK_MONOTONIC_RAW)
#define CLOCK_PROCESS_CPUTIME_ID SYMBOLIC(CLOCK_PROCESS_CPUTIME_ID)
#define CLOCK_PROF SYMBOLIC(CLOCK_PROF)
#define CLOCK_REALTIME SYMBOLIC(CLOCK_REALTIME)
#define CLOCK_REALTIME_ALARM SYMBOLIC(CLOCK_REALTIME_ALARM)
#define CLOCK_REALTIME_COARSE SYMBOLIC(CLOCK_REALTIME_COARSE)
#define CLOCK_REALTIME_FAST SYMBOLIC(CLOCK_REALTIME_FAST)
#define CLOCK_REALTIME_PRECISE SYMBOLIC(CLOCK_REALTIME_PRECISE)
#define CLOCK_SECOND SYMBOLIC(CLOCK_SECOND)
#define CLOCK_TAI SYMBOLIC(CLOCK_TAI)
#define CLOCK_THREAD_CPUTIME_ID SYMBOLIC(CLOCK_THREAD_CPUTIME_ID)
#define CLOCK_UPTIME SYMBOLIC(CLOCK_UPTIME)
#define CLOCK_UPTIME_FAST SYMBOLIC(CLOCK_UPTIME_FAST)
#define CLOCK_UPTIME_PRECISE SYMBOLIC(CLOCK_UPTIME_PRECISE)
#endif /* COSMOPOLITAN_LIBC_SYSV_CONSTS_CLOCK_H_ */