📄 isr.cod
字号:
; Listing generated by Microsoft (R) Optimizing Compiler Version 12.00.9044.0
TITLE F:\W2DDK\src\kernel\serial\isr.c
.386P
include listing.inc
if @Version gt 510
.model FLAT
else
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
_DATA SEGMENT DWORD USE32 PUBLIC 'DATA'
_DATA ENDS
CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST ENDS
_BSS SEGMENT DWORD USE32 PUBLIC 'BSS'
_BSS ENDS
$$SYMBOLS SEGMENT BYTE USE32 'DEBSYM'
$$SYMBOLS ENDS
$$TYPES SEGMENT BYTE USE32 'DEBTYP'
$$TYPES ENDS
_TLS SEGMENT DWORD USE32 PUBLIC 'TLS'
_TLS ENDS
PAGESER SEGMENT PARA USE32 PUBLIC ''
PAGESER ENDS
; COMDAT _RtlConvertLongToLargeInteger@4
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT _SerialCIsrSw@8
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT _SerialSharerIsr@8
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT _SerialIndexedMultiportIsr@8
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT _SerialBitMappedMultiportIsr@8
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT _SerialISR@8
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT _SerialPutChar@8
PAGESER SEGMENT PARA USE32 PUBLIC ''
PAGESER ENDS
; COMDAT _SerialProcessLSR@4
PAGESER SEGMENT PARA USE32 PUBLIC ''
PAGESER ENDS
FLAT GROUP _DATA, CONST, _BSS
ASSUME CS: FLAT, DS: FLAT, SS: FLAT
endif
INCLUDELIB LIBC
INCLUDELIB OLDNAMES
PUBLIC _SerialCIsrSw@8
; Function compile flags: /Ogsy
; File f:\w2ddk\src\kernel\serial\isr.c
; COMDAT _SerialCIsrSw@8
_TEXT SEGMENT
_InterruptObject$ = 8
_Context$ = 12
_SerialCIsrSw@8 PROC NEAR ; COMDAT
; 59 : PSERIAL_CISR_SW csw = (PSERIAL_CISR_SW)Context;
; 60 :
; 61 : return (*(csw->IsrFunc))(InterruptObject, csw->Context);
00000 8b 44 24 08 mov eax, DWORD PTR _Context$[esp-4]
00004 ff 70 04 push DWORD PTR [eax+4]
00007 ff 74 24 08 push DWORD PTR _InterruptObject$[esp]
0000b ff 10 call DWORD PTR [eax]
; 62 : }
0000d c2 08 00 ret 8
_SerialCIsrSw@8 ENDP
_TEXT ENDS
PUBLIC _SerialSharerIsr@8
; Function compile flags: /Ogsy
; COMDAT _SerialSharerIsr@8
_TEXT SEGMENT
_InterruptObject$ = 8
_Context$ = 12
_servicedAnInterrupt$ = -1
_thisPassServiced$ = 15
_SerialSharerIsr@8 PROC NEAR ; COMDAT
; 98 : {
00000 55 push ebp
00001 8b ec mov ebp, esp
00003 51 push ecx
; 99 :
; 100 : BOOLEAN servicedAnInterrupt = FALSE;
00004 80 65 ff 00 and BYTE PTR _servicedAnInterrupt$[ebp], 0
00008 56 push esi
00009 57 push edi
; 101 : BOOLEAN thisPassServiced;
; 102 : PLIST_ENTRY interruptEntry = ((PLIST_ENTRY)Context)->Flink;
0000a 8b 7d 0c mov edi, DWORD PTR _Context$[ebp]
0000d 8b 37 mov esi, DWORD PTR [edi]
; 103 : PLIST_ENTRY firstInterruptEntry = Context;
; 104 :
; 105 : if (IsListEmpty(firstInterruptEntry)) {
0000f 3b f7 cmp esi, edi
00011 75 04 jne SHORT $L14783
; 106 : return FALSE;
00013 32 c0 xor al, al
00015 eb 23 jmp SHORT $L14776
$L14783:
; 107 : }
; 108 :
; 109 : do {
; 110 :
; 111 : thisPassServiced = FALSE;
00017 80 65 0f 00 and BYTE PTR _thisPassServiced$[ebp], 0
$L14786:
; 112 : do {
; 113 :
; 114 : PSERIAL_DEVICE_EXTENSION extension = CONTAINING_RECORD(
; 115 : interruptEntry,
; 116 : SERIAL_DEVICE_EXTENSION,
; 117 : TopLevelSharers
; 118 : );
; 119 :
; 120 : thisPassServiced |= extension->TopLevelOurIsr(
; 121 : InterruptObject,
; 122 : extension->TopLevelOurIsrContext
; 123 : );
0001b ff 76 fc push DWORD PTR [esi-4]
0001e ff 75 08 push DWORD PTR _InterruptObject$[ebp]
00021 ff 56 f8 call DWORD PTR [esi-8]
00024 08 45 0f or BYTE PTR _thisPassServiced$[ebp], al
; 124 :
; 125 : servicedAnInterrupt |= thisPassServiced;
; 126 : interruptEntry = interruptEntry->Flink;
00027 8b 36 mov esi, DWORD PTR [esi]
00029 8a 45 0f mov al, BYTE PTR _thisPassServiced$[ebp]
0002c 08 45 ff or BYTE PTR _servicedAnInterrupt$[ebp], al
; 127 :
; 128 : } while (interruptEntry != firstInterruptEntry);
0002f 3b f7 cmp esi, edi
00031 75 e8 jne SHORT $L14786
; 129 :
; 130 : } while (thisPassServiced);
00033 84 c0 test al, al
00035 75 e0 jne SHORT $L14783
; 131 :
; 132 : return servicedAnInterrupt;
00037 8a 45 ff mov al, BYTE PTR _servicedAnInterrupt$[ebp]
$L14776:
0003a 5f pop edi
0003b 5e pop esi
; 133 :
; 134 : }
0003c c9 leave
0003d c2 08 00 ret 8
_SerialSharerIsr@8 ENDP
_TEXT ENDS
PUBLIC _SerialISR@8
PUBLIC _SerialIndexedMultiportIsr@8
EXTRN __imp__READ_PORT_UCHAR@4:NEAR
; Function compile flags: /Ogsy
; COMDAT _SerialIndexedMultiportIsr@8
_TEXT SEGMENT
_InterruptObject$ = 8
_Context$ = 12
_SerialIndexedMultiportIsr@8 PROC NEAR ; COMDAT
; 169 : {
00000 53 push ebx
00001 56 push esi
; 170 :
; 171 : BOOLEAN servicedAnInterrupt = FALSE;
00002 8b 74 24 10 mov esi, DWORD PTR _Context$[esp+4]
00006 32 db xor bl, bl
$L14804:
; 172 : BOOLEAN thisStatusReadServiced;
; 173 : PSERIAL_MULTIPORT_DISPATCH dispatch = Context;
; 174 : ULONG whichPort;
; 175 : UCHAR statusRegister;
; 176 :
; 177 : do {
; 178 :
; 179 : thisStatusReadServiced = FALSE;
; 180 : statusRegister = READ_PORT_UCHAR(
; 181 : dispatch->InterruptStatus
; 182 : );
00008 ff 36 push DWORD PTR [esi]
0000a ff 15 00 00 00
00 call DWORD PTR __imp__READ_PORT_UCHAR@4
; 183 :
; 184 : whichPort = statusRegister & 0x07;
00010 8a c8 mov cl, al
00012 83 e1 07 and ecx, 7
; 185 :
; 186 : //
; 187 : // We test against 0xff, which signals that no port
; 188 : // is interruping. The reason 0xff (rather than 0)
; 189 : // is that that would indicate the 0th (first) port
; 190 : // or the 0th daisy chained card.
; 191 : //
; 192 :
; 193 : if (statusRegister != 0xff) {
00015 3c ff cmp al, 255 ; 000000ffH
00017 74 18 je SHORT $L15188
; 194 :
; 195 : if (dispatch->Extensions[whichPort]) {
00019 8b 44 8e 04 mov eax, DWORD PTR [esi+ecx*4+4]
0001d 85 c0 test eax, eax
0001f 74 10 je SHORT $L15188
; 196 :
; 197 : thisStatusReadServiced = SerialISR(
; 198 : InterruptObject,
; 199 : dispatch->Extensions[whichPort]
; 200 : );
00021 50 push eax
00022 ff 74 24 10 push DWORD PTR _InterruptObject$[esp+8]
00026 e8 00 00 00 00 call _SerialISR@8
; 201 :
; 202 : servicedAnInterrupt |= thisStatusReadServiced;
0002b 0a d8 or bl, al
; 203 :
; 204 : }
; 205 :
; 206 : }
; 207 :
; 208 : } while (thisStatusReadServiced);
0002d 84 c0 test al, al
0002f 75 d7 jne SHORT $L14804
$L15188:
; 209 :
; 210 : return servicedAnInterrupt;
00031 8a c3 mov al, bl
00033 5e pop esi
00034 5b pop ebx
; 211 :
; 212 : }
00035 c2 08 00 ret 8
_SerialIndexedMultiportIsr@8 ENDP
_TEXT ENDS
PUBLIC _SerialBitMappedMultiportIsr@8
; Function compile flags: /Ogsy
; COMDAT _SerialBitMappedMultiportIsr@8
_TEXT SEGMENT
_InterruptObject$ = 8
_Context$ = 12
_SerialBitMappedMultiportIsr@8 PROC NEAR ; COMDAT
; 248 : {
00000 53 push ebx
00001 56 push esi
; 249 :
; 250 : BOOLEAN servicedAnInterrupt = FALSE;
00002 8b 74 24 10 mov esi, DWORD PTR _Context$[esp+4]
00006 32 db xor bl, bl
$L14818:
; 251 : PSERIAL_MULTIPORT_DISPATCH dispatch = Context;
; 252 : ULONG whichPort;
; 253 : UCHAR statusRegister;
; 254 :
; 255 : do {
; 256 :
; 257 : statusRegister = READ_PORT_UCHAR(
; 258 : dispatch->InterruptStatus
; 259 : );
00008 ff 36 push DWORD PTR [esi]
0000a ff 15 00 00 00
00 call DWORD PTR __imp__READ_PORT_UCHAR@4
; 260 : if (dispatch->MaskInverted) {
00010 83 7e 44 00 cmp DWORD PTR [esi+68], 0
00014 74 02 je SHORT $L14821
; 261 : statusRegister = ~statusRegister;
00016 f6 d0 not al
$L14821:
; 262 : }
; 263 : statusRegister &= dispatch->UsablePortMask;
00018 22 46 48 and al, BYTE PTR [esi+72]
; 264 :
; 265 : if (statusRegister) {
0001b 74 4e je SHORT $L15193
; 266 :
; 267 : if (statusRegister & 0x0f) {
0001d a8 0f test al, 15 ; 0000000fH
0001f 74 18 je SHORT $L14823
; 268 :
; 269 : if (statusRegister & 0x03) {
00021 a8 03 test al, 3
; 270 :
; 271 : if (statusRegister & 1) {
00023 f6 d0 not al
00025 0f b6 c0 movzx eax, al
00028 74 05 je SHORT $L14824
0002a 83 e0 01 and eax, 1
; 272 :
; 273 : whichPort = 0;
; 274 :
; 275 : } else {
; 276 :
; 277 : whichPort = 1;
; 278 :
; 279 : }
; 280 :
; 281 : } else {
0002d eb 22 jmp SHORT $L14835
$L14824:
; 282 :
; 283 : if (statusRegister & 0x04) {
0002f 83 e0 04 and eax, 4
00032 0c 08 or al, 8
00034 c1 e8 02 shr eax, 2
; 284 :
; 285 : whichPort = 2;
; 286 :
; 287 : } else {
; 288 :
; 289 : whichPort = 3;
; 290 :
; 291 : }
; 292 :
; 293 : }
; 294 :
; 295 : } else {
00037 eb 18 jmp SHORT $L14835
$L14823:
; 296 :
; 297 : if (statusRegister & 0x30) {
00039 a8 30 test al, 48 ; 00000030H
; 298 :
; 299 : if (statusRegister & 0x10) {
0003b f6 d0 not al
0003d 0f b6 c0 movzx eax, al
00040 74 0a je SHORT $L14831
00042 83 e0 10 and eax, 16 ; 00000010H
00045 0c 40 or al, 64 ; 00000040H
00047 c1 e8 04 shr eax, 4
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -