Mercurial > hg > CbC > CbC_xv6
changeset 376:718e7398b2c3
define ptable.h
author | anatofuz |
---|---|
date | Tue, 07 Jul 2020 16:41:31 +0900 |
parents | 4a4950e400b8 |
children | 19d966c1d2c6 |
files | src/impl/CbCProcImpl.cbc src/interface/CbCProc.h src/proc.cbc src/ptable.h |
diffstat | 4 files changed, 13 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/src/impl/CbCProcImpl.cbc Tue Jul 07 16:05:38 2020 +0900 +++ b/src/impl/CbCProcImpl.cbc Tue Jul 07 16:41:31 2020 +0900 @@ -6,6 +6,7 @@ #include "arm.h" #include "proc.h" #include "spinlock.h" +#include "ptable.h" #include "kernel.h" @@ -55,7 +56,7 @@ goto next(...); } -__code sleepCbCProcImpl(struct CbCProcImpl* cbc_proc, struct spinlock* lk, __code next(...)) { +__code sleepCbCProcImpl(struct CbCProcImpl* cbc_proc, void* chan, struct spinlock* lk, __code next(...)) { //show_callstk("sleep"); if(proc == 0) { @@ -74,14 +75,15 @@ proc->state = SLEEPING; proc->lk = lk; - goto cbc_sched(cbc_sleep1, next); + goto schedCbCProcImpl(cbc_sleep1); } __code sleepCbCProcImpl_stub(struct Context* cbc_context) { CbCProcImpl* cbc_proc = (CbCProcImpl*)GearImpl(cbc_context, CbCProc, cbc_proc); struct spinlock* lk = Gearef(cbc_context, CbCProc)->lk; + void* chan = Gearef(cbc_context, CbCProc)->chan; enum Code next = Gearef(cbc_context, CbCProc)->next; - goto sleepCbCProcImpl(cbc_context, cbc_proc, lk, next); + goto sleepCbCProcImpl(cbc_context, cbc_proc, chan, lk, next); }
--- a/src/interface/CbCProc.h Tue Jul 07 16:05:38 2020 +0900 +++ b/src/interface/CbCProc.h Tue Jul 07 16:41:31 2020 +0900 @@ -1,6 +1,6 @@ typedef struct CbCProc <Type, Impl> { __code sched(Impl* cbc_proc, __code next(...)); - __code sleep(Impl* cbc_proc, struct spinlock* lk, __code next(...)); + __code sleep(Impl* cbc_proc, void* chan, struct spinlock* lk, __code next(...)); __code sleep1(Impl* cbc_proc, __code next1(...)); __code wakeup(Impl* cbc_proc, void* chan, __code next1(...)); __code wakeup1(Impl* cbc_proc, void* chan, __code next(...));
--- a/src/proc.cbc Tue Jul 07 16:05:38 2020 +0900 +++ b/src/proc.cbc Tue Jul 07 16:41:31 2020 +0900 @@ -29,10 +29,13 @@ // between two processes, but instead, between the scheduler. Think of scheduler // as the idle process. // +/* struct { struct spinlock lock; struct proc proc[NPROC]; } ptable; +*/ +#include "ptable.h" static struct proc *initproc; struct proc *proc;