aboutsummaryrefslogtreecommitdiffstats
path: root/hw/fw_cfg.c
AgeCommit message (Collapse)AuthorFilesLines
2012-02-15qom: Unify type registrationAndreas Färber1-2/+2
Replace device_init() with generalized type_init(). While at it, unify naming convention: type_init([$prefix_]register_types) Also, type_init() is a function, so add preceding blank line where necessary and don't put a semicolon after the closing brace. Signed-off-by: Andreas Färber <afaerber@suse.de> Cc: Anthony Liguori <anthony@codemonkey.ws> Cc: malc <av1474@comtv.ru> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-02-03qdev: register all types natively through QEMU Object ModelAnthony Liguori1-9/+11
This was done in a mostly automated fashion. I did it in three steps and then rebased it into a single step which avoids repeatedly touching every file in the tree. The first step was a sed-based addition of the parent type to the subclass registration functions. The second step was another sed-based removal of subclass registration functions while also adding virtual functions from the base class into a class_init function as appropriate. Finally, a python script was used to convert the DeviceInfo structures and qdev_register_subclass functions to TypeInfo structures, class_init functions, and type_register_static calls. We are almost fully converted to QOM after this commit. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-01-27sysbus: apic: ioapic: convert to QEMU Object ModelAnthony Liguori1-12/+21
This converts three devices because apic and ioapic are subclasses of sysbus. Converting subclasses independently of their base class is prohibitively hard. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-28sysbus: rename sysbus_init_mmio_region() to sysbus_init_mmio()Avi Kivity1-2/+2
Signed-off-by: Avi Kivity <avi@redhat.com>
2011-11-24fw_cfg: convert to memory APIAvi Kivity1-45/+65
Because the new API doesn't allow overlapping regions with just different access sizes, we have to create a new "combined" region for both control and data, when the two share an ioport offset. Signed-off-by: Avi Kivity <avi@redhat.com>
2011-11-01fw_cfg: Use g_file_get_contents instead of multiple fread() callsPavel Borzenkov1-64/+38
Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Pavel Borzenkov <pavel.borzenkov@gmail.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-09-04fw_cfg: fix crash if FW_CFG_WRITE_CHANNEL is used incorrectlyBlue Swirl1-1/+2
Avoid a crash if the guest combines FW_CFG_WRITE_CHANNEL with a wrong value. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-08-20Use glib memory allocation and free functionsAnthony Liguori1-8/+8
qemu_malloc/qemu_free no longer exist after this commit. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-05Check fread() results to avoid gcc 4.6 warningsDavid Gibson1-0/+13
When compiling with gcc 4.6, some code in fw_cfg.c complains that fop_ret is assigned but not used (which is true). However, it looks like the meaningless assignments to fop_ret were done to suppress other gcc warnings due to the fact that fread() is labelled as warn_unused_result in glibc. This patch avoids both errors, by actually checking the fread() result code and dropping out with an error message if it fails. Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Tested-by: Stefan Berger <stefanb@linux.vnet.ibm.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-07-29showing a splash picture when startwayne1-1/+139
Added options to let qemu transfer two configuration files to bios: "bootsplash.bmp" and "etc/boot-menu-wait", which could be specified by command -boot splash=P,splash-time=T P is jpg/bmp file name or an absolute path, T have a max value of 0xffff, unit is ms. With these two options, if user invoke qemu with menu=on option, then a splash picture would be showed in a given time. For example: qemu -boot menu=on,splash=/root/boot.bmp,splash-time=5000 would make boot.bmp shown as a brand with 5 seconds in the booting up process. This feature need the new seabios's support, which could be got from git. Signed-off-by: Wayne Xia <xiawenc@linux.vnet.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-07-23notifier: Pass data argument to callbackJan Kiszka1-1/+1
This allows to pass additional information to the notifier callback which is useful if sender and receiver do not share any other distinct data structure. Will be used first for the clock reset notifier. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-12-11Pass boot device list to firmware.Gleb Natapov1-0/+14
Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-12-11Change fw_cfg_add_file() to get full file path as a parameter.Gleb Natapov1-12/+4
Change fw_cfg_add_file() to get full file path as a parameter instead of building one internally. Two reasons for that. First caller may need to know how file is named. Second this moves policy of file naming out from fw_cfg. Platform may want to use more then two levels of directories for instance. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-12-11Add endianness as io mem parameterAlexander Graf1-2/+4
As stated before, devices can be little, big or native endian. The target endianness is not of their concern, so we need to push things down a level. This patch adds a parameter to cpu_register_io_memory that allows a device to choose its endianness. For now, all devices simply choose native endian, because that's the same behavior as before. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-06-27fw_cfg: convert to qdevBlue Swirl1-20/+60
Convert fw_cfg to qdev. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-03-14spelling typo (compatibilty) in hw/fw_cfg.cVagrant Cascadian1-1/+1
here's a trivial patch to fix the spelling of "compatibility": Signed-off-by: Vagrant Cascadian <vagrant@freegeek.org> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-02-07fw_cfg: don't use reserved _ prefixBlue Swirl1-2/+2
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-01-11fw_cfg: rom loader tweaks.Gerd Hoffmann1-7/+11
Changes: - make dir argument mandatory, we allways have one anyway (vgaroms or genroms). - check for duplicates, skip loading if found. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-18fw_cfg: add API for file transfer.Gerd Hoffmann1-0/+43
This patch adds a file transfer interface to fw_cfg. Intended to be used for passing non-pci option roms and vgabios to seabios. Namespace is modeled after the existing cbfs filesystem support in seabios. Reading the new FW_CFG_FILE_DIR entry returns a file list. Fields there are in network byte order (aka bigendian). aliguori: fix fw_cfg.h for multiboot.bin, add proper fw_cfg.h declarations, quiet fprintf() in fw_cfg.c Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-18fw_cfg: make calls typesafeGerd Hoffmann1-14/+12
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-04Add "static" to please SparseBlue Swirl1-1/+1
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-11-17fw_cfg: change cur_offset to 32 bitsJuan Quintela1-5/+39
Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-07sparc32 (mostly): remove unneeded calls to device resetBlue Swirl1-1/+0
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-10-01Revert "Get rid of _t suffix"Anthony Liguori1-4/+4
In the very least, a change like this requires discussion on the list. The naming convention is goofy and it causes a massive merge problem. Something like this _must_ be presented on the list first so people can provide input and cope with it. This reverts commit 99a0949b720a0936da2052cb9a46db04ffc6db29. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-01Get rid of _t suffixmalc1-4/+4
Some not so obvious bits, slirp and Xen were left alone for the time being. Signed-off-by: malc <av1474@comtv.ru>
2009-09-11vmstate: port fw_cfg deviceJuan Quintela1-21/+12
Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-25Make CPURead/WriteFunc structure 'const'Blue Swirl1-4/+4
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-27Introduce -smp , maxcpus= flag to specify maximum number of CPUS.Jes Sorensen1-0/+1
Follow on patch will use it to determine the size of the MADT and other BIOS tables. Signed-off-by: Jes Sorensen <jes@sgi.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-16Add boot menu control via command line switchJan Kiszka1-0/+1
Disable the lengthy BIOS prompt for selecting a boot device by default, but let the user reenable it via '-boot menu=on'. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-06-29Revert "Introduce reset notifier order"Jan Kiszka1-1/+1
This reverts commit 8217606e6edb49591b4a6fd5a0d1229cebe470a9 (and updates later added users of qemu_register_reset), we solved the problem it originally addressed less invasively. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-06-16Remove io_index argument from cpu_register_io_memory()Avi Kivity1-2/+2
The parameter is always zero except when registering the three internal io regions (ROM, unassigned, notdirty). Remove the parameter to reduce the API's power, thus facilitating future change. Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-05-22Introduce reset notifier orderJan Kiszka1-1/+1
Add the parameter 'order' to qemu_register_reset and sort callbacks on registration. On system reset, callbacks with lower order will be invoked before those with higher order. Update all existing users to the standard order 0. Note: At least for x86, the existing users seem to assume that handlers are called in their registration order. Therefore, the patch preserves this property. If someone feels bored, (s)he could try to identify this dependency and express it properly on callback registration. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-05-21Refactor how display drivers are selectedAnthony Liguori1-1/+1
My previous commit, f92f8afebe, broke -vnc (spotted by Glauber Costa). This is because it's necessary to tell when the no special display parameters have been passed and default to SDL or VNC appropriately. This refactors the display selection logic to be less complicated which has the effect of fixing the regression mentioned above. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-05-13Replace gcc variadic macro extension with C99 versionBlue Swirl1-3/+3
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-04-07Don't try to return result from a void function (spotted by Sparse)blueswir11-2/+2
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7017 c046a42c-6fe2-441c-8c8c-71466251a162
2009-02-05hw: remove error handling from qemu_malloc() callers (Avi Kivity)aliguori1-8/+0
Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6529 c046a42c-6fe2-441c-8c8c-71466251a162
2008-12-11Allow to register a callback with fw_cfg_add_callback()blueswir11-2/+4
fw_cfg_add_callback() checks if key has FW_CFG_WRITE_CHANNEL bit set after masking the key with FW_CFG_ENTRY_MASK. But as FW_CFG_ENTRY_MASK is ~(FW_CFG_WRITE_CHANNEL | FW_CFG_ARCH_LOCAL), the bit is never set and function exits. This patch corrects this by checking the bit before masking the value. Signed-by-off: Laurent Vivier <Laurent.Vivier@bull.net> Acked-by: Gleb Natapov <gleb@redhat.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5978 c046a42c-6fe2-441c-8c8c-71466251a162
2008-10-04Move nographic export to sysemu.hblueswir11-1/+0
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5414 c046a42c-6fe2-441c-8c8c-71466251a162
2008-09-18Add common keys to firmware configurationblueswir11-0/+4
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5260 c046a42c-6fe2-441c-8c8c-71466251a162
2008-09-18Add UUID to firmware configuration info (Gleb Natapov)blueswir11-0/+2
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5259 c046a42c-6fe2-441c-8c8c-71466251a162
2008-09-18Key/value based qemu<->guest firmware communication mechanism (Gleb Natapov)blueswir11-0/+289
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5256 c046a42c-6fe2-441c-8c8c-71466251a162