diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2014-02-05 20:52:25 -0500 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2014-02-05 20:52:25 -0500 |
commit | 20dc419306701354f17abc8fe5d8eb467a009470 (patch) | |
tree | 91caf5103a0b32aa78678ada7b40e241ba98860f /vgasrc/vgahw.h | |
parent | da6a15762b07028926fe0d78b1b54153c4f0c560 (diff) | |
download | seabios-20dc419306701354f17abc8fe5d8eb467a009470.tar.gz |
vgabios: Simplify save/restore mechanism.
Reorganize the save/restore functions to eliminate some boilerplate
code.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'vgasrc/vgahw.h')
-rw-r--r-- | vgasrc/vgahw.h | 24 |
1 files changed, 4 insertions, 20 deletions
diff --git a/vgasrc/vgahw.h b/vgasrc/vgahw.h index f69a5ac5..3e843571 100644 --- a/vgasrc/vgahw.h +++ b/vgasrc/vgahw.h @@ -105,28 +105,12 @@ static inline int vgahw_set_dacformat(struct vgamode_s *vmode_g, int val) { return stdvga_set_dacformat(vmode_g, val); } -static inline int vgahw_size_state(int states) { +static inline int vgahw_save_restore(int cmd, u16 seg, void *data) { if (CONFIG_VGA_CIRRUS) - return clext_size_state(states); + return clext_save_restore(cmd, seg, data); if (CONFIG_VGA_BOCHS) - return bochsvga_size_state(states); - return stdvga_size_state(states); -} - -static inline int vgahw_save_state(u16 seg, void *data, int states) { - if (CONFIG_VGA_CIRRUS) - return clext_save_state(seg, data, states); - if (CONFIG_VGA_BOCHS) - return bochsvga_save_state(seg, data, states); - return stdvga_save_state(seg, data, states); -} - -static inline int vgahw_restore_state(u16 seg, void *data, int states) { - if (CONFIG_VGA_CIRRUS) - return clext_restore_state(seg, data, states); - if (CONFIG_VGA_BOCHS) - return bochsvga_restore_state(seg, data, states); - return stdvga_restore_state(seg, data, states); + return bochsvga_save_restore(cmd, seg, data); + return stdvga_save_restore(cmd, seg, data); } #endif // vgahw.h |