Watt-32 tcp/ip  2.2 dev-rel.10
x32vm.h
Go to the documentation of this file.
1 
3 #ifndef _w32_X32VM_H
4 #define _w32_X32VM_H
5 
6 #if (DOSX & X32VM) /* FlashTek's X32 extender */
7 
8 #undef REALPTR
9 #define REALPTR DWORD /* segment in upper 16 bits */
10 #define RP_SET(rp,ofs,seg) (rp = ((DWORD)(seg) << 16) + (ofs))
11 #define RP_OFF(rp) (WORD)((DWORD)(rp) & 0xFFFF)
12 #define RP_SEG(rp) (WORD)((DWORD)(rp) >> 16)
13 
14 #include <sys/pack_on.h>
15 
16 typedef struct SWI_REGS {
17  DWORD r_ax;
18  DWORD r_bx;
19  DWORD r_cx;
20  DWORD r_dx;
21  DWORD r_si;
22  DWORD r_di;
23  WORD r_ds;
24  WORD r_es;
25  WORD r_fs;
26  WORD r_gs;
27  DWORD r_flags;
28  } SWI_REGS;
29 
30 typedef struct RMC_BLK {
31  WORD ds;
32  WORD es;
33  WORD fs;
34  WORD gs;
35  DWORD eax;
36  DWORD ebx;
37  DWORD ecx;
38  DWORD edx;
39  } RMC_BLK;
40 
41 typedef struct {
42  WORD inum;
43  WORD ds_reg, es_reg;
44  WORD fs_reg, gs_reg;
45  DWORD eax_reg, edx_reg;
46  } RMI_BLK;
47 
48 typedef void (*pmodeHook) (SWI_REGS *);
49 typedef void (*rmodeHook) (void);
50 
51 #include <sys/pack_off.h>
52 
53 #define _dx_rmiv_get W32_NAMESPACE (_dx_rmiv_get)
54 #define _dx_rmiv_set W32_NAMESPACE (_dx_rmiv_set)
55 #define _dx_real_int W32_NAMESPACE (_dx_real_int)
56 #define _dx_real_free W32_NAMESPACE (_dx_real_free)
57 #define _dx_real_above W32_NAMESPACE (_dx_real_above)
58 #define _dx_real_alloc W32_NAMESPACE (_dx_real_alloc)
59 #define _dx_call_real W32_NAMESPACE (_dx_call_real)
60 #define _dx_lock_pgs W32_NAMESPACE (_dx_lock_pgs)
61 #define _dx_lock_pgsn W32_NAMESPACE (_dx_lock_pgsn)
62 #define _dx_ulock_pgsn W32_NAMESPACE (_dx_ulock_pgsn)
63 #define _dx_rmlink_get W32_NAMESPACE (_dx_rmlink_get)
64 
65 #define ReadRealMem W32_NAMESPACE (ReadRealMem)
66 #define WriteRealMem W32_NAMESPACE (WriteRealMem)
67 #define PokeRealWord W32_NAMESPACE (PokeRealWord)
68 #define PeekRealWord W32_NAMESPACE (PeekRealWord)
69 #define PeekRealDWord W32_NAMESPACE (PeekRealDWord)
70 #define stack_rewind W32_NAMESPACE (stack_rewind)
71 
72 #define _dx_alloc_rmode_wrapper_retf W32_NAMESPACE (_dx_alloc_rmode_wrapper_retf)
73 #define _dx_alloc_rmode_wrapper_iret W32_NAMESPACE (_dx_alloc_rmode_wrapper_iret)
74 #define _dx_free_rmode_wrapper W32_NAMESPACE (_dx_free_rmode_wrapper)
75 
76 extern void _dx_rmiv_get (int int_no, REALPTR *handler);
77 extern void _dx_rmiv_set (int int_no, REALPTR handler);
78 extern void _dx_pmiv_get (int int_no, FARPTR *handler);
79 extern void _dx_apmiv_set (int int_no, FARPTR handler);
80 extern void _dx_real_int (int int_no, SWI_REGS *regs);
81 extern int _dx_real_free (WORD segment);
82 extern int _dx_real_above(int paras, WORD *para, WORD *largest);
83 extern int _dx_real_alloc(int paras, WORD *para, WORD *largest);
84 extern int _dx_call_real (REALPTR proc, RMC_BLK *rm_reg, DWORD count, ...);
85 
86 extern int _dx_lock_pgs (const void _far *addr, int len);
87 extern int _dx_lock_pgsn (const void *addr, int len);
88 extern int _dx_ulock_pgsn (const void *addr, int len);
89 
90 extern void _dx_rmlink_get (REALPTR *cback, REALPTR *rm_cbuf,
91  DWORD *rm_cbuf_size, void _far **pm_cbuf);
92 
93 extern REALPTR _dx_alloc_rmode_wrapper_retf (pmodeHook pmHook,
94  rmodeHook rmHook,
95  int len, int stack_size);
96 
97 extern REALPTR _dx_alloc_rmode_wrapper_iret (pmodeHook pmHook,
98  int stack_size);
99 
100 extern void _dx_free_rmode_wrapper (REALPTR dosAddr);
101 
102 extern void ReadRealMem (void *buf, REALPTR rp, unsigned len);
103 extern void WriteRealMem (REALPTR rp, const void *src, int size);
104 extern void PokeRealWord (REALPTR rp, WORD val);
105 extern WORD PeekRealWord (REALPTR rp);
106 extern DWORD PeekRealDWord(REALPTR rp);
107 extern void stack_rewind (DWORD start, DWORD base);
108 
109 extern UINT cdecl _x386_stacklow; /* in FlashTek's x32.lib */
110 
111 #endif /* DOSX & X32VM */
112 #endif /* _w32_X32VM_H */
113 
Definition: x32vm.h:41
Definition: x32vm.h:30
Definition: if.h:83
int _dx_real_alloc(int paras, WORD *para, WORD *largest)
Definition: x32vm.c:233
Definition: x32vm.h:16