diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2017-01-22 21:12:38 +0100 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2017-01-22 21:12:38 +0100 |
commit | 9278b94623bbadcf64c1e3b6feb5f770379e18aa (patch) | |
tree | f8f0d80bab4f749ef978a7965b3454ceac463bee | |
parent | 885d41dd7b87c41cb618140d50dd23501b6d4279 (diff) | |
download | plan9front-9278b94623bbadcf64c1e3b6feb5f770379e18aa.tar.xz |
pc/pc64: get rid of timerset(0) case, was used with "i8253set off" ctl
-rw-r--r-- | sys/src/9/pc/apic.c | 15 | ||||
-rw-r--r-- | sys/src/9/pc/devarch.c | 17 | ||||
-rw-r--r-- | sys/src/9/pc/i8253.c | 19 |
3 files changed, 15 insertions, 36 deletions
diff --git a/sys/src/9/pc/apic.c b/sys/src/9/pc/apic.c index f27adb81e..30ca0b50a 100644 --- a/sys/src/9/pc/apic.c +++ b/sys/src/9/pc/apic.c @@ -396,15 +396,12 @@ lapictimerset(uvlong next) Apictimer *a; a = &lapictimer[m->machno]; - period = a->max; - if(next != 0){ - period = next - fastticks(nil); - period /= a->div; - if(period < a->min) - period = a->min; - else if(period > a->max - a->min) - period = a->max; - } + period = next - fastticks(nil); + period /= a->div; + if(period < a->min) + period = a->min; + else if(period > a->max - a->min) + period = a->max; lapicw(LapicTICR, period); } diff --git a/sys/src/9/pc/devarch.c b/sys/src/9/pc/devarch.c index 0b4cad252..523f2262a 100644 --- a/sys/src/9/pc/devarch.c +++ b/sys/src/9/pc/devarch.c @@ -69,8 +69,6 @@ int narchdir = Qbase; int (*_pcmspecial)(char*, ISAConf*); void (*_pcmspecialclose)(int); -static int doi8253set = 1; - /* * Add a file to the #P listing. Once added, you can't delete it. * You can't add a file with the same name as one already there, @@ -923,7 +921,6 @@ archctlread(Chan*, void *a, long nn, vlong offset) p = seprint(p, ep, "cmpswap486\n"); else p = seprint(p, ep, "0x%p\n", cmpswap); - p = seprint(p, ep, "i8253set %s\n", doi8253set ? "on" : "off"); p = seprint(p, ep, "arch %s\n", arch->id); n = p - buf; n += mtrrprint(p, ep - p); @@ -938,7 +935,6 @@ enum { CMpge, CMcoherence, - CMi8253set, CMcache, }; @@ -946,7 +942,6 @@ static Cmdtab archctlmsg[] = { CMpge, "pge", 2, CMcoherence, "coherence", 2, - CMi8253set, "i8253set", 2, CMcache, "cache", 4, }; @@ -994,15 +989,6 @@ archctlwrite(Chan*, void *a, long n, vlong) }else cmderror(cb, "invalid coherence ctl"); break; - case CMi8253set: - if(strcmp(cb->f[1], "on") == 0) - doi8253set = 1; - else if(strcmp(cb->f[1], "off") == 0){ - doi8253set = 0; - (*arch->timerset)(0); - }else - cmderror(cb, "invalid i2853set ctl"); - break; case CMcache: base = strtoull(cb->f[1], &ep, 0); if(*ep) @@ -1144,8 +1130,7 @@ ulong void timerset(Tval x) { - if(doi8253set) - (*arch->timerset)(x); + (*arch->timerset)(x); } /* diff --git a/sys/src/9/pc/i8253.c b/sys/src/9/pc/i8253.c index 1ae22615f..1163ace3c 100644 --- a/sys/src/9/pc/i8253.c +++ b/sys/src/9/pc/i8253.c @@ -199,17 +199,14 @@ i8253timerset(uvlong next) ulong want; ulong now; - period = MaxPeriod; - if(next != 0){ - want = next>>Tickshift; - now = i8253.ticks; /* assuming whomever called us just did fastticks() */ - - period = want - now; - if(period < MinPeriod) - period = MinPeriod; - else if(period > MaxPeriod) - period = MaxPeriod; - } + want = next>>Tickshift; + now = i8253.ticks; /* assuming whomever called us just did fastticks() */ + + period = want - now; + if(period < MinPeriod) + period = MinPeriod; + else if(period > MaxPeriod) + period = MaxPeriod; /* hysteresis */ if(i8253.period != period){ |