Changeset 679 for GPL/trunk/drv32/startup.inc
- Timestamp:
- Mar 18, 2021, 8:57:36 PM (4 years ago)
- Location:
- GPL/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
GPL/trunk
- Property svn:mergeinfo changed
/GPL/branches/uniaud32-linux-3.2.102 (added) merged: 611-614 /GPL/branches/uniaud32-next (added) merged: 615-678
- Property svn:mergeinfo changed
-
GPL/trunk/drv32/startup.inc
r32 r679 53 53 ENDM 54 54 55 56 IFDEF KEE57 55 ;pushfd/popfd trashed by fucking BUGY KernThunkStackTo32 58 56 ;fix idea by zuko … … 64 62 push stacksel 65 63 push stackbase 66 67 64 push edx 68 65 mov edx, ss 69 66 mov stacksel, edx 70 67 pushfd 71 72 68 call KernThunkStackTo32 73 69 popfd 74 70 mov stackbase, edx 75 pop edx ;trashed by KernThunkStackTo32 76 xor eax, eax ; mark success 71 pop edx ;trashed by KernThunkStackTo32 77 72 ENDM 73 78 74 ;;****************************************************************************** 79 75 ;;****************************************************************************** … … 87 83 pop eax ;trashed by KernThunkStackTo32 88 84 ENDM 85 89 86 ;;****************************************************************************** 90 87 ;;****************************************************************************** … … 97 94 pop eax ;trashed by KernThunkStackTo16 98 95 pop edx ;trashed by KernThunkStackTo16 when called in interrupt context 99 100 96 pop stackbase 101 97 pop stacksel … … 113 109 pop edx ;trashed by KernThunkStackTo16 when called in interrupt context 114 110 ENDM 115 ;;******************************************************************************116 ;;******************************************************************************117 111 118 ELSE119 120 ;;******************************************************************************121 ;;Need to preserve fs:ebx!! (all other registers must be saved by the caller)122 ;;******************************************************************************123 DevThunkStackTo32 MACRO124 LOCAL @@stackok, @@stackchangeend125 126 ;;;; int 3127 128 pushfd129 cli130 pop dword ptr [cpuflags]131 132 ;check if kernel DS selector DPL == 3; if so, change to 0133 call FixSelDPL134 135 ;allocate private stack136 push fs137 call StackAlloc138 pop fs ;trashed by StackAlloc139 mov dword ptr [fInitStack], 1140 141 cmp eax, 0142 jne @@stackok143 144 IFDEF DEBUG145 int 3 ;this is very fatal146 ENDIF147 call RestoreSelDPL148 mov eax, -1 ;mark failure149 150 push dword ptr [cpuflags]151 popfd152 jmp short @@stackchangeend153 154 @@stackok:155 ;stack ptr in eax156 call dword ptr [intSwitchStack]157 158 push dword ptr [cpuflags]159 popfd160 161 mov eax, 0 ;mark success162 @@stackchangeend:163 ENDM164 165 ;;******************************************************************************166 ;;******************************************************************************167 DevThunkStackTo32_Int MACRO168 LOCAL @@cont32169 170 cmp dword ptr [fInitStack], 0171 je @@cont32172 173 ;;;; int 3174 pushfd175 cli176 pop dword ptr [cpuflags]177 178 mov dword ptr [tempeax], eax ;save eax179 180 pop eax ;pop saved flat stack pointer181 182 ;and switch back to our flat stack again183 call dword ptr [intSwitchStack]184 185 mov eax, dword ptr [tempeax] ;restore eax186 push dword ptr [cpuflags]187 popfd188 189 @@cont32:190 ENDM191 192 ;;******************************************************************************193 ;;******************************************************************************194 DevThunkStackTo16 MACRO195 ;;;; int 3196 197 pushfd198 cli199 pop dword ptr [cpuflags]200 201 mov dword ptr [tempeax], eax ;save eax202 mov dword ptr [tempesi], esi ;save esi203 204 mov esi, esp205 xor eax, eax ;switch to 16 bits stack206 call dword ptr [intSwitchStack]207 208 mov eax, esi209 call StackFree210 211 call RestoreSelDPL212 213 mov eax, dword ptr [tempeax]214 mov esi, dword ptr [tempesi]215 216 push dword ptr [cpuflags]217 popfd218 219 ENDM220 221 ;;******************************************************************************222 ;;******************************************************************************223 DevThunkStackTo16_Int MACRO224 LOCAL @@cont16225 226 cmp dword ptr [fInitStack], 0227 je @@cont16228 229 ;;;; int 3230 pushfd231 cli232 pop dword ptr [cpuflags]233 234 mov dword ptr [tempeax], eax ;save eax235 mov dword ptr [tempesi], esi ;save esi236 mov esi, esp237 xor eax, eax ;switch to 16 bits stack238 call dword ptr [intSwitchStack]239 push esi ;flat stack ptr (popped before switching back to flat)240 241 mov eax, dword ptr [tempeax]242 mov esi, dword ptr [tempesi]243 push dword ptr [cpuflags]244 popfd245 246 @@cont16:247 ENDM248 249 ENDIF ;KEE250 251 IFDEF FLATSTACK252 112 ;******************************************************************************* 253 113 ;enter a function that needs to switch to a 16 bits stack … … 263 123 push esi 264 124 push edi 265 266 125 ;to access the parameters on the 32 bits stack, once we've switched 267 126 mov edi, ebp 268 269 127 DevThunkStackTo16_Int 270 128 ENDM 129 271 130 ;******************************************************************************* 272 131 ;switch stack from 16 bits to 32 bits and return … … 288 147 ;;****************************************************************************** 289 148 290 ENDIF291 149 292 150 ;Constants and structure definitions 293 294 DevHlp_VirtToLin EQU 5Bh295 DevHlp_VMLock EQU 55h296 151 297 152 ; Status word masks … … 330 185 o_status dw ? 331 186 rpInitOut ends 332 333 334 ; definitions for 16 bits resource manager buffers335 ; (also in rm.hpp!!)336 MAXSIZE_RMNodeData EQU 1024337 MAXSIZE_RMResources EQU 128338 MAXSIZE_RMHandleList EQU 128339 MAXSIZE_RMResourceList EQU 256
Note:
See TracChangeset
for help on using the changeset viewer.