diff --git a/proc.c b/proc.c index fbfc6773b08a606f1641a02220cbd2b763e98ebf..139623d5e4a8f79f68892d1674148068623ec85b 100644 --- a/proc.c +++ b/proc.c @@ -322,6 +322,7 @@ wait(void) void scheduler(void) { + extern int cpuMode; struct proc *p; struct cpu *c = mycpu(); struct proc *p1; diff --git a/proc.h b/proc.h index 00f844a3c978a31f3d81c38380ef536a8caab810..b87374634cf8abb9b0d07d50cc7b973605439fa2 100644 --- a/proc.h +++ b/proc.h @@ -12,7 +12,7 @@ struct cpu { extern struct cpu cpus[NCPU]; extern int ncpu; -extern int cpuMode;// this field show how schedule system use +int cpuMode;// this field show how schedule system use //PAGEBREAK: 17 diff --git a/sysproc.c b/sysproc.c index 222e417673c03e2cf88cdc777324cf3382c05419..8691996c81d78d5814967de9e7cd029fcdfe98ef 100644 --- a/sysproc.c +++ b/sysproc.c @@ -140,7 +140,7 @@ sys_getCount(int find){ //3.2 int -changePriority(int newPriority){ +sys_changePriority(int newPriority){ argint(0,&newPriority); if(newPriority > 5 || newPriority < 0){ return -1; diff --git a/trap.c b/trap.c index f929ccdec25db584b9191de15025a87d09b63f5b..2a10e6e14c2f7fcddc2e11004a3a32b99a0d4c8e 100644 --- a/trap.c +++ b/trap.c @@ -11,6 +11,7 @@ // Interrupt descriptor table (shared by all CPUs). struct gatedesc idt[256]; extern uint vectors[]; // in vectors.S: array of 256 entry pointers +extern int cpuMode; // kashani struct spinlock tickslock; uint ticks; int currentQuantom ; //show us how many quantom passed in this procces