Changeset 1467 for trunk/src/win32k/dev32/devfirst.asm
- Timestamp:
- Oct 27, 1999, 4:03:01 AM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/win32k/dev32/devfirst.asm
r847 r1467 1 ; $Id: devfirst.asm,v 1. 1 1999-09-06 02:19:56bird Exp $1 ; $Id: devfirst.asm,v 1.2 1999-10-27 02:02:54 bird Exp $ 2 2 ; 3 3 ; DevFirst - entrypoint and segment definitions … … 5 5 ; Copyright (c) 1999 knut st. osmundsen 6 6 ; 7 ; Project Odin Software License can be found in LICENSE.TXT 7 8 ; 8 9 .386p … … 12 13 ; 13 14 include devsegdf.inc 15 include sas.inc 14 16 15 17 ; … … 29 31 public _strategyAsm0 30 32 public _strategyAsm1 33 public _CallGetOTEs32 31 34 public _SSToDS_16a 35 public GetOS2KrnlMTE 32 36 33 37 … … 35 39 ; Externs 36 40 ; 41 extrn _TKSSBase16:dword 42 extrn GETOTES32:FAR 43 .286p 37 44 extrn _strategy:near 38 extrn CODE16END:byte39 extrn DATA16END:byte40 extrn _TKSSBase16:dword41 45 42 46 … … 46 50 CODE16START label byte 47 51 52 .286p 48 53 ;$win32ki entry point 49 54 _strategyAsm0: … … 56 61 jmp _strategyAsm 57 62 63 ;; 64 ; Stub which pushes parameters onto the stack and call the 16-bit C strategy routine. 65 ; @returns returns the return value of strategy(...) 66 ; @author knut st. osmundsen 58 67 _strategyAsm proc far 59 68 push es … … 66 75 mov word ptr es:[bx+3], ax 67 76 add sp, 2 68 ; int 369 77 retf 70 78 _strategyAsm endp 71 79 72 80 73 ;extern LIN SSToDS_16a(void NEAR *pStackVar); 81 .386p 82 ;; 83 ; Thunk procedure for R0Init32. 84 ; @cproto USHORT NEAR CallGetOTEs32(ULONG addressOTEBuf); 85 ; @returns Same as GetOTEs32. 86 ; @param addressOTEBuf 32-bit pointer to request data. 87 ; @status completely implemented. 88 ; @author knut st. osmundsen 89 _CallGetOTEs32 PROC NEAR 90 ASSUME CS:CODE16 91 push ds 92 push word ptr [esp+6] ; push high word. 93 push word ptr [esp+6] ; push low word. 94 call far ptr FLAT:GETOTES32 95 pop ds 96 retn 97 _CallGetOTEs32 ENDP 98 99 100 ;; 101 ; SSToDS - stack pointer to Flat pointer. 102 ; @cproto extern LIN SSToDS_16a(void NEAR *pStackVar); 103 ; @returns ax:dx makes up a 32-bit flat pointer to stack. 104 ; @param pStackVar Stack pointer which is to be made a flat pointer. 105 ; @equiv SSToDS in 32-bit code. 106 ; @sketch Get Flat CS 107 ; Get TKSSBase address. (FLAT) 108 ; return *TKSSBase + pStackVar. 109 ; @status completely implemented. 110 ; @author knut st. osmundsen 111 ; @remark es is cs, not ds! 74 112 _SSToDS_16a proc near 75 113 assume CS:CODE16, DS:DATA16, ES:NOTHING 114 mov edx, ds:_TKSSBase16 ; get pointer held by _TKSSBase16 (pointer to stack base) 115 call far ptr FLAT:far_getCS ; get flat selector. 76 116 push es 77 jmp far ptr FLAT:_SSToDS_16a_GetFLAT_32 78 _SSToDS_16a_GetFLAT_16:: 79 mov edx, ds:_TKSSBase16 80 movzx eax, word ptr ss:[esp + 4] 81 add eax, es:[edx] 117 mov es, ax 118 assume es:FLAT 119 mov eax, es:[edx] ; get pointer to stack base 120 pop es 121 movzx edx, word ptr ss:[esp + 2] ; 16-bit stack pointer (parameter) 122 add eax, edx ; 32-bit stack pointer in eax 82 123 mov edx, eax 83 shr edx, 16 84 pop es 124 shr edx, 16 ; dx high 16-bit of 32-bit stack pointer. 85 125 ret 86 126 _SSToDS_16a endp … … 88 128 CODE16 ends 89 129 130 131 ; 132 ; all segments have a <segmentname>START label at the start of the segment. 133 ; 134 90 135 CODE32 segment 91 136 CODE32START label byte 92 ASSUME CS:CODE32 93 _SSToDS_16a_GetFLAT_32: 94 push cs 95 pop es 96 jmp far ptr CODE16:_SSToDS_16a_GetFLAT_16 137 138 ;; 139 ; Gets the current cs. 140 ; @cproto none. 141 ; @returns CS 142 ; @author knut st. osmundsen 143 ; @remark internal method. called from 16-bit code... 144 far_getCS proc far 145 ASSUME DS:nothing, ES:nothing 146 mov ax, cs 147 retf 148 far_getCS endp 149 150 151 152 ;; 153 ; Gets the a 32-bit flat pointer to the OS/2 Kernel MTE. 154 ; @cproto extern PMTE _System GetOS2KrnlMTE(void); 155 ; @returns Pointer to kernel MTE. 156 ; @status completely implemented. 157 ; @author knut st. osmundsen 158 GetOS2KrnlMTE PROC NEAR 159 push es 160 161 mov ax, SAS_selector ;70h - Read-only SAS selector. 162 mov es, ax 163 xor ebx, ebx 164 assume ebx: PTR SAS 165 mov bx, es:[ebx].SAS_vm_data ;SAS_vm_data (0ch) 166 assume ebx: PTR SAS_vm_section 167 mov eax, es:[ebx].SAS_vm_krnl_mte ;SAS_vm_krnl_mte (0ch) 168 169 pop es 170 ret 171 GetOS2KrnlMTE ENDP 97 172 98 173 CODE32 ends 99 174 100 175 101 ;102 ; all segments have a <segmentname>START label at the start of the segment.103 ;104 176 DATA16 segment 105 177 DATA16START label byte
Note:
See TracChangeset
for help on using the changeset viewer.