From 03470e7babed4033c4351149323abd67316df5bc Mon Sep 17 00:00:00 2001 From: Alexander Boettcher Date: Mon, 1 Aug 2022 14:41:05 +0200 Subject: [PATCH] nova: use kernel with suspend/resume support Issue #4669 --- repos/base-nova/include/nova/syscall-generic.h | 2 +- repos/base-nova/include/spec/32bit/nova/syscalls.h | 12 ++++++++++-- repos/base-nova/include/spec/64bit/nova/syscalls.h | 12 ++++++++++-- repos/base-nova/ports/nova.hash | 2 +- repos/base-nova/ports/nova.port | 2 +- 5 files changed, 23 insertions(+), 7 deletions(-) diff --git a/repos/base-nova/include/nova/syscall-generic.h b/repos/base-nova/include/nova/syscall-generic.h index 1654bdbc3f..a9194569c4 100644 --- a/repos/base-nova/include/nova/syscall-generic.h +++ b/repos/base-nova/include/nova/syscall-generic.h @@ -56,7 +56,7 @@ namespace Nova { NOVA_CREATE_PT = 0x5, NOVA_CREATE_SM = 0x6, NOVA_REVOKE = 0x7, - NOVA_LOOKUP = 0x8, + NOVA_MISC = 0x8, /* lookup, delegate, acpi_suspend */ NOVA_EC_CTRL = 0x9, NOVA_SC_CTRL = 0xa, NOVA_PT_CTRL = 0xb, diff --git a/repos/base-nova/include/spec/32bit/nova/syscalls.h b/repos/base-nova/include/spec/32bit/nova/syscalls.h index 6fb41d4fee..22de9e655f 100644 --- a/repos/base-nova/include/spec/32bit/nova/syscalls.h +++ b/repos/base-nova/include/spec/32bit/nova/syscalls.h @@ -405,7 +405,7 @@ namespace Nova { inline uint8_t lookup(Crd &crd) { mword_t crd_r; - uint8_t res = syscall_1(NOVA_LOOKUP, 0, 0, crd.value(), &crd_r); + uint8_t res = syscall_1(NOVA_MISC, 0, 0, crd.value(), &crd_r); crd = Crd(crd_r); return res; } @@ -414,7 +414,15 @@ namespace Nova { ALWAYS_INLINE inline uint8_t delegate(mword_t pd_snd, mword_t pd_dst, Crd crd_dst) { - return syscall_2(NOVA_LOOKUP, 1, pd_snd, crd_dst.value(), pd_dst); + return syscall_2(NOVA_MISC, 1, pd_snd, crd_dst.value(), pd_dst); + } + + + ALWAYS_INLINE + inline uint8_t acpi_suspend(mword_t sm_auth_acpi, mword_t sleep_state_a, + mword_t sleep_state_b) + { + return syscall_2(NOVA_MISC, 2, sm_auth_acpi, sleep_state_a, sleep_state_b); } diff --git a/repos/base-nova/include/spec/64bit/nova/syscalls.h b/repos/base-nova/include/spec/64bit/nova/syscalls.h index 9e8fa765fc..0491379fa9 100644 --- a/repos/base-nova/include/spec/64bit/nova/syscalls.h +++ b/repos/base-nova/include/spec/64bit/nova/syscalls.h @@ -342,7 +342,7 @@ namespace Nova { inline uint8_t lookup(Crd &crd) { mword_t crd_r; - uint8_t res = syscall_1(NOVA_LOOKUP, 0, 0, crd.value(), &crd_r); + uint8_t res = syscall_1(NOVA_MISC, 0, 0, crd.value(), &crd_r); crd = Crd(crd_r); return res; } @@ -351,7 +351,15 @@ namespace Nova { ALWAYS_INLINE inline uint8_t delegate(mword_t pd_snd, mword_t pd_dst, Crd crd_dst) { - return syscall_2(NOVA_LOOKUP, 1, pd_snd, crd_dst.value(), pd_dst); + return syscall_2(NOVA_MISC, 1, pd_snd, crd_dst.value(), pd_dst); + } + + + ALWAYS_INLINE + inline uint8_t acpi_suspend(mword_t sm_auth_acpi, mword_t sleep_state_a, + mword_t sleep_state_b) + { + return syscall_2(NOVA_MISC, 2, sm_auth_acpi, sleep_state_a, sleep_state_b); } diff --git a/repos/base-nova/ports/nova.hash b/repos/base-nova/ports/nova.hash index 8dc8cb7754..b4fec77779 100644 --- a/repos/base-nova/ports/nova.hash +++ b/repos/base-nova/ports/nova.hash @@ -1 +1 @@ -ab5601025e5e69a30f03219c3be108ff3d866ce4 +5e7fa1e56f6ebe1a5c88d7e5278585c543ca3cf3 diff --git a/repos/base-nova/ports/nova.port b/repos/base-nova/ports/nova.port index f2b3c2c941..1d8fd79361 100644 --- a/repos/base-nova/ports/nova.port +++ b/repos/base-nova/ports/nova.port @@ -4,7 +4,7 @@ DOWNLOADS := nova.git # r10 branch URL(nova) := https://github.com/alex-ab/NOVA.git -REV(nova) := 048109941862356b4785a50d1ef012d2ad9761c5 +REV(nova) := 0a54bd120ee15672089a0fcacef3b02cc0db523b DIR(nova) := src/kernel/nova PATCHES := $(sort $(wildcard $(REP_DIR)/patches/*.patch))