X Tutup
Skip to content

Commit efbb867

Browse files
committed
sd-boot: don't export ticks_read() and ticks_freq()
They only have a single user in time_usec(), hence don't expose them.
1 parent 476c0e9 commit efbb867

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

src/boot/efi/ticks.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,39 +6,39 @@
66
#include "ticks.h"
77

88
#ifdef __x86_64__
9-
UINT64 ticks_read(void) {
9+
static UINT64 ticks_read(void) {
1010
UINT64 a, d;
1111
__asm__ volatile ("rdtsc" : "=a" (a), "=d" (d));
1212
return (d << 32) | a;
1313
}
1414
#elif defined(__i386__)
15-
UINT64 ticks_read(void) {
15+
static UINT64 ticks_read(void) {
1616
UINT64 val;
1717
__asm__ volatile ("rdtsc" : "=A" (val));
1818
return val;
1919
}
2020
#elif defined(__aarch64__)
21-
UINT64 ticks_read(void) {
21+
static UINT64 ticks_read(void) {
2222
UINT64 val;
2323
__asm__ volatile ("mrs %0, cntpct_el0" : "=r" (val));
2424
return val;
2525
}
2626
#else
27-
UINT64 ticks_read(void) {
27+
static UINT64 ticks_read(void) {
2828
UINT64 val = 1;
2929
return val;
3030
}
3131
#endif
3232

3333
#if defined(__aarch64__)
34-
UINT64 ticks_freq(void) {
34+
static UINT64 ticks_freq(void) {
3535
UINT64 freq;
3636
__asm__ volatile ("mrs %0, cntfrq_el0": "=r" (freq));
3737
return freq;
3838
}
3939
#else
4040
/* count TSC ticks during a millisecond delay */
41-
UINT64 ticks_freq(void) {
41+
static UINT64 ticks_freq(void) {
4242
UINT64 ticks_start, ticks_end;
4343

4444
ticks_start = ticks_read();

src/boot/efi/ticks.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,4 @@
44
#include <efi.h>
55
#include <efilib.h>
66

7-
UINT64 ticks_read(void);
8-
UINT64 ticks_freq(void);
97
UINT64 time_usec(void);

0 commit comments

Comments
 (0)
X Tutup