usb: Rename ?hci_control() to ?hci_send_control()

This is just function renaming - no code implementation changes.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
usb: Rename usb_getFrameExp() to usb_get_period()

This is just function renaming - no code implementation changes.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
usb: Rename findEndPointDesc() to usb_find_desc()

This is just function renaming - no code implementation changes.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
usb: Rename send_default_control() to usb_send_default_control()

This is just function renaming - no code implementation changes.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
usb: Rename free_pipe() to usb_free_pipe()

Also, pass in usbdev to usb_free_pipe().

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

Rename usb_getFreePipe() to usb_get_freelist().  Add usb_is_freelist()
and usb_add_freelist() functions.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
xhci: Change xhci_update_pipe() to xhci_realloc_pipe() and use for alloc too

Instead of exporting both xhci_alloc_pipe() and xhci_update_pipe(),
export only xhci_realloc_pipe() and support alloc, update, and free
from it.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
uhci: Export uhci_realloc_pipe() instead of uhci_alloc_pipe()

Support alloc, update, and free from the single exported function.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
ohci: Export ohci_realloc_pipe() instead of ohci_alloc_pipe()

Support alloc, update, and free from the single exported function.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
ehci: Export ehci_realloc_pipe() instead of ehci_alloc_pipe()

Support alloc, update, and free from the single exported function.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
usb: Use usb_realloc_pipe for pipe alloc, update, and free.

Now that the usb controller drivers all support the realloc method,
use that for all pipe allocations, reallocations, and freeing.  This
gives the driver more control over the pipe life cycle.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Use 32bit memcpy in int1587 when applicable

If the amount of data to be copied is an even number of four, then
copy the data in four byte chunks.  This 32bit copy is more efficient,
in particular when copying to/from memory mapped io.  This should
improve the performance of framebuffer draws in cbvga SeaVGABIOS.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Don't clobber %ax on ENTRY_INTO32 macro

There's no need to clobber %ax in ENTRY_INTO32.  Now that %eax isn't
clobbered, use ENTRY_INTO32 in entry_csm.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Create assembler macros for saving and restoring 'struct bregs'

Create macros SAVEBREGS_POP_DSEAX and RESTOREBREGS_DSEAX for saving
and restoring the cpu state.  These are similar to the existing
PUSHBREGS and POPBREGS macros.

This also fixes a bug in __farcall16 which inadvertently restored %ds
in %es and vice-versa.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Do full BREGS backup/restore for pmm, pnp, and irqentry_extrastack

Although these entry points only require backup and restore of the
registers that the C code clobbers, there is no harm in backing up
some additional registers.  This allows the BREGS macros to be used
which makes the code a little more readable.

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

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
vgabios: Don't declare custom internal BDA storage in std/bda.h

The vgabios uses storage in the BDA at offset 0xb9 for internal custom
storage (the contents do not appear to be part of any bios standard).
Move the description of this custom vgabios area from std/bda.h to
vgasrc/vgabios.h.  Add two new macros (GET_BDA_EXT and SET_BDA_EXT).
This should make it more clear that the area is for custom internal
storage.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
vgabios: Cache a pointer to the current mode struct in the BDA

Cache a pointer to the current mode 'vgamode_s' struct in the BDA to
avoid doing a linear scan of all available vga modes when the struct
is needed.

This uses an additional two bytes in the BDA (at offset 0xbc).  It's
possible this could conflict with some other software, but that seams
unlikely because that part of the BDA seems reserved for BIOS and
VGABIOS uses.  (And neither SeaBIOS nor Bochs BIOS currently make use
of that area.)

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
vgabios: Don't pass vmode_g to vgafb_move_chars() / vgafb_clear_chars()

Now that a pointer to the current video mode info struct is cached in
memory, it's not necessary to pass the struct into the vgafb code.
The vgafb code can lookup the struct itself.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
vgabios: Rename vbe_flags to flags

Allow the custom bda field vbe_flags to be used for flags outside of
vbe.

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