Changeset 6841 for branches/splittup/src/win32k/dev32/devfirst.asm
- Timestamp:
- Sep 27, 2001, 5:08:35 AM (24 years ago)
- File:
-
- 1 edited
-
branches/splittup/src/win32k/dev32/devfirst.asm (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/splittup/src/win32k/dev32/devfirst.asm
r6280 r6841 1 ; $Id: devfirst.asm,v 1.9 2001-07-10 05:19:34 bird Exp $1 ; $Id: devfirst.asm,v 1.9.2.1 2001-09-27 03:08:14 bird Exp $ 2 2 ; 3 3 ; DevFirst - entrypoint and segment definitions … … 33 33 public EH_DATASTART 34 34 35 36 public _strategyAsm0 37 public _strategyAsm1 38 public _CallGetKernelInfo32 39 public _CallElfIOCtl 35 public _strategyAsm 40 36 public _CallWin32kIOCtl 41 37 public _CallWin32kOpen 42 38 public _CallWin32kClose 43 39 public _SSToDS_16a 44 public GetOS2KrnlMTE45 public x86DisableWriteProtect46 public x86RestoreWriteProtect47 40 48 41 … … 50 43 ; Externs 51 44 ; 52 extrn _TKSSBase16:dword 53 extrn GETKERNELINFO32:FAR 54 extrn ELFIOCTL:FAR 45 extrn _TKSSBase:dword 55 46 extrn WIN32KIOCTL:FAR 56 47 extrn WIN32KOPEN:FAR … … 64 55 ASSUME CS:CODE16, DS:DATA16, ES:NOTHING, SS:NOTHING 65 56 66 CODE16START label byte 57 CODE16START db 'CODE16START',0 58 67 59 68 60 .286p 69 ;$win32ki entry point70 _strategyAsm0:71 ; int 372 push 073 jmp _strategyAsm74 75 ;$win32k entry point76 _strategyAsm1:77 ; int 378 push 179 jmp _strategyAsm80 81 61 ;; 82 62 ; Stub which pushes parameters onto the stack and call the 16-bit C strategy routine. … … 99 79 .386p 100 80 ;; 101 ; Thunk procedure for R0Init32.102 ; @cproto USHORT NEAR CallGetKernelInfo32(ULONG addressKrnlInfoBuf);103 ; @returns Same as GetKernelInfo32.104 ; @param addressKrnlInfoBuf 32-bit pointer to request data on stack.105 ; @status completely implemented.106 ; @author knut st. osmundsen107 _CallGetKernelInfo32 PROC NEAR108 ASSUME CS:CODE16109 push ds110 push word ptr [esp+6] ; push high word.111 push word ptr [esp+6] ; push low word.112 call far ptr FLAT:GETKERNELINFO32113 pop ds114 ret115 _CallGetKernelInfo32 ENDP116 117 118 119 120 ;;121 ; Thunk procedure for .122 ; @cproto USHORT NEAR CallElfIOCtl(void);123 ; @returns Same as ElfIOCtl124 ; @param address of IOCtl request packet (32-bit pointer).125 ; @status completely implemented.126 ; @author knut st. osmundsen127 _CallElfIOCtl PROC NEAR128 ASSUME CS:CODE16129 push ds130 push word ptr [esp+6] ; push high word.131 push word ptr [esp+6] ; push low word.132 call far ptr FLAT:ELFIOCTL133 pop ds134 retn135 _CallElfIOCtl ENDP136 137 ;;138 81 ; Thunk procedure for . 139 82 ; @cproto USHORT NEAR CallWin32kIOCtl(void); … … 189 132 190 133 191 192 134 ;; 193 135 ; SSToDS - stack pointer to Flat pointer. … … 204 146 _SSToDS_16a proc NEAR 205 147 assume CS:CODE16, DS:DATA16, ES:NOTHING 206 mov edx, ds:_TKSSBase16 ; get pointer held by _TKSSBase16 (pointer to stack base)207 148 call far ptr FLAT:far_getCS ; get flat selector. 208 149 push es 209 150 mov es, ax 210 151 assume es:FLAT 211 mov eax, es: [edx]; get pointer to stack base152 mov eax, es:_TKSSBase ; get pointer to stack base 212 153 pop es 213 154 movzx edx, word ptr ss:[esp + 2] ; 16-bit stack pointer (parameter) … … 262 203 ret 263 204 GetOS2KrnlMTE ENDP 264 265 266 ;;267 ; Disables the ring-0 write protection.268 ; It's used to help us write to readonly code segments and objects.269 ; @cproto extern ULONG _Optlink x86DisableWriteProtect(void);270 ; @return Previous write protection flag setting.271 ; @uses eax, edx272 ; @status completely implemented.273 ; @author knut st. osmundsen (knut.stange.osmundsen@mynd.no)274 ; @remark Used by importTabInit.275 x86DisableWriteProtect proc near276 cli277 mov edx, cr0 ; Get current cr0278 test edx, 000010000h ; Test for the WriteProtect flag (bit 16)279 setnz al280 movzx eax, al ; Old flag setting in eax (return value)281 and edx, 0fffeffffh ; Clear the 16th (WP) bit.282 mov cr0, edx ;283 sti284 ret ; return eax holds previous WP value.285 x86DisableWriteProtect endp286 287 288 ;;289 ; Restore the WP flag of CR0 to it's previous state.290 ; The call is intent only to be called with the result from x86DisableWriteProtect,291 ; and will hence only enable the WP flag.292 ; @cproto extern ULONG _Optlink x86RestoreWriteProtect(ULONG flWP);293 ; @return Previous write protection flag setting.294 ; @param eax - flWP Boolean value. (1 = WP was set, 0 WP was clear)295 ; @uses eax296 ; @status completely implemented.297 ; @author knut st. osmundsen (knut.stange.osmundsen@mynd.no)298 ; @remark Used by importTabInit.299 x86RestoreWriteProtect proc near300 test eax, eax ; Check if the flag was previously clear301 jnz x86RWP_set ; If set Then Set it back.302 jmp x86RWP_end ; If clear Then nothing to do.303 x86RWP_set:304 cli305 mov eax, cr0 ; Get current cr0.306 or eax, 000010000h ; The the 16-bit (WP) bit.307 mov cr0, eax ; Update cr0.308 sti309 310 x86RWP_end:311 ret312 x86RestoreWriteProtect endp313 205 314 206 … … 367 259 368 260 CODE16_INIT segment 369 CODE16_INITSTART label byte261 CODE16_INITSTART db 'CODE16_INITSTART',0 370 262 CODE16_INIT ends 371 263 372 264 DATA16 segment 373 DATA16START label byte 265 DATA16START label byte ; no string here!! 374 266 DATA16 ends 375 267 376 268 DATA16_BSS segment 377 DATA16_BSSSTART label byte269 DATA16_BSSSTART db 'DATA16_BSSSTART',0 378 270 DATA16_BSS ends 379 271 380 272 DATA16_CONST segment 381 DATA16_CONSTSTART label byte273 DATA16_CONSTSTART db 'DATA16_CONSTSTART', 0 382 274 DATA16_CONST ends 383 275 384 276 DATA16_INIT segment 385 DATA16_INITSTART label byte277 DATA16_INITSTART db 'DATA16_INITSTART',0 386 278 DATA16_INIT ends 387 279 388 280 DATA32 segment 389 DATA32START label byte281 DATA32START db 'DATA32START',0 390 282 DATA32 ends 391 283 392 284 BSS32 segment 393 BSS32START label byte285 BSS32START db 'BSS32START',0 394 286 BSS32 ends 395 287 396 288 CONST32_RO segment 397 CONST32_ROSTART label byte289 CONST32_ROSTART db 'CONST32_ROSTART',0 398 290 CONST32_RO ends 399 291 400 292 _VFT segment 401 _VFTSTART LABEL BYTE293 _VFTSTART db '_VFTSTART',0 402 294 _VFT ends 403 295 404 296 EH_DATA segment 405 EH_DATASTART LABEL BYTE297 EH_DATASTART db 'EH_DATASTART',0 406 298 EH_DATA ends 407 299
Note:
See TracChangeset
for help on using the changeset viewer.
