]> Devi Nivas Git - cs3210-lab0.git/commitdiff
continuous quality management
authorrtm <rtm>
Fri, 31 Aug 2007 19:55:27 +0000 (19:55 +0000)
committerrtm <rtm>
Fri, 31 Aug 2007 19:55:27 +0000 (19:55 +0000)
asm.h
spinlock.c
x86.h

diff --git a/asm.h b/asm.h
index ddea0607004ebeeeaf3db3433280e6e8680dedf9..0c052dbd6cd75898b78f0d3180e93fcc4ea4cc54 100644 (file)
--- a/asm.h
+++ b/asm.h
@@ -1,5 +1,5 @@
 //
-// macros to create x86 segments from assembler
+// assembler macros to create x86 segments
 //
 
 #define SEG_NULLASM                                             \
index 236235c9ff0b61a529b0f555cdb78b9ce4f4ef4f..891f72c5b17227417935795afa50973bad37a720 100644 (file)
@@ -20,8 +20,8 @@ initlock(struct spinlock *lock, char *name)
 
 // Acquire the lock.
 // Loops (spins) until the lock is acquired.
-// (Because contention is handled by spinning,
-// must not go to sleep holding any locks.)
+// Holding a lock for a long time may cause
+// other CPUs to waste time spinning to acquire it.
 void
 acquire(struct spinlock *lock)
 {
diff --git a/x86.h b/x86.h
index 1ef79cbab17f11aee1f7b5536b0de5fb3ea1d6fe..2ac51e5150d32bdc3894307f5c60677360a1d8a9 100644 (file)
--- a/x86.h
+++ b/x86.h
@@ -1,5 +1,4 @@
-// Special assembly routines to access x86-specific
-// hardware instructions.
+// Routines to let C code use special x86 instructions.
 
 static inline uchar
 inb(ushort port)
@@ -131,7 +130,8 @@ sti(void)
   asm volatile("sti");
 }
 
-// Layout of the trap frame on the stack upon entry to trap.
+// Layout of the trap frame built on the stack by the
+// hardware and by trapasm.S, and passed to trap().
 struct trapframe {
   // registers as pushed by pusha
   uint edi;