mirror of
https://github.com/hermitcore/libhermit.git
synced 2025-03-09 00:00:03 +01:00
some code cleanups
This commit is contained in:
parent
f302750ddc
commit
91682c7cac
2 changed files with 4 additions and 4 deletions
|
@ -419,7 +419,7 @@ uint32_t get_cpu_frequency(void)
|
|||
|
||||
void udelay(uint32_t usecs)
|
||||
{
|
||||
if (BUILTIN_EXPECT(has_rdtscp(), 1)) {
|
||||
if (has_rdtscp()) {
|
||||
uint64_t diff, end, start = rdtscp(NULL);
|
||||
uint64_t deadline = get_cpu_frequency() * usecs;
|
||||
|
||||
|
|
|
@ -49,7 +49,7 @@ static uint64_t last_rdtsc = 0;
|
|||
void start_tickless(void)
|
||||
{
|
||||
use_tickless = 1;
|
||||
if (BUILTIN_EXPECT(has_rdtscp(), 1))
|
||||
if (has_rdtscp())
|
||||
last_rdtsc = rdtscp(NULL);
|
||||
else
|
||||
last_rdtsc = rdtsc();
|
||||
|
@ -71,7 +71,7 @@ void check_ticks(void)
|
|||
if (CORE_ID == boot_processor)
|
||||
#endif
|
||||
{
|
||||
if (BUILTIN_EXPECT(has_rdtscp(), 1)){
|
||||
if (has_rdtscp()){
|
||||
uint64_t curr_rdtsc = rdtscp(NULL);
|
||||
uint64_t diff;
|
||||
|
||||
|
@ -158,7 +158,7 @@ int timer_wait(unsigned int ticks)
|
|||
}
|
||||
|
||||
#define LATCH(f) ((CLOCK_TICK_RATE + f/2) / f)
|
||||
#define WAIT_SOME_TIME() do { uint64_t start = rdtsc(); \
|
||||
#define WAIT_SOME_TIME() do { uint64_t start = rdtsc(); mb(); \
|
||||
while(rdtsc() - start < 1000000) ; \
|
||||
} while (0)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue