vbeinfo
diff src/dpmi.h @ 3:5b0ef094b8fd
backported changes from more recent VBE projects
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Mon, 07 Jan 2019 12:07:53 +0200 |
parents | 4b33fa83e381 |
children |
line diff
1.1 --- a/src/dpmi.h Wed Jul 26 21:08:55 2017 +0300 1.2 +++ b/src/dpmi.h Mon Jan 07 12:07:53 2019 +0200 1.3 @@ -1,6 +1,10 @@ 1.4 #ifndef DPMI_H_ 1.5 #define DPMI_H_ 1.6 1.7 +#ifdef __DJGPP__ 1.8 +#include <dpmi.h> 1.9 +#endif 1.10 + 1.11 #include "inttypes.h" 1.12 1.13 struct dpmi_real_regs { 1.14 @@ -12,13 +16,27 @@ 1.15 uint16_t ip, cs, sp, ss; 1.16 }; 1.17 1.18 -unsigned short dpmi_alloc(unsigned int par); 1.19 +uint16_t dpmi_alloc(unsigned int par, uint16_t *sel); 1.20 +void dpmi_free(uint16_t sel); 1.21 + 1.22 +#ifdef __WATCOMC__ 1.23 #pragma aux dpmi_alloc = \ 1.24 "mov eax, 0x100" \ 1.25 "int 0x31" \ 1.26 - value[ax] parm[ebx]; 1.27 + "mov [edi], dx" \ 1.28 + value[ax] parm[ebx][edi]; 1.29 + 1.30 +#pragma aux dpmi_free = \ 1.31 + "mov eax, 0x101" \ 1.32 + "int 0x31" \ 1.33 + parm[dx]; 1.34 1.35 void dpmi_real_int(int inum, struct dpmi_real_regs *regs); 1.36 +#endif /* __WATCOMC__ */ 1.37 + 1.38 +#ifdef __DJGPP__ 1.39 +#define dpmi_real_int(inum, regs) __dpmi_int((inum), (__dpmi_regs*)(regs)) 1.40 +#endif 1.41 1.42 void *dpmi_mmap(uint32_t phys_addr, unsigned int size); 1.43 void dpmi_munmap(void *addr);