diff --git a/elks/arch/i86/lib/prectimer.c b/elks/arch/i86/lib/prectimer.c index dd64dca96..37a692d8a 100644 --- a/elks/arch/i86/lib/prectimer.c +++ b/elks/arch/i86/lib/prectimer.c @@ -113,21 +113,12 @@ unsigned long get_ptime(void) count = lo | hi; pticks = lastcount - count; lastcount = count; -#if 1 if ((int)pticks < 0) { /* wrapped, jiffies is higher */ pticks += MAX_PTICK; /* = MAX_PTICK - count + lastcount */ jdiff--; /* adjust jiffies for wrap, won't ever be negative */ } if (jdiff < 4286) /* < ~42.86s */ return jdiff * (unsigned long)MAX_PTICK + pticks; -#else /* incorrect (old) version - to be removed */ - if ((int)pticks < 0) /* wrapped */ - pticks += MAX_PTICK; /* = MAX_PTICK - count + lastcount */ - if (jdiff < 2) /* < 10ms: 1..11931 */ - return pticks; - if (jdiff < 4286) /* < ~42.86s */ - return (jdiff - 1) * (unsigned long)MAX_PTICK + pticks; -#endif return 0; /* overflow displays 0s */ } diff --git a/libc/debug/prectimer.c b/libc/debug/prectimer.c index dd64dca96..37a692d8a 100644 --- a/libc/debug/prectimer.c +++ b/libc/debug/prectimer.c @@ -113,21 +113,12 @@ unsigned long get_ptime(void) count = lo | hi; pticks = lastcount - count; lastcount = count; -#if 1 if ((int)pticks < 0) { /* wrapped, jiffies is higher */ pticks += MAX_PTICK; /* = MAX_PTICK - count + lastcount */ jdiff--; /* adjust jiffies for wrap, won't ever be negative */ } if (jdiff < 4286) /* < ~42.86s */ return jdiff * (unsigned long)MAX_PTICK + pticks; -#else /* incorrect (old) version - to be removed */ - if ((int)pticks < 0) /* wrapped */ - pticks += MAX_PTICK; /* = MAX_PTICK - count + lastcount */ - if (jdiff < 2) /* < 10ms: 1..11931 */ - return pticks; - if (jdiff < 4286) /* < ~42.86s */ - return (jdiff - 1) * (unsigned long)MAX_PTICK + pticks; -#endif return 0; /* overflow displays 0s */ }