X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=dosdemo;a=blobdiff_plain;f=src%2Fdos%2Fcdpmi.h;h=92bc5b358ad2d2e05aacb2b83c3bd9114ab2a24e;hp=cdfd2f7e9e1b91c1cfbf300a7f10614618ae6d49;hb=92bc7be93ea01896b93f2986c6029b5932c32d97;hpb=e306e700b04607927f659948590c2c2ed234157e diff --git a/src/dos/cdpmi.h b/src/dos/cdpmi.h index cdfd2f7..92bc5b3 100644 --- a/src/dos/cdpmi.h +++ b/src/dos/cdpmi.h @@ -6,7 +6,9 @@ #endif #include "inttypes.h" +#include "util.h" +#pragma pack (push, 1) struct dpmi_regs { uint32_t edi, esi, ebp; uint32_t reserved; @@ -14,7 +16,8 @@ struct dpmi_regs { uint16_t flags; uint16_t es, ds, fs, gs; uint16_t ip, cs, sp, ss; -}; +} PACKED; +#pragma pack (pop) uint16_t dpmi_alloc(unsigned int par, uint16_t *sel); void dpmi_free(uint16_t sel); @@ -27,8 +30,12 @@ void dpmi_munmap(void *addr); "mov ax, 0x100" \ "int 0x31" \ "mov [edi], dx" \ + "jnc alloc_skip_err" \ + "xor ax, ax" \ + "alloc_skip_err:" \ value[ax] \ - parm[ebx][edi]; + parm[ebx][edi] \ + modify[dx]; #pragma aux dpmi_free = \ "mov ax, 0x101" \ @@ -59,7 +66,7 @@ void dpmi_munmap(void *addr); "mov ax, cx" \ value[eax] \ parm[ebx][esi] \ - modify[cx di]; + modify[bx cx di esi]; #pragma aux dpmi_munmap = \ "mov ax, 0x801" \ @@ -67,7 +74,7 @@ void dpmi_munmap(void *addr); "shr ebx, 16" \ "int 0x31" \ parm[ebx] \ - modify[ax]; + modify[ax cx ebx]; #endif /* __WATCOMC__ */ #ifdef __DJGPP__