Changeset 641
- Timestamp:
- 10/10/02 21:46:47 (6 years ago)
- Location:
- trunk/LinuxBIOSv1
- Files:
-
- 8 modified
-
AUTHORS (modified) (1 diff)
-
src/cpu/p5/delay_tsc.c (modified) (2 diffs)
-
src/include/smp/start_stop.h (modified) (1 diff)
-
src/include/string.h (modified) (1 diff)
-
src/lib/elfboot.c (modified) (4 diffs)
-
src/lib/inflate.c (modified) (1 diff)
-
src/lib/linuxpci.c (modified) (7 diffs)
-
src/lib/subr.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LinuxBIOSv1/AUTHORS
r8 r641 2 2 Contributors (in alpha order): 3 3 4 Eric Biederman <ebiederman@lnxi.com> - 440GX SPD, elfboot, mkelfImage, Athlon SMP, P4 Xeon, etc 4 5 Jeff Garzik <jgarzik@mandrakesoft.com> - The essential /dev/fb! First freebios 5 6 James Hendricks <jimi@lanl.gov> - SMP for 440GX among many other things -
trunk/LinuxBIOSv1/src/cpu/p5/delay_tsc.c
r621 r641 99 99 static unsigned long long calibrate_tsc(void) 100 100 { 101 unsigned long long retval, start, end, delta; 102 unsigned long allones = (unsigned long) -1, result; 103 unsigned long startlow, starthigh; 104 unsigned long endlow, endhigh; 105 unsigned long count; 106 107 rdtsc(startlow,starthigh); 108 // no udivdi3, dammit. 109 // so we count to 1<< 20 and then right shift 20 110 for(count = 0; count < (1<<20); count ++) 111 outb(0x80, 0x80); 112 rdtsc(endlow,endhigh); 113 114 // make delta be (endhigh - starthigh) + (endlow - startlow) 115 // but >> 20 116 // do it this way to avoid gcc warnings. 117 start = starthigh; 118 start <<= 32; 119 start |= startlow; 120 end = endhigh; 121 end <<= 32; 122 end |= endlow; 123 delta = end - start; 124 // at this point we have a delta for 1,000,000 outbs. Now rescale for one microsecond. 125 delta >>= 20; 126 // save this for microsecond timing. 127 clocks_per_usec = delta; 128 #define DEBUG 129 #ifdef DEBUG 130 printk_notice("end %x:%x, start %x:%x\n", 131 endhigh, endlow, starthigh, startlow); 132 printk_notice("32-bit delta %d\n", (unsigned long) delta); 133 #endif 134 135 retval = clocks_per_usec; 136 #ifdef DEBUG 137 printk_notice(__FUNCTION__ " 32-bit result is %d\n", result); 138 #endif 139 return retval; 101 unsigned long long retval, start, end, delta; 102 unsigned long allones = (unsigned long) -1, result; 103 unsigned long startlow, starthigh; 104 unsigned long endlow, endhigh; 105 unsigned long count; 106 107 rdtsc(startlow,starthigh); 108 // no udivdi3, dammit. 109 // so we count to 1<< 20 and then right shift 20 110 for(count = 0; count < (1<<20); count ++) 111 outb(0x80, 0x80); 112 rdtsc(endlow,endhigh); 113 114 // make delta be (endhigh - starthigh) + (endlow - startlow) 115 // but >> 20 116 // do it this way to avoid gcc warnings. 117 start = starthigh; 118 start <<= 32; 119 start |= startlow; 120 end = endhigh; 121 end <<= 32; 122 end |= endlow; 123 delta = end - start; 124 // at this point we have a delta for 1,000,000 outbs. Now rescale for one microsecond. 125 delta >>= 20; 126 // save this for microsecond timing. 127 result = delta; 128 printk_spew("end %x:%x, start %x:%x\n", 129 endhigh, endlow, starthigh, startlow); 130 printk_spew("32-bit delta %d\n", (unsigned long) delta); 131 132 printk_spew(__FUNCTION__ " 32-bit result is %d\n", result); 133 return retval; 140 134 } 141 135 … … 150 144 151 145 if (!clocks_per_usec) { 152 c alibrate_tsc();146 clocks_per_usec = calibrate_tsc(); 153 147 printk_info("clocks_per_usec: %u\n", clocks_per_usec); 154 148 } -
trunk/LinuxBIOSv1/src/include/smp/start_stop.h
r408 r641 2 2 #define SMP_START_STOP_H 3 3 4 #if def SMP4 #if SMP == 1 5 5 #include <smp/atomic.h> 6 6 unsigned long this_processors_id(void); -
trunk/LinuxBIOSv1/src/include/string.h
r597 r641 33 33 extern int memcmp(const void *s1, const void *s2, size_t n); 34 34 35 extern int sprintf(char * buf, const char *fmt, ...); 35 36 #endif /* STRING_H */ -
trunk/LinuxBIOSv1/src/lib/elfboot.c
r635 r641 68 68 checksum = add_ip_checksums(bytes, checksum, 69 69 compute_ip_checksum(phdr, ehdr->e_phnum*sizeof(*phdr))); 70 bytes += sizeof(*phdr);70 bytes += ehdr->e_phnum*sizeof(*phdr); 71 71 for(ptr = head->phdr_next; ptr != head; ptr = ptr->phdr_next) { 72 72 checksum = add_ip_checksums(bytes, checksum, … … 575 575 if (!verify_loaded_image(cb_chain, ehdr, phdr, &head)) 576 576 goto out; 577 /*578 */579 577 580 578 printk_info("verified segments\n"); … … 627 625 ehdr = (Elf_ehdr *)(&header[i]); 628 626 if (memcmp(ehdr->e_ident, ELFMAG, 4) != 0) { 629 printk_ debug("NO header at %d\n", i);627 printk_spew("NO header at %d\n", i); 630 628 continue; 631 629 } … … 646 644 ehdr = 0; 647 645 } 648 printk_ debug("header_offset is %d\n", header_offset);646 printk_spew("header_offset is %d\n", header_offset); 649 647 if (header_offset == -1) { 650 648 goto out; 651 649 } 652 650 653 printk_ debug("Try to load at offset 0x%x\n", header_offset);651 printk_spew("Try to load at offset 0x%x\n", header_offset); 654 652 result = elfload(stream, mem, 655 653 header + header_offset , ELF_HEAD_SIZE - header_offset); -
trunk/LinuxBIOSv1/src/lib/inflate.c
r614 r641 1098 1098 } 1099 1099 (ulg)get_byte(); /* Get timestamp */ 1100 ((ulg)get_byte()) ;//<< 8;1101 ((ulg)get_byte()) ;//<< 16;1102 ((ulg)get_byte()) ;//<< 24;1100 ((ulg)get_byte()) << 8; 1101 ((ulg)get_byte()) << 16; 1102 ((ulg)get_byte()) << 24; 1103 1103 1104 1104 (void)get_byte(); /* Ignore extra flags for the moment */ -
trunk/LinuxBIOSv1/src/lib/linuxpci.c
r614 r641 24 24 #include <subr.h> 25 25 26 // yes we could do Yet Another Include File, but ... 27 int sprintf(char * buf, const char *fmt, ...); 26 28 27 29 28 /** … … 120 119 static void pci_get_resource(struct pci_dev *dev, struct resource *resource, unsigned long index) 121 120 { 122 uint32_t addr, size ;121 uint32_t addr, size, base; 123 122 unsigned long type; 124 123 … … 143 142 pci_write_config_dword(dev, index, ~0); 144 143 pci_read_config_dword(dev, index, &size); 144 145 /* get the minimum value the bar can be set to */ 146 pci_write_config_dword(dev, index, 0); 147 pci_read_config_dword(dev, index, &base); 145 148 146 149 /* restore addr */ … … 158 161 * read back as 0 for both address and size. 159 162 */ 160 if ( addr == size) {163 if ((addr == size) && (addr == base)) { 161 164 if (size != 0) { 162 165 printk_debug( … … 319 322 { 320 323 unsigned long base, limit; 321 unsigned long bridge_align = MEM_BRIDGE_ALIGN; // stupid warnings.324 unsigned long bridge_align = MEM_BRIDGE_ALIGN; 322 325 unsigned char buf[10]; 323 326 … … 448 451 } 449 452 450 451 // probably dead.452 #if 0453 static void pci_noop(struct pci_dev *dev)454 {455 return;456 }457 #endif458 453 struct pci_dev_operations default_pci_ops_dev = { 459 454 .read_resources = pci_dev_read_resources, … … 484 479 } 485 480 } 486 #warning set_pci_dev_ops not yet finished487 481 /* If I don't have a specific driver use the default operations */ 488 482 switch(dev->hdr_type & 0x7f) { /* header type */ -
trunk/LinuxBIOSv1/src/lib/subr.c
r593 r641 90 90 void post_code(uint8_t value) 91 91 { 92 #if defSERIAL_POST92 #if SERIAL_POST 93 93 unsigned long hi, lo; 94 94 // DAMMIT! This just broke!
