summaryrefslogtreecommitdiff
path: root/iobp.asm
diff options
context:
space:
mode:
authorIru Cai <mytbk920423@gmail.com>2020-12-25 15:23:35 +0800
committerIru Cai <mytbk920423@gmail.com>2020-12-25 15:23:35 +0800
commit79472fe7229c898fa9a700e4c117aacfb9daa397 (patch)
tree080073afaf59294f6f3a107b1c015eea3c69170e /iobp.asm
parent0cbd2eeaa883a72ccd7f5796736325871521f6eb (diff)
downloadbroadwell-refcode-79472fe7229c898fa9a700e4c117aacfb9daa397.tar.xz
move out iobp
Diffstat (limited to 'iobp.asm')
-rw-r--r--iobp.asm251
1 files changed, 251 insertions, 0 deletions
diff --git a/iobp.asm b/iobp.asm
new file mode 100644
index 0000000..7a302ed
--- /dev/null
+++ b/iobp.asm
@@ -0,0 +1,251 @@
+iobp_write:
+push ebp
+mov ebp, esp
+push esi
+mov esi, dword [ebp + 8]
+push ebx
+lea ebx, [esi + 0x2338]
+
+loc_00009c83:
+sub esp, 0xc
+push ebx
+call read8 ; call 0x17d8b
+add esp, 0x10
+test al, 1
+jne short loc_00009c83 ; jne 0x9c83
+push eax
+push eax
+push dword [ebp + 0xc]
+lea eax, [esi + 0x2330]
+push eax
+call write32 ; call 0x17e8f
+add esp, 0xc
+push 0x700
+push 0xff
+push ebx
+call fcn_00018981 ; call 0x18981
+lea eax, [esi + 0x2334]
+add esi, 0x233a
+pop edx
+pop ecx
+push dword [ebp + 0x10]
+push eax
+call write32 ; call 0x17e8f
+pop eax
+pop edx
+push 0xf000
+push esi
+call write16 ; call 0x17e04
+pop ecx
+pop esi
+push 1
+push ebx
+call or_16 ; call 0x18927
+add esp, 0x10
+
+loc_00009ce8:
+sub esp, 0xc
+push ebx
+call read8 ; call 0x17d8b
+add esp, 0x10
+test al, 1
+jne short loc_00009ce8 ; jne 0x9ce8
+sub esp, 0xc
+push ebx
+call read8 ; call 0x17d8b
+add esp, 0x10
+and eax, 6
+cmp al, 1
+sbb eax, eax
+not eax
+lea esp, [ebp - 8]
+and eax, 0x80000007
+pop ebx
+pop esi
+pop ebp
+ret
+
+iobp_read:
+push ebp
+mov ebp, esp
+push esi
+mov esi, dword [ebp + 8]
+push ebx
+lea ebx, [esi + 0x2338]
+
+loc_00009d27:
+sub esp, 0xc
+push ebx
+call read8 ; call 0x17d8b
+add esp, 0x10
+test al, 1
+jne short loc_00009d27 ; jne 0x9d27
+push eax
+push eax
+push dword [ebp + 0xc]
+lea eax, [esi + 0x2330]
+push eax
+call write32 ; call 0x17e8f
+add esp, 0xc
+push 0x600
+push 0xff
+push ebx
+call fcn_00018981 ; call 0x18981
+lea eax, [esi + 0x233a]
+pop edx
+pop ecx
+push 0xf000
+push eax
+call write16 ; call 0x17e04
+pop eax
+pop edx
+push 1
+push ebx
+call or_16 ; call 0x18927
+add esp, 0x10
+
+loc_00009d7b:
+sub esp, 0xc
+push ebx
+call read8 ; call 0x17d8b
+add esp, 0x10
+test al, 1
+jne short loc_00009d7b ; jne 0x9d7b
+sub esp, 0xc
+push ebx
+call read8 ; call 0x17d8b
+add esp, 0x10
+mov edx, 0x80000007
+test al, 6
+jne short loc_00009db9 ; jne 0x9db9
+sub esp, 0xc
+add esi, 0x2334
+push esi
+call read32 ; call 0x17e4e
+mov edx, dword [ebp + 0x10]
+add esp, 0x10
+mov dword [edx], eax
+xor edx, edx
+
+loc_00009db9:
+lea esp, [ebp - 8]
+mov eax, edx
+pop ebx
+pop esi
+pop ebp
+ret
+
+program_iobp:
+push ebp
+mov ebp, esp
+push edi
+push esi
+push ebx
+sub esp, 0x20
+mov esi, dword [ebp + 0xc]
+lea eax, [ebp - 0x1c]
+mov edi, dword [ebp + 0x14]
+push eax
+push esi
+push dword [ebp + 8]
+call iobp_read ; call 0x9d19
+add esp, 0x10
+mov ebx, eax
+test eax, eax
+jns short loc_00009e40 ; jns 0x9e40
+call fcn_00015479 ; call 0x15479
+test al, al
+je short loc_00009e0a ; je 0x9e0a
+sub esp, 0xc
+push edi
+push dword [ebp + 0x10]
+push esi
+push ref_00022017 ; push 0x22017
+push 0x80000000
+call efi_console_out ; call 0x15487
+add esp, 0x20
+
+loc_00009e0a:
+call dummy_15480 ; call 0x15480
+mov edx, ebx
+test al, al
+je loc_00009ec3 ; je 0x9ec3
+call fcn_00015479 ; call 0x15479
+test al, al
+je short loc_00009e36 ; je 0x9e36
+push edi
+push ebx
+push ref_000206d3 ; push 0x206d3
+push 0x80000000
+call efi_console_out ; call 0x15487
+add esp, 0x10
+
+loc_00009e36:
+push esi
+push ref_000206f4 ; push 0x206f4
+push 0x34
+jmp short loc_00009eb4 ; jmp 0x9eb4
+
+loc_00009e40:
+mov eax, dword [ebp + 0x10]
+and eax, dword [ebp - 0x1c]
+push ecx
+or eax, edi
+push eax
+push esi
+push dword [ebp + 8]
+mov dword [ebp - 0x1c], eax
+call iobp_write ; call 0x9c75
+add esp, 0x10
+mov ebx, eax
+mov edx, eax
+test eax, eax
+jns short loc_00009ec3 ; jns 0x9ec3
+call fcn_00015479 ; call 0x15479
+test al, al
+je short loc_00009e84 ; je 0x9e84
+sub esp, 0xc
+push edi
+push dword [ebp + 0x10]
+push esi
+push ref_00022084 ; push 0x22084
+push 0x80000000
+call efi_console_out ; call 0x15487
+add esp, 0x20
+
+loc_00009e84:
+call dummy_15480 ; call 0x15480
+mov edx, ebx
+test al, al
+je short loc_00009ec3 ; je 0x9ec3
+call fcn_00015479 ; call 0x15479
+test al, al
+je short loc_00009eac ; je 0x9eac
+push edx
+push ebx
+push ref_000206d3 ; push 0x206d3
+push 0x80000000
+call efi_console_out ; call 0x15487
+add esp, 0x10
+
+loc_00009eac:
+push eax
+push ref_000206f4 ; push 0x206f4
+push 0x40
+
+loc_00009eb4:
+push ref_00022050 ; push 0x22050
+call fcn_0001548c ; call 0x1548c
+add esp, 0x10
+mov edx, ebx
+
+loc_00009ec3:
+lea esp, [ebp - 0xc]
+mov eax, edx
+pop ebx
+pop esi
+pop edi
+pop ebp
+ret
+
+