]> Joshua Wise's Git repositories - netwatch.git/blobdiff - aseg/aseg.asm
Don't clear BSS if we don't need to.
[netwatch.git] / aseg / aseg.asm
index ee83272652e66bf3595dd8129eecc6c857b2efb3..244cafc359f3ae87669952727d914f2d43b9f0ed 100644 (file)
@@ -74,29 +74,34 @@ continue:
        mov al, [esp-6]
        out dx, al
 
-       mov al, 0
-       mov edi, [dataptr+4]            ; clear BSS
-       mov ecx, [dataptr+8]
-       rep stosb
-
        mov dx, 0xCFC                   ; restore smramc
        mov al, [esp-5]
        out dx, al
-       
-       mov eax, [dataptr+12]
-       call eax
 
-       mov dx, 0xCF8                   ; restore the old config value
+       mov dx, 0xCF8                   ; restore the old PCI config value
        mov eax, [esp-4]
        out dx, eax
 
+       mov al, [needclear]
+       cmp al, 0
+       jz noclear
+       mov al, 0                       ; clear BSS
+       mov edi, [dataptr+4]
+       mov ecx, [dataptr+8]
+       rep stosb
+       mov [needclear], al
+       
+noclear:
+       mov eax, [dataptr+12]           ; jump into C
+       call eax
+
        mov al, 0x40                    ; ack the periodic IRQ
        mov dx, 0x834
        out dx, al
        
-       mov dx, 0x830
+       mov dx, 0x830                   ; now ack the SMI itself
        in al, dx
-       or al, 0x02                     ; now ack the SMI itself
+       or al, 0x02
        and al, 0xBF
        out dx, al
        or al, 0x40
@@ -104,6 +109,9 @@ continue:
 
        rsm                             ; and leave SMM
 
+needclear:
+       db 0x01
+
        align 0x4
 gdtr:
        db 0x27, 0x00
This page took 0.022771 seconds and 4 git commands to generate.