Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
dcbfad5749
@ -37,8 +37,11 @@ namespace vkvm {
|
|||||||
|
|
||||||
auto callEvent(EventType type) -> bool {
|
auto callEvent(EventType type) -> bool {
|
||||||
auto ivt = getInterrupTable();
|
auto ivt = getInterrupTable();
|
||||||
if (ivt[type].pid != 0) {
|
for(int i = 0; i < impl.interruptEntrysPerEventType;i++){
|
||||||
sendSignal(ivt[type].pid, ivt[type].signum);
|
auto &entry= ivt[type * impl.interruptEntrysPerEventType + i];
|
||||||
|
if (entry.pid != 0) {
|
||||||
|
sendSignal(entry.pid, entry.signum);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -54,7 +54,8 @@ constexpr int keyboardBufferSize = 16;
|
|||||||
int sharedMemoryPid;
|
int sharedMemoryPid;
|
||||||
key_t sharedMemoryKey;
|
key_t sharedMemoryKey;
|
||||||
int sharedMemorySize;
|
int sharedMemorySize;
|
||||||
int interruptEntyCount = 64; //NOLINT
|
int interruptEntyCount = 256; //NOLINT
|
||||||
|
int interruptEntrysPerEventType = 8;
|
||||||
int reservedSize = 1024; //NOLINT
|
int reservedSize = 1024; //NOLINT
|
||||||
std::vector<std::function<void()>> eventTable;
|
std::vector<std::function<void()>> eventTable;
|
||||||
};
|
};
|
||||||
|
14
src/vkvm.cpp
14
src/vkvm.cpp
@ -37,8 +37,12 @@ namespace vkvm {
|
|||||||
|
|
||||||
lockSharedMemory();
|
lockSharedMemory();
|
||||||
|
|
||||||
ivt[type].pid = getpid();
|
for(int i = 0; i < impl.interruptEntrysPerEventType;i++){
|
||||||
ivt[type].signum = signum;
|
auto &entry= ivt[type * impl.interruptEntrysPerEventType + i];
|
||||||
|
if (entry.pid == 0) {
|
||||||
|
|
||||||
|
entry.pid = getpid();
|
||||||
|
entry.signum = signum;
|
||||||
impl.eventTable.push_back(handler);
|
impl.eventTable.push_back(handler);
|
||||||
|
|
||||||
onSignal(signum, [](int sig){
|
onSignal(signum, [](int sig){
|
||||||
@ -48,11 +52,13 @@ namespace vkvm {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
unlockSharedMemory();
|
unlockSharedMemory();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
unlockSharedMemory();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
auto setPixel(int x, int y, Color color) -> bool {
|
auto setPixel(int x, int y, Color color) -> bool {
|
||||||
char *ptr = getPixelArea() + (y * getWidth() + x) * 3;
|
char *ptr = getPixelArea() + (y * getWidth() + x) * 3;
|
||||||
|
Loading…
Reference in New Issue
Block a user