summaryrefslogtreecommitdiffstats
path: root/sys/dev/de
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2005-07-21 16:34:14 +0000
committerjhb <jhb@FreeBSD.org>2005-07-21 16:34:14 +0000
commit3969c485d9ac072bb7cc40918d3bf4c463ead835 (patch)
treeac98127204a3e4e18efe800e891a6e7b0aee28c5 /sys/dev/de
parent7bca04440d312a90ed0845ca3e8b95349c82bbb4 (diff)
downloadFreeBSD-src-3969c485d9ac072bb7cc40918d3bf4c463ead835.zip
FreeBSD-src-3969c485d9ac072bb7cc40918d3bf4c463ead835.tar.gz
Use get_cyclecount() rather than hardcoding rdtsc and rpcc in asm for i386
and alpha, respectively.
Diffstat (limited to 'sys/dev/de')
-rw-r--r--sys/dev/de/if_devar.h22
1 files changed, 2 insertions, 20 deletions
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)
OpenPOWER on IntegriCloud