[Zion] Fix thread start checks and add logging.

This commit is contained in:
Drew Galbraith 2023-11-25 13:06:50 -08:00
parent f9ce4a4a8e
commit 4ee4f9cb87
1 changed files with 3 additions and 1 deletions

View File

@ -6,7 +6,7 @@
namespace {
bool IsKernel(uint64_t addr) { return (addr & 0xFFFF'FF80'0000'0000); }
bool IsKernel(uint64_t addr) { return (addr & 0xFFFF'8000'0000'0000); }
} // namespace
@ -29,6 +29,8 @@ glcr::ErrorCode ThreadStart(ZThreadStartReq* req) {
auto thread = cap->obj<Thread>();
if (IsKernel(req->entry) || IsKernel(req->arg1) || IsKernel(req->arg2)) {
dbgln("Thread start invalid arg: rip {x}, rdi {x}, rsi {x}", req->entry,
req->arg1, req->arg2);
return glcr::INVALID_ARGUMENT;
}