From 76169cd214e4830a523c8c2ee7bbddc04b4253df Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Thu, 5 Dec 2024 15:34:33 +0100 Subject: supervisor: Add an example on the HSM extension MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The HSM extension from SBI v2.0 allows a supervisor to manage the state of harts on the system. Moreover, it also guarantees that only one hart makes it into the booting stages of the supervisor, and it's up to the supervisor to wake up the rest through the HSM extension. I have added an example which showcases this extension in different ways, and it finally shuts down the machine. Signed-off-by: Miquel Sabaté Solà --- arch/riscv/supervisor/hsm/compiler.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 arch/riscv/supervisor/hsm/compiler.h (limited to 'arch/riscv/supervisor/hsm/compiler.h') diff --git a/arch/riscv/supervisor/hsm/compiler.h b/arch/riscv/supervisor/hsm/compiler.h new file mode 100644 index 0000000..f86b0da --- /dev/null +++ b/arch/riscv/supervisor/hsm/compiler.h @@ -0,0 +1,12 @@ +#ifndef __COMPILER_H__ +#define __COMPILER_H__ + +typedef unsigned long uint64_t; +typedef unsigned long uintptr_t; +typedef unsigned long size_t; + +typedef struct { + unsigned int value; +} atomic_t; + +#endif // __COMPILER_H__ -- cgit v1.2.3