build: Don't trash the .config file when src/Kconfig changes.

Revision 5325e91e introduced a change to force the rebuild of the
.config file when the src/Kconfig (or vgasrc/Kconfig) file changes.
However, this was causing a complete rebuild of the user's .config
file which would throw away the user's current settings.

On a rebuild, use the kbuild olddefconfig rule instead of defconfig to
attempt to keep the user's current settings.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Remove the pmm handle argument from _malloc().

The PMM handle argument will almost always be 0xffffffff.  Use
separate code for the few rare cases where it may not be the default
value.  Gcc produces better code if _malloc() only requires three
parameters.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Clear the total block transfer count on error.

The total number of blocks transferred is part of the return status of
the BIOS API.  This is normally the total number of blocks requested.
However, in an error it is possible for this count to be less.  Add a
global check to ensure that on an error event the block count is
updated - if it hasn't been updated, assume that no blocks have been
transferred successfully (the common case).

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Remove unnecesary updates of the disk op->count field.

Now that the op->count field is cleared in a global location on simple
errors, remove various local clears done in individual drivers.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Always perform thread cleanup on MainThread stack.

The thread cleanup was being performed on whatever thread stack was
next in the list.  However, with high debugging this causes spurious
_free() debug messages to show up in random threads which can be
confusing when analyzing the debug output.  So, always run
__end_thread() on the MainThread stack to prevent this confusion.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
pvscsi: Don't store reference to struct pci_device.

The pci_device reference isn't used by pvscsi, and it's confusing to
keep a long held reference to a short lived object.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
pvscsi: Always run entirely in 32bit mode.

Instead of jumping into 32bit mode to access the PCI config space, run
the entire driver in 32bit mode.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
pvscsi: Remove use of LOWFLAT and GLOBALFLAT macros.

Now that pvscsi runs entirely in 32bit mode, there is no need to use
the memory segment access macros.

This also fixes up an incorrect memcpy and memset call.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
usb: Replace EHCI to UHCI/OHCI synchronization with new scheme.

The previous code attempts to correlate which UHCI and OHCI
controllers correlate with which EHCI controllers so that it can
ensure high speed devices are handled by the EHCI code while low/full
speed devices are handled by the UHCI/OHCI code.  Replace this logic
by initializing all EHCI controllers first, and then initializing all
UHCI and OHCI controllers.  This simplifies the code and improves
support for some hardware devices that don't follow the OHCI/UHCI to
EHCI correlation standard.

Also, remove the unused usb->busid field.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>