aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2014-12-03Use macros for .code16/32 mode switches in inline asm in stacks.cKevin O'Connor1-12/+17
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-12-03Minor - be consistent in placement of .code16/32 in romlayout.SKevin O'Connor1-6/+11
Place .code32 in those functions that need it, and make sure every function ends in .code16 mode. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-12-03floppy: Make sure to yield() during floppy PIOKevin O'Connor1-0/+2
The floppy Programmed IO code really should yield while the controller is busy. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-12-03build: set LC_ALL=CGerd Hoffmann1-0/+1
Avoids tools such as layoutrom stumble over localized messages. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Tested-By: Patrick Georgi <pgeorgi@google.com>
2014-11-25add scripts/tarball.shGerd Hoffmann1-0/+36
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-11-12pciinit: Fix build warning in mch_pci_slot_get_irq()Kevin O'Connor1-16/+7
Some old versions of gcc warn that 'irq might be used uninitialized'. Replace the switch statement with an if statement to suppress the warning. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-11-12Fix build issue on gcc34Kevin O'Connor1-1/+1
Older versions of gcc may not inline on_extra_stack() and thus cause a link error when compiling in 32bit segmented mode. Test for MODE16 explicitly in stack_hop_back() to prevent the problem. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-11-12Minor - comment updates in romlayout.SKevin O'Connor1-8/+8
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-11-12Use an aligned stack offset when entering on the extra stackKevin O'Connor4-23/+24
The size of 'struct bregs' is not evenly divisible by four and where the assembler placed a 'struct bregs' on the extra stack as part of entering into the C functions it caused the C functions to run with a non-aligned stack. It's technically not correct to use an unaligned stack and it is certainly less efficient. This patch avoids using BREGS_size (the sizeof struct bregs) and instead introduces PUSHBREGS_size (the size of the general purpose registers in struct bregs) in the assembler. Where the code actually did use the %cs:%ip and flags, an extra 8 (instead of 6) bytes are added to maintain a sane alignment. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-11-12vgabios: Add software cursor capabilityKevin O'Connor6-5/+143
Add mechanism for drawing a cursor to the framebuffer to implement a cursor in software. The timer interrupt is "hooked" so that the cursor can blink. This can be useful for "coreboot native vga". Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-11-12vgabios: Support emulating text mode attributes while in graphics modeKevin O'Connor5-10/+47
Add support for simple text mode attribute emulation while in graphics mode. This improves text highlighting and background color on some boot-loaders. Enable it only for CBVGA vgabios and only when a text mode is requested. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-11-12Minor - move PORT_PS2_CTRLB from hw/ps2port.h to hw/timer.cKevin O'Connor2-2/+1
The PORT_PS2_CTRLB port is only used by timers - it's just a historical artifact that it was part of the original ps2 controller. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-11-10megasas: read addional PCI I/O barHannes Reinecke1-0/+4
Some newer cards have the I/O bar at BAR 0, so we need to check that, too, if we cannot get an address for BAR 2. Without this patch the new 'megasas-gen2' emulation in qemu is not detected. Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-11-03Fix PNP regression introduced in 99cb8f3e due to missed conversionKevin O'Connor1-1/+1
Commit 99cb8f3e missed a conversion from 12(%esp) to BREGS_eax(%esp) causing winxp to break. Reported-by: Ian Campbell <Ian.Campbell@citrix.com> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-10-27vgabios: Add support for reading framebuffer in "direct" modeKevin O'Connor1-5/+32
Support reading high memory "direct" framebuffers and translating the results to 8 bit attribute values. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-10-27vgabios: Fill in available legacy modes in video_func_static at runtimeKevin O'Connor3-2/+12
Instead of hard coding the list of modes, fill them in from the list of supported modes. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-10-27vgabios: Move standard table definitions to std/vga.hKevin O'Connor5-67/+79
Move the standard video bios definitions into a new header file. Also, define a struct with the layout for the static functionality table. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-10-27vgabios: Only set the dcc_index=8 if stdvga ports are availableKevin O'Connor1-2/+1
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-10-27vgabios: Only init BDA device details in init_bios_area()Kevin O'Connor2-20/+8
Don't set the device details when changing modes, and don't set mode details outside of mode setting. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-10-27vgabios: Refactor get/set_cursor_shape() codeKevin O'Connor3-32/+29
Rework the code so that it is possible to calculate the current cursor shape even when not changing it. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-10-27vgabios: Set cursor shape fixesKevin O'Connor1-11/+7
The "cursor scaling" mode is determined by the first bit of the video_ctl bda value, not the modeset_ctl value. Also, on a set_scan_lines() call, the shape should be set to lines-3/lines-2 and the shape must be set after char_height has been updated. The existing cursor shape code matches the legacy "lgpl vgabios", but the behavior doesn't match bios documentation nor observations with an ati vga bios. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-10-27vgabios: Rename vbe_flags to flagsKevin O'Connor2-4/+7
Allow the custom bda field vbe_flags to be used for flags outside of vbe. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-10-27vgabios: Don't pass vmode_g to vgafb_move_chars() / vgafb_clear_chars()Kevin O'Connor3-19/+19
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>
2014-10-27vgabios: Cache a pointer to the current mode struct in the BDAKevin O'Connor2-2/+7
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>
2014-10-27vgabios: Don't declare custom internal BDA storage in std/bda.hKevin O'Connor4-14/+22
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>
2014-10-27Remove unused macro ENTRY_STKevin O'Connor1-23/+0
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-10-27Do full BREGS backup/restore for pmm, pnp, and irqentry_extrastackKevin O'Connor1-41/+15
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>
2014-10-27Create assembler macros for saving and restoring 'struct bregs'Kevin O'Connor3-68/+47
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>
2014-10-27Don't clobber %ax on ENTRY_INTO32 macroKevin O'Connor2-11/+4
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>
2014-10-27Use 32bit memcpy in int1587 when applicableKevin O'Connor1-13/+19
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>
2014-10-16usb: Use usb_realloc_pipe for pipe alloc, update, and free.Kevin O'Connor2-36/+30
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>
2014-10-16ehci: Export ehci_realloc_pipe() instead of ehci_alloc_pipe()Kevin O'Connor3-5/+9
Support alloc, update, and free from the single exported function. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-10-16ohci: Export ohci_realloc_pipe() instead of ohci_alloc_pipe()Kevin O'Connor3-5/+9
Support alloc, update, and free from the single exported function. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-10-16uhci: Export uhci_realloc_pipe() instead of uhci_alloc_pipe()Kevin O'Connor3-5/+9
Support alloc, update, and free from the single exported function. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-10-16xhci: Change xhci_update_pipe() to xhci_realloc_pipe() and use for alloc tooKevin O'Connor3-12/+14
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>
2014-10-16usb: Clarify usb freelist manipulationsKevin O'Connor5-12/+29
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>
2014-10-16usb: Rename free_pipe() to usb_free_pipe()Kevin O'Connor4-11/+11
Also, pass in usbdev to usb_free_pipe(). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-10-16usb: Rename send_default_control() to usb_send_default_control()Kevin O'Connor5-16/+16
This is just function renaming - no code implementation changes. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-10-16usb: Rename findEndPointDesc() to usb_find_desc()Kevin O'Connor4-7/+7
This is just function renaming - no code implementation changes. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-10-16usb: Rename usb_getFrameExp() to usb_get_period()Kevin O'Connor6-8/+8
This is just function renaming - no code implementation changes. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-10-16usb: Rename ?hci_control() to ?hci_send_control()Kevin O'Connor9-24/+24
This is just function renaming - no code implementation changes. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-10-15Backup and restore a20 on call32_sloppy()Kevin O'Connor1-0/+7
Previously, the a20 line would always be enabled and left on after call32_sloppy(). The setting should really be backed up and restored on each call. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-10-15Move a20 code from system.c and ps2port.h to x86.hKevin O'Connor4-31/+19
Although the a20 functionality was originally implemented in the ps2 controller, that is just a historical artifact. It's a core feature of modern x86 cpus and the code is better located in the x86.h header. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-10-15Implement call32 mechanism using SMIs.Kevin O'Connor4-1/+192
Add support for jumping into 32bit mode using a System Management Mode (SMM) handler. When available, this allows SeaBIOS to transition to 32bit mode even when called in vm86 mode. It will also prevent the clobbering of the segment registers. Currently, the SMM mode is only supported in QEMU when running in TCG mode. Also, QEMU v2.1 (or later) is needed for it to work when in vm86 mode. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-10-11Fully restore 16bit state during call16_sloppy()Kevin O'Connor1-30/+63
When transitioning back to 16bit mode from within call32(), restore the full state (cmos index, gdt, fs/gs) in addition to restoring the original stack. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-10-11Break up call32() into call32() and call32_sloppy()Kevin O'Connor1-39/+47
This separates call32() into two functions. It also moves the call16_sloppy() code next to the call32_sloppy() code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-10-11Move call16() functions from romlayout.S to inline assembler in stacks.cKevin O'Connor2-54/+69
Use inline assembler in call16 type functions instead of using __call16() in romlayout.S. Since call16() and call16big() are now only called with %ss==0 they do not need to update the stack pointer. Only call16_sloppy() requires the stack manipulation code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-10-11build: Support declaring 32bit C functions that must reside in the f-segmentKevin O'Connor2-5/+15
Add support for a FUNCFSEG macro that will force a "32bit flat" C function to be located in the f-segment. This is useful for 32bit code with inline assembler that thunks to 16bit mode. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-10-11Update reset() to use call16_back()Kevin O'Connor1-2/+2
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-10-11Simplify farcall16 codeKevin O'Connor2-17/+15
With this change, farcall16() is only used for external API calls and is only invoked from a 32bit mode entered directly via transition32. farcall16big() is also only used for external API calls and is only invoked from a 32bit mode entered directly via transition32. call16_int() now calls _farcall16() directly, and it will use normal 16bit mode or big real mode as required. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>