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

Method allocatePCB

lab8/src/3/src/kernel/program.cpp:150–162  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected