[kernel] Add missing zero_ok changes

This change adds some changes I missed as part of the previous (see
da5c1e9) zero_ok change.
This commit is contained in:
Justin C. Miller
2022-01-30 20:38:51 -08:00
parent 5e1e056623
commit 2aef7176ab
8 changed files with 27 additions and 42 deletions

View File

@@ -28,11 +28,6 @@ endpoint_send(endpoint *self, uint64_t tag, const void * data, size_t data_len)
j6_status_t
endpoint_receive(endpoint *self, uint64_t * tag, void * data, size_t * data_len, uint64_t timeout)
{
// Data is marked optional, but we need the length, and if length > 0,
// data is not optional.
if (!data_len || (*data_len && !data))
return j6_err_invalid_arg;
// Use local variables instead of the passed-in pointers, since
// they may get filled in when the sender is running, which means
// a different user VM space would be active.

View File

@@ -11,9 +11,6 @@ namespace syscalls {
j6_status_t
handle_list(j6_handle_t *handles, size_t *handles_len)
{
if (!handles_len || (*handles_len && !handles))
return j6_err_invalid_arg;
process &p = process::current();
size_t requested = *handles_len;
@@ -26,16 +23,12 @@ handle_list(j6_handle_t *handles, size_t *handles_len)
}
j6_status_t
handle_clone(j6_handle_t orig, j6_handle_t *clone, uint32_t mask)
handle_clone(handle *orig, j6_handle_t *clone, uint32_t mask)
{
handle *orig_handle = get_handle<kobject>(orig);
if (!orig_handle)
return j6_err_invalid_arg;
process &p = process::current();
*clone = p.add_handle(
orig_handle->object,
orig_handle->caps() & mask);
orig->object,
orig->caps() & mask);
return j6_status_ok;
}

View File

@@ -13,7 +13,7 @@ j6_status_t
process_create(j6_handle_t *self)
{
process *p = construct_handle<process>(self);
log::debug(logs::task, "Process %llx created", p->koid());
log::info(logs::task, "Process %llx created", p->koid());
return j6_status_ok;
}
@@ -22,7 +22,7 @@ process_kill(process *self)
{
process &p = process::current();
log::debug(logs::task, "Process %llx killed by process %llx", self->koid(), p.koid());
log::info(logs::task, "Process %llx killed by process %llx", self->koid(), p.koid());
self->exit(-1u);
return j6_status_ok;
@@ -32,7 +32,7 @@ j6_status_t
process_exit(int32_t status)
{
process &p = process::current();
log::debug(logs::task, "Process %llx exiting with code %d", p.koid(), status);
log::info(logs::task, "Process %llx exiting with code %d", p.koid(), status);
p.exit(status);
@@ -41,13 +41,12 @@ process_exit(int32_t status)
}
j6_status_t
process_give_handle(process *self, j6_handle_t target, j6_handle_t *received)
process_give_handle(process *self, handle *target, j6_handle_t *received)
{
handle *target_handle = get_handle<kobject>(target);
j6_handle_t out = self->add_handle(target_handle->object, target_handle->caps());
j6_handle_t out = self->add_handle(target->object, target->caps());
if (received)
*received = out;
return j6_status_ok;
}

View File

@@ -39,11 +39,6 @@ noop()
j6_status_t
system_get_log(system *self, void *buffer, size_t *buffer_len)
{
// Buffer is marked optional, but we need the length, and if length > 0,
// buffer is not optional.
if (!buffer_len || (*buffer_len && !buffer))
return j6_err_invalid_arg;
size_t orig_size = *buffer_len;
*buffer_len = g_logger.get_entry(buffer, *buffer_len);
if (!g_logger.has_log())