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

Method allocatePCB

lab8/src/7/src/kernel/program.cpp:152–164  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected