Changeset 82278 in vbox
- Timestamp:
- Nov 28, 2019 9:23:32 PM (5 years ago)
- Location:
- trunk/src/VBox/Devices/Graphics/BIOS
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Graphics/BIOS/inlines.h
r82246 r82278 31 31 #define outw(p, v) outpw(p, v) 32 32 33 extern uint8_t read_byte(uint16_t seg, uint16_t offset); 34 extern uint16_t read_word(uint16_t seg, uint16_t offset); 35 extern uint32_t read_dword(uint16_t seg, uint16_t offset); 36 extern void write_byte(uint16_t seg, uint16_t offset, uint8_t data); 37 extern void write_word(uint16_t seg, uint16_t offset, uint16_t data); 38 extern void write_dword(uint16_t seg, uint16_t offset, uint32_t data); 33 /* Far byte/word/dword access routines. */ 34 35 inline uint8_t read_byte(uint16_t seg, uint16_t offset) 36 { 37 return( *(seg:>(uint8_t *)offset) ); 38 } 39 40 inline void write_byte(uint16_t seg, uint16_t offset, uint8_t data) 41 { 42 *(seg:>(uint8_t *)offset) = data; 43 } 44 45 inline uint16_t read_word(uint16_t seg, uint16_t offset) 46 { 47 return( *(seg:>(uint16_t *)offset) ); 48 } 49 50 inline void write_word(uint16_t seg, uint16_t offset, uint16_t data) 51 { 52 *(seg:>(uint16_t *)offset) = data; 53 } 54 55 inline uint32_t read_dword(uint16_t seg, uint16_t offset) 56 { 57 return( *(seg:>(uint32_t *)offset) ); 58 } 59 60 inline void write_dword(uint16_t seg, uint16_t offset, uint32_t data) 61 { 62 *(seg:>(uint32_t *)offset) = data; 63 } 39 64 40 65 void int_enable(void); -
trunk/src/VBox/Devices/Graphics/BIOS/vgabios.c
r82246 r82278 78 78 static uint8_t find_vga_entry(); 79 79 80 extern uint8_t xread_byte(uint16_t seg, uint16_t offset); 81 80 82 #ifdef VBE 81 83 extern uint16_t __cdecl vbe_has_vbe_display(void); … … 1391 1393 mask=0x80>>j; 1392 1394 outw(VGAREG_GRDC_ADDRESS, (mask << 8) | 0x08); 1393 read_byte(0xa000,dest);1395 xread_byte(0xa000,dest); 1394 1396 if(fdata[src+i]&mask) 1395 1397 { … … 1638 1640 outw(VGAREG_GRDC_ADDRESS, (mask << 8) | 0x08); 1639 1641 outw(VGAREG_GRDC_ADDRESS, 0x0205); 1640 data = read_byte(0xa000,addr);1642 data = xread_byte(0xa000,addr); 1641 1643 if (AL & 0x80) 1642 1644 { … … 2325 2327 /* =========================================================== */ 2326 2328 2327 uint8_t read_byte(uint16_t seg, uint16_t offset) 2329 /* This function is used for planar VGA memory reads to defeat the 2330 * optimizer. We must read exactly one byte, otherwise the screen 2331 * may be corrupted. 2332 */ 2333 uint8_t xread_byte(uint16_t seg, uint16_t offset) 2328 2334 { 2329 2335 return( *(seg:>(uint8_t *)offset) ); 2330 }2331 2332 void write_byte(uint16_t seg, uint16_t offset, uint8_t data)2333 {2334 *(seg:>(uint8_t *)offset) = data;2335 }2336 2337 uint16_t read_word(uint16_t seg, uint16_t offset)2338 {2339 return( *(seg:>(uint16_t *)offset) );2340 }2341 2342 void write_word(uint16_t seg, uint16_t offset, uint16_t data)2343 {2344 *(seg:>(uint16_t *)offset) = data;2345 }2346 2347 uint32_t read_dword(uint16_t seg, uint16_t offset)2348 {2349 return( *(seg:>(uint32_t *)offset) );2350 }2351 2352 void write_dword(uint16_t seg, uint16_t offset, uint32_t data)2353 {2354 *(seg:>(uint32_t *)offset) = data;2355 2336 } 2356 2337 … … 2566 2547 if (GET_AL() < 2) { 2567 2548 write_byte(BIOSMEM_SEG,BIOSMEM_VIDEO_CTL, 2568 ( read_byte(BIOSMEM_SEG,BIOSMEM_VIDEO_CTL) & ~1) | GET_AL());2549 (xread_byte(BIOSMEM_SEG,BIOSMEM_VIDEO_CTL) & ~1) | GET_AL()); 2569 2550 SET_AL(0x12); 2570 2551 }
Note:
See TracChangeset
for help on using the changeset viewer.