From e9b3403ca46b64153914695cc3ab3eb6a0e057ac Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Mon, 11 Jan 2021 07:47:42 -0800 Subject: vm: derive duplicated constants from Lisp origin. Some constnats in vm.c are hand-duplicates of ones in vm-param.tl. Let's put them in vmop.h instead, where they can be generated by the genvmop.txr script. The two new constants are anticipated for some upcoming VM work. * genvmop.txr: Generate the existing VM_LEV_BITS, VM_LEV_MASK, VM_SM_LEV_BITS and VM_SM_LEV_MASK from the Lisp constants. Also, let's add two new ones. * vm.c (VM_LEV_BITS, VM_LEV_MASK, VM_SM_LEV_BITS, VM_SM_LEV_MASK): Preprocessor symbols removed. * vmop.h (VM_LEV_BITS, VM_LEV_MASK, VM_SM_LEV_BITS, VM_SM_LEV_MASK): Preprocessor symbols generated here with identical values. (VM_MAX_LEV, VM_MAX_V_LEV): New constants. --- vmop.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'vmop.h') diff --git a/vmop.h b/vmop.h index 3f2c2f43..aafbe6e5 100644 --- a/vmop.h +++ b/vmop.h @@ -70,3 +70,10 @@ typedef enum vm_op { SETLX = 41, GETF = 42, } vm_op_t; + +#define VM_LEV_BITS 10 +#define VM_LEV_MASK 0x3FF +#define VM_SM_LEV_BITS 6 +#define VM_SM_LEV_MASK 0x3F +#define VM_MAX_LEV 63 +#define VM_MAX_V_LEV 61 -- cgit v1.2.3