]> Devi Nivas Git - cs3210-lab1.git/commitdiff
rename splhi/spllo to pushcli/popcli
authorrsc <rsc>
Thu, 27 Sep 2007 20:09:40 +0000 (20:09 +0000)
committerrsc <rsc>
Thu, 27 Sep 2007 20:09:40 +0000 (20:09 +0000)
defs.h
main.c
proc.c
proc.h
spinlock.c
trap.c

diff --git a/defs.h b/defs.h
index 4d2cba92efa518d654cab0614430ae5ec8b898f1..beb48fec63479be5d591e2ccbdb9f2b31e2e3a22 100644 (file)
--- a/defs.h
+++ b/defs.h
@@ -115,8 +115,8 @@ void            getcallerpcs(void*, uint*);
 int             holding(struct spinlock*);
 void            initlock(struct spinlock*, char*);
 void            release(struct spinlock*);
-void            splhi();
-void            spllo();
+void            pushcli();
+void            popcli();
 
 // string.c
 int             memcmp(const void*, const void*, uint);
diff --git a/main.c b/main.c
index 4176e6cc5a842468e01d1e274785b2c5584f59ba..464112bb29ad74582e6e4a7b30ef09cff6ae11b8 100644 (file)
--- a/main.c
+++ b/main.c
@@ -18,9 +18,9 @@ main(void)
   // clear BSS
   memset(edata, 0, end - edata);
 
-  // splhi() every processor during bootstrap.
+  // pushcli() every processor during bootstrap.
   for(i=0; i<NCPU; i++)
-    cpus[i].nsplhi = 1;  // no interrupts during bootstrap
+    cpus[i].ncli = 1;  // no interrupts during bootstrap
 
   mp_init(); // collect info about this machine
   bcpu = mp_bcpu();
@@ -63,7 +63,7 @@ mpmain(void)
   asm volatile("movl %0, %%ss" :: "r" (SEG_CPUSTACK << 3));
   cpuid(0, 0, 0, 0, 0);  // memory barrier
   cpus[cpu()].booted = 1;
-  spllo();
+  popcli();
 
   scheduler();
 }
diff --git a/proc.c b/proc.c
index b80a08ec9cf2be6d1dc2f2328f4581f7a605d87f..e139c3907cab1494b2f524c05650277155004bbc 100644 (file)
--- a/proc.c
+++ b/proc.c
@@ -71,7 +71,7 @@ setupsegs(struct proc *p)
 {
   struct cpu *c;
   
-  splhi();
+  pushcli();
   c = &cpus[cpu()];
   c->ts.ss0 = SEG_PROCSTACK << 3;
   if(p)
@@ -97,7 +97,7 @@ setupsegs(struct proc *p)
 
   lgdt(c->gdt, sizeof(c->gdt));
   ltr(SEG_TSS << 3);
-  spllo();
+  popcli();
 }
 
 // Create a new process copying p as the parent.
@@ -189,9 +189,9 @@ curproc(void)
 {
   struct proc *p;
 
-  splhi();
+  pushcli();
   p = cpus[cpu()].curproc;
-  spllo();
+  popcli();
   return p;
 }
 
@@ -249,7 +249,7 @@ sched(void)
     panic("sched running");
   if(!holding(&proc_table_lock))
     panic("sched proc_table_lock");
-  if(cpus[cpu()].nsplhi != 1)
+  if(cpus[cpu()].ncli != 1)
     panic("sched locks");
 
   swtch(&cp->context, &cpus[cpu()].context);
diff --git a/proc.h b/proc.h
index 285f6bf210c75fca78567d70a8000f07f0f0775b..2063baa23e45dd4b71cb74bf02f0b226c49d204e 100644 (file)
--- a/proc.h
+++ b/proc.h
@@ -61,7 +61,7 @@ struct cpu {
   struct segdesc gdt[NSEGS];  // x86 global descriptor table
   char *stack;
   volatile int booted;        // Has the CPU started?
-  int nsplhi;                 // Depth of splhi nesting.
+  int ncli;                 // Depth of pushcli nesting.
 };
 
 extern struct cpu cpus[NCPU];
index 61ae0931eb344a77c57275db4123a9d7ee4cab27..bf0229249ba3c10b1bb46ad963c149b4f78132c2 100644 (file)
@@ -25,7 +25,7 @@ initlock(struct spinlock *lock, char *name)
 void
 acquire(struct spinlock *lock)
 {
-  splhi();
+  pushcli();
   if(holding(lock))
     panic("acquire");
 
@@ -59,7 +59,7 @@ release(struct spinlock *lock)
   cpuid(0, 0, 0, 0, 0);  // memory barrier (see Ch 7, IA-32 manual vol 3)
 
   lock->locked = 0;
-  spllo();
+  popcli();
 }
 
 // Record the current call stack in pcs[] by following the %ebp chain.
@@ -93,20 +93,20 @@ holding(struct spinlock *lock)
 // Better names?  Better functions?  
 
 void
-splhi(void)
+pushcli(void)
 {
   cli();
-  cpus[cpu()].nsplhi++;
+  cpus[cpu()].ncli++;
 }
 
 void
-spllo(void)
+popcli(void)
 {
   if(read_eflags()&FL_IF)
-    panic("spllo - interruptible");
-  if(--cpus[cpu()].nsplhi < 0)
-    panic("spllo");
-  if(cpus[cpu()].nsplhi == 0)
+    panic("popcli - interruptible");
+  if(--cpus[cpu()].ncli < 0)
+    panic("popcli");
+  if(cpus[cpu()].ncli == 0)
     sti();
 }
 
diff --git a/trap.c b/trap.c
index 7ef32ffd3a22cae66cc8d72fa249d51cb1116446..0acc94bfe830d23884a82f4cf169a44bfb32266f 100644 (file)
--- a/trap.c
+++ b/trap.c
@@ -45,7 +45,7 @@ trap(struct trapframe *tf)
   }
 
   // No interrupts during interrupt handling.
-  splhi();
+  pushcli();
 
   switch(tf->trapno){
   case IRQ_OFFSET + IRQ_TIMER:
@@ -84,7 +84,7 @@ trap(struct trapframe *tf)
     cp->killed = 1;
   }
 
-  spllo();
+  popcli();
 
   // Force process exit if it has been killed and is in user space.
   // (If it is still executing in the kernel, let it keep running