summaryrefslogtreecommitdiffstats
path: root/sys/x86
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2010-07-20 15:48:29 +0000
committermav <mav@FreeBSD.org>2010-07-20 15:48:29 +0000
commit0ea74c96a2f40bc01acfd1e4eaff94f73860e331 (patch)
tree2c5e8d78cfbbe53e780bacd903f0ccd75cd9597a /sys/x86
parente1bb40d4c52c58d39b2ef9cf56223c4419e7bd99 (diff)
downloadFreeBSD-src-0ea74c96a2f40bc01acfd1e4eaff94f73860e331.zip
FreeBSD-src-0ea74c96a2f40bc01acfd1e4eaff94f73860e331.tar.gz
Fix several un-/signedness bugs of r210290 and r210293. Add one more check.
Diffstat (limited to 'sys/x86')
-rw-r--r--sys/x86/isa/atrtc.c4
-rw-r--r--sys/x86/isa/clock.c5
-rw-r--r--sys/x86/x86/local_apic.c6
3 files changed, 8 insertions, 7 deletions
diff --git a/sys/x86/isa/atrtc.c b/sys/x86/isa/atrtc.c
index b01e933..929f7e7 100644
--- a/sys/x86/isa/atrtc.c
+++ b/sys/x86/isa/atrtc.c
@@ -280,9 +280,9 @@ atrtc_attach(device_t dev)
sc->et.et_quality = 0;
sc->et.et_frequency = 32768;
sc->et.et_min_period.sec = 0;
- sc->et.et_min_period.frac = 0x0008LL << 48;
+ sc->et.et_min_period.frac = 0x0008LLU << 48;
sc->et.et_max_period.sec = 0;
- sc->et.et_max_period.frac = 0x8000LL << 48;
+ sc->et.et_max_period.frac = 0x8000LLU << 48;
sc->et.et_start = rtc_start;
sc->et.et_stop = rtc_stop;
sc->et.et_priv = dev;
diff --git a/sys/x86/isa/clock.c b/sys/x86/isa/clock.c
index 62869a6..2c0e788 100644
--- a/sys/x86/isa/clock.c
+++ b/sys/x86/isa/clock.c
@@ -666,10 +666,11 @@ attimer_attach(device_t dev)
sc->et.et_quality = 100;
sc->et.et_frequency = i8254_freq;
sc->et.et_min_period.sec = 0;
- sc->et.et_min_period.frac = ((1LL << 62) / i8254_freq) << 2;
+ sc->et.et_min_period.frac =
+ ((0x0002LLU << 48) / i8254_freq) << 16;
sc->et.et_max_period.sec = 0xffff / i8254_freq;
sc->et.et_max_period.frac =
- ((0xffffLL << 48) / i8254_freq) << 16;
+ ((0xfffeLLU << 48) / i8254_freq) << 16;
sc->et.et_start = attimer_start;
sc->et.et_stop = attimer_stop;
sc->et.et_priv = dev;
diff --git a/sys/x86/x86/local_apic.c b/sys/x86/x86/local_apic.c
index ffa34a5..9dba483 100644
--- a/sys/x86/x86/local_apic.c
+++ b/sys/x86/x86/local_apic.c
@@ -500,10 +500,10 @@ lapic_et_start(struct eventtimer *et,
et->et_frequency = value;
et->et_min_period.sec = 0;
et->et_min_period.frac =
- ((1LL << 63) / et->et_frequency) << 1;
- et->et_max_period.sec = 0xffffffff / et->et_frequency;
+ ((0x00000002LLU << 32) / et->et_frequency) << 32;
+ et->et_max_period.sec = 0xfffffffeLLU / et->et_frequency;
et->et_max_period.frac =
- ((0xffffffffLL << 32) / et->et_frequency) << 32;
+ ((0xfffffffeLLU << 32) / et->et_frequency) << 32;
}
la = &lapics[lapic_id()];
/*
OpenPOWER on IntegriCloud