From 3969c485d9ac072bb7cc40918d3bf4c463ead835 Mon Sep 17 00:00:00 2001 From: jhb Date: Thu, 21 Jul 2005 16:34:14 +0000 Subject: Use get_cyclecount() rather than hardcoding rdtsc and rpcc in asm for i386 and alpha, respectively. --- sys/dev/de/if_devar.h | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) (limited to 'sys/dev/de') diff --git a/sys/dev/de/if_devar.h b/sys/dev/de/if_devar.h index 955e39f..aa68f83 100644 --- a/sys/dev/de/if_devar.h +++ b/sys/dev/de/if_devar.h @@ -958,33 +958,15 @@ NETISR_SET(NETISR_DE, tulip_softintr); (sc)->tulip_curperfstats.perf_ ## name ++; \ } while (0) -#if defined(__i386__) -typedef u_quad_t tulip_cycle_t; +typedef u_long tulip_cycle_t; static __inline tulip_cycle_t TULIP_PERFREAD(void) { - tulip_cycle_t x; - __asm__ volatile (".byte 0x0f, 0x31":"=A" (x)); - - return (x); + return (get_cyclecount()); } #define TULIP_PERFDIFF(s, f) ((f) - (s)) -#elif defined(__alpha__) -typedef unsigned long tulip_cycle_t; - -static __inline tulip_cycle_t -TULIP_PERFREAD(void) -{ - tulip_cycle_t x; - __asm__ volatile ("rpcc %0":"=r" (x)); - - return (x); -} - -#define TULIP_PERFDIFF(s, f) ((unsigned int) ((f) - (s))) -#endif #else #define TULIP_PERFSTART(name) #define TULIP_PERFEND(name) do { } while (0) -- cgit v1.1