From 77d227b650c50a7dd0dbaf0ff2ec8681084ddc5f Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Thu, 22 Oct 2009 21:48:39 -0400 Subject: Pass 'drive_s' pointer instead of driveid. Pass a pointer to the drive_s struct instead of a driveid array offset. Don't allocate ata drive's until a real drive found. Introduce getDrive() and allocDrive() functions. --- src/biosvar.h | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'src/biosvar.h') diff --git a/src/biosvar.h b/src/biosvar.h index 983d28fb..7a8e33b9 100644 --- a/src/biosvar.h +++ b/src/biosvar.h @@ -160,14 +160,14 @@ struct dpte_s { // ElTorito Device Emulation data struct cdemu_s { - u8 active; - u8 media; - u8 emulated_extdrive; - u8 emulated_driveid; + struct drive_s *emulated_drive; u32 ilba; u16 buffer_segment; u16 load_segment; u16 sector_count; + u8 active; + u8 media; + u8 emulated_extdrive; // Virtual device struct chs_s lchs; @@ -214,7 +214,7 @@ struct extended_bios_data_area_s { struct dpte_s dpte; // Locks for removable devices - u8 cdrom_locks[CONFIG_MAX_DRIVES]; + u8 cdrom_locks[CONFIG_MAX_EXTDRIVE]; u16 boot_sequence; @@ -265,10 +265,15 @@ static inline u16 get_global_seg() { } #define GET_GLOBAL(var) \ GET_VAR(GLOBAL_SEGREG, (var)) -#define SET_GLOBAL(var, val) do { \ - ASSERT32(); \ - (var) = (val); \ +#define SET_GLOBAL(var, val) do { \ + ASSERT32(); \ + (var) = (val); \ } while (0) +#if MODE16 +#define ADJUST_GLOBAL_PTR(var) (var) +#else +#define ADJUST_GLOBAL_PTR(var) ((typeof(var))((void*)var - BUILD_BIOS_ADDR)) +#endif /**************************************************************** -- cgit