NOVA: Added new hypercalls for Cell management.

This commit is contained in:
Michael Mueller
2024-01-18 18:49:49 +01:00
parent 3c133b459e
commit fe4c8e1dfe
2 changed files with 31 additions and 2 deletions

View File

@@ -66,9 +66,11 @@ namespace Nova {
NOVA_ASSIGN_GSI = 0xe, NOVA_ASSIGN_GSI = 0xe,
NOVA_PD_CTRL = 0xf, NOVA_PD_CTRL = 0xf,
NOVA_YIELD = 0x10, NOVA_YIELD = 0x10,
NOVA_CREATE_CELL= 0x11, NOVA_MXINIT = 0x11,
NOVA_ALLOC_CORES= 0x12, NOVA_ALLOC_CORES= 0x12,
NOVA_CORE_ALLOC = 0x13, NOVA_CORE_ALLOC = 0x13,
NOVA_CREATE_CELL= 0x14,
NOVA_CELL_CTRL = 0x15,
}; };
/** /**
@@ -281,6 +283,15 @@ namespace Nova {
HPC_READ = 10U, HPC_READ = 10U,
}; };
/**
* Cell operations
*/
enum Cell_op
{
SHRINK = 0,
GROW = 1,
};
/** /**
* Pd operations * Pd operations
*/ */

View File

@@ -449,7 +449,7 @@ namespace Nova {
ALWAYS_INLINE ALWAYS_INLINE
inline uint8_t mxinit(mword_t rip, mword_t id, mword_t channel) inline uint8_t mxinit(mword_t rip, mword_t id, mword_t channel)
{ {
return syscall_2(NOVA_CREATE_CELL, 0, id, rip, channel); return syscall_2(NOVA_MXINIT, 0, id, rip, channel);
} }
ALWAYS_INLINE ALWAYS_INLINE
@@ -463,5 +463,23 @@ namespace Nova {
{ {
return syscall_5(NOVA_CORE_ALLOC, 0, 0, allocation, allocation); return syscall_5(NOVA_CORE_ALLOC, 0, 0, allocation, allocation);
} }
ALWAYS_INLINE
inline uint8_t create_cell(mword_t pd, mword_t prio, mword_t start, mword_t end)
{
return syscall_2(NOVA_CREATE_CELL, static_cast<Nova::uint8_t>(prio), pd, start, end);
}
ALWAYS_INLINE
inline uint8_t grow_cell(mword_t pd, mword_t start, mword_t end)
{
return syscall_2(NOVA_CELL_CTRL, Cell_op::GROW, pd, start, end);
}
ALWAYS_INLINE
inline uint8_t shrink_cell(mword_t pd, mword_t start, mword_t end)
{
return syscall_2(NOVA_CELL_CTRL, Cell_op::SHRINK, pd, start, end);
}
} }
#endif /* _INCLUDE__SPEC__64BIT__NOVA__SYSCALLS_H_ */ #endif /* _INCLUDE__SPEC__64BIT__NOVA__SYSCALLS_H_ */