implement user mode catchable exceptions, refactor system status codes to use NTLSTATUS_ prefix, update build scripts to use shared literal macros for linker arguments, update named queue lifetime cleanup to include KeNamedQueueUnpublishHandle.
This commit is contained in:
1 parent
1f5477cf66
commit
b7fcfce6f7
140 files changed
+7649
-3943
No files matched your search
@@ -80,7 +80,7 @@ static void worker_main(uintptr_t arg) {
|
||||
|
||||
DISPLAY_RECT rect = { 0, (int32_t)y0, (int32_t)SURFACE_W, (int32_t)h };
|
||||
uint32_t s = SysPresentSurface(st->Surface, &rect, 1);
|
||||
if (s != STATUS_SUCCESS) {
|
||||
if (s != NTLSTATUS_SUCCESS) {
|
||||
st->Status = s;
|
||||
SysExitThread(1);
|
||||
}
|
||||
@@ -88,7 +88,7 @@ static void worker_main(uintptr_t arg) {
|
||||
SysYield();
|
||||
}
|
||||
|
||||
st->Status = STATUS_SUCCESS;
|
||||
st->Status = NTLSTATUS_SUCCESS;
|
||||
SysExitThread(0);
|
||||
}
|
||||
|
||||
@@ -96,14 +96,21 @@ int main(void) {
|
||||
print("surface_multithread_present: start\n");
|
||||
|
||||
uint32_t surface = 0;
|
||||
uint32_t s = SysCreateSurface(SURFACE_W, SURFACE_H, SYS_SURFACE_FORMAT_XRGB8888,
|
||||
SYS_SURFACE_FLAG_NONE, &surface);
|
||||
if (s != STATUS_SUCCESS) fail_status("create surface", s);
|
||||
SYS_CREATE_SURFACE_REQUEST req;
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.Size = sizeof(req);
|
||||
req.Width = SURFACE_W;
|
||||
req.Height = SURFACE_H;
|
||||
req.Format = SYS_SURFACE_FORMAT_XRGB8888;
|
||||
req.Flags = SYS_SURFACE_FLAG_NONE;
|
||||
req.HandleOut = &surface;
|
||||
uint32_t s = SysCreateSurface(&req);
|
||||
if (s != NTLSTATUS_SUCCESS) fail_status("create surface", s);
|
||||
|
||||
void* base = 0;
|
||||
uint32_t pitch = 0;
|
||||
s = SysMapSurface(surface, &base, &pitch);
|
||||
if (s != STATUS_SUCCESS) fail_status("map surface", s);
|
||||
if (s != NTLSTATUS_SUCCESS) fail_status("map surface", s);
|
||||
if (!base || pitch < SURFACE_W * sizeof(uint32_t)) fail("invalid mapping");
|
||||
|
||||
uint32_t handles[THREAD_COUNT];
|
||||
@@ -117,7 +124,7 @@ int main(void) {
|
||||
gWorkers[i].Surface = surface;
|
||||
gWorkers[i].Base = (uint8_t*)base;
|
||||
gWorkers[i].Pitch = pitch;
|
||||
gWorkers[i].Status = STATUS_PENDING;
|
||||
gWorkers[i].Status = NTLSTATUS_PENDING;
|
||||
SYS_CREATE_THREAD_REQUEST req = {
|
||||
(uintptr_t)worker_main,
|
||||
(uintptr_t)&gWorkers[i],
|
||||
@@ -127,17 +134,17 @@ int main(void) {
|
||||
&tids[i]
|
||||
};
|
||||
s = SysCreateThread(&req);
|
||||
if (s != STATUS_SUCCESS) fail_status("create thread", s);
|
||||
if (s != NTLSTATUS_SUCCESS) fail_status("create thread", s);
|
||||
}
|
||||
|
||||
for (uint32_t i = 0; i < THREAD_COUNT; ++i) {
|
||||
s = SysWait(handles[i], SYS_WAIT_FLAG_NONE);
|
||||
if (s != STATUS_SUCCESS) fail_status("wait thread", s);
|
||||
if (s != NTLSTATUS_SUCCESS) fail_status("wait thread", s);
|
||||
SysCloseHandle(handles[i]);
|
||||
}
|
||||
|
||||
for (uint32_t i = 0; i < THREAD_COUNT; ++i) {
|
||||
if (gWorkers[i].Status != STATUS_SUCCESS) {
|
||||
if (gWorkers[i].Status != NTLSTATUS_SUCCESS) {
|
||||
print("surface_multithread_present: worker ");
|
||||
print_u64(i);
|
||||
print(" status=");
|
||||
|
||||
Reference in new issue
Block a user