From 7748d47868445fea9cbe1a0e2008e2329fb22cee Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Sun, 25 Jun 2000 00:00:00 +0000 Subject: [PATCH] Plan 9 from Bell Labs 2000-06-25 --- alphapc/sdscsi.c | 2 +- pc/sdscsi.c | 2 +- port/tod.c | 6 ++++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/alphapc/sdscsi.c b/alphapc/sdscsi.c index 1a08c5428aef938d0ab297b703d5396d923d5863..e98d038accc6f18db6705afb08b5cf286afa271d 100644 --- a/alphapc/sdscsi.c +++ b/alphapc/sdscsi.c @@ -223,7 +223,7 @@ scsionline(SDunit* unit) * Since we don't read audio via this interface * it's okay to always fudge this. */ - if((unit->inquiry[0] & 0x1F) == 0x05 && unit->secsize == 2352) + if(unit->secsize == 2352) unit->secsize = 2048; ok = 1; break; diff --git a/pc/sdscsi.c b/pc/sdscsi.c index 1a08c5428aef938d0ab297b703d5396d923d5863..e98d038accc6f18db6705afb08b5cf286afa271d 100644 --- a/pc/sdscsi.c +++ b/pc/sdscsi.c @@ -223,7 +223,7 @@ scsionline(SDunit* unit) * Since we don't read audio via this interface * it's okay to always fudge this. */ - if((unit->inquiry[0] & 0x1F) == 0x05 && unit->secsize == 2352) + if(unit->secsize == 2352) unit->secsize = 2048; ok = 1; break; diff --git a/port/tod.c b/port/tod.c index 85b42ceb8ce255a8766bfc298c5c0ac9d7a88736..ed2ac075340471d4d054f9e48eab2fb54cc1031c 100644 --- a/port/tod.c +++ b/port/tod.c @@ -102,6 +102,9 @@ todget(vlong *ticksp) ticks = fastticks((uvlong*)&tod.hz); else ticks = fastticks(nil); + + /* since 64 bit ops are not atomix, we have to lock around them */ + ilock(&tod); diff = ticks - tod.last; // convert to epoch @@ -109,7 +112,6 @@ todget(vlong *ticksp) x = x + tod.off; if(m->machno == 0){ - ilock(&tod); // add in correction if(tod.sstart != tod.send){ @@ -125,7 +127,6 @@ todget(vlong *ticksp) tod.last = ticks; tod.off = x; } - iunlock(&tod); } // time can't go backwards @@ -133,6 +134,7 @@ todget(vlong *ticksp) x = tod.lasttime; else tod.lasttime = x; + iunlock(&tod); if(ticksp != nil) *ticksp = ticks;