儲存庫 vbox 的更動 42332
- 時間撮記:
- 2012-7-23 下午04:48:01 (12 年 以前)
- 位置:
- trunk/src/VBox/Devices/PC/BIOS
- 檔案:
-
- 修改 8 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/src/VBox/Devices/PC/BIOS/inlines.h
r42127 r42332 61 61 modify exact [] nomemory aborts; 62 62 63 #ifdef __386__ 64 65 void rep_movsb(void __far *d, void __far *s, int nbytes); 66 #pragma aux rep_movsb = \ 67 "push ds" \ 68 "mov ds, dx" \ 69 "rep movsb" \ 70 "pop ds" \ 71 parm [es edi] [dx esi] [ecx]; 72 73 #else 74 75 void rep_movsb(void __far *d, void __far *s, int nbytes); 76 #pragma aux rep_movsb = \ 77 "push ds" \ 78 "mov ds, dx" \ 79 "rep movsb" \ 80 "pop ds" \ 81 parm [es di] [dx si] [cx]; 82 83 #endif 84 63 85 void rep_movsw(void __far *d, void __far *s, int nwords); 64 86 #pragma aux rep_movsw = \ -
trunk/src/VBox/Devices/PC/BIOS/makefile
r42258 r42332 15 15 !endif 16 16 CFLAGS = -q -0 -wx -zu -s -oas -d1+ -ms 17 CFLAGS32 = -q -wx -zu -s -oas -d1+ - nt=BIOS32 -nd=BIOS3217 CFLAGS32 = -q -wx -zu -s -oas -d1+ -ms -nt=BIOS32 -nd=BIOS32 18 18 19 19 DEFS = -DVBOX -DVBOX_LANBOOT_SEG=0xE200 -DVBOX_VERSION_STRING=$(Q)0.9$(Q) & -
trunk/src/VBox/Devices/PC/BIOS/orgs.asm
r42127 r42332 110 110 extrn _int19_function:near 111 111 extrn _int1a_function:near 112 extrn _int1a_function_pci:near113 112 extrn _pci16_function:near 114 113 extrn _int70_function:near … … 1646 1645 jne int1a_normal 1647 1646 1648 if 01649 call pcibios_real1650 jc pcibios_error1651 1652 jmp iret_modify_cf ; don't trash caller's flags!1653 1654 pcibios_error:1655 ; mov bl, ah1656 ; mov ah, 0B1h1657 pusha1658 ; mov ax, ss ; set readable descriptor to DS for calling1659 ; mov ds, ax ; PCI BIOS from 16-bit protected mode1660 ; TODO: C environment?!1661 call _int1a_function_pci1662 popa1663 iret1664 else1665 1647 push es 1666 1648 push ds … … 1674 1656 pop es 1675 1657 iret 1676 endif1677 1658 1678 1659 int1a_normal: -
trunk/src/VBox/Devices/PC/BIOS/pcibio32.asm
r42127 r42332 116 116 117 117 pushfd 118 push es 118 119 pushad 119 120 call _pci32_function 120 121 popad 122 pop es 121 123 popfd 122 124 retf -
trunk/src/VBox/Devices/PC/BIOS/pcibios.c
r42127 r42332 97 97 typedef struct { 98 98 pushad_regs_t gr; 99 uint32_t es; 99 100 uint32_t flags; 100 101 } pci_regs_t; … … 157 158 158 159 #endif 160 161 /* PCI IRQ routing expansion buffer descriptor. */ 162 typedef struct { 163 uint16_t buf_size; 164 uint8_t __far *buf_ptr; 165 } pci_route_buf; 166 167 /* Defined in assembler module .*/ 168 extern char pci_routing_table[]; 169 extern uint16_t pci_routing_table_size; 159 170 160 171 /* Write the CONFIG_ADDRESS register to prepare for data access. Requires … … 293 304 void BIOSCALL PCIxx(function)(volatile pci_regs_t r) 294 305 { 295 uint16_t device; 306 pci_route_buf __far *route_buf; 307 uint16_t device; 296 308 297 309 BX_DEBUG_PCI("PCI: AX=%04X BX=%04X CX=%04X\n", AX, BX, CX); … … 367 379 } 368 380 break; 381 case GET_IRQ_ROUTING: 382 route_buf = ES :> (void *)DI; 383 if (pci_routing_table_size > route_buf->buf_size) { 384 SET_AH(BUFFER_TOO_SMALL); 385 SET_CF(); 386 } else { 387 rep_movsb(route_buf->buf_ptr, pci_routing_table, pci_routing_table_size); 388 } 389 break; 369 390 default: 370 391 BX_INFO("PCI: Unsupported function AX=%04X BX=%04X called\n", AX, BX); -
trunk/src/VBox/Devices/PC/BIOS/pcibios.inc
r41989 r42332 49 49 ; Publics for easier debugging and disassembly 50 50 51 public pcibios_real52 public pci_present53 public pci_real_f0254 public pci_real_devloop55 public pci_real_nextdev56 public pci_real_f0357 public pci_real_devloop258 public pci_real_nextdev259 public pci_real_ok60 public pci_real_fail61 public pci_real_select_reg62 51 public pcibios_init_iomem_bases 63 52 public pci_init_io_loop1 … … 81 70 82 71 .386 83 pcibios_real:84 push eax85 push dx86 ifdef PCI_FIXED_HOST_BRIDGE_187 mov eax, 80000000h88 mov dx, PCI_CFG189 out dx, eax90 mov dx, PCI_CFG291 in eax, dx92 cmp eax, PCI_FIXED_HOST_BRIDGE_193 je pci_present94 endif95 96 ifdef PCI_FIXED_HOST_BRIDGE_297 ; 18h << 1198 mov eax, 8000c000h99 mov dx, PCI_CFG1100 out dx, eax101 mov dx, PCI_CFG2102 in eax, dx103 cmp eax, PCI_FIXED_HOST_BRIDGE_2104 je pci_present105 ; 19h << 11106 mov eax, 8000c800h107 mov dx, PCI_CFG1108 out dx, eax109 mov dx, PCI_CFG2110 in eax, dx111 cmp eax, PCI_FIXED_HOST_BRIDGE_2112 je pci_present113 endif114 pop dx115 pop eax116 mov ah, 0FFh117 stc118 ret119 pci_present:120 pop dx121 pop eax122 cmp al, 1 ; installation check123 jne pci_real_f02124 mov ax, 0001h125 mov bx, 0210h126 mov cx, 0127 mov edx, ' ICP' ; #0x20494350 "PCI "128 ;; @todo!129 if 0130 mov edi, 0f0000h131 mov di, pcibios_protected132 else133 mov edi, pcibios_protected134 endif135 clc136 ret137 138 pci_real_f02: ;; find pci device139 push esi140 push edi141 push edx142 cmp al, 2143 jne pci_real_f03144 145 shl ecx, 16146 mov cx, dx147 xor ebx, ebx148 mov di, 0149 pci_real_devloop:150 call pci_real_select_reg151 mov dx, PCI_CFG2152 in eax, dx153 cmp eax, ecx154 jne pci_real_nextdev155 156 cmp si, 0157 je pci_real_ok158 159 dec si160 pci_real_nextdev:161 inc ebx162 cmp ebx, MAX_BUSDEVFN163 jne pci_real_devloop164 165 mov dx, cx166 shr ecx, 16167 mov ax, 8602h168 jmp pci_real_fail169 pci_real_f03: ;; find class code170 cmp al, 3171 jne pci_real_f08172 xor ebx, ebx173 mov di, 8174 pci_real_devloop2:175 call pci_real_select_reg176 mov dx, PCI_CFG2177 in eax, dx178 shr eax, 8179 cmp eax, ecx180 jne pci_real_nextdev2181 182 cmp si, 0183 je pci_real_ok184 185 dec si186 pci_real_nextdev2:187 inc ebx188 cmp ebx, MAX_BUSDEVFN189 jne pci_real_devloop2190 191 mov ax, 8603h192 jmp pci_real_fail193 194 pci_real_f08: ;; read configuration byte195 cmp al, 8196 jne pci_real_f09197 198 call pci_real_select_reg199 push dx200 mov dx, di201 and dx, 3202 add dx, PCI_CFG2203 in al, dx204 pop dx205 mov cl, al206 jmp pci_real_ok207 208 pci_real_f09: ;; read configuration word209 cmp al, 9210 jne pci_real_f0a211 212 call pci_real_select_reg213 push dx214 mov dx, di215 and dx, 2216 add dx, PCI_CFG2217 in ax, dx218 pop dx219 mov cx, ax220 jmp pci_real_ok221 pci_real_f0a: ;; read configuration dword222 cmp al, 0Ah223 jne pci_real_f0b224 225 call pci_real_select_reg226 push dx227 mov dx, PCI_CFG2228 in eax, dx229 pop dx230 mov ecx, eax231 jmp pci_real_ok232 233 pci_real_f0b: ;; write configuration byte234 cmp al, 0Bh235 jne pci_real_f0c236 237 call pci_real_select_reg238 push dx239 mov dx, di240 and dx, 3241 add dx, PCI_CFG2242 mov al, cl243 out dx, al244 pop dx245 jmp pci_real_ok246 247 pci_real_f0c: ;; write configuration word248 cmp al, 0Ch249 jne pci_real_f0d250 251 call pci_real_select_reg252 push dx253 mov dx, di254 and dx, 2255 add dx, PCI_CFG2256 mov ax, cx257 out dx, ax258 pop dx259 jmp pci_real_ok260 261 pci_real_f0d: ;; write configuration dword262 cmp al, 0Dh263 jne pci_real_f0e264 265 call pci_real_select_reg266 push dx267 mov dx, PCI_CFG2268 mov eax, ecx269 out dx, eax270 pop dx271 jmp pci_real_ok272 273 pci_real_f0e: ;; get irq routing options274 cmp al, 0Eh275 jne pci_real_unknown276 277 cmp word ptr es:[di], pci_routing_table_structure_end - pci_routing_table_structure_start278 jb pci_real_too_small279 280 mov word ptr es:[di], pci_routing_table_structure_end - pci_routing_table_structure_start281 pushf282 push ds283 push es284 push cx285 push si286 push di287 cld288 mov si, pci_routing_table_structure_start289 push cs290 pop ds291 mov cx, es:[di+2]292 mov es, es:[di+4]293 mov di, cx294 mov cx, pci_routing_table_structure_end - pci_routing_table_structure_start295 rep movsb296 pop di297 pop si298 pop cx299 pop es300 pop ds301 popf302 mov bx, (1 shl 9) or (1 shl 11) ; #(1 << 9) | (1 << 11) ;; irq 9 and 11 are used303 jmp pci_real_ok304 305 pci_real_too_small:306 mov word ptr es:[di], pci_routing_table_structure_end - pci_routing_table_structure_start307 mov ah, 89h308 jmp pci_real_fail309 310 pci_real_unknown:311 mov ah, 81h312 pci_real_fail:313 pop edx314 pop edi315 pop esi316 stc317 ret318 pci_real_ok:319 xor ah, ah320 pop edx321 pop edi322 pop esi323 clc324 ret325 326 ;; prepare from reading the PCI config space; on input:327 ;; bx = bus/dev/fn328 ;; di = offset into config space header329 ;; destroys eax and may modify di330 pci_real_select_reg:331 push dx332 mov eax, 800000h333 mov ax, bx334 shl eax, 8335 and di, 0FFh336 or ax, di337 and al, 0FCh338 mov dx, PCI_CFG1339 out dx, eax340 pop dx341 ret342 72 343 73 if not BX_ROMBIOS32 -
trunk/src/VBox/Devices/PC/BIOS/pirq.inc
r41496 r42332 40 40 41 41 if BX_PCIBIOS 42 public pci_routing_table_structure ; For disassembly 42 public _pci_routing_table 43 public _pci_routing_table_size 43 44 44 45 align 16 … … 63 64 db 7 ;; checksum 64 65 endif ; !VBOX 65 pci_routing_table_structure_start: 66 _pci_routing_table: 67 pci_routing_table: 66 68 ;; first slot entry PCI-to-ISA (embedded) 67 69 db 0 ;; pci bus number … … 456 458 db 0 ;; reserved 457 459 endif ; VBOX 458 pci_routing_table_structure_end: 460 pci_routing_table_end: 461 ;; Size of the table 462 pci_routing_table_size dw pci_routing_table_end - pci_routing_table 459 463 460 464 endif ; BX_PCIBIOS -
trunk/src/VBox/Devices/PC/BIOS/timepci.c
r38699 r42332 146 146 // in the following routines 147 147 148 /* The PCI BIOS routine must be callable from protected mode, and149 * therefore must not modify any segment registers(!).150 */151 #if BX_PCIBIOS152 void BIOSCALL int1a_function_pci(i1apci_regs_t r)153 {154 #if 0155 // real mode PCI BIOS functions now handled in assembler code156 // this C code handles the error code for information only157 if (r.gr.u.r8.ah == 0xff) {158 BX_INFO("PCI BIOS: PCI not present\n");159 } else if (r.gr.u.r8.ah == 0x81) {160 BX_INFO("unsupported PCI BIOS function 0x%02x\n", r.gr.u.r8.al);161 } else if (r.gr.u.r8.ah == 0x83) {162 BX_INFO("bad PCI vendor ID %04x\n", r.gr.u.r16.dx);163 } else if (r.gr.u.r8.ah == 0x86) {164 if (r.gr.u.r8.ah == 0x02) {165 BX_INFO("PCI device %04x:%04x not found at index %d\n", r.gr.u.r16.dx, r.gr.u.r16.cx, r.gr.u.r16.si);166 } else {167 BX_INFO("no PCI device with class code 0x%02x%04x found at index %d\n", r.gr.u.r8.cl, r.gr.u.r16.dx, r.gr.u.r16.si);168 }169 }170 #endif171 //@todo: OS/2 MCP2 apparently calls us in protected mode with a DS which does not172 // point to the BIOS segment!?!173 send(BIOS_PRINTF_INFO, '!');174 send(BIOS_PRINTF_INFO, '\n');175 if (!GetCF(r.ra.flags)) {176 SetCF(r.ra.flags);177 }178 }179 #endif180 181 182 148 void BIOSCALL int1a_function(pusha_regs_t regs, uint16_t ds, uint16_t es, iret_addr_t iret_addr) 183 149 {
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器