aboutsummaryrefslogtreecommitdiffstats
path: root/src/util.h
Commit message (Collapse)AuthorAgeFilesLines
* sdcard: Initial support for SD cards on PCI SDHCI controllers on QEMUKevin O'Connor2014-12-291-0/+4
| | | | | | | | This adds basic read/write support for SD cards emulated by QEMU. This code is not expected to work on real hardware, because the current controller and card initialization is not robust. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Abstract reset call (and possible 16bit mode switch) into reset() function.Kevin O'Connor2014-06-061-3/+0
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Move most of the VAR16FIXED() defs to misc.c.Kevin O'Connor2014-06-041-0/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* smp: Replace QEMU SMP init assembler code with C; run only in 32bit mode.Kevin O'Connor2014-06-041-1/+0
| | | | | | | | | Change the multi-processor init code to trampoline into 32bit mode on each of the additional processors. Implement an atomic lock so that each processor performs its initialization serially. Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Move cdemu call interface and disk_ret helper code to disk.c.Kevin O'Connor2014-06-041-1/+0
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* cdemu: store internal cdemu fields in standard "el-torito" spec format.Kevin O'Connor2014-06-041-1/+1
| | | | | | | | | Store the fields necessary to export the "el-torito" spec information directly in an internal copy of the "el-torito" struct. This simplifies the interface and obviates the need for an internal home grown struct with the same info. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* acpi: remove PORT_ACPI_PM_BASE constantGerd Hoffmann2014-05-201-0/+1
| | | | | | Use the new acpi_pm_base variable instead. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* If an int 1587 call is made from an option rom, stay in bigreal mode.Kevin O'Connor2014-05-061-0/+1
| | | | | | | | | | | Modify the int 1587 handler to check if the POST phase is still running. If it is, use bigreal mode segment limits so that the caller remains in bigreal mode when the 1587 handler completes. This helps with SeaVGABIOS' use of "direct" framebuffer accesses (an option rom may attempt to display text during its option rom execution which can cause SeaVGABIOS to make the int 1587 calls). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* SMBIOS: Check for aggregate tables & entry point in fw_cfgGabriel L. Somlo2014-05-061-1/+2
| | | | | | | | | | | | | | Check fw_cfg for the presence of an aggregate set of smbios tables (etc/smbios/smbios-tables) and an entry point structure (etc/smbios/smbios-anchor), and, if found, use them instead of generating entries locally. We ensure the presence of a type 0 (bios information) structure by generating it locally if necessary, which is expected to be the common case. Signed-off-by: Gabriel L. Somlo <somlo@cmu.edu> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* coreboot: Make coreboot table searching available to other code.Kevin O'Connor2014-04-111-0/+3
| | | | | | | Make the coreboot table searching code available to code outside coreboot.c, and make it runnable from 16bit mode. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Use biostables.c for copying bios tables even when generating them.Kevin O'Connor2014-04-071-0/+3
| | | | | | | | | Use the biostables.c copy_pir(), copy_smbios(), copy_acpi_rsdp(), and copy_mptable() code even when using the legacy bios table generation code. This unifies the final bios table deployment code between qemu, coreboot, and csm. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Move PirAddr definition from pirtable.c to biostables.c.Kevin O'Connor2014-04-071-1/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* smbios: Move smbios parsing logic from smbios.c to biostables.c.Kevin O'Connor2014-04-071-2/+2
| | | | | | | | After this change, src/fw/smbios.c only contains the legacy code for generating SMBIOS tables. This change only contains code movement - no logic is changed. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* acpi: Move acpi parsing logic from acpi.c to biostables.c / paravirt.c.Kevin O'Connor2014-04-071-7/+5
| | | | | | | | After this change, src/fw/acpi.c only contains the legacy code for generating ACPI tables. This change only contains code movement - no logic is changed. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* resume: restore piix pm config registers after resumeMarcel Apfelbaum2014-01-151-0/+1
| | | | | | | | | | | | | | | | On resume, the OS queries the power management event that caused it. In order to complete this task, it executes some reads to the piix pm io space. This all happens before the OS has a chance to restore the PCI config space for devices, so it is bios's responsibility to make sure the pm IO space is configured correctly. (During suspend, the piix pm configuration space is lost). Note: For 'ordinary' pci devices the config space is saved by the OS on sleep and restored on resume. Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com>
* Move low-level hardware writing from output.c to new file hw/serialio.c.Kevin O'Connor2013-12-041-1/+1
| | | | | | | | | | Avoid hardware specific code in output.c. This will reduce the amount of change needed to output.c as support for more serial hardware is added. This patch also renames some functions to improve the naming scheme. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* biostables: support looking up RSDPMichael S. Tsirkin2013-11-061-0/+1
| | | | | | | Will be used when it's loaded from QEMU. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* vgahooks: add SM720 VGA BIOS hooks for WIN Enterprises MB-60470Jonathan A. Kollasch2013-10-261-0/+1
| | | | | | | | | | | | | Add vgahooks to support the SMI SM720 VGA BIOS used on the WIN Enterprises MB-60470. The response from smi_157f14() is necessary for the CRT output to turn on. The response from smi_157f02() is used to configure which connector(s) output is routed to. As I lack hardware to test LCD panel output, I've selected CRT-only output on the MB-60470 as this prevents the CRT output from being scaled to the resolution of the LCD panel. Signed-off-by: Jonathan A. Kollasch <jakllsch@kollasch.net>
* Move dma code to new file hw/dma.c.Kevin O'Connor2013-09-281-1/+4
| | | | | | | | | | | Move the DMA controller code in resume.c and hw/floppy.c to a new file hw/dma.c. This centralizes the DMA controller code into one place. Also, don't unmask the floppy DRQ during floppy setup - there is no reason to unmask the DRQ prior to a command being programmed into the DMA controller. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Rename hw/cmos.h to hw/rtc.h and copy RTC code from clock.c to hw/rtc.c.Kevin O'Connor2013-09-281-2/+0
| | | | | | | | | Group the Real Time Clock code into hw/rtc.[ch]. Also, use rtc_read/write/mask function naming (instead of inb/outb_cmos) to be more consistent with other register accessors. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Move PIT setup from clock.c to hw/timer.c.Kevin O'Connor2013-09-281-3/+4
| | | | | | | | | | Move the hardware setup to the hw/timer.c code. This eliminates the need for a separate hw/pit.h file with definitions. Also, move the IRQ counting code (which is dependent on the BDA) from hw/timer.c to clock.c. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Sort the sections of util.h.Kevin O'Connor2013-09-181-119/+119
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Merge bmp.h, boot.h, jpeg.h, and post.h into util.h.Kevin O'Connor2013-09-181-1/+41
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Move standard bda type info from biosvar.h to std/bda.h.Kevin O'Connor2013-09-181-1/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Split disk.h into block.h and std/disk.h.Kevin O'Connor2013-09-181-0/+22
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Move pnpbios definition to new file std/pnpbios.h.Kevin O'Connor2013-09-181-1/+0
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Move fw/acpi.h to std/acpi.h.Kevin O'Connor2013-09-181-0/+10
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Move fw/mptable.h to std/mptable.h.Kevin O'Connor2013-09-181-0/+3
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Move fw/smbios.h to std/smbios.h.Kevin O'Connor2013-09-181-0/+5
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Move fw/LegacyBios.h to std/LegacyBios.h and remove csm.h.Kevin O'Connor2013-09-181-1/+6
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Move optionroms.h to std/optionrom.h and util.h.Kevin O'Connor2013-09-181-0/+4
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Move pirtable definitions from hw/pci.h to std/pirtable.h and util.h.Kevin O'Connor2013-09-181-0/+4
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Move function definitions for output.c from util.h to new file output.h.Kevin O'Connor2013-09-181-62/+1
| | | | | | Also, sort the order of include files in the c files. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Move malloc code from pmm.c to new files malloc.c and malloc.h.Kevin O'Connor2013-09-181-59/+0
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Move romfile definitions from util.h to new file romfile.h.Kevin O'Connor2013-09-181-13/+0
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Move stacks.c definitions from util.h to new file stacks.h.Kevin O'Connor2013-09-181-27/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Rename util.c to string.c and introduce string.h.Kevin O'Connor2013-09-181-28/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Move keyboard calling code from util.c to boot.c.Kevin O'Connor2013-09-181-1/+0
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Split x86 specific functions out of util.c/h to new files x86.c/h.Kevin O'Connor2013-09-181-141/+0
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Move code cenetered around firmware initialization to src/fw/Kevin O'Connor2013-09-021-7/+7
| | | | | | Move many C files from the src/ directory to the new src/fw/ directory. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Move code centered around specific hardware devices to src/hw/Kevin O'Connor2013-09-021-1/+1
| | | | | | Move many C files from the src/ directory to the new src/hw/ directory. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Rename check_tsc() (and similar) to timer_check() and use u32.Kevin O'Connor2013-07-211-6/+6
| | | | | | | | | Rename the check_tsc() function to timer_check(). The CPU TSC is often not the basis of the timer, so use a more appropriate name. Convert all callers that were using u64 for the timers to use u32. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Rename check_timer() function (and similar) to irqtimer_check().Kevin O'Connor2013-07-211-3/+3
| | | | | | | Rename functions to be more consistent and so they are not confused with the normal timer functions. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Shift CPU TSC down to reduce need for 64bit variables.Kevin O'Connor2013-07-211-3/+3
| | | | | | | The time-stamp-counter has a higher accuracy than is needed in SeaBIOS. Down shift it to ensure it safely fits in a 32bit variable. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Add helper functions to convert timer irqs to milliseconds.Kevin O'Connor2013-07-201-0/+2
| | | | | | Add ticks_to_ms() and ticks_from_ms() helpers. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Don't pass khz to pmtimer_setup - it's always PM_TIMER_FREQUENCY.Kevin O'Connor2013-07-201-1/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Move internal timer code from clock.c to a new file timer.c.Kevin O'Connor2013-07-201-6/+7
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* coreboot: add cbmem console supportGerd Hoffmann2013-07-141-0/+1
| | | | | | | | Add support for logging to the coreboot cbmem console. Limitation: only supported in 32bit mode. Use 'cbmem -c' to see the logs (coreboot and seabios) after bootup. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* Use container_of on romfile entries.Kevin O'Connor2013-03-301-5/+0
| | | | | | | Create cbfs and fw_cfg specific romfile_s wrappers instead of using private variables directly in romfile_s. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* pciinit: Enable default VGA deviceAlex Williamson2013-03-221-0/+1
| | | | | | | | | As QEMU gains PCI bridge and PCIe root port support, we won't always find the VGA device on the root bus. We therefore need to add support to find and enable a VGA device and the path to it through the VGA Enable support in the PCI bridge control register. Signed-off-by: Alex Williamson <alex.williamson@redhat.com>