+ getRegisteredProcesses()

This commit is contained in:
Julian Hinxlage 2019-12-04 13:33:04 +01:00
parent 9ced919be4
commit 71bd846c6b
3 changed files with 21 additions and 0 deletions

View File

@ -85,4 +85,16 @@ namespace vkvm {
unlockSharedMemory(); unlockSharedMemory();
} }
auto getRegisteredProcesses(EventType eventType) -> std::vector<int> {
std::vector<int> result;
auto ivt = getInterruptTable();
for(int i = 0; i < impl.interruptEntrysPerEventType;i++){
auto &entry= ivt[eventType * impl.interruptEntrysPerEventType + i];
if (entry.pid != 0) {
result.push_back(entry.pid);
}
}
return result;
}
} }

View File

@ -126,6 +126,12 @@ constexpr int keyboardBufferSize = 16;
*/ */
auto buttonPressed(KeyCode keyCode) -> void; auto buttonPressed(KeyCode keyCode) -> void;
/**
* get registered Prosesses for a given event type.
* @param eventType.
*/
auto getRegisteredProcesses(EventType eventType) -> std::vector<int>;
// Shared Memory Layout // Shared Memory Layout
// -------------------------------------------------------------------- // --------------------------------------------------------------------
// struct ControlRegisters // struct ControlRegisters

View File

@ -63,6 +63,9 @@ namespace vkvm {
} }
auto setPixel(int x, int y, Color color) -> bool { auto setPixel(int x, int y, Color color) -> bool {
if(x < 0 || y < 0){
return false;
}
if (x > getWidth() || y > getHeight()) { if (x > getWidth() || y > getHeight()) {
return false; return false;
} }