[kernel] Support handle tag directly on syscalls

The "handle" tag on syscall parameters causes syscall_verify.cpp to pass
the resulting object as a obj::handle* instead of directly as an object
pointer. Now the handle tag is supported directly on the syscall itself
as well, causing the "self" object to be passed as a handle pointer.
This commit is contained in:
Justin C. Miller
2022-02-01 00:39:15 -08:00
parent e3ecd73cd8
commit b6d4fb698c

View File

@@ -94,12 +94,16 @@ for id, scope, method in syscalls.methods:
elif not method.static:
argdefs.append(("j6_handle_t", "self"))
cxxargdefs.append(f"obj::{scope.cname} *self")
args.append("self_obj")
type = f"obj::{scope.cname} *"
if "handle" in method.options:
args.append("self_handle")
cxxargdefs.append(f"obj::handle *self_handle")
else:
args.append("self_obj")
cxxargdefs.append(f"obj::{scope.cname} *self")
objparams.append((f"obj::{scope.cname} *", "self"))
handles.append((scope.cname, "self", get_caps(method.options, scope)))
objparams.append((type, "self"))
for param in method.params:
needs_obj = param.type.needs_object(param.options)