From e51316d0cc6f663357d9d6c6f4ee3ffddb0d09e5 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Sun, 10 Jun 2012 09:09:22 -0400 Subject: Minor - remove CLEARBITS_BDA and SETBITS_BDA macros. Remove these infrequently used macros and replace with explicit GET_BDA/SET_BDA calls. Signed-off-by: Kevin O'Connor --- src/biosvar.h | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'src/biosvar.h') diff --git a/src/biosvar.h b/src/biosvar.h index eceee54f..c879f402 100644 --- a/src/biosvar.h +++ b/src/biosvar.h @@ -134,14 +134,12 @@ struct bios_data_area_s { GET_FARVAR(SEG_BDA, ((struct bios_data_area_s *)0)->var) #define SET_BDA(var, val) \ SET_FARVAR(SEG_BDA, ((struct bios_data_area_s *)0)->var, (val)) -#define CLEARBITS_BDA(var, val) do { \ - typeof(((struct bios_data_area_s *)0)->var) __val = GET_BDA(var); \ - SET_BDA(var, (__val & ~(val))); \ - } while (0) -#define SETBITS_BDA(var, val) do { \ - typeof(((struct bios_data_area_s *)0)->var) __val = GET_BDA(var); \ - SET_BDA(var, (__val | (val))); \ - } while (0) + +// Helper function to set the bits of the equipment_list_flags variable. +static inline void set_equipment_flags(u16 clear, u16 set) { + u16 eqf = GET_BDA(equipment_list_flags); + SET_BDA(equipment_list_flags, (eqf & ~clear) | set); +} /**************************************************************** -- cgit