📄 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: /Ogs
; File f:\w2ddk\src\kernel\serial\isr.c
; COMDAT _SerialCIsrSw@8
_TEXT SEGMENT
_InterruptObject$ = 8
_Context$ = 12
_SerialCIsrSw@8 PROC NEAR ; COMDAT
; 58 : {
00000 55 push ebp
00001 8b ec mov ebp, esp
; 59 : PSERIAL_CISR_SW csw = (PSERIAL_CISR_SW)Context;
; 60 :
; 61 : return (*(csw->IsrFunc))(InterruptObject, csw->Context);
00003 8b 45 0c mov eax, DWORD PTR _Context$[ebp]
00006 ff 70 04 push DWORD PTR [eax+4]
00009 ff 75 08 push DWORD PTR _InterruptObject$[ebp]
0000c ff 10 call DWORD PTR [eax]
; 62 : }
0000e 5d pop ebp
0000f c2 08 00 ret 8
_SerialCIsrSw@8 ENDP
_TEXT ENDS
PUBLIC _SerialSharerIsr@8
; Function compile flags: /Ogs
; 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 $L14821
; 106 : return FALSE;
00013 32 c0 xor al, al
00015 eb 23 jmp SHORT $L14814
$L14821:
; 107 : }
; 108 :
; 109 : do {
; 110 :
; 111 : thisPassServiced = FALSE;
00017 80 65 0f 00 and BYTE PTR _thisPassServiced$[ebp], 0
$L14824:
; 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 $L14824
; 129 :
; 130 : } while (thisPassServiced);
00033 84 c0 test al, al
00035 75 e0 jne SHORT $L14821
; 131 :
; 132 : return servicedAnInterrupt;
00037 8a 45 ff mov al, BYTE PTR _servicedAnInterrupt$[ebp]
$L14814:
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: /Ogs
; COMDAT _SerialIndexedMultiportIsr@8
_TEXT SEGMENT
_InterruptObject$ = 8
_Context$ = 12
_SerialIndexedMultiportIsr@8 PROC NEAR ; COMDAT
; 169 : {
00000 55 push ebp
00001 8b ec mov ebp, esp
00003 53 push ebx
00004 56 push esi
; 170 :
; 171 : BOOLEAN servicedAnInterrupt = FALSE;
00005 8b 75 0c mov esi, DWORD PTR _Context$[ebp]
00008 32 db xor bl, bl
$L14842:
; 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 : );
0000a ff 36 push DWORD PTR [esi]
0000c ff 15 00 00 00
00 call DWORD PTR __imp__READ_PORT_UCHAR@4
; 183 :
; 184 : whichPort = statusRegister & 0x07;
00012 8a c8 mov cl, al
00014 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) {
00017 3c ff cmp al, 255 ; 000000ffH
00019 74 17 je SHORT $L15253
; 194 :
; 195 : if (dispatch->Extensions[whichPort]) {
0001b 8b 44 8e 04 mov eax, DWORD PTR [esi+ecx*4+4]
0001f 85 c0 test eax, eax
00021 74 0f je SHORT $L15253
; 196 :
; 197 : thisStatusReadServiced = SerialISR(
; 198 : InterruptObject,
; 199 : dispatch->Extensions[whichPort]
; 200 : );
00023 50 push eax
00024 ff 75 08 push DWORD PTR _InterruptObject$[ebp]
00027 e8 00 00 00 00 call _SerialISR@8
; 201 :
; 202 : servicedAnInterrupt |= thisStatusReadServiced;
0002c 0a d8 or bl, al
; 203 :
; 204 : }
; 205 :
; 206 : }
; 207 :
; 208 : } while (thisStatusReadServiced);
0002e 84 c0 test al, al
00030 75 d8 jne SHORT $L14842
$L15253:
; 209 :
; 210 : return servicedAnInterrupt;
00032 8a c3 mov al, bl
00034 5e pop esi
00035 5b pop ebx
; 211 :
; 212 : }
00036 5d pop ebp
00037 c2 08 00 ret 8
_SerialIndexedMultiportIsr@8 ENDP
_TEXT ENDS
PUBLIC _SerialBitMappedMultiportIsr@8
; Function compile flags: /Ogs
; COMDAT _SerialBitMappedMultiportIsr@8
_TEXT SEGMENT
_InterruptObject$ = 8
_Context$ = 12
_SerialBitMappedMultiportIsr@8 PROC NEAR ; COMDAT
; 248 : {
00000 55 push ebp
00001 8b ec mov ebp, esp
00003 53 push ebx
00004 56 push esi
; 249 :
; 250 : BOOLEAN servicedAnInterrupt = FALSE;
00005 8b 75 0c mov esi, DWORD PTR _Context$[ebp]
00008 32 db xor bl, bl
$L14856:
; 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 : );
0000a ff 36 push DWORD PTR [esi]
0000c ff 15 00 00 00
00 call DWORD PTR __imp__READ_PORT_UCHAR@4
; 260 : if (dispatch->MaskInverted) {
00012 83 7e 44 00 cmp DWORD PTR [esi+68], 0
00016 74 02 je SHORT $L14859
; 261 : statusRegister = ~statusRegister;
00018 f6 d0 not al
$L14859:
; 262 : }
; 263 : statusRegister &= dispatch->UsablePortMask;
0001a 22 46 48 and al, BYTE PTR [esi+72]
; 264 :
; 265 : if (statusRegister) {
0001d 74 4d je SHORT $L15258
; 266 :
; 267 : if (statusRegister & 0x0f) {
0001f a8 0f test al, 15 ; 0000000fH
00021 74 18 je SHORT $L14861
; 268 :
; 269 : if (statusRegister & 0x03) {
00023 a8 03 test al, 3
; 270 :
; 271 : if (statusRegister & 1) {
00025 f6 d0 not al
00027 0f b6 c0 movzx eax, al
0002a 74 05 je SHORT $L14862
0002c 83 e0 01 and eax, 1
; 272 :
; 273 : whichPort = 0;
; 274 :
; 275 : } else {
; 276 :
; 277 : whichPort = 1;
; 278 :
; 279 : }
; 280 :
; 281 : } else {
0002f eb 22 jmp SHORT $L14873
$L14862:
; 282 :
; 283 : if (statusRegister & 0x04) {
00031 83 e0 04 and eax, 4
00034 0c 08 or al, 8
00036 c1 e8 02 shr eax, 2
; 284 :
; 285 : whichPort = 2;
; 286 :
; 287 : } else {
; 288 :
; 289 : whichPort = 3;
; 290 :
; 291 : }
; 292 :
; 293 : }
; 294 :
; 295 : } else {
00039 eb 18 jmp SHORT $L14873
$L14861:
; 296 :
; 297 : if (statusRegister & 0x30) {
0003b a8 30 test al, 48 ; 00000030H
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -