Mercurial > hg > Papers > 2019 > mitsuki-master
changeset 29:0b7e635fdb8a
xv6 interface
author | mir3636 |
---|---|
date | Tue, 05 Feb 2019 01:47:08 +0900 |
parents | d5bca3bca59c |
children | 8d692d5ff87d |
files | paper/xv6_interface.txt |
diffstat | 1 files changed, 28 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/paper/xv6_interface.txt Tue Feb 05 01:47:08 2019 +0900 @@ -0,0 +1,28 @@ +struct { + struct spinlock lock; + struct proc proc[NPROC]; +} ptable; + +static struct proc *initproc; +struct proc *proc; + + +struct Scheduler () { + union Data * sched; + union Data * ptable; + +} + +scheduler() { + sti(); + acquire(&ptable.lock); + goto scheduler1(); +} + +scheduler1() { + if (ptable.proc < &ptable.proc[NPROC]){ + if(p->state != RUNNABLE) { + goto scheduler1(); + } + } +}