From e82f7d11c308b94deef0b2e07073d75e9f058235 Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Sat, 30 Jan 1999 00:00:00 +0000 Subject: [PATCH] Plan 9 from Bell Labs 1999-01-30 --- pc/archgeneric.c | 8 +++++++- pc/clock.c | 29 ----------------------------- pc/etherelnk3.c | 2 ++ port/devcons.c | 2 +- port/portfns.h | 1 - 5 files changed, 10 insertions(+), 32 deletions(-) diff --git a/pc/archgeneric.c b/pc/archgeneric.c index ffbac101cf94e32a9ae1e0f6227c13fc079b7a8c..3ee0ea9524cf7287acd50522070db05f91159a60 100644 --- a/pc/archgeneric.c +++ b/pc/archgeneric.c @@ -205,7 +205,7 @@ archinit(void) coherence = wbflush; } -extern uvlong fasthz; +static uvlong fasthz; void cycletimerinit(void) @@ -228,3 +228,9 @@ cycletimer(uvlong *hz) *hz = fasthz; return tsc; } + +vlong +fastticks(uvlong *hz) +{ + return (*arch->fastclock)(hz); +} diff --git a/pc/clock.c b/pc/clock.c index 2b8c4f6e6a70883f5250be2f1a33702323a699ea..b4e3a5cd7e7b5caff2f99d77d548f33c04848b8a 100644 --- a/pc/clock.c +++ b/pc/clock.c @@ -17,11 +17,6 @@ typedef struct Clock0link { static Clock0link *clock0link; static Lock clock0lock; -/* for fast clock */ -static vlong fastoff; -static vlong fastsecs; - uvlong fasthz; - void addclock0link(void (*clock)(void)) { @@ -100,27 +95,3 @@ microdelay(int microsecs) microsecs = 1; aamloop(microsecs); } - -vlong -fastticks(uvlong *hz) -{ - return (*arch->fastclock)(hz) + fastoff; -} - -void -syncfastticks(vlong secs) -{ - vlong x, ofastoff; - vlong err, deltat; - - /* set new offset */ - x = (*arch->fastclock)(nil); - ofastoff = fastoff; - fastoff = secs*fasthz - x; - - /* calculate first order diversion rate */ - err = fastoff - ofastoff; - deltat = secs - fastsecs; - fastsecs = secs; - deltat *= fasthz; -} diff --git a/pc/etherelnk3.c b/pc/etherelnk3.c index 6eff56e4644fe6b8466f6cc260c27d4426f7aaf2..02bba8eeb9c198f204c994c41f6f47fe4a78318f 100644 --- a/pc/etherelnk3.c +++ b/pc/etherelnk3.c @@ -30,6 +30,7 @@ * * 9000 PCI 3C900-TPO Etherlink III XL PCI 10BASE-T * 9001 PCI 3C900-COMBO Etherlink III XL PCI 10BASE-T/10BASE-2/AUI + * 9005 PCI 3C900B-COMBO Etherlink III XL PCI 10BASE-T/10BASE-2/AUI * 9050 PCI 3C905-TX Fast Etherlink XL Shared 10BASE-T/100BASE-TX * 9051 PCI 3C905-T4 Fast Etherlink Shared 10BASE-T/100BASE-T4 * 9055 PCI 3C905B-TX Fast Etherlink Shared 10BASE-T/100BASE-TX @@ -1685,6 +1686,7 @@ etherelnk3reset(Ether* ether) case 0x9000: case 0x9001: + case 0x9005: case 0x9050: case 0x9051: case 0x9055: diff --git a/port/devcons.c b/port/devcons.c index b09f7d704983057a96f6d0131b54ed001679cae8..31fa67e7bf48cc9e2cccc24f0a0492166e0d9e9c 100644 --- a/port/devcons.c +++ b/port/devcons.c @@ -372,7 +372,7 @@ static Dirtab consdir[]={ "consctl", {Qconsctl}, 0, 0220, "cputime", {Qcputime}, 6*NUMSIZE, 0444, "drivers", {Qdrivers}, 0, 0644, - "fastclock", {Qfastclock}, 4*NUMSIZE, 0444, + "fastclock", {Qfastclock}, 4*NUMSIZE, 0664, "hostdomain", {Qhostdomain}, DOMLEN, 0664, "hostowner", {Qhostowner}, NAMELEN, 0664, "hz", {Qhz}, NUMSIZE, 0666, diff --git a/port/portfns.h b/port/portfns.h index d8333d9aa3522da0b784af4e99091503115fd04a..28e4da6fca9ea5a4216006116333fcd6f28efcc7 100644 --- a/port/portfns.h +++ b/port/portfns.h @@ -295,7 +295,6 @@ void srvrecover(Chan*, Chan*); int swapcount(ulong); int swapfull(void); void swapinit(void); -void syncfastticks(vlong); Block* trimblock(Block*, int, int); void tsleep(Rendez*, int (*)(void*), void*, int); void unbreak(Proc*);