NOVA: Added new hypercalls for cell management and CPU core allocation.

This commit is contained in:
Michael Mueller
2023-12-15 14:35:04 +01:00
parent 705f262eb9
commit 3c133b459e
2 changed files with 31 additions and 2 deletions

View File

@@ -65,6 +65,10 @@ namespace Nova {
NOVA_ASSIGN_PCI = 0xd, NOVA_ASSIGN_PCI = 0xd,
NOVA_ASSIGN_GSI = 0xe, NOVA_ASSIGN_GSI = 0xe,
NOVA_PD_CTRL = 0xf, NOVA_PD_CTRL = 0xf,
NOVA_YIELD = 0x10,
NOVA_CREATE_CELL= 0x11,
NOVA_ALLOC_CORES= 0x12,
NOVA_CORE_ALLOC = 0x13,
}; };
/** /**

View File

@@ -36,6 +36,7 @@
#include <nova/stdint.h> #include <nova/stdint.h>
#include <nova/syscall-generic.h> #include <nova/syscall-generic.h>
#include <base/trace/types.h>
#define ALWAYS_INLINE __attribute__((always_inline)) #define ALWAYS_INLINE __attribute__((always_inline))
@@ -44,7 +45,7 @@ namespace Nova {
ALWAYS_INLINE ALWAYS_INLINE
inline mword_t rdi(Syscall s, uint8_t flags, mword_t sel) inline mword_t rdi(Syscall s, uint8_t flags, mword_t sel)
{ {
return sel << 8 | (flags & 0xf) << 4 | s; return sel << 12 | (flags & 0xf) << 8 | s;
} }
@@ -438,5 +439,29 @@ namespace Nova {
msi_data = cpu; msi_data = cpu;
return syscall_5(NOVA_ASSIGN_GSI, flags.value(), sm, msi_addr, msi_data, si); return syscall_5(NOVA_ASSIGN_GSI, flags.value(), sm, msi_addr, msi_data, si);
} }
ALWAYS_INLINE
inline uint8_t yield()
{
return syscall_0(NOVA_YIELD, 0, 0);
}
ALWAYS_INLINE
inline uint8_t mxinit(mword_t rip, mword_t id, mword_t channel)
{
return syscall_2(NOVA_CREATE_CELL, 0, id, rip, channel);
}
ALWAYS_INLINE
inline uint8_t alloc_cores(mword_t count)
{
return syscall_1(NOVA_ALLOC_CORES, 0, 0, count);
}
ALWAYS_INLINE
inline uint8_t core_allocation(mword_t &allocation)
{
return syscall_5(NOVA_CORE_ALLOC, 0, 0, allocation, allocation);
}
} }
#endif /* _INCLUDE__SPEC__64BIT__NOVA__SYSCALLS_H_ */ #endif /* _INCLUDE__SPEC__64BIT__NOVA__SYSCALLS_H_ */