Split debug functions out into core/debug.c, so that they can be
automatically linked in on demand.
Corrected warnings in misc.c. strtoul() really should be
unsigned long strtoul ( const char *p, const char **endp, int base )
but such is not the ANSI standard.
Strip down i386 PCI configuration space I/O to the bare minimum. A
typical build will now include 880 bytes of PCI support code, compared to
2327 bytes in Etherboot 5.4.
(There is a slight cost of around 5 extra bytes per access to a
non-constant config space address; this should be an overall win.
Driver-specific accesses will usually be to constant addresses, for
which there is no additional cost.)
Restructured PCI subsystem to fit the new device model.
Generic PCI code now handles 64-bit BARs correctly when setting
"membase"; drivers should need to call pci_bar_start() only if they want
to use BARs other than the first memory or I/O BAR.
Split rarely-used PCI functions out into pciextra.c.
Core PCI code is now 662 bytes (down from 1308 bytes in Etherboot 5.4).
284 bytes of this saving comes from the pci/pciextra split.
Cosmetic changes to lots of drivers (e.g. vendor_id->vendor in order to
match the names used in Linux).
Tear out old heap code, replace with code that simply allocates memory
for use by malloc().
This breaks the image-loading code (which previously used the heap to
allocate the buffer for downloading the image), but that's not a major
concern since I'm going to tear out all the image formats within the next
couple of days anyway. Byebye, NBI! :)
Shaved around 100 bytes off vsprintf.o. It's now 50 bytes smaller than
the old implementation and provides much more conformant semantics,
including the ability to return the number of characters that would have
been printed to the string had the buffer been big enough. (iSCSI needs
this functionality).
At least cope with "%llx" by reading the correct-sized va_arg from the
stack, even if we don't yet print it out.
At some point, vsprintf() needs to be fixed up so that it can correctly
cope with limited-sized buffers (i.e. vsnprintf), long longs, and
standard format specifiers (e.g. "%04x"). We should also remove the
special types (MAC addresses and IP addresses). This would then enable
us to use gcc's ability to type-check printf format strings.
Use .text16.data section with "aw" attributes, to avoid section type
conflicts when placing both code and data into .text16.
Add __from_{text16,data16}.
Preserve the whole of %esp across prot_call(). We have to split this
between the low half stored in the static variable rm_sp, and the high
half stored on the prot_call() stack, because:
Just using the stack would screw up when a prot_call()ed routine
executes a real_call(); it would have no way to find the current top of
the RM stack.
Extending rm_sp to rm_esp would not be safe, because the guarantee that
rm_sp must return to the correct value by the time an external
real-mode call returns applies only to %sp, not to %esp.