MCPcopy Create free account
hub / github.com/YatSenOS/YatSenOS-Tutorial-Volume-1 / allocatePCB

Method allocatePCB

lab8/src/6/src/kernel/program.cpp:155–167  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

153}
154
155PCB *ProgramManager::allocatePCB()
156{
157 for (int i = 0; i < MAX_PROGRAM_AMOUNT; ++i)
158 {
159 if (!PCB_SET_STATUS[i])
160 {
161 PCB_SET_STATUS[i] = true;
162 return (PCB *)((int)PCB_SET + PCB_SIZE * i);
163 }
164 }
165
166 return nullptr;
167}
168
169void ProgramManager::releasePCB(PCB *program)
170{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected