提交 ab4cedb5 创建 作者: rtm's avatar rtm

continuous quality management

上级 ef218524
// //
// macros to create x86 segments from assembler // assembler macros to create x86 segments
// //
#define SEG_NULLASM \ #define SEG_NULLASM \
......
...@@ -20,8 +20,8 @@ initlock(struct spinlock *lock, char *name) ...@@ -20,8 +20,8 @@ initlock(struct spinlock *lock, char *name)
// Acquire the lock. // Acquire the lock.
// Loops (spins) until the lock is acquired. // Loops (spins) until the lock is acquired.
// (Because contention is handled by spinning, // Holding a lock for a long time may cause
// must not go to sleep holding any locks.) // other CPUs to waste time spinning to acquire it.
void void
acquire(struct spinlock *lock) acquire(struct spinlock *lock)
{ {
......
// Special assembly routines to access x86-specific // Routines to let C code use special x86 instructions.
// hardware instructions.
static inline uchar static inline uchar
inb(ushort port) inb(ushort port)
...@@ -131,7 +130,8 @@ sti(void) ...@@ -131,7 +130,8 @@ sti(void)
asm volatile("sti"); 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 { struct trapframe {
// registers as pushed by pusha // registers as pushed by pusha
uint edi; uint edi;
......
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论