From 39bd29f7dea6426db6fa78b4f18aae9aa76d8bc4 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Fri, 3 Oct 2025 16:36:06 -0400 Subject: 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 --- src/sys/include/arch/amd64/piir.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/sys/include/arch') 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_ */ -- cgit v1.2.3