Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ HOST_ONLY_TEST_SRCS := \
tests/host/ddk_kernel_services_test.cpp \
tests/host/file_syscalls_test.cpp \
tests/host/syscall_helpers_test.cpp \
tests/host/process_subsystem_test.cpp \
drivers/dummy/DummyDriver.cpp \
tests/host/socket_syscall_test.cpp \
tests/host/gicv2_test.cpp \
Expand Down
2 changes: 1 addition & 1 deletion kernel/process/Signal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ void deliver_pending_signals(HAL::CpuContext& ctx) noexcept {
exit_current_process(128 + static_cast<int64_t>(sig));
}

const SigAction& act = proc->signals().action(sig);
const SigAction act = proc->signals().action(sig);
if (act.handler == KERNEL_SIG_IGN) {
proc->signals().restore_saved_mask_if_any();
return;
Expand Down
34 changes: 12 additions & 22 deletions tests/host/mocks/host_hal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,55 +175,45 @@ class HostCpuControl final : public HAL::CpuControl {
}

void set_user_stack_pointer(HAL::CpuContext& ctx, uintptr_t user_sp) const noexcept override {
(void)ctx;
(void)user_sp;
ctx.opaque[31] = static_cast<uint64_t>(user_sp);
}

void set_user_tls_pointer(HAL::CpuContext& ctx, uintptr_t tls) const noexcept override {
(void)ctx;
(void)tls;
ctx.opaque[34] = static_cast<uint64_t>(tls);
}

uintptr_t get_user_tls_pointer(const HAL::CpuContext& ctx) const noexcept override {
(void)ctx;
return 0U;
return static_cast<uintptr_t>(ctx.opaque[34]);
}

uint64_t get_reg(const HAL::CpuContext& ctx, size_t index) const noexcept override {
(void)ctx;
(void)index;
return 0ULL;
return (index < 31U) ? ctx.opaque[index] : 0ULL;
}

void set_reg(HAL::CpuContext& ctx, size_t index, uint64_t value) const noexcept override {
(void)ctx;
(void)index;
(void)value;
if (index < 31U) {
ctx.opaque[index] = value;
}
}

uintptr_t get_user_stack_pointer(const HAL::CpuContext& ctx) const noexcept override {
(void)ctx;
return 0U;
return static_cast<uintptr_t>(ctx.opaque[31]);
}

uintptr_t get_user_pc(const HAL::CpuContext& ctx) const noexcept override {
(void)ctx;
return 0U;
return static_cast<uintptr_t>(ctx.opaque[32]);
}

void set_user_pc(HAL::CpuContext& ctx, uintptr_t program_counter) const noexcept override {
(void)ctx;
(void)program_counter;
ctx.opaque[32] = static_cast<uint64_t>(program_counter);
}

uint64_t get_user_pstate(const HAL::CpuContext& ctx) const noexcept override {
(void)ctx;
return 0ULL;
return ctx.opaque[33];
}

void set_user_pstate(HAL::CpuContext& ctx, uint64_t pstate) const noexcept override {
(void)ctx;
(void)pstate;
ctx.opaque[33] = pstate;
}

uint64_t sanitize_user_pstate(uint64_t pstate) const noexcept override { return pstate; }
Expand Down
Loading
Loading