Changeset 5191
- Timestamp:
- Mar 5, 2010 7:27:19 PM (3 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
-
src/devices/pci_device.c (modified) (1 diff)
-
src/include/device/device.h (modified) (1 diff)
-
util/x86emu/yabel/compat/functions.c (modified) (3 diffs)
-
util/x86emu/yabel/compat/time.h (modified) (1 diff)
-
util/x86emu/yabel/interrupt.c (modified) (5 diffs)
-
util/x86emu/yabel/io.c (modified) (1 diff)
-
util/x86emu/yabel/mem.c (modified) (1 diff)
-
util/x86emu/yabel/vbe.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/devices/pci_device.c
r5136 r5191 653 653 { 654 654 #if CONFIG_PCI_ROM_RUN == 1 || CONFIG_VGA_ROM_RUN == 1 655 void run_bios(struct device *dev, unsigned long addr);656 655 struct rom_header *rom, *ram; 657 656 -
trunk/src/include/device/device.h
r4925 r5191 118 118 void disable_children(struct bus *bus); 119 119 120 /* Option ROM helper functions */ 121 void run_bios(struct device *dev, unsigned long addr); 122 120 123 /* Helper functions */ 121 124 device_t find_dev_path(struct bus *parent, struct device_path *path); -
trunk/util/x86emu/yabel/compat/functions.c
r5185 r5191 19 19 #include "../debug.h" 20 20 #include "../biosemu.h" 21 #include "../compat/time.h" 21 22 22 23 #define VMEM_SIZE (1024 * 1024) /* 1 MB */ … … 53 54 } 54 55 56 unsigned long tb_freq = 0; 57 55 58 u64 get_time(void) 56 59 { … … 65 68 return act; 66 69 } 67 68 unsigned int69 read_io(void *addr, size_t sz)70 {71 unsigned int ret;72 /* since we are using inb instructions, we need the port number as 16bit value */73 u16 port = (u16)(u32) addr;74 75 switch (sz) {76 case 1:77 asm volatile ("inb %1, %b0" : "=a"(ret) : "d" (port));78 break;79 case 2:80 asm volatile ("inw %1, %w0" : "=a"(ret) : "d" (port));81 break;82 case 4:83 asm volatile ("inl %1, %0" : "=a"(ret) : "d" (port));84 break;85 default:86 ret = 0;87 }88 89 return ret;90 }91 92 int93 write_io(void *addr, unsigned int value, size_t sz)94 {95 u16 port = (u16)(u32) addr;96 switch (sz) {97 /* since we are using inb instructions, we need the port number as 16bit value */98 case 1:99 asm volatile ("outb %b0, %1" : : "a"(value), "d" (port));100 break;101 case 2:102 asm volatile ("outw %w0, %1" : : "a"(value), "d" (port));103 break;104 case 4:105 asm volatile ("outl %0, %1" : : "a"(value), "d" (port));106 break;107 default:108 return -1;109 }110 111 return 0;112 }113 -
trunk/util/x86emu/yabel/compat/time.h
r4532 r5191 14 14 15 15 /* TODO: check how this works in x86 */ 16 static unsigned long tb_freq = 0; 16 extern unsigned long tb_freq; 17 u64 get_time(void); 17 18 #endif -
trunk/util/x86emu/yabel/interrupt.c
r5185 r5191 32 32 33 33 //setup to run the code at the address, that the Interrupt Vector points to... 34 void34 static void 35 35 setupInt(int intNum) 36 36 { … … 51 51 52 52 // handle int10 (VGA BIOS Interrupt) 53 void53 static void 54 54 handleInt10(void) 55 55 { … … 208 208 ; 209 209 210 void210 static void 211 211 translate_keycode(u64 * keycode) 212 212 { … … 234 234 235 235 // handle int16 (Keyboard BIOS Interrupt) 236 void236 static void 237 237 handleInt16(void) 238 238 { … … 320 320 321 321 // handle int1a (PCI BIOS Interrupt) 322 void322 static void 323 323 handleInt1a(void) 324 324 { -
trunk/util/x86emu/yabel/io.c
r5185 r5191 25 25 #endif 26 26 27 // those are defined in net-snk/oflib/pci.c 28 extern unsigned int read_io(void *, size_t); 29 extern int write_io(void *, unsigned int, size_t); 30 31 //defined in net-snk/kernel/timer.c 32 extern u64 get_time(void); 27 static unsigned int 28 read_io(void *addr, size_t sz) 29 { 30 unsigned int ret; 31 /* since we are using inb instructions, we need the port number as 16bit value */ 32 u16 port = (u16)(u32) addr; 33 34 switch (sz) { 35 case 1: 36 asm volatile ("inb %1, %b0" : "=a"(ret) : "d" (port)); 37 break; 38 case 2: 39 asm volatile ("inw %1, %w0" : "=a"(ret) : "d" (port)); 40 break; 41 case 4: 42 asm volatile ("inl %1, %0" : "=a"(ret) : "d" (port)); 43 break; 44 default: 45 ret = 0; 46 } 47 48 return ret; 49 } 50 51 static int 52 write_io(void *addr, unsigned int value, size_t sz) 53 { 54 u16 port = (u16)(u32) addr; 55 switch (sz) { 56 /* since we are using inb instructions, we need the port number as 16bit value */ 57 case 1: 58 asm volatile ("outb %b0, %1" : : "a"(value), "d" (port)); 59 break; 60 case 2: 61 asm volatile ("outw %w0, %1" : : "a"(value), "d" (port)); 62 break; 63 case 4: 64 asm volatile ("outl %0, %1" : : "a"(value), "d" (port)); 65 break; 66 default: 67 return -1; 68 } 69 70 return 0; 71 } 33 72 34 73 #ifdef CONFIG_ARCH_X86 -
trunk/util/x86emu/yabel/mem.c
r5185 r5191 159 159 #define DEBUG_CHECK_VMEM_WRITE(_addr, _val) 160 160 #endif 161 162 //defined in net-snk/kernel/timer.c163 extern u64 get_time(void);164 161 165 162 void update_time(u32); -
trunk/util/x86emu/yabel/vbe.c
r5185 r5191 571 571 } 572 572 #endif 573 if (*((u64 *) ddc_info.edid_block_zero) != 574 (u64) 0x00FFFFFFFFFFFF00ULL) { 573 /* This could fail because of alignment issues, so use a longer form. 574 *((u64 *) ddc_info.edid_block_zero) != (u64) 0x00FFFFFFFFFFFF00ULL 575 */ 576 if (ddc_info.edid_block_zero[0] != 0x00 || 577 ddc_info.edid_block_zero[1] != 0xFF || 578 ddc_info.edid_block_zero[2] != 0xFF || 579 ddc_info.edid_block_zero[3] != 0xFF || 580 ddc_info.edid_block_zero[4] != 0xFF || 581 ddc_info.edid_block_zero[5] != 0xFF || 582 ddc_info.edid_block_zero[6] != 0xFF || 583 ddc_info.edid_block_zero[7] != 0x00 ) { 575 584 // invalid EDID signature... probably no monitor 576 585
Note: See TracChangeset
for help on using the changeset viewer.
