summaryrefslogtreecommitdiffstats
path: root/drivers/char/hfmodem
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/hfmodem')
-rw-r--r--drivers/char/hfmodem/Makefile2
-rw-r--r--drivers/char/hfmodem/refclock.c41
2 files changed, 4 insertions, 39 deletions
diff --git a/drivers/char/hfmodem/Makefile b/drivers/char/hfmodem/Makefile
index 42629693b..2219cd52e 100644
--- a/drivers/char/hfmodem/Makefile
+++ b/drivers/char/hfmodem/Makefile
@@ -25,7 +25,7 @@ all: all_targets
.PHONY: all
gentbl: gentbl.c
- $(HOSTCC) -Wall $< -o $@ -lm
+ $(HOSTCC) $(HOSTCFLAGS) $< -o $@ -lm
TBLHDR := tables.h
diff --git a/drivers/char/hfmodem/refclock.c b/drivers/char/hfmodem/refclock.c
index 6617673ca..2ca829fbf 100644
--- a/drivers/char/hfmodem/refclock.c
+++ b/drivers/char/hfmodem/refclock.c
@@ -30,6 +30,7 @@
#include <linux/sched.h>
#include <linux/time.h>
#include <linux/hfmodem.h>
+#include <asm/processor.h>
/* --------------------------------------------------------------------- */
@@ -65,49 +66,13 @@ static int rdtsc_ok = 1;
/* --------------------------------------------------------------------- */
#ifdef __i386__
-
__initfunc(static void i386_capability(void))
{
- unsigned long flags;
- unsigned long fl1;
- union {
- struct {
- unsigned int ebx, edx, ecx;
- } r;
- unsigned char s[13];
- } id;
- unsigned int eax;
- unsigned int x86_capability;
-
- save_flags(flags);
- flags |= 0x200000;
- restore_flags(flags);
- save_flags(flags);
- fl1 = flags;
- flags &= ~0x200000;
- restore_flags(flags);
- save_flags(flags);
- if (!(fl1 & 0x200000) || (flags & 0x200000)) {
- printk(KERN_WARNING "%s: cpu does not support CPUID\n", hfmodem_drvname);
- return;
- }
- __asm__ ("cpuid" : "=a" (eax), "=b" (id.r.ebx), "=c" (id.r.ecx), "=d" (id.r.edx) :
- "0" (0));
- id.s[12] = 0;
- if (eax < 1) {
- printk(KERN_WARNING "%s: cpu (vendor string %s) does not support capability "
- "list\n", hfmodem_drvname, id.s);
- return;
- }
- printk(KERN_INFO "%s: cpu: vendor string %s ", hfmodem_drvname, id.s);
- __asm__ ("cpuid" : "=a" (eax), "=d" (x86_capability) : "0" (1) : "ebx", "ecx");
- printk("fam %d mdl %d step %d cap 0x%x\n", (eax >> 8) & 15, (eax >> 4) & 15, eax & 15,
- x86_capability);
- if (x86_capability & 0x10)
+ if (boot_cpu_data.x86_capability & X86_FEATURE_TSC)
rdtsc_ok = 1;
else
printk(KERN_INFO "%s: cpu does not support the rdtsc instruction\n", hfmodem_drvname);
-}
+}
#endif /* __i386__ */
/* --------------------------------------------------------------------- */