} else { \
paddr = ((uint32_t)pseg << 4) + poffs; \
} \
- (ptr) = (void*)paddr; \
+ (ptr) = (void*)phys_to_virt(paddr); \
} while(0)
/* hijack the "VESA" sig field, to pre-cache number of modes */
if(!(seg = dpmi_alloc(sizeof *info / 16, &sel))) {
return -1;
}
- lowbuf = (void*)((uint32_t)seg << 4);
+ lowbuf = (void*)phys_to_virt((uint32_t)seg << 4);
memcpy(lowbuf, "VBE2", 4);
if(!(seg = dpmi_alloc(sizeof *minf / 16, &sel))) {
return -1;
}
- lowbuf = (void*)((uint32_t)seg << 4);
+ lowbuf = (void*)phys_to_virt((uint32_t)seg << 4);
regs.eax = 0x4f01;
regs.ecx = mode;
if(!(seg = dpmi_alloc((sizeof *crtc + 15) / 16, &sel))) {
return -1;
}
- lowbuf = (void*)((uint32_t)seg << 4);
+ lowbuf = (void*)phys_to_virt((uint32_t)seg << 4);
memcpy(lowbuf, crtc, sizeof *crtc);
if(!(seg = dpmi_alloc((sz + 15) / 16, &sel))) {
return -1;
}
- lowbuf = (void*)((uint32_t)seg << 4);
+ lowbuf = (void*)phys_to_virt((uint32_t)seg << 4);
regs.eax = 0x4f04;
regs.edx = 1; /* save */
if(!(seg = dpmi_alloc((sz + 15) / 16, &sel))) {
return -1;
}
- lowbuf = (void*)((uint32_t)seg << 4);
+ lowbuf = (void*)phys_to_virt((uint32_t)seg << 4);
memcpy(lowbuf, stbuf, sz);