diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2009-10-22 21:48:39 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2009-10-22 21:48:39 -0400 |
commit | 77d227b650c50a7dd0dbaf0ff2ec8681084ddc5f (patch) | |
tree | d8a9944c41e922f2c88269066230bc2effd1d425 /src/biosvar.h | |
parent | 9db772a3e6f609ff2969aa644785c7cb66fbd988 (diff) | |
download | seabios-77d227b650c50a7dd0dbaf0ff2ec8681084ddc5f.tar.gz |
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.
Diffstat (limited to 'src/biosvar.h')
-rw-r--r-- | src/biosvar.h | 21 |
1 files changed, 13 insertions, 8 deletions
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 /**************************************************************** |