inlines outsb_fl() outsw_fl and outsl_fl are broken when used from real mode 16bits
Outs use segment DS:SI not ES, so here is the fix:
(assuming we save DS and restore it because Seabios use it)
static inline void outsb_fl(u16 port, void *ptr_fl, u16 count) {
u16 ds = GET_SEG(DS);
SET_SEG(DS, FLATPTR_TO_SEG(ptr_fl));
outsb(port, (u8*)FLATPTR_TO_OFFSET(ptr_fl), count);
SET_SEG(DS, ds);
}
static inline void outsw_fl(u16 port, void *ptr_fl, u16 count) {
u16 ds = GET_SEG(DS);
SET_SEG(DS, FLATPTR_TO_SEG(ptr_fl));
outsw(port, (u16*)FLATPTR_TO_OFFSET(ptr_fl), count);
SET_SEG(DS, ds);
}
static inline void outsl_fl(u16 port, void *ptr_fl, u16 count) {
u16 ds = GET_SEG(DS);
SET_SEG(DS, FLATPTR_TO_SEG(ptr_fl));
outsl(port, (u32*)FLATPTR_TO_OFFSET(ptr_fl), count);
SET_SEG(DS, ds);
}