diff options
author | Ian Moffett <ian@osmora.org> | 2025-10-03 16:36:06 -0400 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2025-10-03 16:36:06 -0400 |
commit | 39bd29f7dea6426db6fa78b4f18aae9aa76d8bc4 (patch) | |
tree | d97305f833e1a442a9b35daf3135b4d2c6ca834a /src/sys/include/arch/amd64/piir.h | |
parent | 5ac96ca0f277c447254bcc50f98457c779d59dd6 (diff) |
np: piir: Add bitmap based register allocation
Introduce register allocation via a bitmap where each bit corresponds to
a specific register index.
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'src/sys/include/arch/amd64/piir.h')
-rw-r--r-- | src/sys/include/arch/amd64/piir.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/sys/include/arch/amd64/piir.h b/src/sys/include/arch/amd64/piir.h index 75236b9..d994339 100644 --- a/src/sys/include/arch/amd64/piir.h +++ b/src/sys/include/arch/amd64/piir.h @@ -54,4 +54,25 @@ ssize_t md_piir_decode( ir_byte_t input ); +/* + * Allocate a register ID for use in the IR + * + * @work: Current work + * @vm: Virtual machine state + * @flags: Optional flags + * + * Returns the allocated register ID on success, otherwise + * a less than zero value on failure + */ +reg_t md_alloc_reg(struct np_work *work, struct piir_vm *vm, int flags); + +/* + * Free one or more registers + * + * @work: Current work + * @vm: Virtual machine state + * @reg: Register to free + */ +void md_free_reg(struct np_work *work, struct piir_vm *vm, reg_t reg); + #endif /* !_MACHINE_PIIR_H_ */ |