├── .gitignore ├── .gitmodules ├── CODING_STYLE ├── COPYING ├── COPYING.LIB ├── Changelog ├── HACKING ├── LICENSE ├── MAINTAINERS ├── Makefile ├── Makefile.dis ├── Makefile.hw ├── Makefile.objs ├── Makefile.target ├── Makefile.user ├── QEMU-README ├── QEMU-TODO ├── QMP ├── README ├── qmp-events.txt ├── qmp-shell ├── qmp-spec.txt └── qmp.py ├── README.txt ├── TODO ├── VERSION ├── a.out.h ├── acl.c ├── acl.h ├── aes.c ├── aes.h ├── aio.c ├── alpha-dis.c ├── alpha.ld ├── arch_init.c ├── arch_init.h ├── arm-dis.c ├── arm-semi.c ├── arm.ld ├── async.c ├── audio ├── alsaaudio.c ├── audio.c ├── audio.h ├── audio_int.h ├── audio_pt_int.c ├── audio_pt_int.h ├── audio_template.h ├── audio_win_int.c ├── audio_win_int.h ├── coreaudio.c ├── dsound_template.h ├── dsoundaudio.c ├── esdaudio.c ├── fmodaudio.c ├── mixeng.c ├── mixeng.h ├── mixeng_template.h ├── noaudio.c ├── ossaudio.c ├── paaudio.c ├── rate_template.h ├── sdlaudio.c ├── spiceaudio.c ├── wavaudio.c ├── wavcapture.c └── winwaveaudio.c ├── balloon.c ├── balloon.h ├── bitmap.c ├── bitmap.h ├── bitops.c ├── bitops.h ├── block-migration.c ├── block-migration.h ├── block.c ├── block.h ├── block ├── blkdebug.c ├── blkverify.c ├── bochs.c ├── cloop.c ├── cow.c ├── curl.c ├── dmg.c ├── nbd.c ├── parallels.c ├── qcow.c ├── qcow2-cache.c ├── qcow2-cluster.c ├── qcow2-refcount.c ├── qcow2-snapshot.c ├── qcow2.c ├── qcow2.h ├── qed-check.c ├── qed-cluster.c ├── qed-gencb.c ├── qed-l2-cache.c ├── qed-table.c ├── qed.c ├── qed.h ├── raw-posix-aio.h ├── raw-posix.c ├── raw-win32.c ├── raw.c ├── rbd.c ├── rbd_types.h ├── sheepdog.c ├── vdi.c ├── vmdk.c ├── vpc.c └── vvfat.c ├── block_int.h ├── blockdev.c ├── blockdev.h ├── bsd-user ├── bsd-mman.h ├── bsdload.c ├── elfload.c ├── errno_defs.h ├── freebsd │ ├── strace.list │ └── syscall_nr.h ├── i386 │ ├── syscall.h │ └── target_signal.h ├── main.c ├── mmap.c ├── netbsd │ ├── strace.list │ └── syscall_nr.h ├── openbsd │ ├── strace.list │ └── syscall_nr.h ├── qemu-types.h ├── qemu.h ├── signal.c ├── sparc │ ├── syscall.h │ └── target_signal.h ├── sparc64 │ ├── syscall.h │ └── target_signal.h ├── strace.c ├── syscall.c ├── syscall_defs.h ├── uaccess.c └── x86_64 │ ├── syscall.h │ └── target_signal.h ├── bswap.h ├── bt-host.c ├── bt-host.h ├── bt-vhci.c ├── buffered_file.c ├── buffered_file.h ├── cache-utils.c ├── cache-utils.h ├── check-qdict.c ├── check-qfloat.c ├── check-qint.c ├── check-qjson.c ├── check-qlist.c ├── check-qstring.c ├── cmd.c ├── cmd.h ├── compatfd.c ├── compatfd.h ├── config.h ├── configure ├── console.c ├── console.h ├── cpu-all.h ├── cpu-common.h ├── cpu-defs.h ├── cpu-exec.c ├── cpus.c ├── cpus.h ├── cris-dis.c ├── cursor.c ├── cursor_hidden.xpm ├── cursor_left_ptr.xpm ├── cutils.c ├── darwin-user ├── commpage.c ├── ioctls.h ├── ioctls_types.h ├── machload.c ├── main.c ├── mmap.c ├── qemu.h ├── signal.c ├── syscall.c └── syscalls.h ├── def-helper.h ├── default-configs ├── alpha-linux-user.mak ├── arm-linux-user.mak ├── arm-softmmu.mak ├── armeb-linux-user.mak ├── cris-linux-user.mak ├── cris-softmmu.mak ├── i386-bsd-user.mak ├── i386-darwin-user.mak ├── i386-linux-user.mak ├── i386-softmmu.mak ├── lm32-softmmu.mak ├── m68k-linux-user.mak ├── m68k-softmmu.mak ├── microblaze-linux-user.mak ├── microblaze-softmmu.mak ├── microblazeel-linux-user.mak ├── microblazeel-softmmu.mak ├── mips-linux-user.mak ├── mips-softmmu.mak ├── mips64-softmmu.mak ├── mips64el-softmmu.mak ├── mipsel-linux-user.mak ├── mipsel-softmmu.mak ├── pci.mak ├── ppc-darwin-user.mak ├── ppc-linux-user.mak ├── ppc-softmmu.mak ├── ppc64-linux-user.mak ├── ppc64-softmmu.mak ├── ppc64abi32-linux-user.mak ├── ppcemb-softmmu.mak ├── s390x-softmmu.mak ├── sh4-linux-user.mak ├── sh4-softmmu.mak ├── sh4eb-linux-user.mak ├── sh4eb-softmmu.mak ├── sparc-bsd-user.mak ├── sparc-linux-user.mak ├── sparc-softmmu.mak ├── sparc32plus-linux-user.mak ├── sparc64-bsd-user.mak ├── sparc64-linux-user.mak ├── sparc64-softmmu.mak ├── x86_64-bsd-user.mak ├── x86_64-linux-user.mak └── x86_64-softmmu.mak ├── device_tree.c ├── device_tree.h ├── devices └── iPhone1 │ ├── config.xml │ ├── landscape.png │ ├── portrait.png │ └── skin.xml ├── dis-asm.h ├── disas.c ├── disas.h ├── dma-helpers.c ├── dma.h ├── docs ├── blkverify.txt ├── bootindex.txt ├── ccid.txt ├── libcacard.txt ├── migration.txt ├── qdev-device-use.txt ├── specs │ ├── acpi_pci_hotplug.txt │ ├── ivshmem_device_spec.txt │ ├── qcow2.txt │ └── qed_spec.txt └── tracing.txt ├── dyngen-exec.h ├── elf.h ├── envlist.c ├── envlist.h ├── exec-all.h ├── exec.c ├── fpu ├── softfloat-macros.h ├── softfloat-native.c ├── softfloat-native.h ├── softfloat-specialize.h ├── softfloat.c └── softfloat.h ├── fsdev ├── qemu-fsdev.c └── qemu-fsdev.h ├── gdb-xml ├── arm-core.xml ├── arm-neon.xml ├── arm-vfp.xml ├── arm-vfp3.xml ├── cf-core.xml ├── cf-fp.xml ├── power-altivec.xml ├── power-core.xml ├── power-fpu.xml ├── power-spe.xml └── power64-core.xml ├── gdbstub.c ├── gdbstub.h ├── gen-icount.h ├── hmp-commands.hx ├── host-utils.c ├── host-utils.h ├── hpet.h ├── hppa-dis.c ├── hppa.ld ├── hw ├── 9p.h ├── a9mpcore.c ├── ac97.c ├── acpi.c ├── acpi.h ├── acpi_piix4.c ├── adb.c ├── adlib.c ├── ads7846.c ├── alpha_palcode.c ├── an5206.c ├── apb_pci.c ├── apb_pci.h ├── apic.c ├── apic.h ├── apm.c ├── apm.h ├── applesmc.c ├── arm-misc.h ├── arm11mpcore.c ├── arm_boot.c ├── arm_gic.c ├── arm_pic.c ├── arm_sysctl.c ├── arm_timer.c ├── armv7m.c ├── armv7m_nvic.c ├── audiodev.h ├── axis_dev88.c ├── baum.c ├── baum.h ├── bitbang_i2c.c ├── bitbang_i2c.h ├── blizzard.c ├── blizzard_template.h ├── boards.h ├── bonito.c ├── bt-hci-csr.c ├── bt-hci.c ├── bt-hid.c ├── bt-l2cap.c ├── bt-sdp.c ├── bt.c ├── bt.h ├── cbus.c ├── ccid-card-emulated.c ├── ccid-card-passthru.c ├── ccid.h ├── cdrom.c ├── cirrus_vga.c ├── cirrus_vga_rop.h ├── cirrus_vga_rop2.h ├── cris-boot.c ├── cris-boot.h ├── cris_pic_cpu.c ├── cs4231.c ├── cs4231a.c ├── cuda.c ├── debugcon.c ├── dec_pci.c ├── dec_pci.h ├── device-hotplug.c ├── devices.h ├── dma.c ├── dp8393x.c ├── ds1225y.c ├── ds1338.c ├── dummy_m68k.c ├── e1000.c ├── e1000_hw.h ├── ecc.c ├── eccmemctl.c ├── eepro100.c ├── eeprom93xx.c ├── eeprom93xx.h ├── elf_ops.h ├── empty_slot.c ├── empty_slot.h ├── es1370.c ├── escc.c ├── escc.h ├── esp.c ├── esp.h ├── etraxfs.c ├── etraxfs.h ├── etraxfs_dma.c ├── etraxfs_dma.h ├── etraxfs_eth.c ├── etraxfs_pic.c ├── etraxfs_ser.c ├── etraxfs_timer.c ├── event_notifier.c ├── event_notifier.h ├── fdc.c ├── fdc.h ├── file-op-9p.h ├── firmware_abi.h ├── flash.h ├── fmopl.c ├── fmopl.h ├── framebuffer.c ├── framebuffer.h ├── fw_cfg.c ├── fw_cfg.h ├── g364fb.c ├── grackle_pci.c ├── grlib.h ├── grlib_apbuart.c ├── grlib_gptimer.c ├── grlib_irqmp.c ├── gt64xxx.c ├── gumstix.c ├── gus.c ├── gusemu.h ├── gusemu_hal.c ├── gusemu_mixer.c ├── gustate.h ├── hda-audio.c ├── heathrow_pic.c ├── hpet.c ├── hpet_emul.h ├── hw.h ├── i2c.c ├── i2c.h ├── i8254.c ├── i8259.c ├── ide.h ├── ide │ ├── ahci.c │ ├── ahci.h │ ├── cmd646.c │ ├── core.c │ ├── ich.c │ ├── internal.h │ ├── isa.c │ ├── macio.c │ ├── microdrive.c │ ├── mmio.c │ ├── pci.c │ ├── pci.h │ ├── piix.c │ ├── qdev.c │ └── via.c ├── integratorcp.c ├── intel-hda-defs.h ├── intel-hda.c ├── intel-hda.h ├── ioapic.c ├── ioapic.h ├── ioh3420.c ├── ioh3420.h ├── ipad1g.c ├── ipad1g.h ├── iphone2g.c ├── iphone2g.h ├── iphone2g_radio.c ├── irq.c ├── irq.h ├── isa-bus.c ├── isa.h ├── isa_mmio.c ├── ivshmem.c ├── jazz_led.c ├── kvmclock.c ├── kvmclock.h ├── lan9118.c ├── lance.c ├── leon3.c ├── lm32.h ├── lm32_boards.c ├── lm32_hwsetup.h ├── lm32_juart.c ├── lm32_juart.h ├── lm32_pic.c ├── lm32_pic.h ├── lm32_sys.c ├── lm32_timer.c ├── lm32_uart.c ├── lm832x.c ├── loader.c ├── loader.h ├── lsi53c895a.c ├── m48t59.c ├── mac_dbdma.c ├── mac_dbdma.h ├── mac_nvram.c ├── macio.c ├── mainstone.c ├── marvell_88w8618_audio.c ├── max111x.c ├── max7310.c ├── mc146818rtc.c ├── mc146818rtc.h ├── mcf.h ├── mcf5206.c ├── mcf5208.c ├── mcf_fec.c ├── mcf_intc.c ├── mcf_uart.c ├── microblaze_pic_cpu.c ├── milkymist-ac97.c ├── milkymist-hpdmc.c ├── milkymist-hw.h ├── milkymist-memcard.c ├── milkymist-minimac.c ├── milkymist-pfpu.c ├── milkymist-softusb.c ├── milkymist-sysctl.c ├── milkymist-tmu2.c ├── milkymist-uart.c ├── milkymist-vgafb.c ├── milkymist-vgafb_template.h ├── milkymist.c ├── mips-bios.h ├── mips.h ├── mips_addr.c ├── mips_cpudevs.h ├── mips_fulong2e.c ├── mips_int.c ├── mips_jazz.c ├── mips_malta.c ├── mips_mipssim.c ├── mips_r4k.c ├── mips_timer.c ├── mipsnet.c ├── mpcore.c ├── msi.c ├── msi.h ├── msix.c ├── msix.h ├── msmouse.c ├── msmouse.h ├── mst_fpga.c ├── multiboot.c ├── multiboot.h ├── musicpal.c ├── nand.c ├── ne2000-isa.c ├── ne2000.c ├── ne2000.h ├── nseries.c ├── nvram.h ├── omap.h ├── omap1.c ├── omap2.c ├── omap_clk.c ├── omap_dma.c ├── omap_dss.c ├── omap_gpio.c ├── omap_gpmc.c ├── omap_gptimer.c ├── omap_i2c.c ├── omap_intc.c ├── omap_l4.c ├── omap_lcd_template.h ├── omap_lcdc.c ├── omap_mmc.c ├── omap_sdrc.c ├── omap_spi.c ├── omap_sx1.c ├── omap_synctimer.c ├── omap_tap.c ├── omap_uart.c ├── onenand.c ├── openpic.c ├── openpic.h ├── palm.c ├── parallel.c ├── pc.c ├── pc.h ├── pc_piix.c ├── pcf50633.c ├── pci-hotplug.c ├── pci-stub.c ├── pci.c ├── pci.h ├── pci_bridge.c ├── pci_bridge.h ├── pci_host.c ├── pci_host.h ├── pci_ids.h ├── pci_internals.h ├── pci_regs.h ├── pcie.c ├── pcie.h ├── pcie_aer.c ├── pcie_aer.h ├── pcie_host.c ├── pcie_host.h ├── pcie_port.c ├── pcie_port.h ├── pcie_regs.h ├── pckbd.c ├── pcmcia.h ├── pcnet-pci.c ├── pcnet.c ├── pcnet.h ├── pcspk.c ├── petalogix_ml605_mmu.c ├── petalogix_s3adsp1800_mmu.c ├── pflash_cfi01.c ├── pflash_cfi02.c ├── pflash_spi.c ├── piix4.c ├── piix_pci.c ├── pixel_ops.h ├── pl011.c ├── pl022.c ├── pl031.c ├── pl050.c ├── pl061.c ├── pl080.c ├── pl110.c ├── pl110_template.h ├── pl181.c ├── pl190.c ├── pl192.c ├── pm_smbus.c ├── pm_smbus.h ├── ppc-viosrp.h ├── ppc.c ├── ppc.h ├── ppc405.h ├── ppc405_boards.c ├── ppc405_uc.c ├── ppc440.c ├── ppc440.h ├── ppc440_bamboo.c ├── ppc4xx.h ├── ppc4xx_devs.c ├── ppc4xx_pci.c ├── ppc_mac.h ├── ppc_newworld.c ├── ppc_oldworld.c ├── ppc_prep.c ├── ppce500.h ├── ppce500_mpc8544ds.c ├── ppce500_pci.c ├── prep_pci.c ├── prep_pci.h ├── primecell.h ├── ps2.c ├── ps2.h ├── ptimer.c ├── pxa.h ├── pxa2xx.c ├── pxa2xx_dma.c ├── pxa2xx_gpio.c ├── pxa2xx_keypad.c ├── pxa2xx_lcd.c ├── pxa2xx_mmci.c ├── pxa2xx_pcmcia.c ├── pxa2xx_pic.c ├── pxa2xx_template.h ├── pxa2xx_timer.c ├── qdev-addr.c ├── qdev-addr.h ├── qdev-properties.c ├── qdev.c ├── qdev.h ├── qxl-logger.c ├── qxl-render.c ├── qxl.c ├── qxl.h ├── r2d.c ├── rc4030.c ├── realview.c ├── realview_gic.c ├── rtl8139.c ├── s390-virtio-bus.c ├── s390-virtio-bus.h ├── s390-virtio.c ├── s5l8900.c ├── s5l8900.h ├── s5l8900_i2c.c ├── s5l8900_spi.c ├── s5l8900_uart.c ├── s5l8900_usb_otg.c ├── s5l8930.c ├── s5l8930.h ├── s5l8930_h2fmi.c ├── s5l8930_i2c.c ├── s5l8930_i2cchg.c ├── s5l8930_iop.c ├── s5l8930_spi.c ├── sb16.c ├── sbi.c ├── scsi-bus.c ├── scsi-defs.h ├── scsi-disk.c ├── scsi-generic.c ├── scsi.h ├── sd.c ├── sd.h ├── serial.c ├── sh.h ├── sh7750.c ├── sh7750_regnames.c ├── sh7750_regnames.h ├── sh7750_regs.h ├── sh_intc.c ├── sh_intc.h ├── sh_pci.c ├── sh_serial.c ├── sh_timer.c ├── sharpsl.h ├── shix.c ├── slavio_intctl.c ├── slavio_misc.c ├── slavio_timer.c ├── sm501.c ├── sm501_template.h ├── smbios.c ├── smbios.h ├── smbus.c ├── smbus.h ├── smbus_eeprom.c ├── smc91c111.c ├── soc_dma.c ├── soc_dma.h ├── spapr.c ├── spapr.h ├── spapr_hcall.c ├── spapr_llan.c ├── spapr_rtas.c ├── spapr_vio.c ├── spapr_vio.h ├── spapr_vscsi.c ├── spapr_vty.c ├── sparc32_dma.c ├── sparc32_dma.h ├── spitz.c ├── srp.h ├── ssd0303.c ├── ssd0323.c ├── ssi-sd.c ├── ssi.c ├── ssi.h ├── stellaris.c ├── stellaris_enet.c ├── stellaris_input.c ├── sun4c_intctl.c ├── sun4m.c ├── sun4m.h ├── sun4m_iommu.c ├── sun4u.c ├── syborg.c ├── syborg.h ├── syborg_fb.c ├── syborg_interrupt.c ├── syborg_keyboard.c ├── syborg_pointer.c ├── syborg_rtc.c ├── syborg_serial.c ├── syborg_timer.c ├── syborg_virtio.c ├── sysbus.c ├── sysbus.h ├── tc58128.c ├── tc6393xb.c ├── tc6393xb_template.h ├── tcp_usb.c ├── tcp_usb.h ├── tcp_usb_bus.c ├── tcx.c ├── tmp105.c ├── tosa.c ├── tsc2005.c ├── tsc210x.c ├── tusb6010.c ├── twl92230.c ├── unin_pci.c ├── usb-bt.c ├── usb-bus.c ├── usb-ccid.c ├── usb-desc.c ├── usb-desc.h ├── usb-hid.c ├── usb-hub.c ├── usb-msd.c ├── usb-musb.c ├── usb-net.c ├── usb-ohci.c ├── usb-ohci.h ├── usb-serial.c ├── usb-uhci.c ├── usb-uhci.h ├── usb-wacom.c ├── usb.c ├── usb.h ├── usb_synopsys.c ├── usb_synopsys.h ├── versatile_pci.c ├── versatilepb.c ├── vexpress.c ├── vga-isa-mm.c ├── vga-isa.c ├── vga-pci.c ├── vga.c ├── vga_int.h ├── vga_template.h ├── vhost.c ├── vhost.h ├── vhost_net.c ├── vhost_net.h ├── virtex_ml507.c ├── virtio-9p-debug.c ├── virtio-9p-debug.h ├── virtio-9p-local.c ├── virtio-9p-posix-acl.c ├── virtio-9p-xattr-user.c ├── virtio-9p-xattr.c ├── virtio-9p-xattr.h ├── virtio-9p.c ├── virtio-9p.h ├── virtio-balloon.c ├── virtio-balloon.h ├── virtio-blk.c ├── virtio-blk.h ├── virtio-console.c ├── virtio-net.c ├── virtio-net.h ├── virtio-pci.c ├── virtio-serial-bus.c ├── virtio-serial.h ├── virtio.c ├── virtio.h ├── vmmouse.c ├── vmport.c ├── vmware_vga.c ├── vmware_vga.h ├── vt82c686.c ├── vt82c686.h ├── watchdog.c ├── watchdog.h ├── wdt_i6300esb.c ├── wdt_ib700.c ├── wm8750.c ├── xen.h ├── xen_backend.c ├── xen_backend.h ├── xen_blkif.h ├── xen_common.h ├── xen_console.c ├── xen_devconfig.c ├── xen_disk.c ├── xen_domainbuild.c ├── xen_domainbuild.h ├── xen_machine_pv.c ├── xen_nic.c ├── xenfb.c ├── xics.c ├── xics.h ├── xilinx.h ├── xilinx_axidma.c ├── xilinx_axidma.h ├── xilinx_axienet.c ├── xilinx_ethlite.c ├── xilinx_intc.c ├── xilinx_timer.c ├── xilinx_uartlite.c ├── xio3130_downstream.c ├── xio3130_downstream.h ├── xio3130_upstream.c ├── xio3130_upstream.h └── zaurus.c ├── i386-dis.c ├── i386.ld ├── ia64-dis.c ├── ia64.ld ├── iemu.c ├── iemu.h ├── input.c ├── iohandler.c ├── ioport-user.c ├── ioport.c ├── ioport.h ├── iorange.h ├── iov.c ├── iov.h ├── json-lexer.c ├── json-lexer.h ├── json-parser.c ├── json-parser.h ├── json-streamer.c ├── json-streamer.h ├── kvm-all.c ├── kvm-stub.c ├── kvm.h ├── libcacard ├── Makefile ├── cac.c ├── cac.h ├── card_7816.c ├── card_7816.h ├── card_7816t.h ├── event.c ├── eventt.h ├── link_test.c ├── vcard.c ├── vcard.h ├── vcard_emul.h ├── vcard_emul_nss.c ├── vcard_emul_type.c ├── vcard_emul_type.h ├── vcardt.h ├── vevent.h ├── vreader.c ├── vreader.h ├── vreadert.h ├── vscard_common.h └── vscclient.c ├── libfdt_env.h ├── linux-aio.c ├── linux-user ├── alpha │ ├── syscall.h │ ├── syscall_nr.h │ ├── target_signal.h │ └── termbits.h ├── arm │ ├── nwfpe │ │ ├── double_cpdo.c │ │ ├── extended_cpdo.c │ │ ├── fpa11.c │ │ ├── fpa11.h │ │ ├── fpa11.inl │ │ ├── fpa11_cpdo.c │ │ ├── fpa11_cpdt.c │ │ ├── fpa11_cprt.c │ │ ├── fpopcode.c │ │ ├── fpopcode.h │ │ ├── fpsr.h │ │ └── single_cpdo.c │ ├── syscall.h │ ├── syscall_nr.h │ ├── target_signal.h │ └── termbits.h ├── cpu-uname.c ├── cpu-uname.h ├── cris │ ├── syscall.h │ ├── syscall_nr.h │ ├── target_signal.h │ └── termbits.h ├── elfload.c ├── errno_defs.h ├── flat.h ├── flatload.c ├── i386 │ ├── syscall.h │ ├── syscall_nr.h │ ├── target_signal.h │ └── termbits.h ├── ioctls.h ├── linux_loop.h ├── linuxload.c ├── m68k-sim.c ├── m68k │ ├── syscall.h │ ├── syscall_nr.h │ ├── target_signal.h │ └── termbits.h ├── main.c ├── microblaze │ ├── syscall.h │ ├── syscall_nr.h │ ├── target_signal.h │ └── termbits.h ├── mips │ ├── syscall.h │ ├── syscall_nr.h │ ├── target_signal.h │ └── termbits.h ├── mips64 │ ├── syscall.h │ ├── syscall_nr.h │ ├── target_signal.h │ └── termbits.h ├── mipsn32 │ ├── syscall.h │ ├── syscall_nr.h │ ├── target_signal.h │ └── termbits.h ├── mmap.c ├── ppc │ ├── syscall.h │ ├── syscall_nr.h │ ├── target_signal.h │ └── termbits.h ├── qemu-types.h ├── qemu.h ├── sh4 │ ├── syscall.h │ ├── syscall_nr.h │ ├── target_signal.h │ └── termbits.h ├── signal.c ├── socket.h ├── sparc │ ├── syscall.h │ ├── syscall_nr.h │ ├── target_signal.h │ └── termbits.h ├── sparc64 │ ├── syscall.h │ ├── syscall_nr.h │ ├── target_signal.h │ └── termbits.h ├── strace.c ├── strace.list ├── syscall.c ├── syscall_defs.h ├── syscall_types.h ├── target_flat.h ├── uaccess.c ├── vm86.c └── x86_64 │ ├── syscall.h │ ├── syscall_nr.h │ ├── target_signal.h │ └── termbits.h ├── m68k-dis.c ├── m68k-semi.c ├── m68k.ld ├── microblaze-dis.c ├── migration-exec.c ├── migration-fd.c ├── migration-tcp.c ├── migration-unix.c ├── migration.c ├── migration.h ├── mips-dis.c ├── mips.ld ├── module.c ├── module.h ├── monitor.c ├── monitor.h ├── nbd.c ├── nbd.h ├── net.c ├── net.h ├── net ├── checksum.c ├── checksum.h ├── dump.c ├── dump.h ├── queue.c ├── queue.h ├── slirp.c ├── slirp.h ├── socket.c ├── socket.h ├── tap-aix.c ├── tap-bsd.c ├── tap-haiku.c ├── tap-linux.c ├── tap-linux.h ├── tap-solaris.c ├── tap-win32.c ├── tap.c ├── tap.h ├── util.c ├── util.h ├── vde.c └── vde.h ├── notify.c ├── notify.h ├── os-posix.c ├── os-win32.c ├── osdep.c ├── osdep.h ├── oslib-posix.c ├── oslib-win32.c ├── path.c ├── pc-bios ├── Makefile ├── README ├── bamboo.dtb ├── bamboo.dts ├── bios.bin ├── gpxe-eepro100-80861209.rom ├── keymaps │ ├── ar │ ├── bepo │ ├── common │ ├── da │ ├── de │ ├── de-ch │ ├── en-gb │ ├── en-us │ ├── es │ ├── et │ ├── fi │ ├── fo │ ├── fr │ ├── fr-be │ ├── fr-ca │ ├── fr-ch │ ├── hr │ ├── hu │ ├── is │ ├── it │ ├── ja │ ├── lt │ ├── lv │ ├── mk │ ├── modifiers │ ├── nl │ ├── nl-be │ ├── no │ ├── pl │ ├── pt │ ├── pt-br │ ├── ru │ ├── sl │ ├── sv │ ├── th │ └── tr ├── linuxboot.bin ├── mpc8544ds.dtb ├── mpc8544ds.dts ├── multiboot.bin ├── ohw.diff ├── openbios-ppc ├── openbios-sparc32 ├── openbios-sparc64 ├── optionrom │ ├── Makefile │ ├── linuxboot.S │ ├── multiboot.S │ └── optionrom.h ├── petalogix-ml605.dtb ├── petalogix-s3adsp1800.dtb ├── ppc_rom.bin ├── pxe-e1000.bin ├── pxe-ne2k_pci.bin ├── pxe-pcnet.bin ├── pxe-rtl8139.bin ├── pxe-virtio.bin ├── s390-zipl.rom ├── slof.bin ├── spapr-rtas.bin ├── spapr-rtas │ ├── Makefile │ └── spapr-rtas.S ├── vgabios-cirrus.bin ├── vgabios-qxl.bin ├── vgabios-stdvga.bin ├── vgabios-vmware.bin └── vgabios.bin ├── pci-ids.txt ├── pflib.c ├── pflib.h ├── poison.h ├── posix-aio-compat.c ├── ppc-dis.c ├── ppc.ld ├── ppc64.ld ├── qbool.c ├── qbool.h ├── qdict-test-data.txt ├── qdict.c ├── qdict.h ├── qemu-aio.h ├── qemu-barrier.h ├── qemu-char.c ├── qemu-char.h ├── qemu-common.h ├── qemu-config.c ├── qemu-config.h ├── qemu-doc.texi ├── qemu-error.c ├── qemu-error.h ├── qemu-img-cmds.hx ├── qemu-img.c ├── qemu-img.texi ├── qemu-io.c ├── qemu-lock.h ├── qemu-log.h ├── qemu-malloc.c ├── qemu-nbd.c ├── qemu-nbd.texi ├── qemu-objects.h ├── qemu-option.c ├── qemu-option.h ├── qemu-options.h ├── qemu-options.hx ├── qemu-os-posix.h ├── qemu-os-win32.h ├── qemu-queue.h ├── qemu-sockets.c ├── qemu-tech.texi ├── qemu-thread-posix.c ├── qemu-thread-posix.h ├── qemu-thread-win32.c ├── qemu-thread-win32.h ├── qemu-thread.h ├── qemu-timer-common.c ├── qemu-timer.c ├── qemu-timer.h ├── qemu-tool.c ├── qemu-x509.h ├── qemu.sasl ├── qemu_socket.h ├── qerror.c ├── qerror.h ├── qfloat.c ├── qfloat.h ├── qint.c ├── qint.h ├── qjson.c ├── qjson.h ├── qlist.c ├── qlist.h ├── qmp-commands.hx ├── qobject.h ├── qstring.c ├── qstring.h ├── range.h ├── readline.c ├── readline.h ├── readme.md ├── rules.mak ├── rwhandler.c ├── rwhandler.h ├── s390-dis.c ├── s390.ld ├── savevm.c ├── scripts ├── checkpatch.pl ├── create_config ├── feature_to_c.sh ├── hxtool ├── make_device_config.sh ├── qemu-binfmt-conf.sh ├── signrom.sh ├── simpletrace.py ├── texi2pod.pl └── tracetool ├── sh4-dis.c ├── simpletrace.c ├── simpletrace.h ├── skin ├── skin.h ├── skin_button.c ├── skin_button.h ├── skin_config.c ├── skin_config.h ├── skin_image.c ├── skin_image.h ├── skin_image_template.h ├── skin_switchstate.h └── skinning.c ├── slirp ├── COPYRIGHT ├── bootp.c ├── bootp.h ├── cksum.c ├── debug.h ├── if.c ├── if.h ├── ip.h ├── ip_icmp.c ├── ip_icmp.h ├── ip_input.c ├── ip_output.c ├── libslirp.h ├── main.h ├── mbuf.c ├── mbuf.h ├── misc.c ├── misc.h ├── sbuf.c ├── sbuf.h ├── slirp.c ├── slirp.h ├── slirp_config.h ├── socket.c ├── socket.h ├── tcp.h ├── tcp_input.c ├── tcp_output.c ├── tcp_subr.c ├── tcp_timer.c ├── tcp_timer.h ├── tcp_var.h ├── tcpip.h ├── tftp.c ├── tftp.h ├── udp.c └── udp.h ├── softmmu-semi.h ├── softmmu_defs.h ├── softmmu_exec.h ├── softmmu_header.h ├── softmmu_template.h ├── sparc-dis.c ├── sparc.ld ├── sparc64.ld ├── spice-qemu-char.c ├── sysconfigs └── target │ └── target-x86_64.conf ├── sysemu.h ├── target-alpha ├── STATUS ├── cpu.h ├── exec.h ├── helper.c ├── helper.h ├── op_helper.c └── translate.c ├── target-arm ├── cpu.h ├── exec.h ├── helper.c ├── helpers.h ├── iwmmxt_helper.c ├── machine.c ├── neon_helper.c ├── op_addsub.h ├── op_helper.c └── translate.c ├── target-cris ├── cpu.h ├── crisv10-decode.h ├── crisv32-decode.h ├── exec.h ├── helper.c ├── helper.h ├── machine.c ├── mmu.c ├── mmu.h ├── op_helper.c ├── opcode-cris.h ├── translate.c └── translate_v10.c ├── target-i386 ├── TODO ├── cpu.h ├── cpuid.c ├── exec.h ├── helper.c ├── helper.h ├── helper_template.h ├── kvm.c ├── machine.c ├── op_helper.c ├── ops_sse.h ├── ops_sse_header.h ├── svm.h └── translate.c ├── target-lm32 ├── README ├── TODO ├── cpu.h ├── exec.h ├── helper.c ├── helper.h ├── machine.c ├── op_helper.c └── translate.c ├── target-m68k ├── cpu.h ├── exec.h ├── helper.c ├── helpers.h ├── m68k-qreg.h ├── machine.c ├── op_helper.c ├── qregs.def └── translate.c ├── target-microblaze ├── cpu.h ├── exec.h ├── helper.c ├── helper.h ├── machine.c ├── microblaze-decode.h ├── mmu.c ├── mmu.h ├── op_helper.c └── translate.c ├── target-mips ├── TODO ├── cpu.h ├── exec.h ├── helper.c ├── helper.h ├── machine.c ├── mips-defs.h ├── op_helper.c ├── translate.c └── translate_init.c ├── target-ppc ├── STATUS ├── cpu.h ├── exec.h ├── helper.c ├── helper.h ├── helper_regs.h ├── kvm.c ├── kvm_ppc.c ├── kvm_ppc.h ├── machine.c ├── mfrom_table.c ├── mfrom_table_gen.c ├── op_helper.c ├── translate.c └── translate_init.c ├── target-s390x ├── cpu.h ├── exec.h ├── helper.c ├── kvm.c ├── machine.c ├── op_helper.c └── translate.c ├── target-sh4 ├── README.sh4 ├── cpu.h ├── exec.h ├── helper.c ├── helper.h ├── machine.c ├── op_helper.c └── translate.c ├── target-sparc ├── TODO ├── cpu.h ├── exec.h ├── helper.c ├── helper.h ├── machine.c ├── op_helper.c └── translate.c ├── targphys.h ├── tcg-runtime.c ├── tcg ├── LICENSE ├── README ├── TODO ├── arm │ ├── tcg-target.c │ └── tcg-target.h ├── hppa │ ├── tcg-target.c │ └── tcg-target.h ├── i386 │ ├── tcg-target.c │ └── tcg-target.h ├── ia64 │ ├── tcg-target.c │ └── tcg-target.h ├── mips │ ├── tcg-target.c │ └── tcg-target.h ├── ppc │ ├── tcg-target.c │ └── tcg-target.h ├── ppc64 │ ├── tcg-target.c │ └── tcg-target.h ├── s390 │ ├── tcg-target.c │ └── tcg-target.h ├── sparc │ ├── tcg-target.c │ └── tcg-target.h ├── tcg-op.h ├── tcg-opc.h ├── tcg-runtime.h ├── tcg.c └── tcg.h ├── tests ├── Makefile ├── alpha │ ├── Makefile │ ├── crt.s │ ├── hello-alpha.c │ ├── test-cond.c │ └── test-ovf.c ├── cris │ ├── .gdbinit │ ├── Makefile │ ├── README │ ├── check_abs.c │ ├── check_addc.c │ ├── check_addcm.c │ ├── check_addi.s │ ├── check_addiv32.s │ ├── check_addm.s │ ├── check_addo.c │ ├── check_addoq.c │ ├── check_addq.s │ ├── check_addr.s │ ├── check_addxc.s │ ├── check_addxm.s │ ├── check_addxr.s │ ├── check_andc.s │ ├── check_andm.s │ ├── check_andq.s │ ├── check_andr.s │ ├── check_asr.s │ ├── check_ba.s │ ├── check_bas.s │ ├── check_bcc.s │ ├── check_bound.c │ ├── check_boundc.s │ ├── check_boundr.s │ ├── check_btst.s │ ├── check_clearfv32.s │ ├── check_clrjmp1.s │ ├── check_cmp-2.s │ ├── check_cmpc.s │ ├── check_cmpm.s │ ├── check_cmpq.s │ ├── check_cmpr.s │ ├── check_cmpxc.s │ ├── check_cmpxm.s │ ├── check_dstep.s │ ├── check_ftag.c │ ├── check_gcctorture_pr28634-1.c │ ├── check_gcctorture_pr28634.c │ ├── check_glibc_kernelversion.c │ ├── check_hello.c │ ├── check_int64.c │ ├── check_jsr.s │ ├── check_lapc.s │ ├── check_lsl.s │ ├── check_lsr.s │ ├── check_lz.c │ ├── check_mapbrk.c │ ├── check_mcp.s │ ├── check_mmap1.c │ ├── check_mmap2.c │ ├── check_mmap3.c │ ├── check_movdelsr1.s │ ├── check_movecr.s │ ├── check_movei.s │ ├── check_movemr.s │ ├── check_movemrv32.s │ ├── check_moveq.c │ ├── check_mover.s │ ├── check_moverm.s │ ├── check_movmp.s │ ├── check_movpmv32.s │ ├── check_movpr.s │ ├── check_movprv32.s │ ├── check_movscr.s │ ├── check_movsm.s │ ├── check_movsr.s │ ├── check_movucr.s │ ├── check_movum.s │ ├── check_movur.s │ ├── check_mulv32.s │ ├── check_mulx.s │ ├── check_neg.s │ ├── check_not.s │ ├── check_openpf1.c │ ├── check_openpf2.c │ ├── check_openpf3.c │ ├── check_openpf4.c │ ├── check_openpf5.c │ ├── check_orc.s │ ├── check_orm.s │ ├── check_orq.s │ ├── check_orr.s │ ├── check_ret.s │ ├── check_scc.s │ ├── check_settls1.c │ ├── check_sigalrm.c │ ├── check_stat1.c │ ├── check_stat2.c │ ├── check_stat3.c │ ├── check_stat4.c │ ├── check_subc.s │ ├── check_subm.s │ ├── check_subq.s │ ├── check_subr.s │ ├── check_swap.c │ ├── check_time1.c │ ├── check_time2.c │ ├── check_xarith.s │ ├── crisutils.h │ ├── crt.s │ ├── sys.c │ ├── sys.h │ └── testutils.inc ├── hello-arm.c ├── hello-i386.c ├── hello-mips.c ├── linux-test.c ├── lm32 │ ├── Makefile │ ├── crt.S │ ├── linker.ld │ ├── macros.inc │ ├── test_add.S │ ├── test_addi.S │ ├── test_and.S │ ├── test_andhi.S │ ├── test_andi.S │ ├── test_b.S │ ├── test_be.S │ ├── test_bg.S │ ├── test_bge.S │ ├── test_bgeu.S │ ├── test_bgu.S │ ├── test_bi.S │ ├── test_bne.S │ ├── test_break.S │ ├── test_bret.S │ ├── test_call.S │ ├── test_calli.S │ ├── test_cmpe.S │ ├── test_cmpei.S │ ├── test_cmpg.S │ ├── test_cmpge.S │ ├── test_cmpgei.S │ ├── test_cmpgeu.S │ ├── test_cmpgeui.S │ ├── test_cmpgi.S │ ├── test_cmpgu.S │ ├── test_cmpgui.S │ ├── test_cmpne.S │ ├── test_cmpnei.S │ ├── test_divu.S │ ├── test_eret.S │ ├── test_lb.S │ ├── test_lbu.S │ ├── test_lh.S │ ├── test_lhu.S │ ├── test_lw.S │ ├── test_modu.S │ ├── test_mul.S │ ├── test_muli.S │ ├── test_nor.S │ ├── test_nori.S │ ├── test_or.S │ ├── test_orhi.S │ ├── test_ori.S │ ├── test_ret.S │ ├── test_sb.S │ ├── test_scall.S │ ├── test_sextb.S │ ├── test_sexth.S │ ├── test_sh.S │ ├── test_sl.S │ ├── test_sli.S │ ├── test_sr.S │ ├── test_sri.S │ ├── test_sru.S │ ├── test_srui.S │ ├── test_sub.S │ ├── test_sw.S │ ├── test_xnor.S │ ├── test_xnori.S │ ├── test_xor.S │ └── test_xori.S ├── pi_10.com ├── qruncom.c ├── runcom.c ├── sha1.c ├── test-arm-iwmmxt.s ├── test-i386-code16.S ├── test-i386-muldiv.h ├── test-i386-shift.h ├── test-i386-ssse3.c ├── test-i386-vm86.S ├── test-i386.c ├── test-i386.h ├── test-mmap.c ├── test_path.c └── testthread.c ├── thunk.c ├── thunk.h ├── trace-events ├── translate-all.c ├── uboot_image.h ├── ui ├── cocoa.m ├── curses.c ├── curses_keys.h ├── d3des.c ├── d3des.h ├── keymaps.c ├── keymaps.h ├── qemu-spice.h ├── sdl.c ├── sdl_keysym.h ├── sdl_zoom.c ├── sdl_zoom.h ├── sdl_zoom_template.h ├── spice-core.c ├── spice-display.c ├── spice-display.h ├── spice-input.c ├── vnc-auth-sasl.c ├── vnc-auth-sasl.h ├── vnc-auth-vencrypt.c ├── vnc-auth-vencrypt.h ├── vnc-enc-hextile-template.h ├── vnc-enc-hextile.c ├── vnc-enc-tight.c ├── vnc-enc-tight.h ├── vnc-enc-zlib.c ├── vnc-enc-zrle-template.c ├── vnc-enc-zrle.c ├── vnc-enc-zrle.h ├── vnc-enc-zywrle-template.c ├── vnc-enc-zywrle.h ├── vnc-jobs-async.c ├── vnc-jobs-sync.c ├── vnc-jobs.h ├── vnc-palette.c ├── vnc-palette.h ├── vnc-tls.c ├── vnc-tls.h ├── vnc.c ├── vnc.h ├── vnc_keysym.h ├── x_keymap.c └── x_keymap.h ├── usb-bsd.c ├── usb-linux.c ├── usb-stub.c ├── version.rc ├── vgafont.h ├── vl.c └── x86_64.ld /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "roms/vgabios"] 2 | path = roms/vgabios 3 | url = git://git.qemu.org/vgabios.git/ 4 | [submodule "roms/seabios"] 5 | path = roms/seabios 6 | url = git://git.qemu.org/seabios.git/ 7 | [submodule "roms/SLOF"] 8 | path = roms/SLOF 9 | url = git://git.qemu.org/SLOF.git 10 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The following points clarify the QEMU license: 2 | 3 | 1) QEMU as a whole is released under the GNU General Public License 4 | 5 | 2) Parts of QEMU have specific licenses which are compatible with the 6 | GNU General Public License. Hence each source file contains its own 7 | licensing information. 8 | 9 | In particular, the QEMU virtual CPU core library (libqemu.a) is 10 | released under the GNU Lesser General Public License. Many hardware 11 | device emulation sources are released under the BSD license. 12 | 13 | 3) The Tiny Code Generator (TCG) is released under the BSD license 14 | (see license headers in files). 15 | 16 | 4) QEMU is a trademark of Fabrice Bellard. 17 | 18 | Fabrice Bellard. 19 | -------------------------------------------------------------------------------- /Makefile.dis: -------------------------------------------------------------------------------- 1 | # Makefile for disassemblers. 2 | 3 | include ../config-host.mak 4 | include config.mak 5 | include $(SRC_PATH)/rules.mak 6 | 7 | .PHONY: all 8 | 9 | $(call set-vpath, $(SRC_PATH)) 10 | 11 | QEMU_CFLAGS+=-I.. 12 | 13 | include $(SRC_PATH)/Makefile.objs 14 | 15 | all: $(libdis-y) 16 | # Dummy command so that make thinks it has done something 17 | @true 18 | 19 | clean: 20 | rm -f *.o *.d *.a *~ 21 | 22 | # Include automatically generated dependency files 23 | -include $(wildcard *.d */*.d) 24 | -------------------------------------------------------------------------------- /Makefile.hw: -------------------------------------------------------------------------------- 1 | # Makefile for qemu target independent devices. 2 | 3 | include ../config-host.mak 4 | include ../config-all-devices.mak 5 | include config.mak 6 | include $(SRC_PATH)/rules.mak 7 | 8 | .PHONY: all 9 | 10 | $(call set-vpath, $(SRC_PATH):$(SRC_PATH)/hw) 11 | 12 | QEMU_CFLAGS+=-I.. -I$(SRC_PATH)/fpu 13 | 14 | include $(SRC_PATH)/Makefile.objs 15 | 16 | all: $(hw-obj-y) 17 | # Dummy command so that make thinks it has done something 18 | @true 19 | 20 | clean: 21 | rm -f *.o */*.o *.d */*.d *.a */*.a *~ */*~ 22 | 23 | # Include automatically generated dependency files 24 | -include $(wildcard *.d */*.d) 25 | -------------------------------------------------------------------------------- /Makefile.user: -------------------------------------------------------------------------------- 1 | # Makefile for qemu target independent user files. 2 | 3 | include ../config-host.mak 4 | include $(SRC_PATH)/rules.mak 5 | -include config.mak 6 | 7 | .PHONY: all 8 | 9 | $(call set-vpath, $(SRC_PATH)) 10 | 11 | QEMU_CFLAGS+=-I.. 12 | 13 | include $(SRC_PATH)/Makefile.objs 14 | 15 | all: $(user-obj-y) 16 | # Dummy command so that make thinks it has done something 17 | @true 18 | 19 | clean: 20 | rm -f *.o *.d *.a *~ 21 | 22 | # Include automatically generated dependency files 23 | -include $(wildcard *.d */*.d) 24 | -------------------------------------------------------------------------------- /QEMU-README: -------------------------------------------------------------------------------- 1 | Read the documentation in qemu-doc.html. 2 | 3 | Fabrice Bellard. 4 | -------------------------------------------------------------------------------- /TODO: -------------------------------------------------------------------------------- 1 | General: 2 | ------- 3 | - add nand support 4 | - fix usb 5 | - fix i2c/spi 6 | - boot kernel 7 | - Add iPhone3gs/iPad/iPhone4 support 8 | - ???? 9 | - jailbreaks++ 10 | -------------------------------------------------------------------------------- /VERSION: -------------------------------------------------------------------------------- 1 | 0.14.50-s5l89xx 2 | -------------------------------------------------------------------------------- /aes.h: -------------------------------------------------------------------------------- 1 | #ifndef QEMU_AES_H 2 | #define QEMU_AES_H 3 | 4 | #define AES_MAXNR 14 5 | #define AES_BLOCK_SIZE 16 6 | 7 | struct aes_key_st { 8 | uint32_t rd_key[4 *(AES_MAXNR + 1)]; 9 | int rounds; 10 | }; 11 | typedef struct aes_key_st AES_KEY; 12 | 13 | int AES_set_encrypt_key(const unsigned char *userKey, const int bits, 14 | AES_KEY *key); 15 | int AES_set_decrypt_key(const unsigned char *userKey, const int bits, 16 | AES_KEY *key); 17 | 18 | void AES_encrypt(const unsigned char *in, unsigned char *out, 19 | const AES_KEY *key); 20 | void AES_decrypt(const unsigned char *in, unsigned char *out, 21 | const AES_KEY *key); 22 | void AES_cbc_encrypt(const unsigned char *in, unsigned char *out, 23 | const unsigned long length, const AES_KEY *key, 24 | unsigned char *ivec, const int enc); 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /arch_init.h: -------------------------------------------------------------------------------- 1 | #ifndef QEMU_ARCH_INIT_H 2 | #define QEMU_ARCH_INIT_H 3 | 4 | extern const char arch_config_name[]; 5 | 6 | enum { 7 | QEMU_ARCH_ALL = -1, 8 | QEMU_ARCH_ALPHA = 1, 9 | QEMU_ARCH_ARM = 2, 10 | QEMU_ARCH_CRIS = 4, 11 | QEMU_ARCH_I386 = 8, 12 | QEMU_ARCH_M68K = 16, 13 | QEMU_ARCH_LM32 = 32, 14 | QEMU_ARCH_MICROBLAZE = 64, 15 | QEMU_ARCH_MIPS = 128, 16 | QEMU_ARCH_PPC = 256, 17 | QEMU_ARCH_S390X = 512, 18 | QEMU_ARCH_SH4 = 1024, 19 | QEMU_ARCH_SPARC = 2048, 20 | }; 21 | 22 | extern const uint32_t arch_type; 23 | 24 | void select_soundhw(const char *optarg); 25 | int ram_save_live(Monitor *mon, QEMUFile *f, int stage, void *opaque); 26 | int ram_load(QEMUFile *f, void *opaque, int version_id); 27 | void do_acpitable_option(const char *optarg); 28 | void do_smbios_option(const char *optarg); 29 | void cpudef_init(void); 30 | int audio_available(void); 31 | void audio_init(qemu_irq *isa_pic, PCIBus *pci_bus); 32 | int kvm_available(void); 33 | int xen_available(void); 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /audio/audio_pt_int.h: -------------------------------------------------------------------------------- 1 | #ifndef QEMU_AUDIO_PT_INT_H 2 | #define QEMU_AUDIO_PT_INT_H 3 | 4 | #include 5 | 6 | struct audio_pt { 7 | const char *drv; 8 | pthread_t thread; 9 | pthread_cond_t cond; 10 | pthread_mutex_t mutex; 11 | }; 12 | 13 | int audio_pt_init (struct audio_pt *, void *(*) (void *), void *, 14 | const char *, const char *); 15 | int audio_pt_fini (struct audio_pt *, const char *); 16 | int audio_pt_lock (struct audio_pt *, const char *); 17 | int audio_pt_unlock (struct audio_pt *, const char *); 18 | int audio_pt_wait (struct audio_pt *, const char *); 19 | int audio_pt_unlock_and_signal (struct audio_pt *, const char *); 20 | int audio_pt_join (struct audio_pt *, void **, const char *); 21 | 22 | #endif /* audio_pt_int.h */ 23 | -------------------------------------------------------------------------------- /audio/audio_win_int.h: -------------------------------------------------------------------------------- 1 | #ifndef AUDIO_WIN_INT_H 2 | #define AUDIO_WIN_INT_H 3 | 4 | int waveformat_from_audio_settings (WAVEFORMATEX *wfx, 5 | struct audsettings *as); 6 | 7 | int waveformat_to_audio_settings (WAVEFORMATEX *wfx, 8 | struct audsettings *as); 9 | 10 | #endif /* AUDIO_WIN_INT_H */ 11 | -------------------------------------------------------------------------------- /balloon.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Balloon 3 | * 4 | * Copyright IBM, Corp. 2008 5 | * 6 | * Authors: 7 | * Anthony Liguori 8 | * 9 | * This work is licensed under the terms of the GNU GPL, version 2. See 10 | * the COPYING file in the top-level directory. 11 | * 12 | */ 13 | 14 | #ifndef _QEMU_BALLOON_H 15 | #define _QEMU_BALLOON_H 16 | 17 | #include "monitor.h" 18 | 19 | typedef void (QEMUBalloonEvent)(void *opaque, ram_addr_t target, 20 | MonitorCompletion cb, void *cb_data); 21 | 22 | void qemu_add_balloon_handler(QEMUBalloonEvent *func, void *opaque); 23 | 24 | int qemu_balloon(ram_addr_t target, MonitorCompletion cb, void *opaque); 25 | 26 | int qemu_balloon_status(MonitorCompletion cb, void *opaque); 27 | 28 | void monitor_print_balloon(Monitor *mon, const QObject *data); 29 | int do_info_balloon(Monitor *mon, MonitorCompletion cb, void *opaque); 30 | int do_balloon(Monitor *mon, const QDict *params, 31 | MonitorCompletion cb, void *opaque); 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /block-migration.h: -------------------------------------------------------------------------------- 1 | /* 2 | * QEMU live block migration 3 | * 4 | * Copyright IBM, Corp. 2009 5 | * 6 | * Authors: 7 | * Liran Schour 8 | * 9 | * This work is licensed under the terms of the GNU GPL, version 2. See 10 | * the COPYING file in the top-level directory. 11 | * 12 | */ 13 | 14 | #ifndef BLOCK_MIGRATION_H 15 | #define BLOCK_MIGRATION_H 16 | 17 | void blk_mig_init(void); 18 | int blk_mig_active(void); 19 | uint64_t blk_mig_bytes_transferred(void); 20 | uint64_t blk_mig_bytes_remaining(void); 21 | uint64_t blk_mig_bytes_total(void); 22 | 23 | #endif /* BLOCK_MIGRATION_H */ 24 | -------------------------------------------------------------------------------- /block/qed-gencb.c: -------------------------------------------------------------------------------- 1 | /* 2 | * QEMU Enhanced Disk Format 3 | * 4 | * Copyright IBM, Corp. 2010 5 | * 6 | * Authors: 7 | * Stefan Hajnoczi 8 | * 9 | * This work is licensed under the terms of the GNU LGPL, version 2 or later. 10 | * See the COPYING.LIB file in the top-level directory. 11 | * 12 | */ 13 | 14 | #include "qed.h" 15 | 16 | void *gencb_alloc(size_t len, BlockDriverCompletionFunc *cb, void *opaque) 17 | { 18 | GenericCB *gencb = qemu_malloc(len); 19 | gencb->cb = cb; 20 | gencb->opaque = opaque; 21 | return gencb; 22 | } 23 | 24 | void gencb_complete(void *opaque, int ret) 25 | { 26 | GenericCB *gencb = opaque; 27 | BlockDriverCompletionFunc *cb = gencb->cb; 28 | void *user_opaque = gencb->opaque; 29 | 30 | qemu_free(gencb); 31 | cb(user_opaque, ret); 32 | } 33 | -------------------------------------------------------------------------------- /bsd-user/i386/target_signal.h: -------------------------------------------------------------------------------- 1 | #ifndef TARGET_SIGNAL_H 2 | #define TARGET_SIGNAL_H 3 | 4 | #include "cpu.h" 5 | 6 | /* this struct defines a stack used during syscall handling */ 7 | 8 | typedef struct target_sigaltstack { 9 | abi_ulong ss_sp; 10 | abi_long ss_flags; 11 | abi_ulong ss_size; 12 | } target_stack_t; 13 | 14 | 15 | static inline abi_ulong get_sp_from_cpustate(CPUX86State *state) 16 | { 17 | return state->regs[R_ESP]; 18 | } 19 | 20 | #endif /* TARGET_SIGNAL_H */ 21 | -------------------------------------------------------------------------------- /bsd-user/qemu-types.h: -------------------------------------------------------------------------------- 1 | #ifndef QEMU_TYPES_H 2 | #define QEMU_TYPES_H 3 | #include "cpu.h" 4 | 5 | #ifdef TARGET_ABI32 6 | typedef uint32_t abi_ulong; 7 | typedef int32_t abi_long; 8 | #define TARGET_ABI_FMT_lx "%08x" 9 | #define TARGET_ABI_FMT_ld "%d" 10 | #define TARGET_ABI_FMT_lu "%u" 11 | #define TARGET_ABI_BITS 32 12 | #else 13 | typedef target_ulong abi_ulong; 14 | typedef target_long abi_long; 15 | #define TARGET_ABI_FMT_lx TARGET_FMT_lx 16 | #define TARGET_ABI_FMT_ld TARGET_FMT_ld 17 | #define TARGET_ABI_FMT_lu TARGET_FMT_lu 18 | #define TARGET_ABI_BITS TARGET_LONG_BITS 19 | /* for consistency, define ABI32 too */ 20 | #if TARGET_ABI_BITS == 32 21 | #define TARGET_ABI32 1 22 | #endif 23 | #endif 24 | #endif 25 | -------------------------------------------------------------------------------- /bsd-user/sparc/syscall.h: -------------------------------------------------------------------------------- 1 | struct target_pt_regs { 2 | abi_ulong psr; 3 | abi_ulong pc; 4 | abi_ulong npc; 5 | abi_ulong y; 6 | abi_ulong u_regs[16]; 7 | }; 8 | 9 | #define UNAME_MACHINE "sun4" 10 | -------------------------------------------------------------------------------- /bsd-user/sparc/target_signal.h: -------------------------------------------------------------------------------- 1 | #ifndef TARGET_SIGNAL_H 2 | #define TARGET_SIGNAL_H 3 | 4 | #include "cpu.h" 5 | 6 | /* this struct defines a stack used during syscall handling */ 7 | 8 | typedef struct target_sigaltstack { 9 | abi_ulong ss_sp; 10 | abi_long ss_flags; 11 | abi_ulong ss_size; 12 | } target_stack_t; 13 | 14 | 15 | #ifndef UREG_I6 16 | #define UREG_I6 6 17 | #endif 18 | #ifndef UREG_FP 19 | #define UREG_FP UREG_I6 20 | #endif 21 | 22 | static inline abi_ulong get_sp_from_cpustate(CPUSPARCState *state) 23 | { 24 | return state->regwptr[UREG_FP]; 25 | } 26 | 27 | #endif /* TARGET_SIGNAL_H */ 28 | -------------------------------------------------------------------------------- /bsd-user/sparc64/syscall.h: -------------------------------------------------------------------------------- 1 | struct target_pt_regs { 2 | abi_ulong u_regs[16]; 3 | abi_ulong tstate; 4 | abi_ulong pc; 5 | abi_ulong npc; 6 | abi_ulong y; 7 | abi_ulong fprs; 8 | }; 9 | 10 | #define UNAME_MACHINE "sun4u" 11 | -------------------------------------------------------------------------------- /bsd-user/sparc64/target_signal.h: -------------------------------------------------------------------------------- 1 | #ifndef TARGET_SIGNAL_H 2 | #define TARGET_SIGNAL_H 3 | 4 | #include "cpu.h" 5 | 6 | /* this struct defines a stack used during syscall handling */ 7 | 8 | typedef struct target_sigaltstack { 9 | abi_ulong ss_sp; 10 | abi_long ss_flags; 11 | abi_ulong ss_size; 12 | } target_stack_t; 13 | 14 | 15 | #ifndef UREG_I6 16 | #define UREG_I6 6 17 | #endif 18 | #ifndef UREG_FP 19 | #define UREG_FP UREG_I6 20 | #endif 21 | 22 | static inline abi_ulong get_sp_from_cpustate(CPUSPARCState *state) 23 | { 24 | return state->regwptr[UREG_FP]; 25 | } 26 | 27 | #endif /* TARGET_SIGNAL_H */ 28 | -------------------------------------------------------------------------------- /bsd-user/x86_64/target_signal.h: -------------------------------------------------------------------------------- 1 | #ifndef TARGET_SIGNAL_H 2 | #define TARGET_SIGNAL_H 3 | 4 | #include "cpu.h" 5 | 6 | /* this struct defines a stack used during syscall handling */ 7 | 8 | typedef struct target_sigaltstack { 9 | abi_ulong ss_sp; 10 | abi_long ss_flags; 11 | abi_ulong ss_size; 12 | } target_stack_t; 13 | 14 | static inline abi_ulong get_sp_from_cpustate(CPUX86State *state) 15 | { 16 | return state->regs[R_ESP]; 17 | } 18 | 19 | #endif /* TARGET_SIGNAL_H */ 20 | -------------------------------------------------------------------------------- /bt-host.h: -------------------------------------------------------------------------------- 1 | #ifndef BT_HOST_H 2 | #define BT_HOST_H 3 | 4 | struct HCIInfo; 5 | 6 | /* bt-host.c */ 7 | struct HCIInfo *bt_host_hci(const char *id); 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /buffered_file.h: -------------------------------------------------------------------------------- 1 | /* 2 | * QEMU buffered QEMUFile 3 | * 4 | * Copyright IBM, Corp. 2008 5 | * 6 | * Authors: 7 | * Anthony Liguori 8 | * 9 | * This work is licensed under the terms of the GNU GPL, version 2. See 10 | * the COPYING file in the top-level directory. 11 | * 12 | */ 13 | 14 | #ifndef QEMU_BUFFERED_FILE_H 15 | #define QEMU_BUFFERED_FILE_H 16 | 17 | #include "hw/hw.h" 18 | 19 | typedef ssize_t (BufferedPutFunc)(void *opaque, const void *data, size_t size); 20 | typedef void (BufferedPutReadyFunc)(void *opaque); 21 | typedef void (BufferedWaitForUnfreezeFunc)(void *opaque); 22 | typedef int (BufferedCloseFunc)(void *opaque); 23 | 24 | QEMUFile *qemu_fopen_ops_buffered(void *opaque, size_t xfer_limit, 25 | BufferedPutFunc *put_buffer, 26 | BufferedPutReadyFunc *put_ready, 27 | BufferedWaitForUnfreezeFunc *wait_for_unfreeze, 28 | BufferedCloseFunc *close); 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /config.h: -------------------------------------------------------------------------------- 1 | #include "config-host.h" 2 | #include "config-target.h" 3 | -------------------------------------------------------------------------------- /cpus.h: -------------------------------------------------------------------------------- 1 | #ifndef QEMU_CPUS_H 2 | #define QEMU_CPUS_H 3 | 4 | /* cpus.c */ 5 | int qemu_init_main_loop(void); 6 | void qemu_main_loop_start(void); 7 | void resume_all_vcpus(void); 8 | void pause_all_vcpus(void); 9 | void cpu_stop_current(void); 10 | 11 | /* vl.c */ 12 | extern int smp_cores; 13 | extern int smp_threads; 14 | void vm_state_notify(int running, int reason); 15 | bool cpu_exec_all(void); 16 | void set_numa_modes(void); 17 | void set_cpu_log(const char *optarg); 18 | void list_cpus(FILE *f, fprintf_function cpu_fprintf, const char *optarg); 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /darwin-user/ioctls.h: -------------------------------------------------------------------------------- 1 | /* emulated ioctl list */ 2 | 3 | IOCTL(TIOCGETA, IOC_R, MK_PTR(MK_STRUCT(STRUCT_termios))) 4 | IOCTL(TIOCSETA, IOC_W, MK_PTR(MK_STRUCT(STRUCT_termios))) 5 | -------------------------------------------------------------------------------- /darwin-user/ioctls_types.h: -------------------------------------------------------------------------------- 1 | STRUCT(termios, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT, MK_ARRAY(TYPE_CHAR, 20), TYPE_INT, TYPE_INT) 2 | -------------------------------------------------------------------------------- /default-configs/alpha-linux-user.mak: -------------------------------------------------------------------------------- 1 | # Default configuration for alpha-linux-user 2 | -------------------------------------------------------------------------------- /default-configs/arm-linux-user.mak: -------------------------------------------------------------------------------- 1 | # Default configuration for arm-linux-user 2 | 3 | CONFIG_GDBSTUB_XML=y 4 | -------------------------------------------------------------------------------- /default-configs/arm-softmmu.mak: -------------------------------------------------------------------------------- 1 | # Default configuration for arm-softmmu 2 | 3 | include pci.mak 4 | CONFIG_GDBSTUB_XML=y 5 | CONFIG_ISA_MMIO=y 6 | CONFIG_NAND=y 7 | CONFIG_ECC=y 8 | CONFIG_SERIAL=y 9 | CONFIG_PTIMER=y 10 | CONFIG_SD=y 11 | CONFIG_MAX7310=y 12 | CONFIG_WM8750=y 13 | CONFIG_TWL92230=y 14 | CONFIG_TSC2005=y 15 | CONFIG_LM832X=y 16 | CONFIG_TMP105=y 17 | CONFIG_STELLARIS_INPUT=y 18 | CONFIG_SSD0303=y 19 | CONFIG_SSD0323=y 20 | CONFIG_ADS7846=y 21 | CONFIG_MAX111X=y 22 | CONFIG_SSI=y 23 | CONFIG_SSI_SD=y 24 | CONFIG_LAN9118=y 25 | CONFIG_SMC91C111=y 26 | CONFIG_DS1338=y 27 | CONFIG_PFLASH_CFI01=y 28 | CONFIG_PFLASH_CFI02=y 29 | -------------------------------------------------------------------------------- /default-configs/armeb-linux-user.mak: -------------------------------------------------------------------------------- 1 | # Default configuration for armeb-linux-user 2 | 3 | CONFIG_GDBSTUB_XML=y 4 | -------------------------------------------------------------------------------- /default-configs/cris-linux-user.mak: -------------------------------------------------------------------------------- 1 | # Default configuration for cris-linux-user 2 | -------------------------------------------------------------------------------- /default-configs/cris-softmmu.mak: -------------------------------------------------------------------------------- 1 | # Default configuration for cris-softmmu 2 | 3 | CONFIG_NAND=y 4 | CONFIG_PTIMER=y 5 | CONFIG_PFLASH_CFI02=y 6 | -------------------------------------------------------------------------------- /default-configs/i386-bsd-user.mak: -------------------------------------------------------------------------------- 1 | # Default configuration for i386-bsd-user 2 | -------------------------------------------------------------------------------- /default-configs/i386-darwin-user.mak: -------------------------------------------------------------------------------- 1 | # Default configuration for i386-darwin-user 2 | -------------------------------------------------------------------------------- /default-configs/i386-linux-user.mak: -------------------------------------------------------------------------------- 1 | # Default configuration for i386-linux-user 2 | -------------------------------------------------------------------------------- /default-configs/i386-softmmu.mak: -------------------------------------------------------------------------------- 1 | # Default configuration for i386-softmmu 2 | 3 | include pci.mak 4 | CONFIG_VGA_PCI=y 5 | CONFIG_VGA_ISA=y 6 | CONFIG_VMWARE_VGA=y 7 | CONFIG_VMMOUSE=y 8 | CONFIG_SERIAL=y 9 | CONFIG_PARALLEL=y 10 | CONFIG_I8254=y 11 | CONFIG_PCSPK=y 12 | CONFIG_PCKBD=y 13 | CONFIG_FDC=y 14 | CONFIG_ACPI=y 15 | CONFIG_APM=y 16 | CONFIG_DMA=y 17 | CONFIG_IDE_ISA=y 18 | CONFIG_IDE_PIIX=y 19 | CONFIG_NE2000_ISA=y 20 | CONFIG_PIIX_PCI=y 21 | CONFIG_SOUND=y 22 | CONFIG_HPET=y 23 | CONFIG_APPLESMC=y 24 | -------------------------------------------------------------------------------- /default-configs/lm32-softmmu.mak: -------------------------------------------------------------------------------- 1 | # Default configuration for lm32-softmmu 2 | 3 | CONFIG_PTIMER=y 4 | CONFIG_PFLASH_CFI01=y 5 | CONFIG_PFLASH_CFI02=y 6 | CONFIG_SD=y 7 | -------------------------------------------------------------------------------- /default-configs/m68k-linux-user.mak: -------------------------------------------------------------------------------- 1 | # Default configuration for m68k-linux-user 2 | 3 | CONFIG_GDBSTUB_XML=y 4 | -------------------------------------------------------------------------------- /default-configs/m68k-softmmu.mak: -------------------------------------------------------------------------------- 1 | # Default configuration for m68k-softmmu 2 | 3 | include pci.mak 4 | CONFIG_GDBSTUB_XML=y 5 | CONFIG_PTIMER=y 6 | -------------------------------------------------------------------------------- /default-configs/microblaze-linux-user.mak: -------------------------------------------------------------------------------- 1 | # Default configuration for microblaze-linux-user 2 | -------------------------------------------------------------------------------- /default-configs/microblaze-softmmu.mak: -------------------------------------------------------------------------------- 1 | # Default configuration for microblaze-softmmu 2 | 3 | CONFIG_PTIMER=y 4 | CONFIG_PFLASH_CFI01=y 5 | CONFIG_SERIAL=y 6 | -------------------------------------------------------------------------------- /default-configs/microblazeel-linux-user.mak: -------------------------------------------------------------------------------- 1 | # Default configuration for microblazeel-linux-user 2 | -------------------------------------------------------------------------------- /default-configs/microblazeel-softmmu.mak: -------------------------------------------------------------------------------- 1 | # Default configuration for microblazeel-softmmu 2 | 3 | CONFIG_PTIMER=y 4 | CONFIG_PFLASH_CFI01=y 5 | CONFIG_SERIAL=y 6 | -------------------------------------------------------------------------------- /default-configs/mips-linux-user.mak: -------------------------------------------------------------------------------- 1 | # Default configuration for mips-linux-user 2 | -------------------------------------------------------------------------------- /default-configs/mips-softmmu.mak: -------------------------------------------------------------------------------- 1 | # Default configuration for mips-softmmu 2 | 3 | include pci.mak 4 | CONFIG_ISA_MMIO=y 5 | CONFIG_ESP=y 6 | CONFIG_VGA_PCI=y 7 | CONFIG_VGA_ISA=y 8 | CONFIG_VGA_ISA_MM=y 9 | CONFIG_VMWARE_VGA=y 10 | CONFIG_SERIAL=y 11 | CONFIG_PARALLEL=y 12 | CONFIG_I8254=y 13 | CONFIG_PCSPK=y 14 | CONFIG_PCKBD=y 15 | CONFIG_FDC=y 16 | CONFIG_ACPI=y 17 | CONFIG_APM=y 18 | CONFIG_DMA=y 19 | CONFIG_PIIX4=y 20 | CONFIG_IDE_ISA=y 21 | CONFIG_IDE_PIIX=y 22 | CONFIG_NE2000_ISA=y 23 | CONFIG_SOUND=y 24 | CONFIG_RC4030=y 25 | CONFIG_DP8393X=y 26 | CONFIG_DS1225Y=y 27 | CONFIG_MIPSNET=y 28 | CONFIG_PFLASH_CFI01=y 29 | -------------------------------------------------------------------------------- /default-configs/mips64-softmmu.mak: -------------------------------------------------------------------------------- 1 | # Default configuration for mips64-softmmu 2 | 3 | include pci.mak 4 | CONFIG_ISA_MMIO=y 5 | CONFIG_ESP=y 6 | CONFIG_VGA_PCI=y 7 | CONFIG_VGA_ISA=y 8 | CONFIG_VGA_ISA_MM=y 9 | CONFIG_VMWARE_VGA=y 10 | CONFIG_SERIAL=y 11 | CONFIG_PARALLEL=y 12 | CONFIG_I8254=y 13 | CONFIG_PCSPK=y 14 | CONFIG_PCKBD=y 15 | CONFIG_FDC=y 16 | CONFIG_ACPI=y 17 | CONFIG_APM=y 18 | CONFIG_DMA=y 19 | CONFIG_PIIX4=y 20 | CONFIG_IDE_ISA=y 21 | CONFIG_IDE_PIIX=y 22 | CONFIG_NE2000_ISA=y 23 | CONFIG_SOUND=y 24 | CONFIG_RC4030=y 25 | CONFIG_DP8393X=y 26 | CONFIG_DS1225Y=y 27 | CONFIG_MIPSNET=y 28 | CONFIG_PFLASH_CFI01=y 29 | -------------------------------------------------------------------------------- /default-configs/mips64el-softmmu.mak: -------------------------------------------------------------------------------- 1 | # Default configuration for mips64el-softmmu 2 | 3 | include pci.mak 4 | CONFIG_ISA_MMIO=y 5 | CONFIG_ESP=y 6 | CONFIG_VGA_PCI=y 7 | CONFIG_VGA_ISA=y 8 | CONFIG_VGA_ISA_MM=y 9 | CONFIG_VMWARE_VGA=y 10 | CONFIG_SERIAL=y 11 | CONFIG_PARALLEL=y 12 | CONFIG_I8254=y 13 | CONFIG_PCSPK=y 14 | CONFIG_PCKBD=y 15 | CONFIG_FDC=y 16 | CONFIG_ACPI=y 17 | CONFIG_APM=y 18 | CONFIG_DMA=y 19 | CONFIG_PIIX4=y 20 | CONFIG_IDE_ISA=y 21 | CONFIG_IDE_PIIX=y 22 | CONFIG_IDE_VIA=y 23 | CONFIG_NE2000_ISA=y 24 | CONFIG_SOUND=y 25 | CONFIG_RC4030=y 26 | CONFIG_DP8393X=y 27 | CONFIG_DS1225Y=y 28 | CONFIG_MIPSNET=y 29 | CONFIG_PFLASH_CFI01=y 30 | CONFIG_FULONG=y 31 | -------------------------------------------------------------------------------- /default-configs/mipsel-linux-user.mak: -------------------------------------------------------------------------------- 1 | # Default configuration for mipsel-linux-user 2 | -------------------------------------------------------------------------------- /default-configs/mipsel-softmmu.mak: -------------------------------------------------------------------------------- 1 | # Default configuration for mipsel-softmmu 2 | 3 | include pci.mak 4 | CONFIG_ISA_MMIO=y 5 | CONFIG_ESP=y 6 | CONFIG_VGA_PCI=y 7 | CONFIG_VGA_ISA=y 8 | CONFIG_VGA_ISA_MM=y 9 | CONFIG_VMWARE_VGA=y 10 | CONFIG_SERIAL=y 11 | CONFIG_PARALLEL=y 12 | CONFIG_I8254=y 13 | CONFIG_PCSPK=y 14 | CONFIG_PCKBD=y 15 | CONFIG_FDC=y 16 | CONFIG_ACPI=y 17 | CONFIG_APM=y 18 | CONFIG_DMA=y 19 | CONFIG_PIIX4=y 20 | CONFIG_IDE_ISA=y 21 | CONFIG_IDE_PIIX=y 22 | CONFIG_NE2000_ISA=y 23 | CONFIG_SOUND=y 24 | CONFIG_RC4030=y 25 | CONFIG_DP8393X=y 26 | CONFIG_DS1225Y=y 27 | CONFIG_MIPSNET=y 28 | CONFIG_PFLASH_CFI01=y 29 | -------------------------------------------------------------------------------- /default-configs/pci.mak: -------------------------------------------------------------------------------- 1 | CONFIG_PCI=y 2 | CONFIG_VIRTIO_PCI=y 3 | CONFIG_VIRTIO=y 4 | CONFIG_USB_UHCI=y 5 | CONFIG_USB_OHCI=y 6 | CONFIG_NE2000_PCI=y 7 | CONFIG_EEPRO100_PCI=y 8 | CONFIG_PCNET_PCI=y 9 | CONFIG_PCNET_COMMON=y 10 | CONFIG_LSI_SCSI_PCI=y 11 | CONFIG_RTL8139_PCI=y 12 | CONFIG_E1000_PCI=y 13 | CONFIG_IDE_CORE=y 14 | CONFIG_IDE_QDEV=y 15 | CONFIG_IDE_PCI=y 16 | CONFIG_AHCI=y 17 | -------------------------------------------------------------------------------- /default-configs/ppc-darwin-user.mak: -------------------------------------------------------------------------------- 1 | # Default configuration for ppc-darwin-user 2 | 3 | CONFIG_GDBSTUB_XML=y 4 | -------------------------------------------------------------------------------- /default-configs/ppc-linux-user.mak: -------------------------------------------------------------------------------- 1 | # Default configuration for ppc-linux-user 2 | 3 | CONFIG_GDBSTUB_XML=y 4 | -------------------------------------------------------------------------------- /default-configs/ppc-softmmu.mak: -------------------------------------------------------------------------------- 1 | # Default configuration for ppc-softmmu 2 | 3 | include pci.mak 4 | CONFIG_GDBSTUB_XML=y 5 | CONFIG_ISA_MMIO=y 6 | CONFIG_ESCC=y 7 | CONFIG_M48T59=y 8 | CONFIG_VGA_PCI=y 9 | CONFIG_SERIAL=y 10 | CONFIG_I8254=y 11 | CONFIG_PCKBD=y 12 | CONFIG_FDC=y 13 | CONFIG_DMA=y 14 | CONFIG_OPENPIC=y 15 | CONFIG_PREP_PCI=y 16 | CONFIG_MACIO=y 17 | CONFIG_CUDA=y 18 | CONFIG_ADB=y 19 | CONFIG_MAC_NVRAM=y 20 | CONFIG_MAC_DBDMA=y 21 | CONFIG_HEATHROW_PIC=y 22 | CONFIG_GRACKLE_PCI=y 23 | CONFIG_UNIN_PCI=y 24 | CONFIG_DEC_PCI=y 25 | CONFIG_PPCE500_PCI=y 26 | CONFIG_IDE_ISA=y 27 | CONFIG_IDE_CMD646=y 28 | CONFIG_IDE_MACIO=y 29 | CONFIG_NE2000_ISA=y 30 | CONFIG_SOUND=y 31 | CONFIG_PFLASH_CFI01=y 32 | CONFIG_PFLASH_CFI02=y 33 | CONFIG_PTIMER=y 34 | -------------------------------------------------------------------------------- /default-configs/ppc64-linux-user.mak: -------------------------------------------------------------------------------- 1 | # Default configuration for ppc64-linux-user 2 | 3 | CONFIG_GDBSTUB_XML=y 4 | -------------------------------------------------------------------------------- /default-configs/ppc64-softmmu.mak: -------------------------------------------------------------------------------- 1 | # Default configuration for ppc64-softmmu 2 | 3 | include pci.mak 4 | CONFIG_GDBSTUB_XML=y 5 | CONFIG_ISA_MMIO=y 6 | CONFIG_ESCC=y 7 | CONFIG_M48T59=y 8 | CONFIG_VGA_PCI=y 9 | CONFIG_SERIAL=y 10 | CONFIG_I8254=y 11 | CONFIG_PCKBD=y 12 | CONFIG_FDC=y 13 | CONFIG_DMA=y 14 | CONFIG_OPENPIC=y 15 | CONFIG_PREP_PCI=y 16 | CONFIG_MACIO=y 17 | CONFIG_CUDA=y 18 | CONFIG_ADB=y 19 | CONFIG_MAC_NVRAM=y 20 | CONFIG_MAC_DBDMA=y 21 | CONFIG_HEATHROW_PIC=y 22 | CONFIG_GRACKLE_PCI=y 23 | CONFIG_UNIN_PCI=y 24 | CONFIG_DEC_PCI=y 25 | CONFIG_PPCE500_PCI=y 26 | CONFIG_IDE_ISA=y 27 | CONFIG_IDE_CMD646=y 28 | CONFIG_IDE_MACIO=y 29 | CONFIG_NE2000_ISA=y 30 | CONFIG_SOUND=y 31 | CONFIG_PFLASH_CFI01=y 32 | CONFIG_PFLASH_CFI02=y 33 | CONFIG_PTIMER=y 34 | -------------------------------------------------------------------------------- /default-configs/ppc64abi32-linux-user.mak: -------------------------------------------------------------------------------- 1 | # Default configuration for ppc64abi32-linux-user 2 | 3 | CONFIG_GDBSTUB_XML=y 4 | -------------------------------------------------------------------------------- /default-configs/ppcemb-softmmu.mak: -------------------------------------------------------------------------------- 1 | # Default configuration for ppcemb-softmmu 2 | 3 | include pci.mak 4 | CONFIG_GDBSTUB_XML=y 5 | CONFIG_ISA_MMIO=y 6 | CONFIG_ESCC=y 7 | CONFIG_M48T59=y 8 | CONFIG_VGA_PCI=y 9 | CONFIG_SERIAL=y 10 | CONFIG_I8254=y 11 | CONFIG_PCKBD=y 12 | CONFIG_FDC=y 13 | CONFIG_DMA=y 14 | CONFIG_OPENPIC=y 15 | CONFIG_PREP_PCI=y 16 | CONFIG_MACIO=y 17 | CONFIG_CUDA=y 18 | CONFIG_ADB=y 19 | CONFIG_MAC_NVRAM=y 20 | CONFIG_MAC_DBDMA=y 21 | CONFIG_HEATHROW_PIC=y 22 | CONFIG_GRACKLE_PCI=y 23 | CONFIG_UNIN_PCI=y 24 | CONFIG_DEC_PCI=y 25 | CONFIG_PPCE500_PCI=y 26 | CONFIG_IDE_ISA=y 27 | CONFIG_IDE_CMD646=y 28 | CONFIG_IDE_MACIO=y 29 | CONFIG_NE2000_ISA=y 30 | CONFIG_SOUND=y 31 | CONFIG_PFLASH_CFI01=y 32 | CONFIG_PFLASH_CFI02=y 33 | CONFIG_PTIMER=y 34 | -------------------------------------------------------------------------------- /default-configs/s390x-softmmu.mak: -------------------------------------------------------------------------------- 1 | CONFIG_VIRTIO=y 2 | -------------------------------------------------------------------------------- /default-configs/sh4-linux-user.mak: -------------------------------------------------------------------------------- 1 | # Default configuration for sh4-linux-user 2 | -------------------------------------------------------------------------------- /default-configs/sh4-softmmu.mak: -------------------------------------------------------------------------------- 1 | # Default configuration for sh4-softmmu 2 | 3 | include pci.mak 4 | CONFIG_SERIAL=y 5 | CONFIG_PTIMER=y 6 | CONFIG_PFLASH_CFI02=y 7 | CONFIG_ISA_MMIO=y 8 | -------------------------------------------------------------------------------- /default-configs/sh4eb-linux-user.mak: -------------------------------------------------------------------------------- 1 | # Default configuration for sh4eb-linux-user 2 | -------------------------------------------------------------------------------- /default-configs/sh4eb-softmmu.mak: -------------------------------------------------------------------------------- 1 | # Default configuration for sh4eb-softmmu 2 | 3 | include pci.mak 4 | CONFIG_SERIAL=y 5 | CONFIG_PTIMER=y 6 | CONFIG_PFLASH_CFI02=y 7 | CONFIG_ISA_MMIO=y 8 | -------------------------------------------------------------------------------- /default-configs/sparc-bsd-user.mak: -------------------------------------------------------------------------------- 1 | # Default configuration for sparc-bsd-user 2 | -------------------------------------------------------------------------------- /default-configs/sparc-linux-user.mak: -------------------------------------------------------------------------------- 1 | # Default configuration for sparc-linux-user 2 | -------------------------------------------------------------------------------- /default-configs/sparc-softmmu.mak: -------------------------------------------------------------------------------- 1 | # Default configuration for sparc-softmmu 2 | 3 | CONFIG_ECC=y 4 | CONFIG_ESP=y 5 | CONFIG_ESCC=y 6 | CONFIG_M48T59=y 7 | CONFIG_PTIMER=y 8 | CONFIG_FDC=y 9 | CONFIG_EMPTY_SLOT=y 10 | CONFIG_PCNET_COMMON=y 11 | -------------------------------------------------------------------------------- /default-configs/sparc32plus-linux-user.mak: -------------------------------------------------------------------------------- 1 | # Default configuration for sparc32plus-linux-user 2 | -------------------------------------------------------------------------------- /default-configs/sparc64-bsd-user.mak: -------------------------------------------------------------------------------- 1 | # Default configuration for sparc64-bsd-user 2 | -------------------------------------------------------------------------------- /default-configs/sparc64-linux-user.mak: -------------------------------------------------------------------------------- 1 | # Default configuration for sparc64-linux-user 2 | -------------------------------------------------------------------------------- /default-configs/sparc64-softmmu.mak: -------------------------------------------------------------------------------- 1 | # Default configuration for sparc64-softmmu 2 | 3 | include pci.mak 4 | CONFIG_ISA_MMIO=y 5 | CONFIG_M48T59=y 6 | CONFIG_PTIMER=y 7 | CONFIG_VGA_PCI=y 8 | CONFIG_SERIAL=y 9 | CONFIG_PARALLEL=y 10 | CONFIG_PCKBD=y 11 | CONFIG_FDC=y 12 | CONFIG_IDE_ISA=y 13 | CONFIG_IDE_CMD646=y 14 | -------------------------------------------------------------------------------- /default-configs/x86_64-bsd-user.mak: -------------------------------------------------------------------------------- 1 | # Default configuration for x86_64-bsd-user 2 | -------------------------------------------------------------------------------- /default-configs/x86_64-linux-user.mak: -------------------------------------------------------------------------------- 1 | # Default configuration for x86_64-linux-user 2 | -------------------------------------------------------------------------------- /default-configs/x86_64-softmmu.mak: -------------------------------------------------------------------------------- 1 | # Default configuration for x86_64-softmmu 2 | 3 | include pci.mak 4 | CONFIG_VGA_PCI=y 5 | CONFIG_VGA_ISA=y 6 | CONFIG_VMWARE_VGA=y 7 | CONFIG_VMMOUSE=y 8 | CONFIG_SERIAL=y 9 | CONFIG_PARALLEL=y 10 | CONFIG_I8254=y 11 | CONFIG_PCSPK=y 12 | CONFIG_PCKBD=y 13 | CONFIG_FDC=y 14 | CONFIG_ACPI=y 15 | CONFIG_APM=y 16 | CONFIG_DMA=y 17 | CONFIG_IDE_ISA=y 18 | CONFIG_IDE_PIIX=y 19 | CONFIG_NE2000_ISA=y 20 | CONFIG_PIIX_PCI=y 21 | CONFIG_SOUND=y 22 | CONFIG_HPET=y 23 | CONFIG_APPLESMC=y 24 | -------------------------------------------------------------------------------- /device_tree.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Header with function prototypes to help device tree manipulation using 3 | * libfdt. It also provides functions to read entries from device tree proc 4 | * interface. 5 | * 6 | * Copyright 2008 IBM Corporation. 7 | * Authors: Jerone Young 8 | * Hollis Blanchard 9 | * 10 | * This work is licensed under the GNU GPL license version 2 or later. 11 | * 12 | */ 13 | 14 | #ifndef __DEVICE_TREE_H__ 15 | #define __DEVICE_TREE_H__ 16 | 17 | void *load_device_tree(const char *filename_path, int *sizep); 18 | 19 | int qemu_devtree_setprop(void *fdt, const char *node_path, 20 | const char *property, void *val_array, int size); 21 | int qemu_devtree_setprop_cell(void *fdt, const char *node_path, 22 | const char *property, uint32_t val); 23 | int qemu_devtree_setprop_string(void *fdt, const char *node_path, 24 | const char *property, const char *string); 25 | 26 | #endif /* __DEVICE_TREE_H__ */ 27 | -------------------------------------------------------------------------------- /devices/iPhone1/config.xml: -------------------------------------------------------------------------------- 1 | 2 | iPhone1 3 | m68ap 4 | skin.xml 5 | iboot 6 | 0x18000000 7 | 8 | -------------------------------------------------------------------------------- /devices/iPhone1/landscape.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fossabot/qemu-ios/b3d8064980b1dac1884ff621e8fed7f5d823c795/devices/iPhone1/landscape.png -------------------------------------------------------------------------------- /devices/iPhone1/portrait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fossabot/qemu-ios/b3d8064980b1dac1884ff621e8fed7f5d823c795/devices/iPhone1/portrait.png -------------------------------------------------------------------------------- /devices/iPhone1/skin.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /envlist.h: -------------------------------------------------------------------------------- 1 | #ifndef ENVLIST_H 2 | #define ENVLIST_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | typedef struct envlist envlist_t; 9 | 10 | envlist_t *envlist_create(void); 11 | void envlist_free(envlist_t *); 12 | int envlist_setenv(envlist_t *, const char *); 13 | int envlist_unsetenv(envlist_t *, const char *); 14 | int envlist_parse_set(envlist_t *, const char *); 15 | int envlist_parse_unset(envlist_t *, const char *); 16 | char **envlist_to_environ(const envlist_t *, size_t *); 17 | 18 | #ifdef __cplusplus 19 | } 20 | #endif 21 | 22 | #endif /* ENVLIST_H */ 23 | -------------------------------------------------------------------------------- /hpet.h: -------------------------------------------------------------------------------- 1 | #ifndef __HPET__ 2 | #define __HPET__ 1 3 | 4 | 5 | 6 | struct hpet_info { 7 | unsigned long hi_ireqfreq; /* Hz */ 8 | unsigned long hi_flags; /* information */ 9 | unsigned short hi_hpet; 10 | unsigned short hi_timer; 11 | }; 12 | 13 | #define HPET_INFO_PERIODIC 0x0001 /* timer is periodic */ 14 | 15 | #define HPET_IE_ON _IO('h', 0x01) /* interrupt on */ 16 | #define HPET_IE_OFF _IO('h', 0x02) /* interrupt off */ 17 | #define HPET_INFO _IOR('h', 0x03, struct hpet_info) 18 | #define HPET_EPI _IO('h', 0x04) /* enable periodic */ 19 | #define HPET_DPI _IO('h', 0x05) /* disable periodic */ 20 | #define HPET_IRQFREQ _IOW('h', 0x6, unsigned long) /* IRQFREQ usec */ 21 | 22 | #endif /* !__HPET__ */ 23 | -------------------------------------------------------------------------------- /hw/9p.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Virtio 9p 3 | * 4 | * Copyright IBM, Corp. 2010 5 | * 6 | * Authors: 7 | * Aneesh Kumar K.V 8 | * 9 | * This work is licensed under the terms of the GNU GPL, version 2. See 10 | * the COPYING file in the top-level directory. 11 | * 12 | */ 13 | 14 | #ifndef QEMU_9P_H 15 | #define QEMU_9P_H 16 | 17 | typedef struct V9fsConf 18 | { 19 | /* tag name for the device */ 20 | char *tag; 21 | char *fsdev_id; 22 | } V9fsConf; 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /hw/a9mpcore.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Cortex-A9MPCore internal peripheral emulation. 3 | * 4 | * Copyright (c) 2009 CodeSourcery. 5 | * Written by Paul Brook 6 | * 7 | * This code is licenced under the GPL. 8 | */ 9 | 10 | /* 64 external IRQ lines. */ 11 | #define GIC_NIRQ 96 12 | #include "mpcore.c" 13 | 14 | static SysBusDeviceInfo mpcore_priv_info = { 15 | .init = mpcore_priv_init, 16 | .qdev.name = "a9mpcore_priv", 17 | .qdev.size = sizeof(mpcore_priv_state), 18 | .qdev.props = (Property[]) { 19 | DEFINE_PROP_UINT32("num-cpu", mpcore_priv_state, num_cpu, 1), 20 | DEFINE_PROP_END_OF_LIST(), 21 | } 22 | }; 23 | 24 | static void a9mpcore_register_devices(void) 25 | { 26 | sysbus_register_withprop(&mpcore_priv_info); 27 | } 28 | 29 | device_init(a9mpcore_register_devices) 30 | -------------------------------------------------------------------------------- /hw/apb_pci.h: -------------------------------------------------------------------------------- 1 | #ifndef APB_PCI_H 2 | #define APB_PCI_H 3 | 4 | #include "qemu-common.h" 5 | 6 | PCIBus *pci_apb_init(target_phys_addr_t special_base, 7 | target_phys_addr_t mem_base, 8 | qemu_irq *pic, PCIBus **bus2, PCIBus **bus3); 9 | #endif 10 | -------------------------------------------------------------------------------- /hw/apic.h: -------------------------------------------------------------------------------- 1 | #ifndef APIC_H 2 | #define APIC_H 3 | 4 | #include "qemu-common.h" 5 | 6 | /* apic.c */ 7 | void apic_deliver_irq(uint8_t dest, uint8_t dest_mode, 8 | uint8_t delivery_mode, 9 | uint8_t vector_num, uint8_t polarity, 10 | uint8_t trigger_mode); 11 | int apic_accept_pic_intr(DeviceState *s); 12 | void apic_deliver_pic_intr(DeviceState *s, int level); 13 | int apic_get_interrupt(DeviceState *s); 14 | void apic_reset_irq_delivered(void); 15 | int apic_get_irq_delivered(void); 16 | void cpu_set_apic_base(DeviceState *s, uint64_t val); 17 | uint64_t cpu_get_apic_base(DeviceState *s); 18 | void cpu_set_apic_tpr(DeviceState *s, uint8_t val); 19 | uint8_t cpu_get_apic_tpr(DeviceState *s); 20 | void apic_init_reset(DeviceState *s); 21 | void apic_sipi(DeviceState *s); 22 | 23 | /* pc.c */ 24 | int cpu_is_bsp(CPUState *env); 25 | DeviceState *cpu_get_current_apic(void); 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /hw/apm.h: -------------------------------------------------------------------------------- 1 | #ifndef APM_H 2 | #define APM_H 3 | 4 | #include 5 | #include "qemu-common.h" 6 | #include "hw.h" 7 | 8 | typedef void (*apm_ctrl_changed_t)(uint32_t val, void *arg); 9 | 10 | typedef struct APMState { 11 | uint8_t apmc; 12 | uint8_t apms; 13 | 14 | apm_ctrl_changed_t callback; 15 | void *arg; 16 | } APMState; 17 | 18 | void apm_init(APMState *s, apm_ctrl_changed_t callback, void *arg); 19 | 20 | extern const VMStateDescription vmstate_apm; 21 | 22 | #endif /* APM_H */ 23 | -------------------------------------------------------------------------------- /hw/audiodev.h: -------------------------------------------------------------------------------- 1 | /* es1370.c */ 2 | int es1370_init(PCIBus *bus); 3 | 4 | /* sb16.c */ 5 | int SB16_init(qemu_irq *pic); 6 | 7 | /* adlib.c */ 8 | int Adlib_init(qemu_irq *pic); 9 | 10 | /* gus.c */ 11 | int GUS_init(qemu_irq *pic); 12 | 13 | /* ac97.c */ 14 | int ac97_init(PCIBus *buf); 15 | 16 | /* cs4231a.c */ 17 | int cs4231a_init(qemu_irq *pic); 18 | 19 | /* intel-hda.c + hda-audio.c */ 20 | int intel_hda_and_codec_init(PCIBus *bus); 21 | -------------------------------------------------------------------------------- /hw/bitbang_i2c.h: -------------------------------------------------------------------------------- 1 | #ifndef BITBANG_I2C_H 2 | #define BITBANG_I2C_H 3 | 4 | #include "i2c.h" 5 | 6 | typedef struct bitbang_i2c_interface bitbang_i2c_interface; 7 | 8 | #define BITBANG_I2C_SDA 0 9 | #define BITBANG_I2C_SCL 1 10 | 11 | bitbang_i2c_interface *bitbang_i2c_init(i2c_bus *bus); 12 | int bitbang_i2c_set(bitbang_i2c_interface *i2c, int line, int level); 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /hw/cris-boot.h: -------------------------------------------------------------------------------- 1 | 2 | struct cris_load_info 3 | { 4 | const char *image_filename; 5 | const char *cmdline; 6 | int image_size; 7 | 8 | target_phys_addr_t entry; 9 | }; 10 | 11 | void cris_load_image(CPUState *env, struct cris_load_info *li); 12 | -------------------------------------------------------------------------------- /hw/dec_pci.h: -------------------------------------------------------------------------------- 1 | #ifndef DEC_PCI_H 2 | #define DEC_PCI_H 3 | 4 | #include "qemu-common.h" 5 | 6 | PCIBus *pci_dec_21154_init(PCIBus *parent_bus, int devfn); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /hw/ds1225y.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fossabot/qemu-ios/b3d8064980b1dac1884ff621e8fed7f5d823c795/hw/ds1225y.c -------------------------------------------------------------------------------- /hw/empty_slot.h: -------------------------------------------------------------------------------- 1 | /* empty_slot.c */ 2 | void empty_slot_init(target_phys_addr_t addr, uint64_t slot_size); 3 | -------------------------------------------------------------------------------- /hw/escc.h: -------------------------------------------------------------------------------- 1 | /* escc.c */ 2 | #define ESCC_SIZE 4 3 | int escc_init(target_phys_addr_t base, qemu_irq irqA, qemu_irq irqB, 4 | CharDriverState *chrA, CharDriverState *chrB, 5 | int clock, int it_shift); 6 | 7 | void slavio_serial_ms_kbd_init(target_phys_addr_t base, qemu_irq irq, 8 | int disabled, int clock, int it_shift); 9 | -------------------------------------------------------------------------------- /hw/esp.h: -------------------------------------------------------------------------------- 1 | #ifndef QEMU_HW_ESP_H 2 | #define QEMU_HW_ESP_H 3 | 4 | /* esp.c */ 5 | #define ESP_MAX_DEVS 7 6 | typedef void (*ESPDMAMemoryReadWriteFunc)(void *opaque, uint8_t *buf, int len); 7 | void esp_init(target_phys_addr_t espaddr, int it_shift, 8 | ESPDMAMemoryReadWriteFunc dma_memory_read, 9 | ESPDMAMemoryReadWriteFunc dma_memory_write, 10 | void *dma_opaque, qemu_irq irq, qemu_irq *reset, 11 | qemu_irq *dma_enable); 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /hw/etraxfs_dma.h: -------------------------------------------------------------------------------- 1 | struct etraxfs_dma_client 2 | { 3 | /* DMA controller. */ 4 | int channel; 5 | void *ctrl; 6 | 7 | /* client. */ 8 | struct 9 | { 10 | int (*push)(void *opaque, unsigned char *buf, int len); 11 | void (*pull)(void *opaque); 12 | void *opaque; 13 | } client; 14 | }; 15 | 16 | void *etraxfs_dmac_init(target_phys_addr_t base, int nr_channels); 17 | void etraxfs_dmac_connect(void *opaque, int channel, qemu_irq *line, 18 | int input); 19 | void etraxfs_dmac_connect_client(void *opaque, int c, 20 | struct etraxfs_dma_client *cl); 21 | int etraxfs_dmac_input(struct etraxfs_dma_client *client, 22 | void *buf, int len, int eop); 23 | -------------------------------------------------------------------------------- /hw/event_notifier.h: -------------------------------------------------------------------------------- 1 | #ifndef QEMU_EVENT_NOTIFIER_H 2 | #define QEMU_EVENT_NOTIFIER_H 3 | 4 | #include "qemu-common.h" 5 | 6 | struct EventNotifier { 7 | int fd; 8 | }; 9 | 10 | int event_notifier_init(EventNotifier *, int active); 11 | void event_notifier_cleanup(EventNotifier *); 12 | int event_notifier_get_fd(EventNotifier *); 13 | int event_notifier_test_and_clear(EventNotifier *); 14 | int event_notifier_test(EventNotifier *); 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /hw/fdc.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fossabot/qemu-ios/b3d8064980b1dac1884ff621e8fed7f5d823c795/hw/fdc.c -------------------------------------------------------------------------------- /hw/fdc.h: -------------------------------------------------------------------------------- 1 | #ifndef HW_FDC_H 2 | #define HW_FDC_H 3 | 4 | #include "isa.h" 5 | #include "blockdev.h" 6 | 7 | /* fdc.c */ 8 | #define MAX_FD 2 9 | 10 | static inline void fdctrl_init_isa(DriveInfo **fds) 11 | { 12 | ISADevice *dev; 13 | 14 | dev = isa_try_create("isa-fdc"); 15 | if (!dev) { 16 | return; 17 | } 18 | if (fds[0]) { 19 | qdev_prop_set_drive_nofail(&dev->qdev, "driveA", fds[0]->bdrv); 20 | } 21 | if (fds[1]) { 22 | qdev_prop_set_drive_nofail(&dev->qdev, "driveB", fds[1]->bdrv); 23 | } 24 | qdev_init_nofail(&dev->qdev); 25 | } 26 | 27 | void fdctrl_init_sysbus(qemu_irq irq, int dma_chann, 28 | target_phys_addr_t mmio_base, DriveInfo **fds); 29 | void sun4m_fdctrl_init(qemu_irq irq, target_phys_addr_t io_base, 30 | DriveInfo **fds, qemu_irq *fdc_tc); 31 | #endif 32 | -------------------------------------------------------------------------------- /hw/framebuffer.h: -------------------------------------------------------------------------------- 1 | #ifndef QEMU_FRAMEBUFFER_H 2 | #define QEMU_FRAMEBUFFER_H 3 | 4 | /* Framebuffer device helper routines. */ 5 | 6 | typedef void (*drawfn)(void *, uint8_t *, const uint8_t *, int, int); 7 | 8 | void framebuffer_update_display( 9 | DisplayState *ds, 10 | target_phys_addr_t base, 11 | int cols, 12 | int rows, 13 | int src_width, 14 | int dest_row_pitch, 15 | int dest_col_pitch, 16 | int invalidate, 17 | drawfn fn, 18 | void *opaque, 19 | int *first_row, 20 | int *last_row); 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /hw/ioapic.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ioapic.c IOAPIC emulation logic 3 | * 4 | * Copyright (c) 2011 Jan Kiszka, Siemens AG 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, see . 18 | */ 19 | 20 | void ioapic_eoi_broadcast(int vector); 21 | -------------------------------------------------------------------------------- /hw/ioh3420.h: -------------------------------------------------------------------------------- 1 | #ifndef QEMU_IOH3420_H 2 | #define QEMU_IOH3420_H 3 | 4 | #include "pcie_port.h" 5 | 6 | PCIESlot *ioh3420_init(PCIBus *bus, int devfn, bool multifunction, 7 | const char *bus_name, pci_map_irq_fn map_irq, 8 | uint8_t port, uint8_t chassis, uint16_t slot); 9 | 10 | #endif /* QEMU_IOH3420_H */ 11 | -------------------------------------------------------------------------------- /hw/ipad1g.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPAD1G_H 2 | #define _IPAD1G_H 3 | 4 | #define RAM_BASE_ADDR 0x40000000 5 | #define RAMEnd 0x60000000 6 | #define LLB_LOAD_ADDR 0x84000000 7 | #define IBOOT_LOAD_ADDR 0x5FF00000 8 | #define RAM_SIZE (RAMEnd - RAM_BASE_ADDR) 9 | 10 | //#define LargeMemoryStart 0x46000000 11 | #define RAM_HIGH_ADDR 0xC0000000 12 | 13 | #define CLCD_BASE_ADDR 0x89100000 14 | #define CLCD_FRAMEBUFFER 0x4F700000 15 | 16 | typedef struct ipad1g_clcd_s { 17 | DisplayState *ds; 18 | uint16_t palette[256]; 19 | int invalidate; 20 | uint32_t lcd_ctrl; 21 | qemu_irq irq; 22 | } ipad1g_clcd_s; 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /hw/irq.h: -------------------------------------------------------------------------------- 1 | #ifndef QEMU_IRQ_H 2 | #define QEMU_IRQ_H 3 | 4 | /* Generic IRQ/GPIO pin infrastructure. */ 5 | 6 | typedef void (*qemu_irq_handler)(void *opaque, int n, int level); 7 | 8 | void qemu_set_irq(qemu_irq irq, int level); 9 | 10 | static inline void qemu_irq_raise(qemu_irq irq) 11 | { 12 | qemu_set_irq(irq, 1); 13 | } 14 | 15 | static inline void qemu_irq_lower(qemu_irq irq) 16 | { 17 | qemu_set_irq(irq, 0); 18 | } 19 | 20 | static inline void qemu_irq_pulse(qemu_irq irq) 21 | { 22 | qemu_set_irq(irq, 1); 23 | qemu_set_irq(irq, 0); 24 | } 25 | 26 | /* Returns an array of N IRQs. */ 27 | qemu_irq *qemu_allocate_irqs(qemu_irq_handler handler, void *opaque, int n); 28 | void qemu_free_irqs(qemu_irq *s); 29 | 30 | /* Returns a new IRQ with opposite polarity. */ 31 | qemu_irq qemu_irq_invert(qemu_irq irq); 32 | 33 | /* Returns a new IRQ which feeds into both the passed IRQs */ 34 | qemu_irq qemu_irq_split(qemu_irq irq1, qemu_irq irq2); 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /hw/jazz_led.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fossabot/qemu-ios/b3d8064980b1dac1884ff621e8fed7f5d823c795/hw/jazz_led.c -------------------------------------------------------------------------------- /hw/kvmclock.h: -------------------------------------------------------------------------------- 1 | /* 2 | * QEMU KVM support, paravirtual clock device 3 | * 4 | * Copyright (C) 2011 Siemens AG 5 | * 6 | * Authors: 7 | * Jan Kiszka 8 | * 9 | * This work is licensed under the terms of the GNU GPL version 2. 10 | * See the COPYING file in the top-level directory. 11 | * 12 | */ 13 | 14 | void kvmclock_create(void); 15 | -------------------------------------------------------------------------------- /hw/lm32.h: -------------------------------------------------------------------------------- 1 | 2 | #include "qemu-common.h" 3 | 4 | static inline DeviceState *lm32_pic_init(qemu_irq cpu_irq) 5 | { 6 | DeviceState *dev; 7 | SysBusDevice *d; 8 | 9 | dev = qdev_create(NULL, "lm32-pic"); 10 | qdev_init_nofail(dev); 11 | d = sysbus_from_qdev(dev); 12 | sysbus_connect_irq(d, 0, cpu_irq); 13 | 14 | return dev; 15 | } 16 | 17 | static inline DeviceState *lm32_juart_init(void) 18 | { 19 | DeviceState *dev; 20 | 21 | dev = qdev_create(NULL, "lm32-juart"); 22 | qdev_init_nofail(dev); 23 | 24 | return dev; 25 | } 26 | -------------------------------------------------------------------------------- /hw/lm32_juart.h: -------------------------------------------------------------------------------- 1 | #ifndef QEMU_HW_LM32_JUART_H 2 | #define QEMU_HW_LM32_JUART_H 3 | 4 | #include "qemu-common.h" 5 | 6 | uint32_t lm32_juart_get_jtx(DeviceState *d); 7 | uint32_t lm32_juart_get_jrx(DeviceState *d); 8 | void lm32_juart_set_jtx(DeviceState *d, uint32_t jtx); 9 | void lm32_juart_set_jrx(DeviceState *d, uint32_t jrx); 10 | 11 | #endif /* QEMU_HW_LM32_JUART_H */ 12 | -------------------------------------------------------------------------------- /hw/lm32_pic.h: -------------------------------------------------------------------------------- 1 | #ifndef QEMU_HW_LM32_PIC_H 2 | #define QEMU_HW_LM32_PIC_H 3 | 4 | #include "qemu-common.h" 5 | 6 | uint32_t lm32_pic_get_ip(DeviceState *d); 7 | uint32_t lm32_pic_get_im(DeviceState *d); 8 | void lm32_pic_set_ip(DeviceState *d, uint32_t ip); 9 | void lm32_pic_set_im(DeviceState *d, uint32_t im); 10 | 11 | #endif /* QEMU_HW_LM32_PIC_H */ 12 | -------------------------------------------------------------------------------- /hw/mc146818rtc.h: -------------------------------------------------------------------------------- 1 | #ifndef MC146818RTC_H 2 | #define MC146818RTC_H 3 | 4 | #include "isa.h" 5 | 6 | #define RTC_ISA_IRQ 8 7 | 8 | ISADevice *rtc_init(int base_year, qemu_irq intercept_irq); 9 | void rtc_set_memory(ISADevice *dev, int addr, int val); 10 | void rtc_set_date(ISADevice *dev, const struct tm *tm); 11 | 12 | #endif /* !MC146818RTC_H */ 13 | -------------------------------------------------------------------------------- /hw/mcf.h: -------------------------------------------------------------------------------- 1 | #ifndef HW_MCF_H 2 | #define HW_MCF_H 3 | /* Motorola ColdFire device prototypes. */ 4 | 5 | /* mcf_uart.c */ 6 | uint32_t mcf_uart_read(void *opaque, target_phys_addr_t addr); 7 | void mcf_uart_write(void *opaque, target_phys_addr_t addr, uint32_t val); 8 | void *mcf_uart_init(qemu_irq irq, CharDriverState *chr); 9 | void mcf_uart_mm_init(target_phys_addr_t base, qemu_irq irq, 10 | CharDriverState *chr); 11 | 12 | /* mcf_intc.c */ 13 | qemu_irq *mcf_intc_init(target_phys_addr_t base, CPUState *env); 14 | 15 | /* mcf_fec.c */ 16 | void mcf_fec_init(NICInfo *nd, target_phys_addr_t base, qemu_irq *irq); 17 | 18 | /* mcf5206.c */ 19 | qemu_irq *mcf5206_init(uint32_t base, CPUState *env); 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /hw/mips-bios.h: -------------------------------------------------------------------------------- 1 | #include "cpu.h" 2 | 3 | #define BIOS_SIZE (4 * 1024 * 1024) 4 | #ifdef TARGET_WORDS_BIGENDIAN 5 | #define BIOS_FILENAME "mips_bios.bin" 6 | #else 7 | #define BIOS_FILENAME "mipsel_bios.bin" 8 | #endif 9 | -------------------------------------------------------------------------------- /hw/mips_cpudevs.h: -------------------------------------------------------------------------------- 1 | #ifndef HW_MIPS_CPUDEVS_H 2 | #define HW_MIPS_CPUDEVS_H 3 | /* Definitions for MIPS CPU internal devices. */ 4 | 5 | /* mips_addr.c */ 6 | uint64_t cpu_mips_kseg0_to_phys(void *opaque, uint64_t addr); 7 | uint64_t cpu_mips_phys_to_kseg0(void *opaque, uint64_t addr); 8 | 9 | /* mips_int.c */ 10 | void cpu_mips_irq_init_cpu(CPUState *env); 11 | 12 | /* mips_timer.c */ 13 | void cpu_mips_clock_init(CPUState *); 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /hw/msmouse.h: -------------------------------------------------------------------------------- 1 | /* msmouse.c */ 2 | CharDriverState *qemu_chr_open_msmouse(QemuOpts *opts); 3 | -------------------------------------------------------------------------------- /hw/multiboot.h: -------------------------------------------------------------------------------- 1 | #ifndef QEMU_MULTIBOOT_H 2 | #define QEMU_MULTIBOOT_H 3 | 4 | int load_multiboot(void *fw_cfg, 5 | FILE *f, 6 | const char *kernel_filename, 7 | const char *initrd_filename, 8 | const char *kernel_cmdline, 9 | int kernel_file_size, 10 | uint8_t *header); 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /hw/openpic.h: -------------------------------------------------------------------------------- 1 | #if !defined(__OPENPIC_H__) 2 | #define __OPENPIC_H__ 3 | 4 | /* OpenPIC have 5 outputs per CPU connected and one IRQ out single output */ 5 | enum { 6 | OPENPIC_OUTPUT_INT = 0, /* IRQ */ 7 | OPENPIC_OUTPUT_CINT, /* critical IRQ */ 8 | OPENPIC_OUTPUT_MCK, /* Machine check event */ 9 | OPENPIC_OUTPUT_DEBUG, /* Inconditional debug event */ 10 | OPENPIC_OUTPUT_RESET, /* Core reset event */ 11 | OPENPIC_OUTPUT_NB, 12 | }; 13 | 14 | qemu_irq *openpic_init (PCIBus *bus, int *pmem_index, int nb_cpus, 15 | qemu_irq **irqs, qemu_irq irq_out); 16 | qemu_irq *mpic_init (target_phys_addr_t base, int nb_cpus, 17 | qemu_irq **irqs, qemu_irq irq_out); 18 | #endif /* __OPENPIC_H__ */ 19 | -------------------------------------------------------------------------------- /hw/pm_smbus.h: -------------------------------------------------------------------------------- 1 | #ifndef PM_SMBUS_H 2 | #define PM_SMBUS_H 3 | 4 | typedef struct PMSMBus { 5 | i2c_bus *smbus; 6 | 7 | uint8_t smb_stat; 8 | uint8_t smb_ctl; 9 | uint8_t smb_cmd; 10 | uint8_t smb_addr; 11 | uint8_t smb_data0; 12 | uint8_t smb_data1; 13 | uint8_t smb_data[32]; 14 | uint8_t smb_index; 15 | } PMSMBus; 16 | 17 | void pm_smbus_init(DeviceState *parent, PMSMBus *smb); 18 | void smb_ioport_writeb(void *opaque, uint32_t addr, uint32_t val); 19 | uint32_t smb_ioport_readb(void *opaque, uint32_t addr); 20 | 21 | #endif /* !PM_SMBUS_H */ 22 | -------------------------------------------------------------------------------- /hw/ppc440.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Qemu PowerPC 440 board emualtion 3 | * 4 | * Copyright 2007 IBM Corporation. 5 | * Authors: Jerone Young 6 | * Christian Ehrhardt 7 | * 8 | * This work is licensed under the GNU GPL licence version 2 or later 9 | * 10 | */ 11 | 12 | #ifndef QEMU_PPC440_H 13 | #define QEMU_PPC440_H 14 | 15 | #include "hw.h" 16 | 17 | CPUState *ppc440ep_init(ram_addr_t *ram_size, PCIBus **pcip, 18 | const unsigned int pci_irq_nrs[4], int do_init, 19 | const char *cpu_model); 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /hw/ppce500.h: -------------------------------------------------------------------------------- 1 | /* 2 | * QEMU PowerPC E500 emulation shared definitions 3 | * 4 | * Copyright (C) 2009 Freescale Semiconductor, Inc. All rights reserved. 5 | * 6 | * Author: Yu Liu, 7 | * 8 | * This file is derived from hw/ppc440.h 9 | * the copyright for that material belongs to the original owners. 10 | * 11 | * This is free software; you can redistribute it and/or modify 12 | * it under the terms of the GNU General Public License as published by 13 | * the Free Software Foundation; either version 2 of the License, or 14 | * (at your option) any later version. 15 | */ 16 | 17 | #if !defined(PPC_E500_H) 18 | #define PPC_E500_H 19 | 20 | PCIBus *ppce500_pci_init(qemu_irq *pic, target_phys_addr_t registers); 21 | 22 | #endif /* !defined(PPC_E500_H) */ 23 | -------------------------------------------------------------------------------- /hw/prep_pci.h: -------------------------------------------------------------------------------- 1 | #ifndef QEMU_PREP_PCI_H 2 | #define QEMU_PREP_PCI_H 3 | 4 | #include "qemu-common.h" 5 | 6 | PCIBus *pci_prep_init(qemu_irq *pic); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /hw/primecell.h: -------------------------------------------------------------------------------- 1 | #ifndef PRIMECELL_H 2 | #define PRIMECELL_H 3 | 4 | /* Declarations for ARM PrimeCell based periperals. */ 5 | /* Also includes some devices that are currently only used by the 6 | ARM boards. */ 7 | 8 | /* pl080.c */ 9 | void *pl080_init(uint32_t base, qemu_irq irq, int nchannels); 10 | 11 | /* pl192.c */ 12 | DeviceState *pl192_init(target_phys_addr_t base, 13 | int instance, ...); 14 | void pl192_chain(void *first, void *next); 15 | 16 | /* arm_sysctl.c */ 17 | void arm_sysctl_init(uint32_t base, uint32_t sys_id, uint32_t proc_id); 18 | 19 | /* arm_sysctl GPIO lines */ 20 | #define ARM_SYSCTL_GPIO_MMC_WPROT 0 21 | #define ARM_SYSCTL_GPIO_MMC_CARDIN 1 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /hw/ps2.h: -------------------------------------------------------------------------------- 1 | /* ps2.c */ 2 | void *ps2_kbd_init(void (*update_irq)(void *, int), void *update_arg); 3 | void *ps2_mouse_init(void (*update_irq)(void *, int), void *update_arg); 4 | void ps2_write_mouse(void *, int val); 5 | void ps2_write_keyboard(void *, int val); 6 | uint32_t ps2_read_data(void *); 7 | void ps2_queue(void *, int b); 8 | void ps2_keyboard_set_translation(void *opaque, int mode); 9 | void ps2_mouse_fake_event(void *opaque); 10 | -------------------------------------------------------------------------------- /hw/qdev-addr.c: -------------------------------------------------------------------------------- 1 | #include "qdev.h" 2 | #include "qdev-addr.h" 3 | #include "targphys.h" 4 | 5 | /* --- target physical address --- */ 6 | 7 | static int parse_taddr(DeviceState *dev, Property *prop, const char *str) 8 | { 9 | target_phys_addr_t *ptr = qdev_get_prop_ptr(dev, prop); 10 | 11 | *ptr = strtoull(str, NULL, 16); 12 | return 0; 13 | } 14 | 15 | static int print_taddr(DeviceState *dev, Property *prop, char *dest, size_t len) 16 | { 17 | target_phys_addr_t *ptr = qdev_get_prop_ptr(dev, prop); 18 | return snprintf(dest, len, "0x" TARGET_FMT_plx, *ptr); 19 | } 20 | 21 | PropertyInfo qdev_prop_taddr = { 22 | .name = "taddr", 23 | .type = PROP_TYPE_TADDR, 24 | .size = sizeof(target_phys_addr_t), 25 | .parse = parse_taddr, 26 | .print = print_taddr, 27 | }; 28 | 29 | void qdev_prop_set_taddr(DeviceState *dev, const char *name, target_phys_addr_t value) 30 | { 31 | qdev_prop_set(dev, name, &value, PROP_TYPE_TADDR); 32 | } 33 | -------------------------------------------------------------------------------- /hw/qdev-addr.h: -------------------------------------------------------------------------------- 1 | #define DEFINE_PROP_TADDR(_n, _s, _f, _d) \ 2 | DEFINE_PROP_DEFAULT(_n, _s, _f, _d, qdev_prop_taddr, target_phys_addr_t) 3 | 4 | extern PropertyInfo qdev_prop_taddr; 5 | void qdev_prop_set_taddr(DeviceState *dev, const char *name, target_phys_addr_t value); 6 | -------------------------------------------------------------------------------- /hw/sh7750_regnames.h: -------------------------------------------------------------------------------- 1 | #ifndef _SH7750_REGNAMES_H 2 | #define _SH7750_REGNAMES_H 3 | 4 | const char *regname(uint32_t addr); 5 | 6 | #endif /* _SH7750_REGNAMES_H */ 7 | -------------------------------------------------------------------------------- /hw/sharpsl.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Common declarations for the Zaurii. 3 | * 4 | * This file is licensed under the GNU GPL. 5 | */ 6 | #ifndef QEMU_SHARPSL_H 7 | #define QEMU_SHARPSL_H 8 | 9 | #define zaurus_printf(format, ...) \ 10 | fprintf(stderr, "%s: " format, __FUNCTION__, ##__VA_ARGS__) 11 | 12 | /* zaurus.c */ 13 | 14 | #define SL_PXA_PARAM_BASE 0xa0000a00 15 | void sl_bootparam_write(target_phys_addr_t ptr); 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /hw/sparc32_dma.h: -------------------------------------------------------------------------------- 1 | #ifndef SPARC32_DMA_H 2 | #define SPARC32_DMA_H 3 | 4 | /* sparc32_dma.c */ 5 | void ledma_memory_read(void *opaque, target_phys_addr_t addr, 6 | uint8_t *buf, int len, int do_bswap); 7 | void ledma_memory_write(void *opaque, target_phys_addr_t addr, 8 | uint8_t *buf, int len, int do_bswap); 9 | void espdma_memory_read(void *opaque, uint8_t *buf, int len); 10 | void espdma_memory_write(void *opaque, uint8_t *buf, int len); 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /hw/syborg.h: -------------------------------------------------------------------------------- 1 | #ifndef _SYBORG_H 2 | #define _SYBORG_H 3 | 4 | #define SYBORG_ID_PLATFORM 0xc51d1000 5 | #define SYBORG_ID_INT 0xc51d0000 6 | #define SYBORG_ID_SERIAL 0xc51d0001 7 | #define SYBORG_ID_KEYBOARD 0xc51d0002 8 | #define SYBORG_ID_TIMER 0xc51d0003 9 | #define SYBORG_ID_RTC 0xc51d0004 10 | #define SYBORG_ID_MOUSE 0xc51d0005 11 | #define SYBORG_ID_TOUCHSCREEN 0xc51d0006 12 | #define SYBORG_ID_FRAMEBUFFER 0xc51d0007 13 | #define SYBORG_ID_HOSTFS 0xc51d0008 14 | #define SYBORG_ID_SNAPSHOT 0xc51d0009 15 | #define SYBORG_ID_VIRTIO 0xc51d000a 16 | #define SYBORG_ID_NAND 0xc51d000b 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /hw/tc6393xb_template.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fossabot/qemu-ios/b3d8064980b1dac1884ff621e8fed7f5d823c795/hw/tc6393xb_template.h -------------------------------------------------------------------------------- /hw/usb-ohci.h: -------------------------------------------------------------------------------- 1 | #ifndef QEMU_USB_OHCI_H 2 | #define QEMU_USB_OHCI_H 3 | 4 | #include "qemu-common.h" 5 | 6 | void usb_ohci_init_pci(struct PCIBus *bus, int devfn); 7 | 8 | #endif 9 | 10 | -------------------------------------------------------------------------------- /hw/usb-uhci.h: -------------------------------------------------------------------------------- 1 | #ifndef QEMU_USB_UHCI_H 2 | #define QEMU_USB_UHCI_H 3 | 4 | #include "qemu-common.h" 5 | 6 | void usb_uhci_piix3_init(PCIBus *bus, int devfn); 7 | void usb_uhci_piix4_init(PCIBus *bus, int devfn); 8 | void usb_uhci_vt82c686b_init(PCIBus *bus, int devfn); 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /hw/usb_synopsys.h: -------------------------------------------------------------------------------- 1 | #ifndef HW_USB_SYNOPSYS 2 | #define HW_USB_SYNOPSYS 3 | 4 | /* 5 | * Synopsys DesignWareCore for USB OTG. 6 | * 7 | * Copyright (c) 2011 Richard Ian Taylor. 8 | * 9 | * This library is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU Lesser General Public 11 | * License as published by the Free Software Foundation; either 12 | * version 2 of the License, or (at your option) any later version. 13 | * 14 | * This library is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | * Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public 20 | * License along with this library; if not, see . 21 | */ 22 | 23 | struct SysBusDeviceInfo; 24 | 25 | #endif //HW_USB_SYNOPSYS 26 | -------------------------------------------------------------------------------- /hw/vhost_net.h: -------------------------------------------------------------------------------- 1 | #ifndef VHOST_NET_H 2 | #define VHOST_NET_H 3 | 4 | #include "net.h" 5 | 6 | struct vhost_net; 7 | typedef struct vhost_net VHostNetState; 8 | 9 | VHostNetState *vhost_net_init(VLANClientState *backend, int devfd, bool force); 10 | 11 | bool vhost_net_query(VHostNetState *net, VirtIODevice *dev); 12 | int vhost_net_start(VHostNetState *net, VirtIODevice *dev); 13 | void vhost_net_stop(VHostNetState *net, VirtIODevice *dev); 14 | 15 | void vhost_net_cleanup(VHostNetState *net); 16 | 17 | unsigned vhost_net_get_features(VHostNetState *net, unsigned features); 18 | void vhost_net_ack_features(VHostNetState *net, unsigned features); 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /hw/virtio-9p-debug.h: -------------------------------------------------------------------------------- 1 | #ifndef _QEMU_VIRTIO_9P_DEBUG_H 2 | #define _QEMU_VIRTIO_9P_DEBUG_H 3 | 4 | void pprint_pdu(V9fsPDU *pdu); 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /hw/vmport.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fossabot/qemu-ios/b3d8064980b1dac1884ff621e8fed7f5d823c795/hw/vmport.c -------------------------------------------------------------------------------- /hw/vmware_vga.h: -------------------------------------------------------------------------------- 1 | #ifndef QEMU_VMWARE_VGA_H 2 | #define QEMU_VMWARE_VGA_H 3 | 4 | #include "qemu-common.h" 5 | 6 | /* vmware_vga.c */ 7 | static inline bool pci_vmsvga_init(PCIBus *bus) 8 | { 9 | PCIDevice *dev; 10 | 11 | dev = pci_try_create(bus, -1, "vmware-svga"); 12 | if (!dev || qdev_init(&dev->qdev) < 0) { 13 | return false; 14 | } else { 15 | return true; 16 | } 17 | } 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /hw/vt82c686.h: -------------------------------------------------------------------------------- 1 | #ifndef HW_VT82C686_H 2 | #define HW_VT82C686_H 3 | 4 | /* vt82c686.c */ 5 | int vt82c686b_init(PCIBus * bus, int devfn); 6 | void vt82c686b_ac97_init(PCIBus *bus, int devfn); 7 | void vt82c686b_mc97_init(PCIBus *bus, int devfn); 8 | i2c_bus *vt82c686b_pm_init(PCIBus *bus, int devfn, uint32_t smb_io_base, 9 | qemu_irq sci_irq); 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /hw/xen.h: -------------------------------------------------------------------------------- 1 | #ifndef QEMU_HW_XEN_H 2 | #define QEMU_HW_XEN_H 1 3 | /* 4 | * public xen header 5 | * stuff needed outside xen-*.c, i.e. interfaces to qemu. 6 | * must not depend on any xen headers being present in 7 | * /usr/include/xen, so it can be included unconditionally. 8 | */ 9 | #include 10 | 11 | /* xen-machine.c */ 12 | enum xen_mode { 13 | XEN_EMULATE = 0, // xen emulation, using xenner (default) 14 | XEN_CREATE, // create xen domain 15 | XEN_ATTACH // attach to xen domain created by xend 16 | }; 17 | 18 | extern uint32_t xen_domid; 19 | extern enum xen_mode xen_mode; 20 | 21 | #endif /* QEMU_HW_XEN_H */ 22 | -------------------------------------------------------------------------------- /hw/xen_common.h: -------------------------------------------------------------------------------- 1 | #ifndef QEMU_HW_XEN_COMMON_H 2 | #define QEMU_HW_XEN_COMMON_H 1 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | #include 9 | #include 10 | 11 | #include "hw.h" 12 | #include "xen.h" 13 | #include "qemu-queue.h" 14 | 15 | /* 16 | * tweaks needed to build with different xen versions 17 | * 0x00030205 -> 3.1.0 18 | * 0x00030207 -> 3.2.0 19 | * 0x00030208 -> unstable 20 | */ 21 | #include 22 | #if __XEN_LATEST_INTERFACE_VERSION__ < 0x00030205 23 | # define evtchn_port_or_error_t int 24 | #endif 25 | #if __XEN_LATEST_INTERFACE_VERSION__ < 0x00030207 26 | # define xc_map_foreign_pages xc_map_foreign_batch 27 | #endif 28 | #if __XEN_LATEST_INTERFACE_VERSION__ < 0x00030208 29 | # define xen_mb() mb() 30 | # define xen_rmb() rmb() 31 | # define xen_wmb() wmb() 32 | #endif 33 | 34 | #endif /* QEMU_HW_XEN_COMMON_H */ 35 | -------------------------------------------------------------------------------- /hw/xen_domainbuild.h: -------------------------------------------------------------------------------- 1 | #ifndef QEMU_HW_XEN_DOMAINBUILD_H 2 | #define QEMU_HW_XEN_DOMAINBUILD_H 1 3 | 4 | #include "xen_common.h" 5 | 6 | int xenstore_domain_init1(const char *kernel, const char *ramdisk, 7 | const char *cmdline); 8 | int xenstore_domain_init2(int xenstore_port, int xenstore_mfn, 9 | int console_port, int console_mfn); 10 | int xen_domain_build_pv(const char *kernel, const char *ramdisk, 11 | const char *cmdline); 12 | 13 | #endif /* QEMU_HW_XEN_DOMAINBUILD_H */ 14 | -------------------------------------------------------------------------------- /hw/xio3130_downstream.h: -------------------------------------------------------------------------------- 1 | #ifndef QEMU_XIO3130_DOWNSTREAM_H 2 | #define QEMU_XIO3130_DOWNSTREAM_H 3 | 4 | #include "pcie_port.h" 5 | 6 | PCIESlot *xio3130_downstream_init(PCIBus *bus, int devfn, bool multifunction, 7 | const char *bus_name, pci_map_irq_fn map_irq, 8 | uint8_t port, uint8_t chassis, 9 | uint16_t slot); 10 | 11 | #endif /* QEMU_XIO3130_DOWNSTREAM_H */ 12 | -------------------------------------------------------------------------------- /hw/xio3130_upstream.h: -------------------------------------------------------------------------------- 1 | #ifndef QEMU_XIO3130_UPSTREAM_H 2 | #define QEMU_XIO3130_UPSTREAM_H 3 | 4 | #include "pcie_port.h" 5 | 6 | PCIEPort *xio3130_upstream_init(PCIBus *bus, int devfn, bool multifunction, 7 | const char *bus_name, pci_map_irq_fn map_irq, 8 | uint8_t port); 9 | 10 | #endif /* QEMU_XIO3130_H */ 11 | -------------------------------------------------------------------------------- /iemu.h: -------------------------------------------------------------------------------- 1 | #ifndef IOS_FW_H 2 | #define IOS_FW_H 3 | 4 | typedef enum { 5 | BOOT_TYPE_IBOOT = 1, 6 | BOOT_TYPE_OPENIBOOT, 7 | BOOT_TYPE_VROM 8 | } boot_type; 9 | 10 | void iemu_fw_list(const char *device); 11 | int iemu_fw_load(const char *deviceName, const char *iemuVersion); 12 | int iemu_fw_init(const char *optarg, const char *device); 13 | char *iemu_get_skin(void); 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /iorange.h: -------------------------------------------------------------------------------- 1 | #ifndef IORANGE_H 2 | #define IORANGE_H 3 | 4 | #include 5 | 6 | typedef struct IORange IORange; 7 | typedef struct IORangeOps IORangeOps; 8 | 9 | struct IORangeOps { 10 | void (*read)(IORange *iorange, uint64_t offset, unsigned width, 11 | uint64_t *data); 12 | void (*write)(IORange *iorange, uint64_t offset, unsigned width, 13 | uint64_t data); 14 | }; 15 | 16 | struct IORange { 17 | const IORangeOps *ops; 18 | uint64_t base; 19 | uint64_t len; 20 | }; 21 | 22 | static inline void iorange_init(IORange *iorange, const IORangeOps *ops, 23 | uint64_t base, uint64_t len) 24 | { 25 | iorange->ops = ops; 26 | iorange->base = base; 27 | iorange->len = len; 28 | } 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /iov.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Helpers for getting linearized buffers from iov / filling buffers into iovs 3 | * 4 | * Copyright (C) 2010 Red Hat, Inc. 5 | * 6 | * Author(s): 7 | * Amit Shah 8 | * 9 | * This work is licensed under the terms of the GNU GPL, version 2. See 10 | * the COPYING file in the top-level directory. 11 | */ 12 | 13 | #include "qemu-common.h" 14 | 15 | size_t iov_from_buf(struct iovec *iov, unsigned int iovcnt, 16 | const void *buf, size_t size); 17 | size_t iov_to_buf(const struct iovec *iov, const unsigned int iovcnt, 18 | void *buf, size_t offset, size_t size); 19 | size_t iov_size(const struct iovec *iov, const unsigned int iovcnt); 20 | -------------------------------------------------------------------------------- /json-parser.h: -------------------------------------------------------------------------------- 1 | /* 2 | * JSON Parser 3 | * 4 | * Copyright IBM, Corp. 2009 5 | * 6 | * Authors: 7 | * Anthony Liguori 8 | * 9 | * This work is licensed under the terms of the GNU LGPL, version 2.1 or later. 10 | * See the COPYING.LIB file in the top-level directory. 11 | * 12 | */ 13 | 14 | #ifndef QEMU_JSON_PARSER_H 15 | #define QEMU_JSON_PARSER_H 16 | 17 | #include "qemu-common.h" 18 | #include "qlist.h" 19 | 20 | QObject *json_parser_parse(QList *tokens, va_list *ap); 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /libcacard/Makefile: -------------------------------------------------------------------------------- 1 | -include ../config-host.mak 2 | -include $(SRC_PATH)/Makefile.objs 3 | -include $(SRC_PATH)/rules.mak 4 | 5 | $(call set-vpath, $(SRC_PATH):$(SRC_PATH)/libcacard) 6 | 7 | ifeq ($(CONFIG_WIN32),y) 8 | QEMU_THREAD=qemu-thread-win32.o 9 | else 10 | QEMU_THREAD=qemu-thread-posix.o 11 | endif 12 | 13 | 14 | QEMU_OBJS=$(addprefix ../, $(QEMU_THREAD) $(oslib-obj-y) $(trace-obj-y) qemu-malloc.o qemu-timer-common.o) 15 | 16 | QEMU_CFLAGS+=-I../ 17 | 18 | vscclient: $(libcacard-y) $(QEMU_OBJS) vscclient.o 19 | $(call quiet-command,$(CC) $(libcacard_libs) -lrt -o $@ $^," LINK $(TARGET_DIR)$@") 20 | 21 | all: vscclient 22 | 23 | clean: 24 | rm -f *.o */*.o *.d */*.d *.a */*.a *~ */*~ vscclient 25 | 26 | -------------------------------------------------------------------------------- /libcacard/cac.h: -------------------------------------------------------------------------------- 1 | /* 2 | * defines the entry point for the cac card. Only used by cac.c anc 3 | * vcard_emul_type.c 4 | * 5 | * This work is licensed under the terms of the GNU LGPL, version 2.1 or later. 6 | * See the COPYING.LIB file in the top-level directory. 7 | */ 8 | #ifndef CAC_H 9 | #define CAC_H 1 10 | #include "vcard.h" 11 | #include "vreader.h" 12 | /* 13 | * Initialize the cac card. This is the only public function in this file. All 14 | * the rest are connected through function pointers. 15 | */ 16 | VCardStatus cac_card_init(VReader *reader, VCard *card, const char *params, 17 | unsigned char * const *cert, int cert_len[], 18 | VCardKey *key[] /* adopt the keys*/, 19 | int cert_count); 20 | 21 | /* not yet implemented */ 22 | VCardStatus cac_is_cac_card(VReader *reader); 23 | #endif 24 | -------------------------------------------------------------------------------- /libcacard/eventt.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This work is licensed under the terms of the GNU LGPL, version 2.1 or later. 3 | * See the COPYING.LIB file in the top-level directory. 4 | */ 5 | 6 | #ifndef EVENTT_H 7 | #define EVENTT_H 1 8 | #include "vreadert.h" 9 | #include "vcardt.h" 10 | 11 | typedef struct VEventStruct VEvent; 12 | 13 | typedef enum { 14 | VEVENT_READER_INSERT, 15 | VEVENT_READER_REMOVE, 16 | VEVENT_CARD_INSERT, 17 | VEVENT_CARD_REMOVE, 18 | VEVENT_LAST, 19 | } VEventType; 20 | 21 | struct VEventStruct { 22 | VEvent *next; 23 | VEventType type; 24 | VReader *reader; 25 | VCard *card; 26 | }; 27 | #endif 28 | 29 | 30 | -------------------------------------------------------------------------------- /libcacard/link_test.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This work is licensed under the terms of the GNU LGPL, version 2.1 or later. 3 | * See the COPYING.LIB file in the top-level directory. 4 | */ 5 | 6 | #include 7 | #include "vcard.h" 8 | 9 | VCardStatus cac_card_init(const char *flags, VCard *card, 10 | const unsigned char *cert[], 11 | int cert_len[], VCardKey *key[] /* adopt the keys*/, 12 | int cert_count); 13 | /* 14 | * this will crash... just test the linkage right now 15 | */ 16 | 17 | main(int argc, char **argv) 18 | { 19 | VCard *card; /* no constructor yet */ 20 | cac_card_init("", card, NULL, 0, NULL, 0); 21 | } 22 | 23 | -------------------------------------------------------------------------------- /libcacard/vevent.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This work is licensed under the terms of the GNU LGPL, version 2.1 or later. 3 | * See the COPYING.LIB file in the top-level directory. 4 | */ 5 | #ifndef EVENT_H 6 | #define EVENT_H 1 7 | #include "eventt.h" 8 | #include "vreadert.h" 9 | #include "vcardt.h" 10 | 11 | VEvent *vevent_new(VEventType type, VReader *reader, VCard *card); 12 | void vevent_delete(VEvent *); 13 | 14 | /* 15 | * VEvent queueing services 16 | */ 17 | void vevent_queue_vevent(VEvent *); 18 | void vevent_queue_init(void); 19 | 20 | /* 21 | * VEvent dequeing services 22 | */ 23 | VEvent *vevent_wait_next_vevent(void); 24 | VEvent *vevent_get_next_vevent(void); 25 | 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /libcacard/vreadert.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This work is licensed under the terms of the GNU LGPL, version 2.1 or later. 3 | * See the COPYING.LIB file in the top-level directory. 4 | */ 5 | 6 | #ifndef VREADERT_H 7 | #define VREADERT_H 1 8 | 9 | typedef enum { 10 | VREADER_OK = 0, 11 | VREADER_NO_CARD, 12 | VREADER_OUT_OF_MEMORY 13 | } VReaderStatus; 14 | 15 | typedef unsigned int vreader_id_t; 16 | typedef struct VReaderStruct VReader; 17 | typedef struct VReaderListStruct VReaderList; 18 | typedef struct VReaderListEntryStruct VReaderListEntry; 19 | 20 | typedef struct VReaderEmulStruct VReaderEmul; 21 | typedef void (*VReaderEmulFree)(VReaderEmul *); 22 | 23 | #endif 24 | 25 | -------------------------------------------------------------------------------- /linux-user/arm/nwfpe/fpopcode.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fossabot/qemu-ios/b3d8064980b1dac1884ff621e8fed7f5d823c795/linux-user/arm/nwfpe/fpopcode.h -------------------------------------------------------------------------------- /linux-user/arm/target_signal.h: -------------------------------------------------------------------------------- 1 | #ifndef TARGET_SIGNAL_H 2 | #define TARGET_SIGNAL_H 3 | 4 | #include "cpu.h" 5 | 6 | /* this struct defines a stack used during syscall handling */ 7 | 8 | typedef struct target_sigaltstack { 9 | abi_ulong ss_sp; 10 | abi_long ss_flags; 11 | abi_ulong ss_size; 12 | } target_stack_t; 13 | 14 | 15 | /* 16 | * sigaltstack controls 17 | */ 18 | #define TARGET_SS_ONSTACK 1 19 | #define TARGET_SS_DISABLE 2 20 | 21 | #define TARGET_MINSIGSTKSZ 2048 22 | #define TARGET_SIGSTKSZ 8192 23 | 24 | static inline abi_ulong get_sp_from_cpustate(CPUARMState *state) 25 | { 26 | return state->regs[13]; 27 | } 28 | 29 | #endif /* TARGET_SIGNAL_H */ 30 | -------------------------------------------------------------------------------- /linux-user/cpu-uname.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fossabot/qemu-ios/b3d8064980b1dac1884ff621e8fed7f5d823c795/linux-user/cpu-uname.c -------------------------------------------------------------------------------- /linux-user/cpu-uname.h: -------------------------------------------------------------------------------- 1 | const char *cpu_to_uname_machine(void *cpu_env); 2 | -------------------------------------------------------------------------------- /linux-user/cris/target_signal.h: -------------------------------------------------------------------------------- 1 | #ifndef TARGET_SIGNAL_H 2 | #define TARGET_SIGNAL_H 3 | 4 | #include "cpu.h" 5 | 6 | /* this struct defines a stack used during syscall handling */ 7 | 8 | typedef struct target_sigaltstack { 9 | abi_ulong ss_sp; 10 | abi_ulong ss_size; 11 | abi_long ss_flags; 12 | } target_stack_t; 13 | 14 | 15 | /* 16 | * sigaltstack controls 17 | */ 18 | #define TARGET_SS_ONSTACK 1 19 | #define TARGET_SS_DISABLE 2 20 | 21 | #define TARGET_MINSIGSTKSZ 2048 22 | #define TARGET_SIGSTKSZ 8192 23 | 24 | static inline abi_ulong get_sp_from_cpustate(CPUCRISState *state) 25 | { 26 | return state->regs[14]; 27 | } 28 | 29 | #endif /* TARGET_SIGNAL_H */ 30 | -------------------------------------------------------------------------------- /linux-user/i386/target_signal.h: -------------------------------------------------------------------------------- 1 | #ifndef TARGET_SIGNAL_H 2 | #define TARGET_SIGNAL_H 3 | 4 | #include "cpu.h" 5 | 6 | /* this struct defines a stack used during syscall handling */ 7 | 8 | typedef struct target_sigaltstack { 9 | abi_ulong ss_sp; 10 | abi_long ss_flags; 11 | abi_ulong ss_size; 12 | } target_stack_t; 13 | 14 | 15 | /* 16 | * sigaltstack controls 17 | */ 18 | #define TARGET_SS_ONSTACK 1 19 | #define TARGET_SS_DISABLE 2 20 | 21 | #define TARGET_MINSIGSTKSZ 2048 22 | #define TARGET_SIGSTKSZ 8192 23 | 24 | static inline abi_ulong get_sp_from_cpustate(CPUX86State *state) 25 | { 26 | return state->regs[R_ESP]; 27 | } 28 | 29 | #endif /* TARGET_SIGNAL_H */ 30 | -------------------------------------------------------------------------------- /linux-user/m68k/syscall.h: -------------------------------------------------------------------------------- 1 | 2 | /* this struct defines the way the registers are stored on the 3 | stack during a system call. */ 4 | 5 | struct target_pt_regs { 6 | abi_long d1, d2, d3, d4, d5, d6, d7; 7 | abi_long a0, a1, a2, a3, a4, a5, a6; 8 | abi_ulong d0; 9 | abi_ulong usp; 10 | abi_ulong orig_d0; 11 | int16_t stkadj; 12 | uint16_t sr; 13 | abi_ulong pc; 14 | uint16_t fntvex; 15 | uint16_t __fill; 16 | }; 17 | 18 | 19 | #define UNAME_MACHINE "m68k" 20 | 21 | void do_m68k_simcall(CPUState *, int); 22 | -------------------------------------------------------------------------------- /linux-user/m68k/target_signal.h: -------------------------------------------------------------------------------- 1 | #ifndef TARGET_SIGNAL_H 2 | #define TARGET_SIGNAL_H 3 | 4 | #include "cpu.h" 5 | 6 | /* this struct defines a stack used during syscall handling */ 7 | 8 | typedef struct target_sigaltstack { 9 | abi_ulong ss_sp; 10 | abi_long ss_flags; 11 | abi_ulong ss_size; 12 | } target_stack_t; 13 | 14 | 15 | /* 16 | * sigaltstack controls 17 | */ 18 | #define TARGET_SS_ONSTACK 1 19 | #define TARGET_SS_DISABLE 2 20 | 21 | #define TARGET_MINSIGSTKSZ 2048 22 | #define TARGET_SIGSTKSZ 8192 23 | 24 | static inline abi_ulong get_sp_from_cpustate(CPUM68KState *state) 25 | { 26 | return state->aregs[7]; 27 | } 28 | 29 | #endif /* TARGET_SIGNAL_H */ 30 | -------------------------------------------------------------------------------- /linux-user/microblaze/target_signal.h: -------------------------------------------------------------------------------- 1 | #ifndef TARGET_SIGNAL_H 2 | #define TARGET_SIGNAL_H 3 | 4 | #include "cpu.h" 5 | 6 | /* this struct defines a stack used during syscall handling */ 7 | 8 | typedef struct target_sigaltstack { 9 | abi_ulong ss_sp; 10 | abi_ulong ss_size; 11 | abi_long ss_flags; 12 | } target_stack_t; 13 | 14 | 15 | /* 16 | * sigaltstack controls 17 | */ 18 | #define TARGET_SS_ONSTACK 1 19 | #define TARGET_SS_DISABLE 2 20 | 21 | #define TARGET_MINSIGSTKSZ 2048 22 | #define TARGET_SIGSTKSZ 8192 23 | 24 | static inline abi_ulong get_sp_from_cpustate(CPUMBState *state) 25 | { 26 | return state->regs[14]; 27 | } 28 | 29 | #endif /* TARGET_SIGNAL_H */ 30 | -------------------------------------------------------------------------------- /linux-user/mips/target_signal.h: -------------------------------------------------------------------------------- 1 | #ifndef TARGET_SIGNAL_H 2 | #define TARGET_SIGNAL_H 3 | 4 | #include "cpu.h" 5 | 6 | /* this struct defines a stack used during syscall handling */ 7 | 8 | typedef struct target_sigaltstack { 9 | abi_long ss_sp; 10 | abi_ulong ss_size; 11 | abi_long ss_flags; 12 | } target_stack_t; 13 | 14 | 15 | /* 16 | * sigaltstack controls 17 | */ 18 | #define TARGET_SS_ONSTACK 1 19 | #define TARGET_SS_DISABLE 2 20 | 21 | #define TARGET_MINSIGSTKSZ 2048 22 | #define TARGET_SIGSTKSZ 8192 23 | 24 | static inline abi_ulong get_sp_from_cpustate(CPUMIPSState *state) 25 | { 26 | return state->active_tc.gpr[29]; 27 | } 28 | 29 | #endif /* TARGET_SIGNAL_H */ 30 | -------------------------------------------------------------------------------- /linux-user/mips64/target_signal.h: -------------------------------------------------------------------------------- 1 | #ifndef TARGET_SIGNAL_H 2 | #define TARGET_SIGNAL_H 3 | 4 | #include "cpu.h" 5 | 6 | /* this struct defines a stack used during syscall handling */ 7 | 8 | typedef struct target_sigaltstack { 9 | abi_long ss_sp; 10 | abi_ulong ss_size; 11 | abi_long ss_flags; 12 | } target_stack_t; 13 | 14 | 15 | /* 16 | * sigaltstack controls 17 | */ 18 | #define TARGET_SS_ONSTACK 1 19 | #define TARGET_SS_DISABLE 2 20 | 21 | #define TARGET_MINSIGSTKSZ 2048 22 | #define TARGET_SIGSTKSZ 8192 23 | 24 | static inline abi_ulong get_sp_from_cpustate(CPUMIPSState *state) 25 | { 26 | return state->active_tc.gpr[29]; 27 | } 28 | 29 | #endif /* TARGET_SIGNAL_H */ 30 | -------------------------------------------------------------------------------- /linux-user/mipsn32/target_signal.h: -------------------------------------------------------------------------------- 1 | #ifndef TARGET_SIGNAL_H 2 | #define TARGET_SIGNAL_H 3 | 4 | #include "cpu.h" 5 | 6 | /* this struct defines a stack used during syscall handling */ 7 | 8 | typedef struct target_sigaltstack { 9 | int32_t ss_sp; 10 | uint32_t ss_size; 11 | int32_t ss_flags; 12 | } target_stack_t; 13 | 14 | 15 | /* 16 | * sigaltstack controls 17 | */ 18 | #define TARGET_SS_ONSTACK 1 19 | #define TARGET_SS_DISABLE 2 20 | 21 | #define TARGET_MINSIGSTKSZ 2048 22 | #define TARGET_SIGSTKSZ 8192 23 | 24 | static inline target_ulong get_sp_from_cpustate(CPUMIPSState *state) 25 | { 26 | return state->active_tc.gpr[29]; 27 | } 28 | 29 | #endif /* TARGET_SIGNAL_H */ 30 | -------------------------------------------------------------------------------- /linux-user/ppc/target_signal.h: -------------------------------------------------------------------------------- 1 | #ifndef TARGET_SIGNAL_H 2 | #define TARGET_SIGNAL_H 3 | 4 | #include "cpu.h" 5 | 6 | /* this struct defines a stack used during syscall handling */ 7 | 8 | typedef struct target_sigaltstack { 9 | abi_ulong ss_sp; 10 | int ss_flags; 11 | abi_ulong ss_size; 12 | } target_stack_t; 13 | 14 | 15 | /* 16 | * sigaltstack controls 17 | */ 18 | #define TARGET_SS_ONSTACK 1 19 | #define TARGET_SS_DISABLE 2 20 | 21 | #define TARGET_MINSIGSTKSZ 2048 22 | #define TARGET_SIGSTKSZ 8192 23 | 24 | static inline abi_ulong get_sp_from_cpustate(CPUPPCState *state) 25 | { 26 | return state->gpr[1]; 27 | } 28 | 29 | #endif /* TARGET_SIGNAL_H */ 30 | -------------------------------------------------------------------------------- /linux-user/qemu-types.h: -------------------------------------------------------------------------------- 1 | #ifndef QEMU_TYPES_H 2 | #define QEMU_TYPES_H 3 | #include "cpu.h" 4 | 5 | #ifdef TARGET_ABI32 6 | typedef uint32_t abi_ulong; 7 | typedef int32_t abi_long; 8 | #define TARGET_ABI_FMT_lx "%08x" 9 | #define TARGET_ABI_FMT_ld "%d" 10 | #define TARGET_ABI_FMT_lu "%u" 11 | #define TARGET_ABI_BITS 32 12 | #else 13 | typedef target_ulong abi_ulong; 14 | typedef target_long abi_long; 15 | #define TARGET_ABI_FMT_lx TARGET_FMT_lx 16 | #define TARGET_ABI_FMT_ld TARGET_FMT_ld 17 | #define TARGET_ABI_FMT_lu TARGET_FMT_lu 18 | #define TARGET_ABI_BITS TARGET_LONG_BITS 19 | /* for consistency, define ABI32 too */ 20 | #if TARGET_ABI_BITS == 32 21 | #define TARGET_ABI32 1 22 | #endif 23 | #endif 24 | #endif 25 | -------------------------------------------------------------------------------- /linux-user/sh4/syscall.h: -------------------------------------------------------------------------------- 1 | struct target_pt_regs { 2 | unsigned long regs[16]; 3 | unsigned long pc; 4 | unsigned long pr; 5 | unsigned long sr; 6 | unsigned long gbr; 7 | unsigned long mach; 8 | unsigned long macl; 9 | long tra; 10 | }; 11 | 12 | #define UNAME_MACHINE "sh4" 13 | -------------------------------------------------------------------------------- /linux-user/sh4/target_signal.h: -------------------------------------------------------------------------------- 1 | #ifndef TARGET_SIGNAL_H 2 | #define TARGET_SIGNAL_H 3 | 4 | #include "cpu.h" 5 | 6 | /* this struct defines a stack used during syscall handling */ 7 | 8 | typedef struct target_sigaltstack { 9 | abi_ulong ss_sp; 10 | abi_long ss_flags; 11 | abi_ulong ss_size; 12 | } target_stack_t; 13 | 14 | 15 | /* 16 | * sigaltstack controls 17 | */ 18 | #define TARGET_SS_ONSTACK 1 19 | #define TARGET_SS_DISABLE 2 20 | 21 | #define TARGET_MINSIGSTKSZ 2048 22 | #define TARGET_SIGSTKSZ 8192 23 | 24 | static inline abi_ulong get_sp_from_cpustate(CPUSH4State *state) 25 | { 26 | return state->gregs[15]; 27 | } 28 | 29 | #endif /* TARGET_SIGNAL_H */ 30 | -------------------------------------------------------------------------------- /linux-user/sparc/syscall.h: -------------------------------------------------------------------------------- 1 | struct target_pt_regs { 2 | abi_ulong psr; 3 | abi_ulong pc; 4 | abi_ulong npc; 5 | abi_ulong y; 6 | abi_ulong u_regs[16]; 7 | }; 8 | 9 | #define UNAME_MACHINE "sun4" 10 | -------------------------------------------------------------------------------- /linux-user/sparc/target_signal.h: -------------------------------------------------------------------------------- 1 | #ifndef TARGET_SIGNAL_H 2 | #define TARGET_SIGNAL_H 3 | 4 | #include "cpu.h" 5 | 6 | /* this struct defines a stack used during syscall handling */ 7 | 8 | typedef struct target_sigaltstack { 9 | abi_ulong ss_sp; 10 | abi_long ss_flags; 11 | abi_ulong ss_size; 12 | } target_stack_t; 13 | 14 | 15 | /* 16 | * sigaltstack controls 17 | */ 18 | #define TARGET_SS_ONSTACK 1 19 | #define TARGET_SS_DISABLE 2 20 | 21 | #define TARGET_MINSIGSTKSZ 4096 22 | #define TARGET_SIGSTKSZ 16384 23 | 24 | #ifndef UREG_I6 25 | #define UREG_I6 6 26 | #endif 27 | #ifndef UREG_FP 28 | #define UREG_FP UREG_I6 29 | #endif 30 | 31 | static inline abi_ulong get_sp_from_cpustate(CPUSPARCState *state) 32 | { 33 | return state->regwptr[UREG_FP]; 34 | } 35 | 36 | #endif /* TARGET_SIGNAL_H */ 37 | -------------------------------------------------------------------------------- /linux-user/sparc64/syscall.h: -------------------------------------------------------------------------------- 1 | struct target_pt_regs { 2 | abi_ulong u_regs[16]; 3 | abi_ulong tstate; 4 | abi_ulong pc; 5 | abi_ulong npc; 6 | abi_ulong y; 7 | abi_ulong fprs; 8 | }; 9 | 10 | #define UNAME_MACHINE "sun4u" 11 | -------------------------------------------------------------------------------- /linux-user/sparc64/target_signal.h: -------------------------------------------------------------------------------- 1 | #ifndef TARGET_SIGNAL_H 2 | #define TARGET_SIGNAL_H 3 | 4 | #include "cpu.h" 5 | 6 | /* this struct defines a stack used during syscall handling */ 7 | 8 | typedef struct target_sigaltstack { 9 | abi_ulong ss_sp; 10 | abi_long ss_flags; 11 | abi_ulong ss_size; 12 | } target_stack_t; 13 | 14 | 15 | /* 16 | * sigaltstack controls 17 | */ 18 | #define TARGET_SS_ONSTACK 1 19 | #define TARGET_SS_DISABLE 2 20 | 21 | #define TARGET_MINSIGSTKSZ 4096 22 | #define TARGET_SIGSTKSZ 16384 23 | 24 | #ifndef UREG_I6 25 | #define UREG_I6 6 26 | #endif 27 | #ifndef UREG_FP 28 | #define UREG_FP UREG_I6 29 | #endif 30 | 31 | static inline abi_ulong get_sp_from_cpustate(CPUSPARCState *state) 32 | { 33 | return state->regwptr[UREG_FP]; 34 | } 35 | 36 | #endif /* TARGET_SIGNAL_H */ 37 | -------------------------------------------------------------------------------- /linux-user/target_flat.h: -------------------------------------------------------------------------------- 1 | /* If your arch needs to do custom stuff, create your own target_flat.h 2 | * header file in linux-user// 3 | */ 4 | #define flat_argvp_envp_on_stack() 1 5 | #define flat_reloc_valid(reloc, size) ((reloc) <= (size)) 6 | #define flat_old_ram_flag(flag) (flag) 7 | #define flat_get_relocate_addr(relval) (relval) 8 | #define flat_get_addr_from_rp(rp, relval, flags, persistent) (rp) 9 | #define flat_set_persistent(relval, persistent) (*persistent) 10 | #define flat_put_addr_at_rp(rp, addr, relval) put_user_ual(addr, rp) 11 | -------------------------------------------------------------------------------- /linux-user/x86_64/target_signal.h: -------------------------------------------------------------------------------- 1 | #ifndef TARGET_SIGNAL_H 2 | #define TARGET_SIGNAL_H 3 | 4 | #include "cpu.h" 5 | 6 | /* this struct defines a stack used during syscall handling */ 7 | 8 | typedef struct target_sigaltstack { 9 | abi_ulong ss_sp; 10 | abi_long ss_flags; 11 | abi_ulong ss_size; 12 | } target_stack_t; 13 | 14 | 15 | /* 16 | * sigaltstack controls 17 | */ 18 | #define TARGET_SS_ONSTACK 1 19 | #define TARGET_SS_DISABLE 2 20 | 21 | #define TARGET_MINSIGSTKSZ 2048 22 | #define TARGET_SIGSTKSZ 8192 23 | 24 | static inline abi_ulong get_sp_from_cpustate(CPUX86State *state) 25 | { 26 | return state->regs[R_ESP]; 27 | } 28 | 29 | #endif /* TARGET_SIGNAL_H */ 30 | -------------------------------------------------------------------------------- /notify.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Notifier lists 3 | * 4 | * Copyright IBM, Corp. 2010 5 | * 6 | * Authors: 7 | * Anthony Liguori 8 | * 9 | * This work is licensed under the terms of the GNU GPL, version 2. See 10 | * the COPYING file in the top-level directory. 11 | * 12 | */ 13 | 14 | #include "qemu-common.h" 15 | #include "notify.h" 16 | 17 | void notifier_list_init(NotifierList *list) 18 | { 19 | QTAILQ_INIT(&list->notifiers); 20 | } 21 | 22 | void notifier_list_add(NotifierList *list, Notifier *notifier) 23 | { 24 | QTAILQ_INSERT_HEAD(&list->notifiers, notifier, node); 25 | } 26 | 27 | void notifier_list_remove(NotifierList *list, Notifier *notifier) 28 | { 29 | QTAILQ_REMOVE(&list->notifiers, notifier, node); 30 | } 31 | 32 | void notifier_list_notify(NotifierList *list) 33 | { 34 | Notifier *notifier, *next; 35 | 36 | QTAILQ_FOREACH_SAFE(notifier, &list->notifiers, node, next) { 37 | notifier->notify(notifier); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /notify.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Notifier lists 3 | * 4 | * Copyright IBM, Corp. 2010 5 | * 6 | * Authors: 7 | * Anthony Liguori 8 | * 9 | * This work is licensed under the terms of the GNU GPL, version 2. See 10 | * the COPYING file in the top-level directory. 11 | * 12 | */ 13 | 14 | #ifndef QEMU_NOTIFY_H 15 | #define QEMU_NOTIFY_H 16 | 17 | #include "qemu-queue.h" 18 | 19 | typedef struct Notifier Notifier; 20 | 21 | struct Notifier 22 | { 23 | void (*notify)(Notifier *notifier); 24 | QTAILQ_ENTRY(Notifier) node; 25 | }; 26 | 27 | typedef struct NotifierList 28 | { 29 | QTAILQ_HEAD(, Notifier) notifiers; 30 | } NotifierList; 31 | 32 | #define NOTIFIER_LIST_INITIALIZER(head) \ 33 | { QTAILQ_HEAD_INITIALIZER((head).notifiers) } 34 | 35 | void notifier_list_init(NotifierList *list); 36 | 37 | void notifier_list_add(NotifierList *list, Notifier *notifier); 38 | 39 | void notifier_list_remove(NotifierList *list, Notifier *notifier); 40 | 41 | void notifier_list_notify(NotifierList *list); 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /pc-bios/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # NOTE: only compilable with x86 cross compile tools 3 | # 4 | include ../config-host.mak 5 | 6 | DEFINES= 7 | 8 | TARGETS= 9 | 10 | all: $(TARGETS) 11 | 12 | %.o: %.S 13 | $(CC) $(DEFINES) -c -o $@ $< 14 | 15 | %.dtb: %.dts 16 | dtc -I dts -O dtb -o $@ $< 17 | 18 | clean: 19 | rm -f $(TARGETS) *.o *~ 20 | -------------------------------------------------------------------------------- /pc-bios/bamboo.dtb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fossabot/qemu-ios/b3d8064980b1dac1884ff621e8fed7f5d823c795/pc-bios/bamboo.dtb -------------------------------------------------------------------------------- /pc-bios/bios.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fossabot/qemu-ios/b3d8064980b1dac1884ff621e8fed7f5d823c795/pc-bios/bios.bin -------------------------------------------------------------------------------- /pc-bios/gpxe-eepro100-80861209.rom: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fossabot/qemu-ios/b3d8064980b1dac1884ff621e8fed7f5d823c795/pc-bios/gpxe-eepro100-80861209.rom -------------------------------------------------------------------------------- /pc-bios/keymaps/en-us: -------------------------------------------------------------------------------- 1 | # generated from XKB map us 2 | include common 3 | map 0x409 4 | exclam 0x02 shift 5 | at 0x03 shift 6 | numbersign 0x04 shift 7 | dollar 0x05 shift 8 | percent 0x06 shift 9 | asciicircum 0x07 shift 10 | ampersand 0x08 shift 11 | asterisk 0x09 shift 12 | parenleft 0x0a shift 13 | parenright 0x0b shift 14 | minus 0x0c 15 | underscore 0x0c shift 16 | equal 0x0d 17 | plus 0x0d shift 18 | bracketleft 0x1a 19 | braceleft 0x1a shift 20 | bracketright 0x1b 21 | braceright 0x1b shift 22 | semicolon 0x27 23 | colon 0x27 shift 24 | apostrophe 0x28 25 | quotedbl 0x28 shift 26 | grave 0x29 27 | asciitilde 0x29 shift 28 | backslash 0x2b 29 | bar 0x2b shift 30 | comma 0x33 31 | less 0x33 shift 32 | period 0x34 33 | greater 0x34 shift 34 | slash 0x35 35 | question 0x35 shift 36 | -------------------------------------------------------------------------------- /pc-bios/keymaps/is: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fossabot/qemu-ios/b3d8064980b1dac1884ff621e8fed7f5d823c795/pc-bios/keymaps/is -------------------------------------------------------------------------------- /pc-bios/keymaps/modifiers: -------------------------------------------------------------------------------- 1 | Shift_R 0x36 2 | Shift_L 0x2a 3 | 4 | Alt_R 0xb8 5 | Mode_switch 0xb8 6 | ISO_Level3_Shift 0xb8 7 | Alt_L 0x38 8 | 9 | Control_R 0x9d 10 | Control_L 0x1d 11 | 12 | # Translate Super to Windows keys. 13 | # This is hardcoded. See documentation for details. 14 | Super_R 0xdc 15 | Super_L 0xdb 16 | 17 | # Translate Menu to the Windows Application key. 18 | Menu 0xdd 19 | -------------------------------------------------------------------------------- /pc-bios/keymaps/nl-be: -------------------------------------------------------------------------------- 1 | # Dutch (Belgium) 2 | map 0x813 3 | include common 4 | -------------------------------------------------------------------------------- /pc-bios/linuxboot.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fossabot/qemu-ios/b3d8064980b1dac1884ff621e8fed7f5d823c795/pc-bios/linuxboot.bin -------------------------------------------------------------------------------- /pc-bios/mpc8544ds.dtb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fossabot/qemu-ios/b3d8064980b1dac1884ff621e8fed7f5d823c795/pc-bios/mpc8544ds.dtb -------------------------------------------------------------------------------- /pc-bios/multiboot.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fossabot/qemu-ios/b3d8064980b1dac1884ff621e8fed7f5d823c795/pc-bios/multiboot.bin -------------------------------------------------------------------------------- /pc-bios/openbios-ppc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fossabot/qemu-ios/b3d8064980b1dac1884ff621e8fed7f5d823c795/pc-bios/openbios-ppc -------------------------------------------------------------------------------- /pc-bios/openbios-sparc32: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fossabot/qemu-ios/b3d8064980b1dac1884ff621e8fed7f5d823c795/pc-bios/openbios-sparc32 -------------------------------------------------------------------------------- /pc-bios/openbios-sparc64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fossabot/qemu-ios/b3d8064980b1dac1884ff621e8fed7f5d823c795/pc-bios/openbios-sparc64 -------------------------------------------------------------------------------- /pc-bios/optionrom/Makefile: -------------------------------------------------------------------------------- 1 | all: build-all 2 | # Dummy command so that make thinks it has done something 3 | @true 4 | 5 | include ../../config-host.mak 6 | include $(SRC_PATH)/rules.mak 7 | 8 | $(call set-vpath, $(SRC_PATH)/pc-bios/optionrom) 9 | 10 | .PHONY : all clean build-all 11 | 12 | CFLAGS := -Wall -Wstrict-prototypes -Werror -fomit-frame-pointer -fno-builtin 13 | CFLAGS += -I$(SRC_PATH) 14 | CFLAGS += $(call cc-option, $(CFLAGS), -fno-stack-protector) 15 | QEMU_CFLAGS = $(CFLAGS) 16 | 17 | build-all: multiboot.bin linuxboot.bin 18 | 19 | %.img: %.o 20 | $(call quiet-command,$(LD) -Ttext 0 -e _start -s -o $@ $<," Building $(TARGET_DIR)$@") 21 | 22 | %.raw: %.img 23 | $(call quiet-command,$(OBJCOPY) -O binary -j .text $< $@," Building $(TARGET_DIR)$@") 24 | 25 | %.bin: %.raw 26 | $(call quiet-command,$(SHELL) $(SRC_PATH)/scripts/signrom.sh $< $@," Signing $(TARGET_DIR)$@") 27 | 28 | clean: 29 | rm -f *.o *.d *.raw *.img *.bin *~ 30 | -------------------------------------------------------------------------------- /pc-bios/petalogix-ml605.dtb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fossabot/qemu-ios/b3d8064980b1dac1884ff621e8fed7f5d823c795/pc-bios/petalogix-ml605.dtb -------------------------------------------------------------------------------- /pc-bios/petalogix-s3adsp1800.dtb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fossabot/qemu-ios/b3d8064980b1dac1884ff621e8fed7f5d823c795/pc-bios/petalogix-s3adsp1800.dtb -------------------------------------------------------------------------------- /pc-bios/ppc_rom.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fossabot/qemu-ios/b3d8064980b1dac1884ff621e8fed7f5d823c795/pc-bios/ppc_rom.bin -------------------------------------------------------------------------------- /pc-bios/pxe-e1000.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fossabot/qemu-ios/b3d8064980b1dac1884ff621e8fed7f5d823c795/pc-bios/pxe-e1000.bin -------------------------------------------------------------------------------- /pc-bios/pxe-ne2k_pci.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fossabot/qemu-ios/b3d8064980b1dac1884ff621e8fed7f5d823c795/pc-bios/pxe-ne2k_pci.bin -------------------------------------------------------------------------------- /pc-bios/pxe-pcnet.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fossabot/qemu-ios/b3d8064980b1dac1884ff621e8fed7f5d823c795/pc-bios/pxe-pcnet.bin -------------------------------------------------------------------------------- /pc-bios/pxe-rtl8139.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fossabot/qemu-ios/b3d8064980b1dac1884ff621e8fed7f5d823c795/pc-bios/pxe-rtl8139.bin -------------------------------------------------------------------------------- /pc-bios/pxe-virtio.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fossabot/qemu-ios/b3d8064980b1dac1884ff621e8fed7f5d823c795/pc-bios/pxe-virtio.bin -------------------------------------------------------------------------------- /pc-bios/s390-zipl.rom: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fossabot/qemu-ios/b3d8064980b1dac1884ff621e8fed7f5d823c795/pc-bios/s390-zipl.rom -------------------------------------------------------------------------------- /pc-bios/slof.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fossabot/qemu-ios/b3d8064980b1dac1884ff621e8fed7f5d823c795/pc-bios/slof.bin -------------------------------------------------------------------------------- /pc-bios/spapr-rtas.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fossabot/qemu-ios/b3d8064980b1dac1884ff621e8fed7f5d823c795/pc-bios/spapr-rtas.bin -------------------------------------------------------------------------------- /pc-bios/spapr-rtas/Makefile: -------------------------------------------------------------------------------- 1 | all: build-all 2 | # Dummy command so that make thinks it has done something 3 | @true 4 | 5 | include ../../config-host.mak 6 | include $(SRC_PATH)/rules.mak 7 | 8 | $(call set-vpath, $(SRC_PATH)/pc-bios/spapr-rtas) 9 | 10 | .PHONY : all clean build-all 11 | 12 | #CFLAGS += -I$(SRC_PATH) 13 | #QEMU_CFLAGS = $(CFLAGS) 14 | 15 | build-all: spapr-rtas.bin 16 | 17 | %.img: %.o 18 | $(call quiet-command,$(CC) -nostdlib -o $@ $<," Building $(TARGET_DIR)$@") 19 | 20 | %.bin: %.img 21 | $(call quiet-command,$(OBJCOPY) -O binary -j .text $< $@," Building $(TARGET_DIR)$@") 22 | 23 | clean: 24 | rm -f *.o *.d *.img *.bin *~ 25 | -------------------------------------------------------------------------------- /pc-bios/vgabios-cirrus.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fossabot/qemu-ios/b3d8064980b1dac1884ff621e8fed7f5d823c795/pc-bios/vgabios-cirrus.bin -------------------------------------------------------------------------------- /pc-bios/vgabios-qxl.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fossabot/qemu-ios/b3d8064980b1dac1884ff621e8fed7f5d823c795/pc-bios/vgabios-qxl.bin -------------------------------------------------------------------------------- /pc-bios/vgabios-stdvga.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fossabot/qemu-ios/b3d8064980b1dac1884ff621e8fed7f5d823c795/pc-bios/vgabios-stdvga.bin -------------------------------------------------------------------------------- /pc-bios/vgabios-vmware.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fossabot/qemu-ios/b3d8064980b1dac1884ff621e8fed7f5d823c795/pc-bios/vgabios-vmware.bin -------------------------------------------------------------------------------- /pc-bios/vgabios.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fossabot/qemu-ios/b3d8064980b1dac1884ff621e8fed7f5d823c795/pc-bios/vgabios.bin -------------------------------------------------------------------------------- /pci-ids.txt: -------------------------------------------------------------------------------- 1 | 2 | PCI IDs for qemu 3 | ================ 4 | 5 | Red Hat, Inc. donates a part of its device ID range to qemu, to be used for 6 | virtual devices. The vendor ID is 1af4 (formerly Qumranet ID). 7 | 8 | The 1000 -> 10ff device ID range is used for VirtIO devices. 9 | 10 | The 1100 device ID is used as PCI Subsystem ID for existing hardware 11 | devices emulated by qemu. 12 | 13 | All other device IDs are reserved. 14 | 15 | 16 | VirtIO Device IDs 17 | ----------------- 18 | 19 | 1af4:1000 network device 20 | 1af4:1001 block device 21 | 1af4:1002 balloon device 22 | 1af4:1003 console device 23 | 24 | 1af4:1004 Reserved. 25 | to Contact Gerd Hoffmann to get a 26 | 1af4:10ef device ID assigned for your new virtio device. 27 | 28 | 1af4:10f0 Available for experimental usage without registration. Must get 29 | to official ID when the code leaves the test lab (i.e. when seeking 30 | 1af4:10ff upstream merge or shipping a distro/product) to avoid conflicts. 31 | 32 | -------------------------------------------------------------------------------- /pflib.h: -------------------------------------------------------------------------------- 1 | #ifndef __QEMU_PFLIB_H 2 | #define __QEMU_PFLIB_H 3 | 4 | /* 5 | * PixelFormat conversion library. 6 | * 7 | * Author: Gerd Hoffmann 8 | * 9 | * This work is licensed under the terms of the GNU GPL, version 2. See 10 | * the COPYING file in the top-level directory. 11 | * 12 | */ 13 | 14 | typedef struct QemuPfConv QemuPfConv; 15 | 16 | QemuPfConv *qemu_pf_conv_get(PixelFormat *dst, PixelFormat *src); 17 | void qemu_pf_conv_run(QemuPfConv *conv, void *dst, void *src, uint32_t cnt); 18 | void qemu_pf_conv_put(QemuPfConv *conv); 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /qbool.h: -------------------------------------------------------------------------------- 1 | /* 2 | * QBool Module 3 | * 4 | * Copyright IBM, Corp. 2009 5 | * 6 | * Authors: 7 | * Anthony Liguori 8 | * 9 | * This work is licensed under the terms of the GNU LGPL, version 2.1 or later. 10 | * See the COPYING.LIB file in the top-level directory. 11 | * 12 | */ 13 | 14 | #ifndef QBOOL_H 15 | #define QBOOL_H 16 | 17 | #include 18 | #include "qobject.h" 19 | 20 | typedef struct QBool { 21 | QObject_HEAD; 22 | int value; 23 | } QBool; 24 | 25 | QBool *qbool_from_int(int value); 26 | int qbool_get_int(const QBool *qb); 27 | QBool *qobject_to_qbool(const QObject *obj); 28 | 29 | #endif /* QBOOL_H */ 30 | -------------------------------------------------------------------------------- /qemu-barrier.h: -------------------------------------------------------------------------------- 1 | #ifndef __QEMU_BARRIER_H 2 | #define __QEMU_BARRIER_H 1 3 | 4 | /* FIXME: arch dependant, x86 version */ 5 | #define smp_wmb() asm volatile("" ::: "memory") 6 | 7 | /* Compiler barrier */ 8 | #define barrier() asm volatile("" ::: "memory") 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /qemu-config.h: -------------------------------------------------------------------------------- 1 | #ifndef QEMU_CONFIG_H 2 | #define QEMU_CONFIG_H 3 | 4 | extern QemuOptsList qemu_fsdev_opts; 5 | extern QemuOptsList qemu_virtfs_opts; 6 | extern QemuOptsList qemu_spice_opts; 7 | 8 | QemuOptsList *qemu_find_opts(const char *group); 9 | void qemu_add_opts(QemuOptsList *list); 10 | int qemu_set_option(const char *str); 11 | int qemu_global_option(const char *str); 12 | void qemu_add_globals(void); 13 | 14 | void qemu_config_write(FILE *fp); 15 | int qemu_config_parse(FILE *fp, QemuOptsList **lists, const char *fname); 16 | 17 | int qemu_read_config_file(const char *filename); 18 | 19 | #endif /* QEMU_CONFIG_H */ 20 | -------------------------------------------------------------------------------- /qemu-objects.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Include all QEMU objects. 3 | * 4 | * Copyright (C) 2009 Red Hat Inc. 5 | * 6 | * Authors: 7 | * Luiz Capitulino 8 | * 9 | * This work is licensed under the terms of the GNU LGPL, version 2.1 or later. 10 | * See the COPYING.LIB file in the top-level directory. 11 | */ 12 | 13 | #ifndef QEMU_OBJECTS_H 14 | #define QEMU_OBJECTS_H 15 | 16 | #include "qobject.h" 17 | #include "qint.h" 18 | #include "qfloat.h" 19 | #include "qbool.h" 20 | #include "qstring.h" 21 | #include "qdict.h" 22 | #include "qlist.h" 23 | #include "qjson.h" 24 | 25 | #endif /* QEMU_OBJECTS_H */ 26 | -------------------------------------------------------------------------------- /qemu-thread-posix.h: -------------------------------------------------------------------------------- 1 | #ifndef __QEMU_THREAD_POSIX_H 2 | #define __QEMU_THREAD_POSIX_H 1 3 | #include "pthread.h" 4 | 5 | struct QemuMutex { 6 | pthread_mutex_t lock; 7 | }; 8 | 9 | struct QemuCond { 10 | pthread_cond_t cond; 11 | }; 12 | 13 | struct QemuThread { 14 | pthread_t thread; 15 | }; 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /qemu-thread-win32.h: -------------------------------------------------------------------------------- 1 | #ifndef __QEMU_THREAD_WIN32_H 2 | #define __QEMU_THREAD_WIN32_H 1 3 | #include "windows.h" 4 | 5 | struct QemuMutex { 6 | CRITICAL_SECTION lock; 7 | LONG owner; 8 | }; 9 | 10 | struct QemuCond { 11 | LONG waiters, target; 12 | HANDLE sema; 13 | HANDLE continue_event; 14 | }; 15 | 16 | struct QemuThread { 17 | HANDLE thread; 18 | void *ret; 19 | }; 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /qemu-x509.h: -------------------------------------------------------------------------------- 1 | #ifndef QEMU_X509_H 2 | #define QEMU_X509_H 3 | 4 | #define X509_CA_CERT_FILE "ca-cert.pem" 5 | #define X509_CA_CRL_FILE "ca-crl.pem" 6 | #define X509_SERVER_KEY_FILE "server-key.pem" 7 | #define X509_SERVER_CERT_FILE "server-cert.pem" 8 | 9 | #endif /* QEMU_X509_H */ 10 | -------------------------------------------------------------------------------- /qfloat.h: -------------------------------------------------------------------------------- 1 | /* 2 | * QFloat Module 3 | * 4 | * Copyright IBM, Corp. 2009 5 | * 6 | * Authors: 7 | * Anthony Liguori 8 | * 9 | * This work is licensed under the terms of the GNU LGPL, version 2.1 or later. 10 | * See the COPYING.LIB file in the top-level directory. 11 | * 12 | */ 13 | 14 | #ifndef QFLOAT_H 15 | #define QFLOAT_H 16 | 17 | #include 18 | #include "qobject.h" 19 | 20 | typedef struct QFloat { 21 | QObject_HEAD; 22 | double value; 23 | } QFloat; 24 | 25 | QFloat *qfloat_from_double(double value); 26 | double qfloat_get_double(const QFloat *qi); 27 | QFloat *qobject_to_qfloat(const QObject *obj); 28 | 29 | #endif /* QFLOAT_H */ 30 | -------------------------------------------------------------------------------- /qint.h: -------------------------------------------------------------------------------- 1 | /* 2 | * QInt Module 3 | * 4 | * Copyright (C) 2009 Red Hat Inc. 5 | * 6 | * Authors: 7 | * Luiz Capitulino 8 | * 9 | * This work is licensed under the terms of the GNU LGPL, version 2.1 or later. 10 | * See the COPYING.LIB file in the top-level directory. 11 | */ 12 | 13 | #ifndef QINT_H 14 | #define QINT_H 15 | 16 | #include 17 | #include "qobject.h" 18 | 19 | typedef struct QInt { 20 | QObject_HEAD; 21 | int64_t value; 22 | } QInt; 23 | 24 | QInt *qint_from_int(int64_t value); 25 | int64_t qint_get_int(const QInt *qi); 26 | QInt *qobject_to_qint(const QObject *obj); 27 | 28 | #endif /* QINT_H */ 29 | -------------------------------------------------------------------------------- /qjson.h: -------------------------------------------------------------------------------- 1 | /* 2 | * QObject JSON integration 3 | * 4 | * Copyright IBM, Corp. 2009 5 | * 6 | * Authors: 7 | * Anthony Liguori 8 | * 9 | * This work is licensed under the terms of the GNU LGPL, version 2.1 or later. 10 | * See the COPYING.LIB file in the top-level directory. 11 | * 12 | */ 13 | 14 | #ifndef QJSON_H 15 | #define QJSON_H 16 | 17 | #include 18 | #include "qobject.h" 19 | #include "qstring.h" 20 | 21 | QObject *qobject_from_json(const char *string) GCC_FMT_ATTR(1, 0); 22 | QObject *qobject_from_jsonf(const char *string, ...) GCC_FMT_ATTR(1, 2); 23 | QObject *qobject_from_jsonv(const char *string, va_list *ap) GCC_FMT_ATTR(1, 0); 24 | 25 | QString *qobject_to_json(const QObject *obj); 26 | QString *qobject_to_json_pretty(const QObject *obj); 27 | 28 | #endif /* QJSON_H */ 29 | -------------------------------------------------------------------------------- /qstring.h: -------------------------------------------------------------------------------- 1 | /* 2 | * QString Module 3 | * 4 | * Copyright (C) 2009 Red Hat Inc. 5 | * 6 | * Authors: 7 | * Luiz Capitulino 8 | * 9 | * This work is licensed under the terms of the GNU LGPL, version 2.1 or later. 10 | * See the COPYING.LIB file in the top-level directory. 11 | */ 12 | 13 | #ifndef QSTRING_H 14 | #define QSTRING_H 15 | 16 | #include 17 | #include "qobject.h" 18 | 19 | typedef struct QString { 20 | QObject_HEAD; 21 | char *string; 22 | size_t length; 23 | size_t capacity; 24 | } QString; 25 | 26 | QString *qstring_new(void); 27 | QString *qstring_from_str(const char *str); 28 | QString *qstring_from_substr(const char *str, int start, int end); 29 | const char *qstring_get_str(const QString *qstring); 30 | void qstring_append_int(QString *qstring, int64_t value); 31 | void qstring_append(QString *qstring, const char *str); 32 | void qstring_append_chr(QString *qstring, int c); 33 | QString *qobject_to_qstring(const QObject *obj); 34 | 35 | #endif /* QSTRING_H */ 36 | -------------------------------------------------------------------------------- /range.h: -------------------------------------------------------------------------------- 1 | #ifndef QEMU_RANGE_H 2 | #define QEMU_RANGE_H 3 | 4 | /* Get last byte of a range from offset + length. 5 | * Undefined for ranges that wrap around 0. */ 6 | static inline uint64_t range_get_last(uint64_t offset, uint64_t len) 7 | { 8 | return offset + len - 1; 9 | } 10 | 11 | /* Check whether a given range covers a given byte. */ 12 | static inline int range_covers_byte(uint64_t offset, uint64_t len, 13 | uint64_t byte) 14 | { 15 | return offset <= byte && byte <= range_get_last(offset, len); 16 | } 17 | 18 | /* Check whether 2 given ranges overlap. 19 | * Undefined if ranges that wrap around 0. */ 20 | static inline int ranges_overlap(uint64_t first1, uint64_t len1, 21 | uint64_t first2, uint64_t len2) 22 | { 23 | uint64_t last1 = range_get_last(first1, len1); 24 | uint64_t last2 = range_get_last(first2, len2); 25 | 26 | return !(last2 < first1 || last1 < first2); 27 | } 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | [![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fnvsio%2Fqemu-ios.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fnvsio%2Fqemu-ios?ref=badge_shield) 2 | 3 | ### QEMU iOS Emulator 4 | #### QEMU s5l89xx Port 5 | 6 | 7 | 8 | ### Credits 9 | Made possible by [cmw](https://github.com/cmwdotme/). 10 | 11 | 12 | ## License 13 | [![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fnvsio%2Fqemu-ios.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fnvsio%2Fqemu-ios?ref=badge_large) -------------------------------------------------------------------------------- /scripts/make_device_config.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # Construct a target device config file from a default, pulling in any 3 | # files from include directives. 4 | 5 | dest=$1.tmp 6 | dep=$1.d 7 | src=$2 8 | src_dir=`dirname $src` 9 | all_includes= 10 | 11 | process_includes () { 12 | cat $1 | grep '^include' | \ 13 | while read include file ; do 14 | all_includes="$all_includes $src_dir/$file" 15 | process_includes $src_dir/$file 16 | done 17 | } 18 | 19 | f=$src 20 | while [ -n "$f" ] ; do 21 | f=`tr -d '\r' < $f | awk '/^include / {printf "'$src_dir'/%s", $2}'` 22 | [ $? = 0 ] || exit 1 23 | all_includes="$all_includes $f" 24 | done 25 | process_includes $src > $dest 26 | 27 | cat $src $all_includes | grep -v '^include' > $dest 28 | echo "$1: $all_includes" > $dep 29 | -------------------------------------------------------------------------------- /slirp/debug.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1995 Danny Gasparovski. 3 | * 4 | * Please read the file COPYRIGHT for the 5 | * terms and conditions of the copyright. 6 | */ 7 | 8 | //#define DEBUG 1 9 | 10 | #ifdef DEBUG 11 | 12 | #define DBG_CALL 0x1 13 | #define DBG_MISC 0x2 14 | #define DBG_ERROR 0x4 15 | 16 | #define dfd stderr 17 | 18 | extern int slirp_debug; 19 | 20 | #define DEBUG_CALL(x) if (slirp_debug & DBG_CALL) { fprintf(dfd, "%s...\n", x); fflush(dfd); } 21 | #define DEBUG_ARG(x, y) if (slirp_debug & DBG_CALL) { fputc(' ', dfd); fprintf(dfd, x, y); fputc('\n', dfd); fflush(dfd); } 22 | #define DEBUG_ARGS(x) if (slirp_debug & DBG_CALL) { fprintf x ; fflush(dfd); } 23 | #define DEBUG_MISC(x) if (slirp_debug & DBG_MISC) { fprintf x ; fflush(dfd); } 24 | #define DEBUG_ERROR(x) if (slirp_debug & DBG_ERROR) {fprintf x ; fflush(dfd); } 25 | 26 | #else 27 | 28 | #define DEBUG_CALL(x) 29 | #define DEBUG_ARG(x, y) 30 | #define DEBUG_ARGS(x) 31 | #define DEBUG_MISC(x) 32 | #define DEBUG_ERROR(x) 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /slirp/if.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1995 Danny Gasparovski. 3 | * 4 | * Please read the file COPYRIGHT for the 5 | * terms and conditions of the copyright. 6 | */ 7 | 8 | #ifndef _IF_H_ 9 | #define _IF_H_ 10 | 11 | #define IF_COMPRESS 0x01 /* We want compression */ 12 | #define IF_NOCOMPRESS 0x02 /* Do not do compression */ 13 | #define IF_AUTOCOMP 0x04 /* Autodetect (default) */ 14 | #define IF_NOCIDCOMP 0x08 /* CID compression */ 15 | 16 | #define IF_MTU 1500 17 | #define IF_MRU 1500 18 | #define IF_COMP IF_AUTOCOMP /* Flags for compression */ 19 | 20 | /* 2 for alignment, 14 for ethernet, 40 for TCP/IP */ 21 | #define IF_MAXLINKHDR (2 + 14 + 40) 22 | 23 | #define ifs_init(ifm) ((ifm)->ifs_next = (ifm)->ifs_prev = (ifm)) 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /slirp/sbuf.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1995 Danny Gasparovski. 3 | * 4 | * Please read the file COPYRIGHT for the 5 | * terms and conditions of the copyright. 6 | */ 7 | 8 | #ifndef _SBUF_H_ 9 | #define _SBUF_H_ 10 | 11 | #define sbflush(sb) sbdrop((sb),(sb)->sb_cc) 12 | #define sbspace(sb) ((sb)->sb_datalen - (sb)->sb_cc) 13 | 14 | struct sbuf { 15 | u_int sb_cc; /* actual chars in buffer */ 16 | u_int sb_datalen; /* Length of data */ 17 | char *sb_wptr; /* write pointer. points to where the next 18 | * bytes should be written in the sbuf */ 19 | char *sb_rptr; /* read pointer. points to where the next 20 | * byte should be read from the sbuf */ 21 | char *sb_data; /* Actual data */ 22 | }; 23 | 24 | void sbfree(struct sbuf *); 25 | void sbdrop(struct sbuf *, int); 26 | void sbreserve(struct sbuf *, int); 27 | void sbappend(struct socket *, struct mbuf *); 28 | void sbcopy(struct sbuf *, int, int, char *); 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /slirp/tftp.h: -------------------------------------------------------------------------------- 1 | /* tftp defines */ 2 | 3 | #define TFTP_SESSIONS_MAX 3 4 | 5 | #define TFTP_SERVER 69 6 | 7 | #define TFTP_RRQ 1 8 | #define TFTP_WRQ 2 9 | #define TFTP_DATA 3 10 | #define TFTP_ACK 4 11 | #define TFTP_ERROR 5 12 | #define TFTP_OACK 6 13 | 14 | #define TFTP_FILENAME_MAX 512 15 | 16 | struct tftp_t { 17 | struct ip ip; 18 | struct udphdr udp; 19 | uint16_t tp_op; 20 | union { 21 | struct { 22 | uint16_t tp_block_nr; 23 | uint8_t tp_buf[512]; 24 | } tp_data; 25 | struct { 26 | uint16_t tp_error_code; 27 | uint8_t tp_msg[512]; 28 | } tp_error; 29 | char tp_buf[512 + 2]; 30 | } x; 31 | }; 32 | 33 | struct tftp_session { 34 | Slirp *slirp; 35 | char *filename; 36 | 37 | struct in_addr client_ip; 38 | uint16_t client_port; 39 | 40 | int timestamp; 41 | }; 42 | 43 | void tftp_input(struct mbuf *m); 44 | -------------------------------------------------------------------------------- /target-cris/mmu.h: -------------------------------------------------------------------------------- 1 | #define CRIS_MMU_ERR_EXEC 0 2 | #define CRIS_MMU_ERR_READ 1 3 | #define CRIS_MMU_ERR_WRITE 2 4 | #define CRIS_MMU_ERR_FLUSH 3 5 | 6 | struct cris_mmu_result 7 | { 8 | uint32_t phy; 9 | int prot; 10 | int bf_vec; 11 | }; 12 | 13 | void cris_mmu_init(CPUState *env); 14 | void cris_mmu_flush_pid(CPUState *env, uint32_t pid); 15 | int cris_mmu_translate(struct cris_mmu_result *res, 16 | CPUState *env, uint32_t vaddr, 17 | int rw, int mmu_idx, int debug); 18 | -------------------------------------------------------------------------------- /target-lm32/TODO: -------------------------------------------------------------------------------- 1 | * disassembler (lm32-dis.c) 2 | * linux-user emulation 3 | * native bp/wp emulation (?) 4 | -------------------------------------------------------------------------------- /target-lm32/helper.h: -------------------------------------------------------------------------------- 1 | #include "def-helper.h" 2 | 3 | DEF_HELPER_1(raise_exception, void, i32) 4 | DEF_HELPER_0(hlt, void) 5 | DEF_HELPER_1(wcsr_im, void, i32) 6 | DEF_HELPER_1(wcsr_ip, void, i32) 7 | DEF_HELPER_1(wcsr_jtx, void, i32) 8 | DEF_HELPER_1(wcsr_jrx, void, i32) 9 | DEF_HELPER_0(rcsr_im, i32) 10 | DEF_HELPER_0(rcsr_ip, i32) 11 | DEF_HELPER_0(rcsr_jtx, i32) 12 | DEF_HELPER_0(rcsr_jrx, i32) 13 | 14 | #include "def-helper.h" 15 | -------------------------------------------------------------------------------- /target-m68k/m68k-qreg.h: -------------------------------------------------------------------------------- 1 | enum { 2 | #define DEFO32(name, offset) QREG_##name, 3 | #define DEFR(name, reg, mode) QREG_##name, 4 | #define DEFF64(name, offset) QREG_##name, 5 | QREG_NULL, 6 | #include "qregs.def" 7 | TARGET_NUM_QREGS = 0x100 8 | #undef DEFO32 9 | #undef DEFR 10 | #undef DEFF64 11 | }; 12 | -------------------------------------------------------------------------------- /target-m68k/machine.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fossabot/qemu-ios/b3d8064980b1dac1884ff621e8fed7f5d823c795/target-m68k/machine.c -------------------------------------------------------------------------------- /target-m68k/qregs.def: -------------------------------------------------------------------------------- 1 | DEFF64(FP_RESULT, fp_result) 2 | DEFO32(PC, pc) 3 | DEFO32(SR, sr) 4 | DEFO32(CC_OP, cc_op) 5 | DEFO32(CC_DEST, cc_dest) 6 | DEFO32(CC_SRC, cc_src) 7 | DEFO32(CC_X, cc_x) 8 | DEFO32(DIV1, div1) 9 | DEFO32(DIV2, div2) 10 | DEFO32(EXCEPTION, exception_index) 11 | DEFO32(HALTED, halted) 12 | DEFO32(MACSR, macsr) 13 | DEFO32(MAC_MASK, mac_mask) 14 | -------------------------------------------------------------------------------- /target-microblaze/machine.c: -------------------------------------------------------------------------------- 1 | #include "hw/hw.h" 2 | #include "hw/boards.h" 3 | 4 | void cpu_save(QEMUFile *f, void *opaque) 5 | { 6 | } 7 | 8 | int cpu_load(QEMUFile *f, void *opaque, int version_id) 9 | { 10 | return 0; 11 | } 12 | -------------------------------------------------------------------------------- /target-ppc/mfrom_table_gen.c: -------------------------------------------------------------------------------- 1 | #define _GNU_SOURCE 2 | #include 3 | #include 4 | #include 5 | 6 | int main (void) 7 | { 8 | double d; 9 | uint8_t n; 10 | int i; 11 | 12 | printf("static const uint8_t mfrom_ROM_table[602] =\n{\n "); 13 | for (i = 0; i < 602; i++) { 14 | /* Extremly decomposed: 15 | * -T0 / 256 16 | * T0 = 256 * log10(10 + 1.0) + 0.5 17 | */ 18 | d = -i; 19 | d /= 256.0; 20 | d = exp10(d); 21 | d += 1.0; 22 | d = log10(d); 23 | d *= 256; 24 | d += 0.5; 25 | n = d; 26 | printf("%3d, ", n); 27 | if ((i & 7) == 7) 28 | printf("\n "); 29 | } 30 | printf("\n};\n"); 31 | 32 | return 0; 33 | } 34 | -------------------------------------------------------------------------------- /target-sh4/machine.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fossabot/qemu-ios/b3d8064980b1dac1884ff621e8fed7f5d823c795/target-sh4/machine.c -------------------------------------------------------------------------------- /target-sparc/exec.h: -------------------------------------------------------------------------------- 1 | #ifndef EXEC_SPARC_H 2 | #define EXEC_SPARC_H 1 3 | #include "config.h" 4 | #include "dyngen-exec.h" 5 | 6 | register struct CPUSPARCState *env asm(AREG0); 7 | 8 | #include "cpu.h" 9 | #include "exec-all.h" 10 | 11 | #if !defined(CONFIG_USER_ONLY) 12 | #include "softmmu_exec.h" 13 | #endif /* !defined(CONFIG_USER_ONLY) */ 14 | 15 | /* op_helper.c */ 16 | void do_interrupt(CPUState *env); 17 | 18 | static inline int cpu_has_work(CPUState *env1) 19 | { 20 | return (env1->interrupt_request & CPU_INTERRUPT_HARD) && 21 | cpu_interrupts_enabled(env1); 22 | } 23 | 24 | 25 | static inline void cpu_pc_from_tb(CPUState *env, TranslationBlock *tb) 26 | { 27 | env->pc = tb->pc; 28 | env->npc = tb->cs_base; 29 | } 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /targphys.h: -------------------------------------------------------------------------------- 1 | /* Define target_phys_addr_t if it exists. */ 2 | 3 | #ifndef TARGPHYS_H 4 | #define TARGPHYS_H 5 | 6 | #ifdef TARGET_PHYS_ADDR_BITS 7 | /* target_phys_addr_t is the type of a physical address (its size can 8 | be different from 'target_ulong'). */ 9 | 10 | #if TARGET_PHYS_ADDR_BITS == 32 11 | typedef uint32_t target_phys_addr_t; 12 | #define TARGET_PHYS_ADDR_MAX UINT32_MAX 13 | #define TARGET_FMT_plx "%08x" 14 | #elif TARGET_PHYS_ADDR_BITS == 64 15 | typedef uint64_t target_phys_addr_t; 16 | #define TARGET_PHYS_ADDR_MAX UINT64_MAX 17 | #define TARGET_FMT_plx "%016" PRIx64 18 | #endif 19 | #endif 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /tcg/LICENSE: -------------------------------------------------------------------------------- 1 | All the files in this directory and subdirectories are released under 2 | a BSD like license (see header in each file). No other license is 3 | accepted. 4 | -------------------------------------------------------------------------------- /tcg/TODO: -------------------------------------------------------------------------------- 1 | - Add new instructions such as: clz, ctz, popcnt. 2 | 3 | - See if it is worth exporting mul2, mulu2, div2, divu2. 4 | 5 | - Support of globals saved in fixed registers between TBs. 6 | 7 | Ideas: 8 | 9 | - Move the slow part of the qemu_ld/st ops after the end of the TB. 10 | 11 | - Change exception syntax to get closer to QOP system (exception 12 | parameters given with a specific instruction). 13 | 14 | - Add float and vector support. 15 | -------------------------------------------------------------------------------- /tcg/tcg-runtime.h: -------------------------------------------------------------------------------- 1 | #ifndef TCG_RUNTIME_H 2 | #define TCG_RUNTIME_H 3 | 4 | /* tcg-runtime.c */ 5 | int32_t tcg_helper_div_i32(int32_t arg1, int32_t arg2); 6 | int32_t tcg_helper_rem_i32(int32_t arg1, int32_t arg2); 7 | uint32_t tcg_helper_divu_i32(uint32_t arg1, uint32_t arg2); 8 | uint32_t tcg_helper_remu_i32(uint32_t arg1, uint32_t arg2); 9 | 10 | int64_t tcg_helper_shl_i64(int64_t arg1, int64_t arg2); 11 | int64_t tcg_helper_shr_i64(int64_t arg1, int64_t arg2); 12 | int64_t tcg_helper_sar_i64(int64_t arg1, int64_t arg2); 13 | int64_t tcg_helper_div_i64(int64_t arg1, int64_t arg2); 14 | int64_t tcg_helper_rem_i64(int64_t arg1, int64_t arg2); 15 | uint64_t tcg_helper_divu_i64(uint64_t arg1, uint64_t arg2); 16 | uint64_t tcg_helper_remu_i64(uint64_t arg1, uint64_t arg2); 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /tests/alpha/Makefile: -------------------------------------------------------------------------------- 1 | CROSS=alpha-linux-gnu- 2 | CC=$(CROSS)gcc 3 | AS=$(CROSS)as 4 | 5 | SIM=../../alpha-linux-user/qemu-alpha 6 | 7 | CFLAGS=-O 8 | LINK=$(CC) -o $@ crt.o $< -nostdlib 9 | 10 | TESTS=test-cond test-cmov 11 | 12 | all: hello-alpha $(TESTS) 13 | 14 | hello-alpha: hello-alpha.o crt.o 15 | $(LINK) 16 | 17 | test-cond: test-cond.o crt.o 18 | $(LINK) 19 | 20 | test-cmov.o: test-cond.c 21 | $(CC) -c $(CFLAGS) -DTEST_CMOV -o $@ $< 22 | 23 | test-cmov: test-cmov.o crt.o 24 | $(LINK) 25 | 26 | test-ovf: test-ovf.o crt.o 27 | $(LINK) 28 | 29 | check: $(TESTS) 30 | for f in $(TESTS); do $(SIM) $$f || exit 1; done 31 | 32 | clean: 33 | $(RM) *.o *~ hello-alpha $(TESTS) 34 | 35 | .PHONY: clean all check 36 | -------------------------------------------------------------------------------- /tests/alpha/crt.s: -------------------------------------------------------------------------------- 1 | .text 2 | 3 | .globl _start 4 | .ent _start,0 5 | _start: 6 | .frame $15,0,$15 7 | br $29,1f 8 | 1: ldgp $29, 0($29) 9 | .prologue 0 10 | ldq $27,main($29) !literal!1 11 | jsr $26,($27) 12 | or $0,$0,$16 13 | .end _start 14 | 15 | .globl _exit 16 | _exit: 17 | lda $0,1 18 | callsys 19 | 20 | call_pal 0 21 | 22 | .globl write 23 | write: 24 | lda $0,4 25 | callsys 26 | ret 27 | -------------------------------------------------------------------------------- /tests/alpha/hello-alpha.c: -------------------------------------------------------------------------------- 1 | int main (void) 2 | { 3 | write (1, "hello\n", 6); 4 | return 0; 5 | } 6 | -------------------------------------------------------------------------------- /tests/alpha/test-ovf.c: -------------------------------------------------------------------------------- 1 | static long test_subqv (long a, long b) 2 | { 3 | long res; 4 | 5 | asm ("subq/v %1,%2,%0" 6 | : "=r" (res) : "r" (a), "r" (b)); 7 | return res; 8 | } 9 | static struct { 10 | long (*func)(long, long); 11 | long a; 12 | long b; 13 | long r; 14 | } vectors[] = 15 | { 16 | {test_subqv, 0, 0x7d54000, 0xfffffffff82ac000L} 17 | }; 18 | 19 | int main (void) 20 | { 21 | int i; 22 | 23 | for (i = 0; i < sizeof (vectors)/sizeof(vectors[0]); i++) 24 | if ((*vectors[i].func)(vectors[i].a, vectors[i].b) != vectors[i].r) { 25 | write(1, "Failed\n", 7); 26 | } 27 | write(1, "OK\n", 3); 28 | return 0; 29 | } 30 | -------------------------------------------------------------------------------- /tests/cris/.gdbinit: -------------------------------------------------------------------------------- 1 | b main 2 | b _fail 3 | b exit 4 | display /i $pc 5 | display /x $srp 6 | display /x $r0 7 | display /x $r1 8 | display /x $r2 9 | display /x $r3 10 | display /x $r4 11 | display /t $ccs 12 | -------------------------------------------------------------------------------- /tests/cris/README: -------------------------------------------------------------------------------- 1 | Test-suite for the cris port. Heavily based on the test-suite for the CRIS port of sim by Hans-Peter Nilsson. 2 | -------------------------------------------------------------------------------- /tests/cris/check_abs.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include "sys.h" 5 | #include "crisutils.h" 6 | 7 | static inline int cris_abs(int n) 8 | { 9 | int r; 10 | asm ("abs\t%1, %0\n" : "=r" (r) : "r" (n)); 11 | return r; 12 | } 13 | 14 | static inline void 15 | verify_abs(int val, int res, 16 | const int n, const int z, const int v, const int c) 17 | { 18 | int r; 19 | 20 | cris_tst_cc_init(); 21 | r = cris_abs(val); 22 | cris_tst_cc(n, z, v, c); 23 | if (r != res) 24 | err(); 25 | } 26 | 27 | int main(void) 28 | { 29 | verify_abs(-1, 1, 0, 0, 0, 0); 30 | verify_abs(0x80000000, 0x80000000, 1, 0, 0, 0); 31 | verify_abs(0x7fffffff, 0x7fffffff, 0, 0, 0, 0); 32 | verify_abs(42, 42, 0, 0, 0, 0); 33 | verify_abs(1, 1, 0, 0, 0, 0); 34 | verify_abs(0xffff, 0xffff, 0, 0, 0, 0); 35 | verify_abs(0xffff, 0xffff, 0, 0, 0, 0); 36 | verify_abs(-31, 0x1f, 0, 0, 0, 0); 37 | verify_abs(0, 0, 0, 1, 0, 0); 38 | pass(); 39 | return 0; 40 | } 41 | -------------------------------------------------------------------------------- /tests/cris/check_addi.s: -------------------------------------------------------------------------------- 1 | # mach: crisv0 crisv3 crisv8 crisv10 crisv32 2 | # output: 0\n1\n2\n4\nbe02460f\n69d035a6\nc16c14d4\n 3 | 4 | .include "testutils.inc" 5 | start 6 | moveq 0,r3 7 | moveq 0,r4 8 | clearf zcvn 9 | addi r4.b,r3 10 | test_cc 0 0 0 0 11 | checkr3 0 12 | 13 | moveq 0,r3 14 | moveq 1,r4 15 | setf zcvn 16 | addi r4.b,r3 17 | test_cc 1 1 1 1 18 | checkr3 1 19 | 20 | moveq 0,r3 21 | moveq 1,r4 22 | setf cv 23 | clearf zn 24 | addi r4.w,r3 25 | test_cc 0 0 1 1 26 | checkr3 2 27 | 28 | moveq 0,r3 29 | moveq 1,r4 30 | clearf cv 31 | setf zn 32 | addi r4.d,r3 33 | test_cc 1 1 0 0 34 | checkr3 4 35 | 36 | move.d 0x12345678,r3 37 | move.d 0xabcdef97,r4 38 | clearf cn 39 | setf zv 40 | addi r4.b,r3 41 | test_cc 0 1 1 0 42 | checkr3 be02460f 43 | 44 | move.d 0x12345678,r3 45 | move.d 0xabcdef97,r4 46 | setf cn 47 | clearf zv 48 | addi r4.w,r3 49 | test_cc 1 0 0 1 50 | checkr3 69d035a6 51 | 52 | move.d 0x12345678,r3 53 | move.d 0xabcdef97,r4 54 | addi r4.d,r3 55 | checkr3 c16c14d4 56 | 57 | quit 58 | -------------------------------------------------------------------------------- /tests/cris/check_addq.s: -------------------------------------------------------------------------------- 1 | # mach: crisv3 crisv8 crisv10 crisv32 2 | # output: ffffffff\n0\n1\n100\n10000\n47\n67\na6\n80000001\n 3 | 4 | .include "testutils.inc" 5 | start 6 | moveq -2,r3 7 | addq 1,r3 8 | test_cc 1 0 0 0 9 | checkr3 ffffffff 10 | 11 | addq 1,r3 12 | test_cc 0 1 0 1 13 | checkr3 0 14 | 15 | addq 1,r3 16 | test_cc 0 0 0 0 17 | checkr3 1 18 | 19 | move.d 0xff,r3 20 | addq 1,r3 21 | test_cc 0 0 0 0 22 | checkr3 100 23 | 24 | move.d 0xffff,r3 25 | addq 1,r3 26 | test_cc 0 0 0 0 27 | checkr3 10000 28 | 29 | move.d 0x42,r3 30 | addq 5,r3 31 | test_cc 0 0 0 0 32 | checkr3 47 33 | 34 | addq 32,r3 35 | test_cc 0 0 0 0 36 | checkr3 67 37 | 38 | addq 63,r3 39 | test_cc 0 0 0 0 40 | checkr3 a6 41 | 42 | move.d 0x7ffffffe,r3 43 | addq 3,r3 44 | test_cc 1 0 1 0 45 | checkr3 80000001 46 | 47 | quit 48 | -------------------------------------------------------------------------------- /tests/cris/check_andq.s: -------------------------------------------------------------------------------- 1 | # mach: crisv0 crisv3 crisv8 crisv10 crisv32 2 | # output: 2\n2\nffff\nffffffff\n1f\nffffffe0\n78134452\n0\n 3 | 4 | .include "testutils.inc" 5 | start 6 | moveq -1,r3 7 | andq 2,r3 8 | test_move_cc 0 0 0 0 9 | checkr3 2 10 | 11 | moveq 2,r3 12 | andq -1,r3 13 | test_move_cc 0 0 0 0 14 | checkr3 2 15 | 16 | move.d 0xffff,r3 17 | andq -1,r3 18 | test_move_cc 0 0 0 0 19 | checkr3 ffff 20 | 21 | moveq -1,r3 22 | andq -1,r3 23 | test_move_cc 1 0 0 0 24 | checkr3 ffffffff 25 | 26 | moveq -1,r3 27 | andq 31,r3 28 | test_move_cc 0 0 0 0 29 | checkr3 1f 30 | 31 | moveq -1,r3 32 | andq -32,r3 33 | test_move_cc 1 0 0 0 34 | checkr3 ffffffe0 35 | 36 | move.d 0x78134457,r3 37 | andq -14,r3 38 | test_move_cc 0 0 0 0 39 | checkr3 78134452 40 | 41 | moveq 0,r3 42 | andq -14,r3 43 | test_move_cc 0 1 0 0 44 | checkr3 0 45 | 46 | quit 47 | -------------------------------------------------------------------------------- /tests/cris/check_clearfv32.s: -------------------------------------------------------------------------------- 1 | # mach: crisv32 2 | # output: ef\nef\n 3 | 4 | ; Check that "clearf x" doesn't trivially fail. 5 | 6 | .include "testutils.inc" 7 | start 8 | setf puixnzvc 9 | clearf x ; Actually, x would be cleared by almost-all other insns. 10 | move ccs,r3 11 | and.d 0xff, $r3 12 | checkr3 ef 13 | 14 | setf puixnzvc 15 | moveq 0, $r3 ; moveq should only clear the xflag. 16 | move ccs,r3 17 | and.d 0xff, $r3 18 | checkr3 ef 19 | quit 20 | -------------------------------------------------------------------------------- /tests/cris/check_clrjmp1.s: -------------------------------------------------------------------------------- 1 | # mach: crisv3 crisv8 crisv10 crisv32 2 | # output: ffffff00\n 3 | 4 | ; A bug resulting in a non-effectual clear.b discovered running the GCC 5 | ; testsuite; jump actually wrote to p0. 6 | 7 | .include "testutils.inc" 8 | 9 | start 10 | jump 1f 11 | nop 12 | .p2align 8 13 | 1: 14 | move.d y,r4 15 | 16 | .if 0 ;0 == ..asm.arch.cris.v32 17 | ; There was a bug causing this insn to set special register p0 18 | ; (byte-clear) to 8 (low 8 bits of location after insn). 19 | jump [r4+] 20 | .endif 21 | 22 | 1: 23 | move.d 0f,r4 24 | 25 | ; The corresponding bug would cause this insn too, to set p0. 26 | jump r4 27 | nop 28 | quit 29 | 0: 30 | moveq -1,r3 31 | clear.b r3 32 | checkr3 ffffff00 33 | quit 34 | 35 | y: 36 | .dword 1b 37 | -------------------------------------------------------------------------------- /tests/cris/check_cmp-2.s: -------------------------------------------------------------------------------- 1 | 2 | 3 | .include "testutils.inc" 4 | 5 | start 6 | 7 | move.d 4294967283, $r0 8 | move.d $r0, $r10 9 | cmp.d $r0, $r10 10 | beq 1f 11 | move.d $r10, $r3 12 | fail 13 | 1: 14 | pass 15 | quit 16 | -------------------------------------------------------------------------------- /tests/cris/check_dstep.s: -------------------------------------------------------------------------------- 1 | # mach: crisv0 crisv3 crisv8 crisv10 crisv32 2 | # output: fffffffc\n4\nffff\nfffffffe\n9bf3911b\n0\n 3 | 4 | .include "testutils.inc" 5 | start 6 | moveq -1,r3 7 | moveq 2,r4 8 | dstep r4,r3 9 | test_move_cc 1 0 0 0 10 | checkr3 fffffffc 11 | 12 | moveq 2,r3 13 | moveq -1,r4 14 | dstep r4,r3 15 | test_move_cc 0 0 0 0 16 | checkr3 4 17 | 18 | move.d 0xffff,r4 19 | move.d r4,r3 20 | dstep r4,r3 21 | test_move_cc 0 0 0 0 22 | checkr3 ffff 23 | 24 | moveq -1,r4 25 | move.d r4,r3 26 | dstep r4,r3 27 | test_move_cc 1 0 0 0 28 | checkr3 fffffffe 29 | 30 | move.d 0x5432f789,r4 31 | move.d 0x78134452,r3 32 | dstep r4,r3 33 | test_move_cc 1 0 0 0 34 | checkr3 9bf3911b 35 | 36 | move.d 0xffff,r3 37 | move.d 0x1fffe,r4 38 | dstep r4,r3 39 | test_move_cc 0 1 0 0 40 | checkr3 0 41 | 42 | quit 43 | -------------------------------------------------------------------------------- /tests/cris/check_ftag.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include "sys.h" 5 | #include "crisutils.h" 6 | 7 | static inline void cris_ftag_i(unsigned int x) 8 | { 9 | register unsigned int v asm("$r10") = x; 10 | asm ("ftagi\t[%0]\n" : : "r" (v) ); 11 | } 12 | static inline void cris_ftag_d(unsigned int x) 13 | { 14 | register unsigned int v asm("$r10") = x; 15 | asm ("ftagd\t[%0]\n" : : "r" (v) ); 16 | } 17 | static inline void cris_fidx_i(unsigned int x) 18 | { 19 | register unsigned int v asm("$r10") = x; 20 | asm ("fidxi\t[%0]\n" : : "r" (v) ); 21 | } 22 | static inline void cris_fidx_d(unsigned int x) 23 | { 24 | register unsigned int v asm("$r10") = x; 25 | asm ("fidxd\t[%0]\n" : : "r" (v) ); 26 | } 27 | 28 | 29 | int main(void) 30 | { 31 | cris_ftag_i(0); 32 | cris_ftag_d(0); 33 | cris_fidx_i(0); 34 | cris_fidx_d(0); 35 | pass(); 36 | return 0; 37 | } 38 | -------------------------------------------------------------------------------- /tests/cris/check_gcctorture_pr28634-1.c: -------------------------------------------------------------------------------- 1 | /* PR rtl-optimization/28634. On targets with delayed branches, 2 | dbr_schedule could do the next iteration's addition in the 3 | branch delay slot, then subtract the value again if the branch 4 | wasn't taken. This can lead to rounding errors. */ 5 | int x = -1; 6 | int y = 1; 7 | int 8 | main (void) 9 | { 10 | while (y > 0) 11 | y += x; 12 | if (y != x + 1) 13 | abort (); 14 | exit (0); 15 | } 16 | -------------------------------------------------------------------------------- /tests/cris/check_gcctorture_pr28634.c: -------------------------------------------------------------------------------- 1 | /* PR rtl-optimization/28634. On targets with delayed branches, 2 | dbr_schedule could do the next iteration's addition in the 3 | branch delay slot, then subtract the value again if the branch 4 | wasn't taken. This can lead to rounding errors. */ 5 | double x = -0x1.0p53; 6 | double y = 1; 7 | int 8 | main (void) 9 | { 10 | while (y > 0) 11 | y += x; 12 | if (y != x + 1) 13 | abort (); 14 | exit (0); 15 | } 16 | -------------------------------------------------------------------------------- /tests/cris/check_hello.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | int main () 4 | { 5 | printf ("pass\n"); 6 | exit (0); 7 | } 8 | -------------------------------------------------------------------------------- /tests/cris/check_int64.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include "sys.h" 5 | #include "crisutils.h" 6 | 7 | 8 | static inline int64_t add64(const int64_t a, const int64_t b) 9 | { 10 | return a + b; 11 | } 12 | 13 | static inline int64_t sub64(const int64_t a, const int64_t b) 14 | { 15 | return a - b; 16 | } 17 | 18 | int main(void) 19 | { 20 | int64_t a = 1; 21 | int64_t b = 2; 22 | 23 | /* FIXME: add some tests. */ 24 | a = add64(a, b); 25 | if (a != 3) 26 | err(); 27 | 28 | a = sub64(a, b); 29 | if (a != 1) 30 | err(); 31 | 32 | a = add64(a, -4); 33 | if (a != -3) 34 | err(); 35 | 36 | a = add64(a, 3); 37 | if (a != 0) 38 | err(); 39 | 40 | a = 0; 41 | a = sub64(a, 1); 42 | if (a != -1) 43 | err(); 44 | 45 | pass(); 46 | return 0; 47 | } 48 | -------------------------------------------------------------------------------- /tests/cris/check_lz.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include "sys.h" 5 | 6 | static inline int cris_lz(int x) 7 | { 8 | int r; 9 | asm ("lz\t%1, %0\n" : "=r" (r) : "r" (x)); 10 | return r; 11 | } 12 | 13 | void check_lz(void) 14 | { 15 | int i; 16 | 17 | if (cris_lz(0) != 32) 18 | err(); 19 | if (cris_lz(1) != 31) 20 | err(); 21 | if (cris_lz(2) != 30) 22 | err(); 23 | if (cris_lz(4) != 29) 24 | err(); 25 | if (cris_lz(8) != 28) 26 | err(); 27 | 28 | /* try all positions with a single bit. */ 29 | for (i = 1; i < 32; i++) { 30 | if (cris_lz(1 << (i-1)) != (32 - i)) 31 | err(); 32 | } 33 | 34 | /* try all positions with all bits. */ 35 | for (i = 1; i < 32; i++) { 36 | /* split up this computation to clarify it. */ 37 | uint32_t val; 38 | val = (unsigned int)-1 >> (32 - i); 39 | if (cris_lz(val) != (32 - i)) 40 | err(); 41 | } 42 | } 43 | 44 | int main(void) 45 | { 46 | check_lz(); 47 | pass(); 48 | exit(0); 49 | } 50 | -------------------------------------------------------------------------------- /tests/cris/check_mapbrk.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | /* Basic sanity check that syscalls to implement malloc (brk, mmap2, 5 | munmap) are trivially functional. */ 6 | 7 | int main () 8 | { 9 | void *p1, *p2, *p3, *p4, *p5, *p6; 10 | 11 | if ((p1 = malloc (8100)) == NULL 12 | || (p2 = malloc (16300)) == NULL 13 | || (p3 = malloc (4000)) == NULL 14 | || (p4 = malloc (500)) == NULL 15 | || (p5 = malloc (1023*1024)) == NULL 16 | || (p6 = malloc (8191*1024)) == NULL) 17 | { 18 | printf ("fail\n"); 19 | exit (1); 20 | } 21 | 22 | free (p1); 23 | free (p2); 24 | free (p3); 25 | free (p4); 26 | free (p5); 27 | free (p6); 28 | 29 | p1 = malloc (64000); 30 | if (p1 == NULL) 31 | { 32 | printf ("fail\n"); 33 | exit (1); 34 | } 35 | free (p1); 36 | 37 | printf ("pass\n"); 38 | exit (0); 39 | } 40 | -------------------------------------------------------------------------------- /tests/cris/check_mcp.s: -------------------------------------------------------------------------------- 1 | # mach: crisv32 2 | # output: fffffffe\n1\n1ffff\nfffffffe\ncc463bdc\n4c463bdc\n0\n 3 | 4 | .include "testutils.inc" 5 | start 6 | 7 | ; Set R, clear C. 8 | move 0x100,ccs 9 | moveq -5,r3 10 | move 2,mof 11 | mcp mof,r3 12 | test_cc 1 0 0 0 13 | checkr3 fffffffe 14 | 15 | moveq 2,r3 16 | move -1,srp 17 | mcp srp,r3 18 | test_cc 0 0 0 0 19 | checkr3 1 20 | 21 | move 0xffff,srp 22 | move srp,r3 23 | mcp srp,r3 24 | test_cc 0 0 0 0 25 | checkr3 1ffff 26 | 27 | move -1,mof 28 | move mof,r3 29 | mcp mof,r3 30 | test_cc 1 0 0 0 31 | checkr3 fffffffe 32 | 33 | move 0x5432f789,mof 34 | move.d 0x78134452,r3 35 | mcp mof,r3 36 | test_cc 1 0 1 0 37 | checkr3 cc463bdc 38 | 39 | move 0x80000000,srp 40 | mcp srp,r3 41 | test_cc 0 0 1 0 42 | checkr3 4c463bdc 43 | 44 | move 0xb3b9c423,srp 45 | mcp srp,r3 46 | test_cc 0 1 0 0 47 | checkr3 0 48 | 49 | quit 50 | -------------------------------------------------------------------------------- /tests/cris/check_mmap3.c: -------------------------------------------------------------------------------- 1 | /* 2 | #notarget: cris*-*-elf 3 | */ 4 | 5 | #define _GNU_SOURCE 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | int main (int argc, char *argv[]) 15 | { 16 | volatile unsigned char *a; 17 | 18 | /* Check that we can map a non-multiple of a page and still get a full page. */ 19 | a = mmap (NULL, 0x4c, PROT_READ | PROT_WRITE | PROT_EXEC, 20 | MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); 21 | if (a == NULL || a == (unsigned char *) -1) 22 | abort (); 23 | 24 | a[0] = 0xbe; 25 | a[8191] = 0xef; 26 | memset ((char *) a + 1, 0, 8190); 27 | 28 | if (a[0] != 0xbe || a[8191] != 0xef) 29 | abort (); 30 | 31 | printf ("pass\n"); 32 | exit (0); 33 | } 34 | -------------------------------------------------------------------------------- /tests/cris/check_movdelsr1.s: -------------------------------------------------------------------------------- 1 | # mach: crisv0 crisv3 crisv8 crisv10 crisv32 2 | # output: aa117acd\n 3 | # output: eeaabb42\n 4 | 5 | ; Bug with move to special register in delay slot, due to 6 | ; special flush-insn-cache simulator use. Ordinary move worked; 7 | ; special register caused branch to fail. 8 | 9 | .include "testutils.inc" 10 | start 11 | move -1,srp 12 | 13 | move.d 0xaa117acd,r1 14 | moveq 3,r9 15 | cmpq 1,r9 16 | bhi 0f 17 | move.d r1,r3 18 | 19 | fail 20 | 0: 21 | checkr3 aa117acd 22 | 23 | move.d 0xeeaabb42,r1 24 | moveq 3,r9 25 | cmpq 1,r9 26 | bhi 0f 27 | move r1,srp 28 | 29 | fail 30 | 0: 31 | move srp,r3 32 | checkr3 eeaabb42 33 | quit 34 | -------------------------------------------------------------------------------- /tests/cris/check_movecr.s: -------------------------------------------------------------------------------- 1 | # mach: crisv3 crisv8 crisv10 crisv32 2 | # output: ffffff42\n94\nffff4321\n9234\n76543210\n76540000\n 3 | 4 | ; Move constant byte, word, dword to register. Check that no extension is 5 | ; performed, that only part of the register is set. 6 | 7 | .include "testutils.inc" 8 | startnostack 9 | moveq -1,r3 10 | move.b 0x42,r3 11 | test_move_cc 0 0 0 0 12 | checkr3 ffffff42 13 | 14 | moveq 0,r3 15 | move.b 0x94,r3 16 | test_move_cc 1 0 0 0 17 | checkr3 94 18 | 19 | moveq -1,r3 20 | move.w 0x4321,r3 21 | test_move_cc 0 0 0 0 22 | checkr3 ffff4321 23 | 24 | moveq 0,r3 25 | move.w 0x9234,r3 26 | test_move_cc 1 0 0 0 27 | checkr3 9234 28 | 29 | move.d 0x76543210,r3 30 | test_move_cc 0 0 0 0 31 | checkr3 76543210 32 | 33 | move.w 0,r3 34 | test_move_cc 0 1 0 0 35 | checkr3 76540000 36 | 37 | quit 38 | -------------------------------------------------------------------------------- /tests/cris/check_movei.s: -------------------------------------------------------------------------------- 1 | # mach: crisv32 2 | # output: fffffffe\n 3 | # output: fffffffe\n 4 | 5 | ; Check basic integral-write semantics regarding flags. 6 | 7 | .include "testutils.inc" 8 | start 9 | 10 | move.d 0, $r3 11 | ; A write that works. Check that flags are set correspondingly. 12 | move.d d,r4 13 | ;; store to bring it into the tlb with the right prot bits 14 | move.d r3,[r4] 15 | moveq -2,r5 16 | setf c 17 | clearf p 18 | move.d [r4],r3 19 | ax 20 | move.d r5,[r4] 21 | move.d [r4],r3 22 | 23 | bcc 0f 24 | nop 25 | fail 26 | 27 | 0: 28 | checkr3 fffffffe 29 | 30 | ; A write that fails; check flags too. 31 | move.d d,r4 32 | moveq 23,r5 33 | setf p 34 | clearf c 35 | move.d [r4],r3 36 | ax 37 | move.d r5,[r4] 38 | move.d [r4],r3 39 | 40 | bcs 0f 41 | nop 42 | fail 43 | 44 | 0: 45 | checkr3 fffffffe 46 | quit 47 | 48 | .data 49 | d: 50 | .dword 42424242 51 | -------------------------------------------------------------------------------- /tests/cris/check_mover.s: -------------------------------------------------------------------------------- 1 | # mach: crisv3 crisv8 crisv10 crisv32 2 | # output: ffffff05\nffff0005\n5\nffffff00\n 3 | 4 | ; Move between registers. Check that just the subreg is copied. 5 | 6 | .include "testutils.inc" 7 | startnostack 8 | moveq -30,r3 9 | moveq 5,r4 10 | move.b r4,r3 11 | test_move_cc 0 0 0 0 ; FIXME 12 | checkr3 ffffff05 13 | 14 | move.w r4,r3 15 | test_move_cc 0 0 0 0 16 | checkr3 ffff0005 17 | 18 | move.d r4,r3 19 | test_move_cc 0 0 0 0 20 | checkr3 5 21 | 22 | moveq -1,r3 23 | moveq 0,r4 24 | move.b r4,r3 25 | test_move_cc 0 1 0 0 26 | checkr3 ffffff00 27 | 28 | quit 29 | -------------------------------------------------------------------------------- /tests/cris/check_moverm.s: -------------------------------------------------------------------------------- 1 | # mach: crisv3 crisv8 crisv10 crisv32 2 | # output: 7823fec2\n10231879\n102318fe\n 3 | 4 | .include "testutils.inc" 5 | start 6 | 7 | .data 8 | mem1: 9 | .dword 0x12345678 10 | mem2: 11 | .word 0x4567 12 | mem3: 13 | .byte 0x23 14 | .dword 0x76543210 15 | .byte 0xaa,0x11,0x99 16 | 17 | .text 18 | move.d mem1,r2 19 | move.d 0x7823fec2,r4 20 | setf nzvc 21 | move.d r4,[r2+] 22 | test_cc 1 1 1 1 23 | subq 4,r2 24 | move.d [r2],r3 25 | checkr3 7823fec2 26 | 27 | move.d mem2,r3 28 | move.d 0x45231879,r4 29 | clearf nzvc 30 | move.w r4,[r3] 31 | test_cc 0 0 0 0 32 | move.d [r3],r3 33 | checkr3 10231879 34 | 35 | move.d mem2,r2 36 | moveq -2,r4 37 | clearf nc 38 | setf zv 39 | move.b r4,[r2+] 40 | test_cc 0 1 1 0 41 | subq 1,r2 42 | move.d [r2],r3 43 | checkr3 102318fe 44 | 45 | quit 46 | -------------------------------------------------------------------------------- /tests/cris/check_movpmv32.s: -------------------------------------------------------------------------------- 1 | # mach: crisv32 2 | # output: 11223320\nbb113344\naa557711\n 3 | 4 | # Test v32-specific special registers. FIXME: more registers. 5 | 6 | .include "testutils.inc" 7 | start 8 | .data 9 | store: 10 | .dword 0x11223344 11 | .dword 0x77665544 12 | 13 | .text 14 | moveq -1,r3 15 | move.d store,r4 16 | move vr,[r4] 17 | move [r4+],mof 18 | move mof,r3 19 | checkr3 11223320 20 | 21 | moveq -1,r3 22 | clearf zcvn 23 | move 0xbb113344,mof 24 | test_cc 0 0 0 0 25 | move mof,r3 26 | checkr3 bb113344 27 | 28 | setf zcvn 29 | move 0xaa557711,mof 30 | test_cc 1 1 1 1 31 | move mof,[r4] 32 | move.d [r4],r3 33 | checkr3 aa557711 34 | 35 | quit 36 | -------------------------------------------------------------------------------- /tests/cris/check_movpr.s: -------------------------------------------------------------------------------- 1 | # mach: crisv3 crisv8 crisv10 crisv32 2 | # output: ffffff00\nffff0000\n0\nbb113344\n 3 | 4 | # Test generic "move Ps,Rd" and "move Rs,Pd" insns; the ones with 5 | # functionality common to all models. 6 | 7 | .include "testutils.inc" 8 | start 9 | moveq -1,r3 10 | clear.b r3 11 | checkr3 ffffff00 12 | 13 | moveq -1,r3 14 | clear.w r3 15 | checkr3 ffff0000 16 | 17 | moveq -1,r3 18 | clear.d r3 19 | checkr3 0 20 | 21 | moveq -1,r3 22 | move.d 0xbb113344,r4 23 | setf zcvn 24 | move r4,srp 25 | move srp,r3 26 | test_cc 1 1 1 1 27 | checkr3 bb113344 28 | quit 29 | -------------------------------------------------------------------------------- /tests/cris/check_movprv32.s: -------------------------------------------------------------------------------- 1 | # mach: crisv32 2 | # output: ffffff20\nbb113344\n 3 | 4 | # Test v32-specific special registers. FIXME: more registers. 5 | 6 | .include "testutils.inc" 7 | start 8 | moveq -1,r3 9 | setf zcvn 10 | move vr,r3 11 | test_cc 1 1 1 1 12 | checkr3 ffffff20 13 | 14 | moveq -1,r3 15 | move.d 0xbb113344,r4 16 | clearf cvnz 17 | move r4,mof 18 | test_cc 0 0 0 0 19 | move mof,r3 20 | checkr3 bb113344 21 | quit 22 | -------------------------------------------------------------------------------- /tests/cris/check_movscr.s: -------------------------------------------------------------------------------- 1 | # mach: crisv3 crisv8 crisv10 crisv32 2 | # output: 42\nffffff85\n7685\nffff8765\n0\n 3 | 4 | ; Move constant byte, word, dword to register. Check that sign-extension 5 | ; is performed. 6 | 7 | .include "testutils.inc" 8 | start 9 | moveq -1,r3 10 | movs.b 0x42,r3 11 | checkr3 42 12 | 13 | movs.b 0x85,r3 14 | test_move_cc 1 0 0 0 15 | checkr3 ffffff85 16 | 17 | movs.w 0x7685,r3 18 | test_move_cc 0 0 0 0 19 | checkr3 7685 20 | 21 | movs.w 0x8765,r3 22 | test_move_cc 1 0 0 0 23 | checkr3 ffff8765 24 | 25 | movs.w 0,r3 26 | test_move_cc 0 1 0 0 27 | checkr3 0 28 | 29 | quit 30 | -------------------------------------------------------------------------------- /tests/cris/check_movsm.s: -------------------------------------------------------------------------------- 1 | # mach: crisv3 crisv8 crisv10 crisv32 2 | # output: 5\nfffffff5\n5\nfffffff5\n0\n 3 | 4 | ; Movs between registers. Check that sign-extension is performed and the 5 | ; full register is set. 6 | 7 | .include "testutils.inc" 8 | 9 | .data 10 | x: 11 | .byte 5,-11 12 | .word 5,-11 13 | .word 0 14 | 15 | start 16 | move.d x,r5 17 | 18 | moveq -1,r3 19 | movs.b [r5+],r3 20 | test_move_cc 0 0 0 0 21 | checkr3 5 22 | 23 | moveq 0,r3 24 | movs.b [r5],r3 25 | test_move_cc 1 0 0 0 26 | addq 1,r5 27 | checkr3 fffffff5 28 | 29 | moveq -1,r3 30 | movs.w [r5+],r3 31 | test_move_cc 0 0 0 0 32 | checkr3 5 33 | 34 | moveq 0,r3 35 | movs.w [r5],r3 36 | test_move_cc 1 0 0 0 37 | addq 2,r5 38 | checkr3 fffffff5 39 | 40 | movs.w [r5],r3 41 | test_move_cc 0 1 0 0 42 | checkr3 0 43 | 44 | quit 45 | -------------------------------------------------------------------------------- /tests/cris/check_movsr.s: -------------------------------------------------------------------------------- 1 | # mach: crisv3 crisv8 crisv10 crisv32 2 | # output: 5\nfffffff5\n5\nfffffff5\n0\n 3 | 4 | ; Movs between registers. Check that sign-extension is performed and the 5 | ; full register is set. 6 | 7 | .include "testutils.inc" 8 | start 9 | moveq -1,r5 10 | moveq 5,r4 11 | move.b r4,r5 12 | moveq -1,r3 13 | movs.b r5,r3 14 | test_move_cc 0 0 0 0 15 | checkr3 5 16 | 17 | moveq 0,r5 18 | moveq -11,r4 19 | move.b r4,r5 20 | moveq 0,r3 21 | movs.b r5,r3 22 | test_move_cc 1 0 0 0 23 | checkr3 fffffff5 24 | 25 | moveq -1,r5 26 | moveq 5,r4 27 | move.w r4,r5 28 | moveq -1,r3 29 | movs.w r5,r3 30 | test_move_cc 0 0 0 0 31 | checkr3 5 32 | 33 | moveq 0,r5 34 | moveq -11,r4 35 | move.w r4,r5 36 | moveq 0,r3 37 | movs.w r5,r3 38 | test_move_cc 1 0 0 0 39 | checkr3 fffffff5 40 | 41 | moveq 0,r5 42 | movs.b r5,r3 43 | test_move_cc 0 1 0 0 44 | checkr3 0 45 | 46 | quit 47 | -------------------------------------------------------------------------------- /tests/cris/check_movucr.s: -------------------------------------------------------------------------------- 1 | # mach: crisv3 crisv8 crisv10 crisv32 2 | # output: 42\n85\n7685\n8765\n0\n 3 | 4 | ; Move constant byte, word, dword to register. Check that zero-extension 5 | ; is performed. 6 | 7 | .include "testutils.inc" 8 | start 9 | moveq -1,r3 10 | movu.b 0x42,r3 11 | test_move_cc 0 0 0 0 12 | checkr3 42 13 | 14 | moveq -1,r3 15 | movu.b 0x85,r3 16 | test_move_cc 0 0 0 0 17 | checkr3 85 18 | 19 | moveq -1,r3 20 | movu.w 0x7685,r3 21 | test_move_cc 0 0 0 0 22 | checkr3 7685 23 | 24 | moveq -1,r3 25 | movu.w 0x8765,r3 26 | test_move_cc 0 0 0 0 27 | checkr3 8765 28 | 29 | movu.b 0,r3 30 | test_move_cc 0 1 0 0 31 | checkr3 0 32 | 33 | quit 34 | -------------------------------------------------------------------------------- /tests/cris/check_movum.s: -------------------------------------------------------------------------------- 1 | # mach: crisv3 crisv8 crisv10 crisv32 2 | # output: 5\nf5\n5\nfff5\n0\n 3 | 4 | ; Movu between registers. Check that zero-extension is performed and the 5 | ; full register is set. 6 | 7 | .include "testutils.inc" 8 | 9 | .data 10 | x: 11 | .byte 5,-11 12 | .word 5,-11 13 | .word 0 14 | 15 | start 16 | move.d x,r5 17 | 18 | movu.b [r5+],r3 19 | test_move_cc 0 0 0 0 20 | checkr3 5 21 | 22 | movu.b [r5],r3 23 | test_move_cc 0 0 0 0 24 | addq 1,r5 25 | checkr3 f5 26 | 27 | movu.w [r5+],r3 28 | test_move_cc 0 0 0 0 29 | checkr3 5 30 | 31 | movu.w [r5],r3 32 | test_move_cc 0 0 0 0 33 | addq 2,r5 34 | checkr3 fff5 35 | 36 | movu.w [r5],r3 37 | test_move_cc 0 1 0 0 38 | checkr3 0 39 | 40 | quit 41 | -------------------------------------------------------------------------------- /tests/cris/check_movur.s: -------------------------------------------------------------------------------- 1 | # mach: crisv3 crisv8 crisv10 crisv32 2 | # output: 5\nf5\n5\nfff5\n0\n 3 | 4 | ; Movu between registers. Check that zero-extension is performed and the 5 | ; full register is set. 6 | 7 | .include "testutils.inc" 8 | start 9 | moveq -1,r5 10 | moveq 5,r4 11 | move.b r4,r5 12 | moveq -1,r3 13 | movu.b r5,r3 14 | test_move_cc 0 0 0 0 15 | checkr3 5 16 | 17 | moveq 0,r5 18 | moveq -11,r4 19 | move.b r4,r5 20 | moveq -1,r3 21 | movu.b r5,r3 22 | test_move_cc 0 0 0 0 23 | checkr3 f5 24 | 25 | moveq -1,r5 26 | moveq 5,r4 27 | move.w r4,r5 28 | moveq -1,r3 29 | movu.w r5,r3 30 | test_move_cc 0 0 0 0 31 | checkr3 5 32 | 33 | moveq 0,r5 34 | moveq -11,r4 35 | move.w r4,r5 36 | moveq -1,r3 37 | movu.w r5,r3 38 | test_move_cc 0 0 0 0 39 | checkr3 fff5 40 | 41 | movu.w 0,r3 42 | test_move_cc 0 1 0 0 43 | checkr3 0 44 | 45 | quit 46 | -------------------------------------------------------------------------------- /tests/cris/check_mulv32.s: -------------------------------------------------------------------------------- 1 | # mach: crisv32 2 | # output: fffffffe\n 3 | # output: ffffffff\n 4 | # output: fffffffe\n 5 | # output: 1\n 6 | # output: fffffffe\n 7 | # output: ffffffff\n 8 | # output: fffffffe\n 9 | # output: 1\n 10 | 11 | ; Check that carry is not modified on v32. 12 | 13 | .include "testutils.inc" 14 | start 15 | moveq -1,r3 16 | moveq 2,r4 17 | setf c 18 | muls.d r4,r3 19 | test_cc 1 0 0 1 20 | checkr3 fffffffe 21 | move mof,r3 22 | checkr3 ffffffff 23 | 24 | moveq -1,r3 25 | moveq 2,r4 26 | setf c 27 | mulu.d r4,r3 28 | test_cc 0 0 1 1 29 | checkr3 fffffffe 30 | move mof,r3 31 | checkr3 1 32 | 33 | moveq -1,r3 34 | moveq 2,r4 35 | clearf c 36 | muls.d r4,r3 37 | test_cc 1 0 0 0 38 | checkr3 fffffffe 39 | move mof,r3 40 | checkr3 ffffffff 41 | 42 | moveq -1,r3 43 | moveq 2,r4 44 | clearf c 45 | mulu.d r4,r3 46 | test_cc 0 0 1 0 47 | checkr3 fffffffe 48 | move mof,r3 49 | checkr3 1 50 | 51 | quit 52 | -------------------------------------------------------------------------------- /tests/cris/check_not.s: -------------------------------------------------------------------------------- 1 | # mach: crisv0 crisv3 crisv8 crisv10 crisv32 2 | # output: fffffffe\nfffffffd\nffff0f00\n0\n87ecbbad\n 3 | 4 | .include "testutils.inc" 5 | start 6 | moveq 1,r3 7 | not r3 8 | test_move_cc 1 0 0 0 9 | checkr3 fffffffe 10 | 11 | moveq 2,r3 12 | not r3 13 | test_move_cc 1 0 0 0 14 | checkr3 fffffffd 15 | 16 | move.d 0xf0ff,r3 17 | not r3 18 | test_move_cc 1 0 0 0 19 | checkr3 ffff0f00 20 | 21 | moveq -1,r3 22 | not r3 23 | test_move_cc 0 1 0 0 24 | checkr3 0 25 | 26 | move.d 0x78134452,r3 27 | not r3 28 | test_move_cc 1 0 0 0 29 | checkr3 87ecbbad 30 | 31 | quit 32 | -------------------------------------------------------------------------------- /tests/cris/check_openpf2.c: -------------------------------------------------------------------------------- 1 | /* Check that the simulator has chdir:ed to the --sysroot argument 2 | #sim: --sysroot=@srcdir@ 3 | (or that --sysroot is applied to relative file paths). */ 4 | 5 | #include 6 | #include 7 | #include 8 | int main (int argc, char *argv[]) 9 | { 10 | FILE *f = fopen ("check_openpf2.c", "rb"); 11 | if (f == NULL) 12 | abort (); 13 | fclose(f); 14 | printf ("pass\n"); 15 | return 0; 16 | } 17 | -------------------------------------------------------------------------------- /tests/cris/check_openpf4.c: -------------------------------------------------------------------------------- 1 | /* Basic file operations, now *with* sysroot. 2 | #sim: --sysroot=@exedir@ 3 | */ 4 | #define PREFIX "/" 5 | #include "check_openpf3.c" 6 | -------------------------------------------------------------------------------- /tests/cris/check_orq.s: -------------------------------------------------------------------------------- 1 | # mach: crisv0 crisv3 crisv8 crisv10 crisv32 2 | # output: 3\n3\nffffffff\nffffffff\n1f\nffffffe0\n7813445e\n 3 | 4 | .include "testutils.inc" 5 | start 6 | moveq 1,r3 7 | orq 2,r3 8 | test_move_cc 0 0 0 0 9 | checkr3 3 10 | 11 | moveq 2,r3 12 | orq 1,r3 13 | test_move_cc 0 0 0 0 14 | checkr3 3 15 | 16 | move.d 0xf0ff,r3 17 | orq -1,r3 18 | test_move_cc 1 0 0 0 19 | checkr3 ffffffff 20 | 21 | moveq 0,r3 22 | orq -1,r3 23 | test_move_cc 1 0 0 0 24 | checkr3 ffffffff 25 | 26 | moveq 0,r3 27 | orq 31,r3 28 | test_move_cc 0 0 0 0 29 | checkr3 1f 30 | 31 | moveq 0,r3 32 | orq -32,r3 33 | test_move_cc 1 0 0 0 34 | checkr3 ffffffe0 35 | 36 | move.d 0x78134452,r3 37 | orq 12,r3 38 | test_move_cc 0 0 0 0 39 | checkr3 7813445e 40 | 41 | quit 42 | -------------------------------------------------------------------------------- /tests/cris/check_ret.s: -------------------------------------------------------------------------------- 1 | # mach: crisv3 crisv8 crisv10 2 | # output: 3\n 3 | 4 | # Test that ret works. 5 | 6 | .include "testutils.inc" 7 | start 8 | x: 9 | moveq 0,r3 10 | jsr z 11 | w: 12 | quit 13 | y: 14 | addq 1,r3 15 | checkr3 3 16 | quit 17 | 18 | z: 19 | addq 1,r3 20 | move srp,r2 21 | add.d y-w,r2 22 | move r2,srp 23 | ret 24 | addq 1,r3 25 | quit 26 | -------------------------------------------------------------------------------- /tests/cris/check_sigalrm.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | #define MAGIC (0xdeadbeef) 7 | 8 | int s = 0; 9 | void sighandler(int sig) 10 | { 11 | s = MAGIC; 12 | } 13 | 14 | int main(int argc, char **argv) 15 | { 16 | int p; 17 | 18 | p = getpid(); 19 | signal(SIGALRM, sighandler); 20 | kill(p, SIGALRM); 21 | if (s != MAGIC) 22 | return EXIT_FAILURE; 23 | 24 | printf ("passed\n"); 25 | return EXIT_SUCCESS; 26 | } 27 | -------------------------------------------------------------------------------- /tests/cris/check_stat1.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | int main (void) 8 | { 9 | struct stat buf; 10 | 11 | if (stat (".", &buf) != 0 12 | || !S_ISDIR (buf.st_mode)) 13 | abort (); 14 | printf ("pass\n"); 15 | exit (0); 16 | } 17 | -------------------------------------------------------------------------------- /tests/cris/check_stat2.c: -------------------------------------------------------------------------------- 1 | /* 2 | #notarget: cris*-*-elf 3 | */ 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | int main (void) 12 | { 13 | struct stat buf; 14 | 15 | if (lstat (".", &buf) != 0 16 | || !S_ISDIR (buf.st_mode)) 17 | abort (); 18 | printf ("pass\n"); 19 | exit (0); 20 | } 21 | -------------------------------------------------------------------------------- /tests/cris/check_stat3.c: -------------------------------------------------------------------------------- 1 | /* Simulator options: 2 | #sim: --sysroot=@exedir@ 3 | */ 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | int main (int argc, char *argv[]) 12 | { 13 | char path[1024] = "/"; 14 | struct stat buf; 15 | 16 | strncat(path, argv[0], sizeof(path) - 2); 17 | if (stat (".", &buf) != 0 18 | || !S_ISDIR (buf.st_mode)) 19 | abort (); 20 | if (stat (path, &buf) != 0 21 | || !S_ISREG (buf.st_mode)) 22 | abort (); 23 | printf ("pass\n"); 24 | exit (0); 25 | } 26 | -------------------------------------------------------------------------------- /tests/cris/check_stat4.c: -------------------------------------------------------------------------------- 1 | /* Simulator options: 2 | #notarget: cris*-*-elf 3 | #sim: --sysroot=@exedir@ 4 | */ 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | int main (int argc, char *argv[]) 14 | { 15 | char path[1024] = "/"; 16 | struct stat buf; 17 | 18 | strncat(path, argv[0], sizeof(path) - 2); 19 | if (lstat (".", &buf) != 0 20 | || !S_ISDIR (buf.st_mode)) 21 | abort (); 22 | if (lstat (path, &buf) != 0 23 | || !S_ISREG (buf.st_mode)) 24 | abort (); 25 | printf ("pass\n"); 26 | exit (0); 27 | } 28 | -------------------------------------------------------------------------------- /tests/cris/check_subq.s: -------------------------------------------------------------------------------- 1 | # mach: crisv3 crisv8 crisv10 crisv32 2 | # output: 0\nffffffff\nfffffffe\nffff\nff\n56788f9\n56788d9\n567889a\n0\n7ffffffc\n 3 | 4 | .include "testutils.inc" 5 | start 6 | moveq 1,r3 7 | subq 1,r3 8 | test_cc 0 1 0 0 9 | checkr3 0 10 | 11 | subq 1,r3 12 | test_cc 1 0 0 1 13 | checkr3 ffffffff 14 | 15 | subq 1,r3 16 | test_cc 1 0 0 0 17 | checkr3 fffffffe 18 | 19 | move.d 0x10000,r3 20 | subq 1,r3 21 | test_cc 0 0 0 0 22 | checkr3 ffff 23 | 24 | move.d 0x100,r3 25 | subq 1,r3 26 | test_cc 0 0 0 0 27 | checkr3 ff 28 | 29 | move.d 0x5678900,r3 30 | subq 7,r3 31 | test_cc 0 0 0 0 32 | checkr3 56788f9 33 | 34 | subq 32,r3 35 | test_cc 0 0 0 0 36 | checkr3 56788d9 37 | 38 | subq 63,r3 39 | test_cc 0 0 0 0 40 | checkr3 567889a 41 | 42 | move.d 34,r3 43 | subq 34,r3 44 | test_cc 0 1 0 0 45 | checkr3 0 46 | 47 | move.d 0x80000024,r3 48 | subq 40,r3 49 | test_cc 0 0 1 0 50 | checkr3 7ffffffc 51 | 52 | quit 53 | -------------------------------------------------------------------------------- /tests/cris/check_time2.c: -------------------------------------------------------------------------------- 1 | /* CB_SYS_time doesn't implement the Linux time syscall; the return 2 | value isn't written to the argument. */ 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | int 9 | main (void) 10 | { 11 | time_t x = (time_t) -1; 12 | time_t t = time (&x); 13 | 14 | if (t == (time_t) -1 || t != x) 15 | abort (); 16 | printf ("pass\n"); 17 | exit (0); 18 | } 19 | -------------------------------------------------------------------------------- /tests/cris/crt.s: -------------------------------------------------------------------------------- 1 | .data 2 | _stack_start: 3 | .space 8192, 0 4 | _stack_end: 5 | .text 6 | .global _start 7 | _start: 8 | move.d _stack_end, $sp 9 | jsr main 10 | nop 11 | moveq 0, $r10 12 | jump exit 13 | nop 14 | -------------------------------------------------------------------------------- /tests/cris/sys.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #define STRINGIFY(x) #x 4 | #define TOSTRING(x) STRINGIFY(x) 5 | 6 | #define CURRENT_LOCATION __FILE__ ":" TOSTRING(__LINE__) 7 | 8 | #define err() \ 9 | { \ 10 | _fail("at " CURRENT_LOCATION " "); \ 11 | } 12 | 13 | #define mb() asm volatile ("" : : : "memory") 14 | 15 | void pass(void); 16 | void _fail(char *reason); 17 | -------------------------------------------------------------------------------- /tests/hello-i386.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | static inline volatile void exit(int status) 4 | { 5 | int __res; 6 | __asm__ volatile ("movl %%ecx,%%ebx\n"\ 7 | "int $0x80" \ 8 | : "=a" (__res) : "0" (__NR_exit),"c" ((long)(status))); 9 | } 10 | 11 | static inline int write(int fd, const char * buf, int len) 12 | { 13 | int status; 14 | __asm__ volatile ("pushl %%ebx\n"\ 15 | "movl %%esi,%%ebx\n"\ 16 | "int $0x80\n" \ 17 | "popl %%ebx\n"\ 18 | : "=a" (status) \ 19 | : "0" (__NR_write),"S" ((long)(fd)),"c" ((long)(buf)),"d" ((long)(len))); 20 | } 21 | 22 | void _start(void) 23 | { 24 | write(1, "Hello World\n", 12); 25 | exit(0); 26 | } 27 | -------------------------------------------------------------------------------- /tests/lm32/linker.ld: -------------------------------------------------------------------------------- 1 | OUTPUT_FORMAT("elf32-lm32") 2 | ENTRY(_start) 3 | 4 | __DYNAMIC = 0; 5 | 6 | MEMORY { 7 | ram : ORIGIN = 0x08000000, LENGTH = 0x04000000 /* 64M */ 8 | } 9 | 10 | SECTIONS 11 | { 12 | .text : 13 | { 14 | _ftext = .; 15 | *(.text .stub .text.* .gnu.linkonce.t.*) 16 | _etext = .; 17 | } > ram 18 | 19 | .rodata : 20 | { 21 | . = ALIGN(4); 22 | _frodata = .; 23 | *(.rodata .rodata.* .gnu.linkonce.r.*) 24 | *(.rodata1) 25 | _erodata = .; 26 | } > ram 27 | 28 | .data : 29 | { 30 | . = ALIGN(4); 31 | _fdata = .; 32 | *(.data .data.* .gnu.linkonce.d.*) 33 | *(.data1) 34 | _gp = ALIGN(16); 35 | *(.sdata .sdata.* .gnu.linkonce.s.*) 36 | _edata = .; 37 | } > ram 38 | 39 | .bss : 40 | { 41 | . = ALIGN(4); 42 | _fbss = .; 43 | *(.dynsbss) 44 | *(.sbss .sbss.* .gnu.linkonce.sb.*) 45 | *(.scommon) 46 | *(.dynbss) 47 | *(.bss .bss.* .gnu.linkonce.b.*) 48 | *(COMMON) 49 | _ebss = .; 50 | _end = .; 51 | } > ram 52 | } 53 | 54 | PROVIDE(_fstack = ORIGIN(ram) + LENGTH(ram) - 4); 55 | 56 | -------------------------------------------------------------------------------- /tests/lm32/test_addi.S: -------------------------------------------------------------------------------- 1 | .include "macros.inc" 2 | 3 | start 4 | 5 | test_name ADDI_1 6 | mvi r1, 0 7 | addi r3, r1, 0 8 | check_r3 0 9 | 10 | test_name ADDI_2 11 | mvi r1, 0 12 | addi r3, r1, 1 13 | check_r3 1 14 | 15 | test_name ADDI_3 16 | mvi r1, 1 17 | addi r3, r1, 0 18 | check_r3 1 19 | 20 | test_name ADDI_4 21 | mvi r1, 1 22 | addi r3, r1, -1 23 | check_r3 0 24 | 25 | test_name ADDI_5 26 | mvi r1, -1 27 | addi r3, r1, 1 28 | check_r3 0 29 | 30 | test_name ADDI_6 31 | mvi r1, -1 32 | addi r3, r1, 0 33 | check_r3 -1 34 | 35 | test_name ADDI_7 36 | mvi r1, 0 37 | addi r3, r1, -1 38 | check_r3 -1 39 | 40 | test_name ADDI_8 41 | mvi r3, 4 42 | addi r3, r3, 4 43 | check_r3 8 44 | 45 | test_name ADDI_9 46 | mvi r3, 4 47 | addi r3, r3, -4 48 | check_r3 0 49 | 50 | test_name ADDI_10 51 | mvi r3, 4 52 | addi r3, r3, -5 53 | check_r3 -1 54 | 55 | end 56 | 57 | -------------------------------------------------------------------------------- /tests/lm32/test_and.S: -------------------------------------------------------------------------------- 1 | .include "macros.inc" 2 | 3 | start 4 | 5 | test_name AND_1 6 | mvi r1, 0 7 | mvi r2, 0 8 | and r3, r1, r2 9 | check_r3 0 10 | 11 | test_name AND_2 12 | mvi r1, 0 13 | mvi r2, 1 14 | and r3, r1, r2 15 | check_r3 0 16 | 17 | test_name AND_3 18 | mvi r1, 1 19 | mvi r2, 1 20 | and r3, r1, r2 21 | check_r3 1 22 | 23 | test_name AND_4 24 | mvi r3, 7 25 | and r3, r3, r3 26 | check_r3 7 27 | 28 | test_name AND_5 29 | mvi r1, 7 30 | and r3, r1, r1 31 | check_r3 7 32 | 33 | test_name AND_6 34 | mvi r1, 7 35 | mvi r3, 0 36 | and r3, r1, r3 37 | check_r3 0 38 | 39 | test_name AND_7 40 | load r1 0xaa55aa55 41 | load r2 0x55aa55aa 42 | and r3, r1, r2 43 | check_r3 0 44 | 45 | end 46 | -------------------------------------------------------------------------------- /tests/lm32/test_andhi.S: -------------------------------------------------------------------------------- 1 | .include "macros.inc" 2 | 3 | start 4 | 5 | test_name ANDHI_1 6 | mvi r1, 0 7 | andhi r3, r1, 0 8 | check_r3 0 9 | 10 | test_name ANDHI_2 11 | mvi r1, 1 12 | andhi r3, r1, 1 13 | check_r3 0 14 | 15 | test_name ANDHI_3 16 | load r1 0x000f0000 17 | andhi r3, r1, 1 18 | check_r3 0x00010000 19 | 20 | test_name ANDHI_4 21 | load r1 0xffffffff 22 | andhi r3, r1, 0xffff 23 | check_r3 0xffff0000 24 | 25 | test_name ANDHI_5 26 | load r1 0xffffffff 27 | andhi r3, r1, 0 28 | check_r3 0 29 | 30 | test_name ANDHI_6 31 | load r3 0x55aaffff 32 | andhi r3, r3, 0xaaaa 33 | check_r3 0x00aa0000 34 | 35 | end 36 | -------------------------------------------------------------------------------- /tests/lm32/test_andi.S: -------------------------------------------------------------------------------- 1 | .include "macros.inc" 2 | 3 | start 4 | 5 | test_name ANDI_1 6 | mvi r1, 0 7 | andi r3, r1, 0 8 | check_r3 0 9 | 10 | test_name ANDI_2 11 | mvi r1, 1 12 | andi r3, r1, 1 13 | check_r3 1 14 | 15 | test_name ANDI_3 16 | load r1 0x000f0000 17 | andi r3, r1, 1 18 | check_r3 0 19 | 20 | test_name ANDI_4 21 | load r1 0xffffffff 22 | andi r3, r1, 0xffff 23 | check_r3 0xffff 24 | 25 | test_name ANDI_5 26 | load r1 0xffffffff 27 | andi r3, r1, 0 28 | check_r3 0 29 | 30 | test_name ANDI_6 31 | load r3 0xffff55aa 32 | andi r3, r3, 0xaaaa 33 | check_r3 0x000000aa 34 | 35 | end 36 | -------------------------------------------------------------------------------- /tests/lm32/test_b.S: -------------------------------------------------------------------------------- 1 | .include "macros.inc" 2 | 3 | start 4 | 5 | test_name B_1 6 | load r1 jump 7 | b r1 8 | tc_fail 9 | end 10 | 11 | jump: 12 | tc_pass 13 | end 14 | -------------------------------------------------------------------------------- /tests/lm32/test_be.S: -------------------------------------------------------------------------------- 1 | .include "macros.inc" 2 | 3 | start 4 | 5 | test_name BE_1 6 | mvi r1, 0 7 | mvi r2, 0 8 | be r1, r2, 1f 9 | tc_fail 10 | bi 2f 11 | 1: 12 | tc_pass 13 | 2: 14 | 15 | test_name BE_2 16 | mvi r1, 1 17 | mvi r2, 0 18 | be r1, r2, 1f 19 | tc_pass 20 | bi 2f 21 | 1: 22 | tc_fail 23 | 2: 24 | 25 | test_name BE_3 26 | mvi r1, 0 27 | mvi r2, 1 28 | be r1, r2, 1f 29 | tc_pass 30 | bi 2f 31 | 1: 32 | tc_fail 33 | 2: 34 | 35 | bi 2f 36 | 1: 37 | tc_pass 38 | bi 3f 39 | 2: 40 | test_name BE_4 41 | mvi r1, 1 42 | mvi r2, 1 43 | be r1, r2, 1b 44 | tc_fail 45 | 3: 46 | 47 | end 48 | 49 | -------------------------------------------------------------------------------- /tests/lm32/test_bg.S: -------------------------------------------------------------------------------- 1 | .include "macros.inc" 2 | 3 | start 4 | 5 | test_name BG_1 6 | mvi r1, 0 7 | mvi r2, 0 8 | bg r1, r2, 1f 9 | tc_pass 10 | bi 2f 11 | 1: 12 | tc_fail 13 | 2: 14 | 15 | test_name BG_2 16 | mvi r1, 1 17 | mvi r2, 0 18 | bg r1, r2, 1f 19 | tc_fail 20 | bi 2f 21 | 1: 22 | tc_pass 23 | 2: 24 | 25 | test_name BG_3 26 | mvi r1, 0 27 | mvi r2, 1 28 | bg r1, r2, 1f 29 | tc_pass 30 | bi 2f 31 | 1: 32 | tc_fail 33 | 2: 34 | 35 | test_name BG_4 36 | mvi r1, 0 37 | mvi r2, -1 38 | bg r1, r2, 1f 39 | tc_fail 40 | bi 2f 41 | 1: 42 | tc_pass 43 | 2: 44 | 45 | test_name BG_5 46 | mvi r1, -1 47 | mvi r2, 0 48 | bg r1, r2, 1f 49 | tc_pass 50 | bi 2f 51 | 1: 52 | tc_fail 53 | 2: 54 | 55 | test_name BG_6 56 | mvi r1, -1 57 | mvi r2, -1 58 | bg r1, r2, 1f 59 | tc_pass 60 | bi 2f 61 | 1: 62 | tc_fail 63 | 2: 64 | 65 | bi 2f 66 | 1: 67 | tc_pass 68 | bi 3f 69 | 2: 70 | test_name BG_7 71 | mvi r1, 1 72 | mvi r2, 0 73 | bg r1, r2, 1b 74 | tc_fail 75 | 3: 76 | 77 | end 78 | 79 | -------------------------------------------------------------------------------- /tests/lm32/test_bge.S: -------------------------------------------------------------------------------- 1 | .include "macros.inc" 2 | 3 | start 4 | 5 | test_name BGE_1 6 | mvi r1, 0 7 | mvi r2, 0 8 | bge r1, r2, 1f 9 | tc_fail 10 | bi 2f 11 | 1: 12 | tc_pass 13 | 2: 14 | 15 | test_name BGE_2 16 | mvi r1, 1 17 | mvi r2, 0 18 | bge r1, r2, 1f 19 | tc_fail 20 | bi 2f 21 | 1: 22 | tc_pass 23 | 2: 24 | 25 | test_name BGE_3 26 | mvi r1, 0 27 | mvi r2, 1 28 | bge r1, r2, 1f 29 | tc_pass 30 | bi 2f 31 | 1: 32 | tc_fail 33 | 2: 34 | 35 | test_name BGE_4 36 | mvi r1, 0 37 | mvi r2, -1 38 | bge r1, r2, 1f 39 | tc_fail 40 | bi 2f 41 | 1: 42 | tc_pass 43 | 2: 44 | 45 | test_name BGE_5 46 | mvi r1, -1 47 | mvi r2, 0 48 | bge r1, r2, 1f 49 | tc_pass 50 | bi 2f 51 | 1: 52 | tc_fail 53 | 2: 54 | 55 | test_name BGE_6 56 | mvi r1, -1 57 | mvi r2, -1 58 | bge r1, r2, 1f 59 | tc_fail 60 | bi 2f 61 | 1: 62 | tc_pass 63 | 2: 64 | 65 | bi 2f 66 | 1: 67 | tc_pass 68 | bi 3f 69 | 2: 70 | test_name BGE_7 71 | mvi r1, 1 72 | mvi r2, 0 73 | bge r1, r2, 1b 74 | tc_fail 75 | 3: 76 | 77 | end 78 | 79 | -------------------------------------------------------------------------------- /tests/lm32/test_bgeu.S: -------------------------------------------------------------------------------- 1 | .include "macros.inc" 2 | 3 | start 4 | 5 | test_name BGEU_1 6 | mvi r1, 0 7 | mvi r2, 0 8 | bgeu r1, r2, 1f 9 | tc_fail 10 | bi 2f 11 | 1: 12 | tc_pass 13 | 2: 14 | 15 | test_name BGEU_2 16 | mvi r1, 1 17 | mvi r2, 0 18 | bgeu r1, r2, 1f 19 | tc_fail 20 | bi 2f 21 | 1: 22 | tc_pass 23 | 2: 24 | 25 | test_name BGEU_3 26 | mvi r1, 0 27 | mvi r2, 1 28 | bgeu r1, r2, 1f 29 | tc_pass 30 | bi 2f 31 | 1: 32 | tc_fail 33 | 2: 34 | 35 | test_name BGEU_4 36 | mvi r1, 0 37 | mvi r2, -1 38 | bgeu r1, r2, 1f 39 | tc_pass 40 | bi 2f 41 | 1: 42 | tc_fail 43 | 2: 44 | 45 | test_name BGEU_5 46 | mvi r1, -1 47 | mvi r2, 0 48 | bgeu r1, r2, 1f 49 | tc_fail 50 | bi 2f 51 | 1: 52 | tc_pass 53 | 2: 54 | 55 | test_name BGEU_6 56 | mvi r1, -1 57 | mvi r2, -1 58 | bgeu r1, r2, 1f 59 | tc_fail 60 | bi 2f 61 | 1: 62 | tc_pass 63 | 2: 64 | 65 | bi 2f 66 | 1: 67 | tc_pass 68 | bi 3f 69 | 2: 70 | test_name BGEU_7 71 | mvi r1, 1 72 | mvi r2, 0 73 | bgeu r1, r2, 1b 74 | tc_fail 75 | 3: 76 | 77 | end 78 | 79 | -------------------------------------------------------------------------------- /tests/lm32/test_bgu.S: -------------------------------------------------------------------------------- 1 | .include "macros.inc" 2 | 3 | start 4 | 5 | test_name BGU_1 6 | mvi r1, 0 7 | mvi r2, 0 8 | bgu r1, r2, 1f 9 | tc_pass 10 | bi 2f 11 | 1: 12 | tc_fail 13 | 2: 14 | 15 | test_name BGU_2 16 | mvi r1, 1 17 | mvi r2, 0 18 | bgu r1, r2, 1f 19 | tc_fail 20 | bi 2f 21 | 1: 22 | tc_pass 23 | 2: 24 | 25 | test_name BGU_3 26 | mvi r1, 0 27 | mvi r2, 1 28 | bgu r1, r2, 1f 29 | tc_pass 30 | bi 2f 31 | 1: 32 | tc_fail 33 | 2: 34 | 35 | test_name BGU_4 36 | mvi r1, 0 37 | mvi r2, -1 38 | bgu r1, r2, 1f 39 | tc_pass 40 | bi 2f 41 | 1: 42 | tc_fail 43 | 2: 44 | 45 | test_name BGU_5 46 | mvi r1, -1 47 | mvi r2, 0 48 | bgu r1, r2, 1f 49 | tc_fail 50 | bi 2f 51 | 1: 52 | tc_pass 53 | 2: 54 | 55 | test_name BGU_6 56 | mvi r1, -1 57 | mvi r2, -1 58 | bgu r1, r2, 1f 59 | tc_pass 60 | bi 2f 61 | 1: 62 | tc_fail 63 | 2: 64 | 65 | bi 2f 66 | 1: 67 | tc_pass 68 | bi 3f 69 | 2: 70 | test_name BGU_7 71 | mvi r1, 1 72 | mvi r2, 0 73 | bgu r1, r2, 1b 74 | tc_fail 75 | 3: 76 | 77 | end 78 | 79 | -------------------------------------------------------------------------------- /tests/lm32/test_bi.S: -------------------------------------------------------------------------------- 1 | .include "macros.inc" 2 | 3 | start 4 | 5 | test_name BI_1 6 | bi jump 7 | tc_fail 8 | end 9 | 10 | jump_back: 11 | tc_pass 12 | end 13 | 14 | jump: 15 | tc_pass 16 | 17 | test_name BI_2 18 | bi jump_back 19 | tc_fail 20 | 21 | end 22 | 23 | 24 | -------------------------------------------------------------------------------- /tests/lm32/test_bne.S: -------------------------------------------------------------------------------- 1 | .include "macros.inc" 2 | 3 | start 4 | 5 | test_name BNE_1 6 | mvi r1, 0 7 | mvi r2, 0 8 | bne r1, r2, 1f 9 | tc_pass 10 | bi 2f 11 | 1: 12 | tc_fail 13 | 2: 14 | 15 | test_name BNE_2 16 | mvi r1, 1 17 | mvi r2, 0 18 | bne r1, r2, 1f 19 | tc_fail 20 | bi 2f 21 | 1: 22 | tc_pass 23 | 2: 24 | 25 | test_name BNE_3 26 | mvi r1, 0 27 | mvi r2, 1 28 | bne r1, r2, 1f 29 | tc_fail 30 | bi 2f 31 | 1: 32 | tc_pass 33 | 2: 34 | 35 | bi 2f 36 | 1: 37 | tc_fail 38 | bi 3f 39 | 2: 40 | test_name BNE_4 41 | mvi r1, 1 42 | mvi r2, 1 43 | bne r1, r2, 1b 44 | tc_pass 45 | 3: 46 | 47 | end 48 | 49 | -------------------------------------------------------------------------------- /tests/lm32/test_break.S: -------------------------------------------------------------------------------- 1 | .include "macros.inc" 2 | 3 | start 4 | 5 | test_name BREAK_1 6 | mvi r1, 1 7 | wcsr IE, r1 8 | insn: 9 | break 10 | check_excp 1 11 | 12 | test_name BREAK_2 13 | mv r3, ba 14 | check_r3 insn 15 | 16 | test_name BREAK_3 17 | rcsr r3, IE 18 | check_r3 4 19 | 20 | end 21 | -------------------------------------------------------------------------------- /tests/lm32/test_bret.S: -------------------------------------------------------------------------------- 1 | .include "macros.inc" 2 | 3 | start 4 | 5 | test_name BRET_1 6 | mvi r1, 4 7 | wcsr IE, r1 8 | load ba mark 9 | bret 10 | tc_fail 11 | bi 1f 12 | 13 | mark: 14 | tc_pass 15 | 16 | 1: 17 | test_name BRET_2 18 | rcsr r3, IE 19 | check_r3 5 20 | 21 | test_name BRET_3 22 | mvi r1, 0 23 | wcsr IE, r1 24 | load ba mark2 25 | bret 26 | tc_fail 27 | bi 1f 28 | 29 | mark2: 30 | tc_pass 31 | 32 | 1: 33 | test_name BRET_4 34 | rcsr r3, IE 35 | check_r3 0 36 | 37 | end 38 | 39 | -------------------------------------------------------------------------------- /tests/lm32/test_call.S: -------------------------------------------------------------------------------- 1 | .include "macros.inc" 2 | 3 | start 4 | 5 | test_name CALL_1 6 | load r1 mark 7 | call r1 8 | return: 9 | 10 | tc_fail 11 | end 12 | 13 | mark: 14 | mv r3, ra 15 | check_r3 return 16 | end 17 | -------------------------------------------------------------------------------- /tests/lm32/test_calli.S: -------------------------------------------------------------------------------- 1 | .include "macros.inc" 2 | 3 | start 4 | 5 | test_name CALLI_1 6 | calli mark 7 | return: 8 | 9 | tc_fail 10 | end 11 | 12 | mark: 13 | mv r3, ra 14 | check_r3 return 15 | end 16 | -------------------------------------------------------------------------------- /tests/lm32/test_cmpe.S: -------------------------------------------------------------------------------- 1 | .include "macros.inc" 2 | 3 | start 4 | 5 | test_name CMPE_1 6 | mvi r1, 0 7 | mvi r2, 0 8 | cmpe r3, r1, r2 9 | check_r3 1 10 | 11 | test_name CMPE_2 12 | mvi r1, 0 13 | mvi r2, 1 14 | cmpe r3, r1, r2 15 | check_r3 0 16 | 17 | test_name CMPE_3 18 | mvi r1, 1 19 | mvi r2, 0 20 | cmpe r3, r1, r2 21 | check_r3 0 22 | 23 | test_name CMPE_4 24 | mvi r3, 0 25 | mvi r2, 1 26 | cmpe r3, r3, r2 27 | check_r3 0 28 | 29 | test_name CMPE_5 30 | mvi r3, 0 31 | mvi r2, 0 32 | cmpe r3, r3, r2 33 | check_r3 1 34 | 35 | test_name CMPE_6 36 | mvi r3, 0 37 | cmpe r3, r3, r3 38 | check_r3 1 39 | 40 | end 41 | -------------------------------------------------------------------------------- /tests/lm32/test_cmpei.S: -------------------------------------------------------------------------------- 1 | .include "macros.inc" 2 | 3 | start 4 | 5 | test_name CMPEI_1 6 | mvi r1, 0 7 | cmpei r3, r1, 0 8 | check_r3 1 9 | 10 | test_name CMPEI_2 11 | mvi r1, 0 12 | cmpei r3, r1, 1 13 | check_r3 0 14 | 15 | test_name CMPEI_3 16 | mvi r1, 1 17 | cmpei r3, r1, 0 18 | check_r3 0 19 | 20 | test_name CMPEI_4 21 | load r1 0xffffffff 22 | cmpei r3, r1, -1 23 | check_r3 1 24 | 25 | test_name CMPEI_5 26 | mvi r3, 0 27 | cmpei r3, r3, 0 28 | check_r3 1 29 | 30 | test_name CMPEI_6 31 | mvi r3, 0 32 | cmpei r3, r3, 1 33 | check_r3 0 34 | 35 | end 36 | -------------------------------------------------------------------------------- /tests/lm32/test_cmpg.S: -------------------------------------------------------------------------------- 1 | .include "macros.inc" 2 | 3 | start 4 | 5 | test_name CMPG_1 6 | mvi r1, 0 7 | mvi r2, 0 8 | cmpg r3, r1, r2 9 | check_r3 0 10 | 11 | test_name CMPG_2 12 | mvi r1, 0 13 | mvi r2, 1 14 | cmpg r3, r1, r2 15 | check_r3 0 16 | 17 | test_name CMPG_3 18 | mvi r1, 1 19 | mvi r2, 0 20 | cmpg r3, r1, r2 21 | check_r3 1 22 | 23 | test_name CMPG_4 24 | mvi r1, 1 25 | mvi r2, 1 26 | cmpg r3, r1, r2 27 | check_r3 0 28 | 29 | test_name CMPG_5 30 | mvi r1, 0 31 | mvi r2, -1 32 | cmpg r3, r1, r2 33 | check_r3 1 34 | 35 | test_name CMPG_6 36 | mvi r1, -1 37 | mvi r2, 0 38 | cmpg r3, r1, r2 39 | check_r3 0 40 | 41 | test_name CMPG_7 42 | mvi r1, -1 43 | mvi r2, -1 44 | cmpg r3, r1, r2 45 | check_r3 0 46 | 47 | test_name CMPG_8 48 | mvi r3, 0 49 | mvi r2, 1 50 | cmpg r3, r3, r2 51 | check_r3 0 52 | 53 | test_name CMPG_9 54 | mvi r3, 1 55 | mvi r2, 0 56 | cmpg r3, r3, r2 57 | check_r3 1 58 | 59 | test_name CMPG_10 60 | mvi r3, 0 61 | cmpg r3, r3, r3 62 | check_r3 0 63 | 64 | end 65 | -------------------------------------------------------------------------------- /tests/lm32/test_cmpge.S: -------------------------------------------------------------------------------- 1 | .include "macros.inc" 2 | 3 | start 4 | 5 | test_name CMPGE_1 6 | mvi r1, 0 7 | mvi r2, 0 8 | cmpge r3, r1, r2 9 | check_r3 1 10 | 11 | test_name CMPGE_2 12 | mvi r1, 0 13 | mvi r2, 1 14 | cmpge r3, r1, r2 15 | check_r3 0 16 | 17 | test_name CMPGE_3 18 | mvi r1, 1 19 | mvi r2, 0 20 | cmpge r3, r1, r2 21 | check_r3 1 22 | 23 | test_name CMPGE_4 24 | mvi r1, 1 25 | mvi r2, 1 26 | cmpge r3, r1, r2 27 | check_r3 1 28 | 29 | test_name CMPGE_5 30 | mvi r1, 0 31 | mvi r2, -1 32 | cmpge r3, r1, r2 33 | check_r3 1 34 | 35 | test_name CMPGE_6 36 | mvi r1, -1 37 | mvi r2, 0 38 | cmpge r3, r1, r2 39 | check_r3 0 40 | 41 | test_name CMPGE_7 42 | mvi r1, -1 43 | mvi r2, -1 44 | cmpge r3, r1, r2 45 | check_r3 1 46 | 47 | test_name CMPGE_8 48 | mvi r3, 0 49 | mvi r2, 1 50 | cmpge r3, r3, r2 51 | check_r3 0 52 | 53 | test_name CMPGE_9 54 | mvi r3, 1 55 | mvi r2, 0 56 | cmpge r3, r3, r2 57 | check_r3 1 58 | 59 | test_name CMPGE_10 60 | mvi r3, 0 61 | cmpge r3, r3, r3 62 | check_r3 1 63 | 64 | end 65 | -------------------------------------------------------------------------------- /tests/lm32/test_cmpgei.S: -------------------------------------------------------------------------------- 1 | .include "macros.inc" 2 | 3 | start 4 | 5 | test_name CMPGEI_1 6 | mvi r1, 0 7 | cmpgei r3, r1, 0 8 | check_r3 1 9 | 10 | test_name CMPGEI_2 11 | mvi r1, 0 12 | cmpgei r3, r1, 1 13 | check_r3 0 14 | 15 | test_name CMPGEI_3 16 | mvi r1, 1 17 | cmpgei r3, r1, 0 18 | check_r3 1 19 | 20 | test_name CMPGEI_4 21 | mvi r1, 1 22 | cmpgei r3, r1, 1 23 | check_r3 1 24 | 25 | test_name CMPGEI_5 26 | mvi r1, 0 27 | cmpgei r3, r1, -1 28 | check_r3 1 29 | 30 | test_name CMPGEI_6 31 | mvi r1, -1 32 | cmpgei r3, r1, 0 33 | check_r3 0 34 | 35 | test_name CMPGEI_7 36 | mvi r1, -1 37 | cmpgei r3, r1, -1 38 | check_r3 1 39 | 40 | test_name CMPGEI_8 41 | mvi r3, 0 42 | cmpgei r3, r3, 1 43 | check_r3 0 44 | 45 | test_name CMPGEI_9 46 | mvi r3, 1 47 | cmpgei r3, r3, 0 48 | check_r3 1 49 | 50 | test_name CMPGEI_10 51 | mvi r3, 0 52 | cmpgei r3, r3, 0 53 | check_r3 1 54 | 55 | end 56 | -------------------------------------------------------------------------------- /tests/lm32/test_cmpgeu.S: -------------------------------------------------------------------------------- 1 | .include "macros.inc" 2 | 3 | start 4 | 5 | test_name CMPGEU_1 6 | mvi r1, 0 7 | mvi r2, 0 8 | cmpgeu r3, r1, r2 9 | check_r3 1 10 | 11 | test_name CMPGEU_2 12 | mvi r1, 0 13 | mvi r2, 1 14 | cmpgeu r3, r1, r2 15 | check_r3 0 16 | 17 | test_name CMPGEU_3 18 | mvi r1, 1 19 | mvi r2, 0 20 | cmpgeu r3, r1, r2 21 | check_r3 1 22 | 23 | test_name CMPGEU_4 24 | mvi r1, 1 25 | mvi r2, 1 26 | cmpgeu r3, r1, r2 27 | check_r3 1 28 | 29 | test_name CMPGEU_5 30 | mvi r1, 0 31 | mvi r2, -1 32 | cmpgeu r3, r1, r2 33 | check_r3 0 34 | 35 | test_name CMPGEU_6 36 | mvi r1, -1 37 | mvi r2, 0 38 | cmpgeu r3, r1, r2 39 | check_r3 1 40 | 41 | test_name CMPGEU_7 42 | mvi r1, -1 43 | mvi r2, -1 44 | cmpgeu r3, r1, r2 45 | check_r3 1 46 | 47 | test_name CMPGEU_8 48 | mvi r3, 0 49 | mvi r2, 1 50 | cmpgeu r3, r3, r2 51 | check_r3 0 52 | 53 | test_name CMPGEU_9 54 | mvi r3, 1 55 | mvi r2, 0 56 | cmpgeu r3, r3, r2 57 | check_r3 1 58 | 59 | test_name CMPGEU_10 60 | mvi r3, 0 61 | cmpgeu r3, r3, r3 62 | check_r3 1 63 | 64 | end 65 | -------------------------------------------------------------------------------- /tests/lm32/test_cmpgeui.S: -------------------------------------------------------------------------------- 1 | .include "macros.inc" 2 | 3 | start 4 | 5 | test_name CMPGEUI_1 6 | mvi r1, 0 7 | cmpgeui r3, r1, 0 8 | check_r3 1 9 | 10 | test_name CMPGEUI_2 11 | mvi r1, 0 12 | cmpgeui r3, r1, 1 13 | check_r3 0 14 | 15 | test_name CMPGEUI_3 16 | mvi r1, 1 17 | cmpgeui r3, r1, 0 18 | check_r3 1 19 | 20 | test_name CMPGEUI_4 21 | mvi r1, 1 22 | cmpgeui r3, r1, 1 23 | check_r3 1 24 | 25 | test_name CMPGEUI_5 26 | mvi r1, 0 27 | cmpgeui r3, r1, 0xffff 28 | check_r3 0 29 | 30 | test_name CMPGEUI_6 31 | mvi r1, -1 32 | cmpgeui r3, r1, 0 33 | check_r3 1 34 | 35 | test_name CMPGEUI_7 36 | mvi r1, -1 37 | cmpgeui r3, r1, 0xffff 38 | check_r3 1 39 | 40 | test_name CMPGEUI_8 41 | mvi r3, 0 42 | cmpgeui r3, r3, 1 43 | check_r3 0 44 | 45 | test_name CMPGEUI_9 46 | mvi r3, 1 47 | cmpgeui r3, r3, 0 48 | check_r3 1 49 | 50 | test_name CMPGEUI_10 51 | mvi r3, 0 52 | cmpgeui r3, r3, 0 53 | check_r3 1 54 | 55 | end 56 | -------------------------------------------------------------------------------- /tests/lm32/test_cmpgi.S: -------------------------------------------------------------------------------- 1 | .include "macros.inc" 2 | 3 | start 4 | 5 | test_name CMPGI_1 6 | mvi r1, 0 7 | cmpgi r3, r1, 0 8 | check_r3 0 9 | 10 | test_name CMPGI_2 11 | mvi r1, 0 12 | cmpgi r3, r1, 1 13 | check_r3 0 14 | 15 | test_name CMPGI_3 16 | mvi r1, 1 17 | cmpgi r3, r1, 0 18 | check_r3 1 19 | 20 | test_name CMPGI_4 21 | mvi r1, 1 22 | cmpgi r3, r1, 1 23 | check_r3 0 24 | 25 | test_name CMPGI_5 26 | mvi r1, 0 27 | cmpgi r3, r1, -1 28 | check_r3 1 29 | 30 | test_name CMPGI_6 31 | mvi r1, -1 32 | cmpgi r3, r1, 0 33 | check_r3 0 34 | 35 | test_name CMPGI_7 36 | mvi r1, -1 37 | cmpgi r3, r1, -1 38 | check_r3 0 39 | 40 | test_name CMPGI_8 41 | mvi r3, 0 42 | cmpgi r3, r3, 1 43 | check_r3 0 44 | 45 | test_name CMPGI_9 46 | mvi r3, 1 47 | cmpgi r3, r3, 0 48 | check_r3 1 49 | 50 | test_name CMPGI_10 51 | mvi r3, 0 52 | cmpgi r3, r3, 0 53 | check_r3 0 54 | 55 | end 56 | -------------------------------------------------------------------------------- /tests/lm32/test_cmpgu.S: -------------------------------------------------------------------------------- 1 | .include "macros.inc" 2 | 3 | start 4 | 5 | test_name CMPGU_1 6 | mvi r1, 0 7 | mvi r2, 0 8 | cmpgu r3, r1, r2 9 | check_r3 0 10 | 11 | test_name CMPGU_2 12 | mvi r1, 0 13 | mvi r2, 1 14 | cmpgu r3, r1, r2 15 | check_r3 0 16 | 17 | test_name CMPGU_3 18 | mvi r1, 1 19 | mvi r2, 0 20 | cmpgu r3, r1, r2 21 | check_r3 1 22 | 23 | test_name CMPGU_4 24 | mvi r1, 1 25 | mvi r2, 1 26 | cmpgu r3, r1, r2 27 | check_r3 0 28 | 29 | test_name CMPGU_5 30 | mvi r1, 0 31 | mvi r2, -1 32 | cmpgu r3, r1, r2 33 | check_r3 0 34 | 35 | test_name CMPGU_6 36 | mvi r1, -1 37 | mvi r2, 0 38 | cmpgu r3, r1, r2 39 | check_r3 1 40 | 41 | test_name CMPGU_7 42 | mvi r1, -1 43 | mvi r2, -1 44 | cmpgu r3, r1, r2 45 | check_r3 0 46 | 47 | test_name CMPGU_8 48 | mvi r3, 0 49 | mvi r2, 1 50 | cmpgu r3, r3, r2 51 | check_r3 0 52 | 53 | test_name CMPGU_9 54 | mvi r3, 1 55 | mvi r2, 0 56 | cmpgu r3, r3, r2 57 | check_r3 1 58 | 59 | test_name CMPGU_10 60 | mvi r3, 0 61 | cmpgu r3, r3, r3 62 | check_r3 0 63 | 64 | end 65 | -------------------------------------------------------------------------------- /tests/lm32/test_cmpgui.S: -------------------------------------------------------------------------------- 1 | .include "macros.inc" 2 | 3 | start 4 | 5 | test_name CMPGUI_1 6 | mvi r1, 0 7 | cmpgui r3, r1, 0 8 | check_r3 0 9 | 10 | test_name CMPGUI_2 11 | mvi r1, 0 12 | cmpgui r3, r1, 1 13 | check_r3 0 14 | 15 | test_name CMPGUI_3 16 | mvi r1, 1 17 | cmpgui r3, r1, 0 18 | check_r3 1 19 | 20 | test_name CMPGUI_4 21 | mvi r1, 1 22 | cmpgui r3, r1, 1 23 | check_r3 0 24 | 25 | test_name CMPGUI_5 26 | mvi r1, 0 27 | cmpgui r3, r1, 0xffff 28 | check_r3 0 29 | 30 | test_name CMPGUI_6 31 | mvi r1, -1 32 | cmpgui r3, r1, 0 33 | check_r3 1 34 | 35 | test_name CMPGUI_7 36 | mvi r1, -1 37 | cmpgui r3, r1, 0xffff 38 | check_r3 0 39 | 40 | test_name CMPGUI_8 41 | mvi r3, 0 42 | cmpgui r3, r3, 1 43 | check_r3 0 44 | 45 | test_name CMPGUI_9 46 | mvi r3, 1 47 | cmpgui r3, r3, 0 48 | check_r3 1 49 | 50 | test_name CMPGUI_10 51 | mvi r3, 0 52 | cmpgui r3, r3, 0 53 | check_r3 0 54 | 55 | end 56 | -------------------------------------------------------------------------------- /tests/lm32/test_cmpne.S: -------------------------------------------------------------------------------- 1 | .include "macros.inc" 2 | 3 | start 4 | 5 | test_name CMPNE_1 6 | mvi r1, 0 7 | mvi r2, 0 8 | cmpne r3, r1, r2 9 | check_r3 0 10 | 11 | test_name CMPNE_2 12 | mvi r1, 0 13 | mvi r2, 1 14 | cmpne r3, r1, r2 15 | check_r3 1 16 | 17 | test_name CMPNE_3 18 | mvi r1, 1 19 | mvi r2, 0 20 | cmpne r3, r1, r2 21 | check_r3 1 22 | 23 | test_name CMPNE_4 24 | mvi r3, 0 25 | mvi r2, 1 26 | cmpne r3, r3, r2 27 | check_r3 1 28 | 29 | test_name CMPNE_5 30 | mvi r3, 0 31 | mvi r2, 0 32 | cmpne r3, r3, r2 33 | check_r3 0 34 | 35 | test_name CMPNE_6 36 | mvi r3, 0 37 | cmpne r3, r3, r3 38 | check_r3 0 39 | 40 | end 41 | -------------------------------------------------------------------------------- /tests/lm32/test_cmpnei.S: -------------------------------------------------------------------------------- 1 | .include "macros.inc" 2 | 3 | start 4 | 5 | test_name CMPNEI_1 6 | mvi r1, 0 7 | cmpnei r3, r1, 0 8 | check_r3 0 9 | 10 | test_name CMPNEI_2 11 | mvi r1, 0 12 | cmpnei r3, r1, 1 13 | check_r3 1 14 | 15 | test_name CMPNEI_3 16 | mvi r1, 1 17 | cmpnei r3, r1, 0 18 | check_r3 1 19 | 20 | test_name CMPNEI_4 21 | load r1 0xffffffff 22 | cmpnei r3, r1, -1 23 | check_r3 0 24 | 25 | test_name CMPNEI_5 26 | mvi r3, 0 27 | cmpnei r3, r3, 0 28 | check_r3 0 29 | 30 | test_name CMPNEI_6 31 | mvi r3, 0 32 | cmpnei r3, r3, 1 33 | check_r3 1 34 | 35 | end 36 | -------------------------------------------------------------------------------- /tests/lm32/test_divu.S: -------------------------------------------------------------------------------- 1 | .include "macros.inc" 2 | 3 | start 4 | 5 | test_name DIVU_1 6 | mvi r1, 0 7 | mvi r2, 1 8 | divu r3, r1, r2 9 | check_r3 0 10 | 11 | test_name DIVU_2 12 | mvi r1, 1 13 | mvi r2, 1 14 | divu r3, r1, r2 15 | check_r3 1 16 | 17 | test_name DIVU_3 18 | mvi r1, 0 19 | mvi r2, 0 20 | divu r3, r1, r2 21 | check_excp 16 22 | 23 | test_name DIVU_4 24 | load r1 0xabcdef12 25 | load r2 0x12345 26 | divu r3, r1, r2 27 | check_r3 0x9700 28 | 29 | end 30 | -------------------------------------------------------------------------------- /tests/lm32/test_eret.S: -------------------------------------------------------------------------------- 1 | .include "macros.inc" 2 | 3 | start 4 | 5 | test_name ERET_1 6 | mvi r1, 2 7 | wcsr IE, r1 8 | load ea mark 9 | eret 10 | tc_fail 11 | bi 1f 12 | 13 | mark: 14 | tc_pass 15 | 16 | 1: 17 | test_name ERET_2 18 | rcsr r3, IE 19 | check_r3 3 20 | 21 | test_name ERET_3 22 | mvi r1, 0 23 | wcsr IE, r1 24 | load ea mark2 25 | eret 26 | tc_fail 27 | bi 1f 28 | 29 | mark2: 30 | tc_pass 31 | 32 | 1: 33 | test_name ERET_4 34 | rcsr r3, IE 35 | check_r3 0 36 | 37 | end 38 | 39 | -------------------------------------------------------------------------------- /tests/lm32/test_lb.S: -------------------------------------------------------------------------------- 1 | .include "macros.inc" 2 | 3 | start 4 | 5 | test_name LB_1 6 | load r1 data 7 | lb r3, (r1+0) 8 | check_r3 0x7e 9 | 10 | test_name LB_2 11 | lb r3, (r1+1) 12 | check_r3 0x7f 13 | 14 | test_name LB_3 15 | lb r3, (r1+-1) 16 | check_r3 0x7d 17 | 18 | test_name LB_4 19 | load r1 data_msb 20 | lb r3, (r1+0) 21 | check_r3 0xfffffffe 22 | 23 | test_name LB_5 24 | lb r3, (r1+1) 25 | check_r3 0xffffffff 26 | 27 | test_name LB_6 28 | lb r3, (r1+-1) 29 | check_r3 0xfffffffd 30 | 31 | test_name LB_7 32 | load r3 data 33 | lb r3, (r3+0) 34 | check_r3 0x7e 35 | 36 | end 37 | 38 | .data 39 | .align 4 40 | .byte 0x7a, 0x7b, 0x7c, 0x7d 41 | data: 42 | .byte 0x7e, 0x7f, 0x70, 0x71 43 | .byte 0xfa, 0xfb, 0xfc, 0xfd 44 | data_msb: 45 | .byte 0xfe, 0xff, 0xf0, 0xf1 46 | -------------------------------------------------------------------------------- /tests/lm32/test_lbu.S: -------------------------------------------------------------------------------- 1 | .include "macros.inc" 2 | 3 | start 4 | 5 | test_name LBU_1 6 | load r1 data 7 | lbu r3, (r1+0) 8 | check_r3 0x7e 9 | 10 | test_name LBU_2 11 | lbu r3, (r1+1) 12 | check_r3 0x7f 13 | 14 | test_name LBU_3 15 | lbu r3, (r1+-1) 16 | check_r3 0x7d 17 | 18 | test_name LBU_4 19 | load r1 data_msb 20 | lbu r3, (r1+0) 21 | check_r3 0xfe 22 | 23 | test_name LBU_5 24 | lbu r3, (r1+1) 25 | check_r3 0xff 26 | 27 | test_name LBU_6 28 | lbu r3, (r1+-1) 29 | check_r3 0xfd 30 | 31 | test_name LBU_7 32 | load r3 data 33 | lbu r3, (r3+0) 34 | check_r3 0x7e 35 | 36 | end 37 | 38 | .data 39 | .align 4 40 | .byte 0x7a, 0x7b, 0x7c, 0x7d 41 | data: 42 | .byte 0x7e, 0x7f, 0x70, 0x71 43 | .byte 0xfa, 0xfb, 0xfc, 0xfd 44 | data_msb: 45 | .byte 0xfe, 0xff, 0xf0, 0xf1 46 | -------------------------------------------------------------------------------- /tests/lm32/test_lh.S: -------------------------------------------------------------------------------- 1 | .include "macros.inc" 2 | 3 | start 4 | 5 | test_name LH_1 6 | load r1 data 7 | lh r3, (r1+0) 8 | check_r3 0x7e7f 9 | 10 | test_name LH_2 11 | lh r3, (r1+2) 12 | check_r3 0x7071 13 | 14 | test_name LH_3 15 | lh r3, (r1+-2) 16 | check_r3 0x7c7d 17 | 18 | test_name LH_4 19 | load r1 data_msb 20 | lh r3, (r1+0) 21 | check_r3 0xfffffeff 22 | 23 | test_name LH_5 24 | lh r3, (r1+2) 25 | check_r3 0xfffff0f1 26 | 27 | test_name LH_6 28 | lh r3, (r1+-2) 29 | check_r3 0xfffffcfd 30 | 31 | test_name LH_7 32 | load r3 data 33 | lh r3, (r3+0) 34 | check_r3 0x7e7f 35 | 36 | end 37 | 38 | .data 39 | .align 4 40 | .byte 0x7a, 0x7b, 0x7c, 0x7d 41 | data: 42 | .byte 0x7e, 0x7f, 0x70, 0x71 43 | .byte 0xfa, 0xfb, 0xfc, 0xfd 44 | data_msb: 45 | .byte 0xfe, 0xff, 0xf0, 0xf1 46 | -------------------------------------------------------------------------------- /tests/lm32/test_lhu.S: -------------------------------------------------------------------------------- 1 | .include "macros.inc" 2 | 3 | start 4 | 5 | test_name LHU_1 6 | load r1 data 7 | lhu r3, (r1+0) 8 | check_r3 0x7e7f 9 | 10 | test_name LHU_2 11 | lhu r3, (r1+2) 12 | check_r3 0x7071 13 | 14 | test_name LHU_3 15 | lhu r3, (r1+-2) 16 | check_r3 0x7c7d 17 | 18 | test_name LHU_4 19 | load r1 data_msb 20 | lhu r3, (r1+0) 21 | check_r3 0xfeff 22 | 23 | test_name LHU_5 24 | lhu r3, (r1+2) 25 | check_r3 0xf0f1 26 | 27 | test_name LHU_6 28 | lhu r3, (r1+-2) 29 | check_r3 0xfcfd 30 | 31 | test_name LHU_7 32 | load r3 data 33 | lhu r3, (r3+0) 34 | check_r3 0x7e7f 35 | 36 | end 37 | 38 | .data 39 | .align 4 40 | .byte 0x7a, 0x7b, 0x7c, 0x7d 41 | data: 42 | .byte 0x7e, 0x7f, 0x70, 0x71 43 | .byte 0xfa, 0xfb, 0xfc, 0xfd 44 | data_msb: 45 | .byte 0xfe, 0xff, 0xf0, 0xf1 46 | -------------------------------------------------------------------------------- /tests/lm32/test_lw.S: -------------------------------------------------------------------------------- 1 | .include "macros.inc" 2 | 3 | start 4 | 5 | test_name LW_1 6 | load r1 data 7 | lw r3, (r1+0) 8 | check_r3 0x7e7f7071 9 | 10 | test_name LW_2 11 | lw r3, (r1+4) 12 | check_r3 0x72737475 13 | 14 | test_name LW_3 15 | lw r3, (r1+-4) 16 | check_r3 0x7a7b7c7d 17 | 18 | test_name LW_4 19 | load r3 data 20 | lw r3, (r3+0) 21 | check_r3 0x7e7f7071 22 | 23 | end 24 | 25 | .data 26 | .align 4 27 | .byte 0x7a, 0x7b, 0x7c, 0x7d 28 | data: 29 | .byte 0x7e, 0x7f, 0x70, 0x71 30 | .byte 0x72, 0x73, 0x74, 0x75 31 | -------------------------------------------------------------------------------- /tests/lm32/test_modu.S: -------------------------------------------------------------------------------- 1 | .include "macros.inc" 2 | 3 | start 4 | 5 | test_name MODU_1 6 | mvi r1, 0 7 | mvi r2, 1 8 | modu r3, r1, r2 9 | check_r3 0 10 | 11 | test_name MODU_2 12 | mvi r1, 1 13 | mvi r2, 1 14 | modu r3, r1, r2 15 | check_r3 0 16 | 17 | test_name MODU_3 18 | mvi r1, 3 19 | mvi r2, 2 20 | modu r3, r1, r2 21 | check_r3 1 22 | 23 | test_name MODU_4 24 | mvi r1, 0 25 | mvi r2, 0 26 | modu r3, r1, r2 27 | check_excp 16 28 | 29 | test_name MODU_5 30 | load r1 0xabcdef12 31 | load r2 0x12345 32 | modu r3, r1, r2 33 | check_r3 0x3c12 34 | 35 | end 36 | -------------------------------------------------------------------------------- /tests/lm32/test_muli.S: -------------------------------------------------------------------------------- 1 | .include "macros.inc" 2 | 3 | start 4 | 5 | test_name MULI_1 6 | mvi r1, 0 7 | muli r3, r1, 0 8 | check_r3 0 9 | 10 | test_name MULI_2 11 | mvi r1, 1 12 | muli r3, r1, 0 13 | check_r3 0 14 | 15 | test_name MULI_3 16 | mvi r1, 0 17 | muli r3, r1, 1 18 | check_r3 0 19 | 20 | test_name MULI_4 21 | mvi r1, 1 22 | muli r3, r1, 1 23 | check_r3 1 24 | 25 | test_name MULI_5 26 | mvi r1, 2 27 | muli r3, r1, -1 28 | check_r3 -2 29 | 30 | test_name MULI_6 31 | mvi r1, -2 32 | muli r3, r1, -1 33 | check_r3 2 34 | 35 | test_name MULI_7 36 | mvi r1, 0x1234 37 | muli r3, r1, 0x789 38 | check_r3 0x8929d4 39 | 40 | test_name MULI_8 41 | mvi r3, 4 42 | muli r3, r3, 4 43 | check_r3 16 44 | 45 | end 46 | -------------------------------------------------------------------------------- /tests/lm32/test_nor.S: -------------------------------------------------------------------------------- 1 | .include "macros.inc" 2 | 3 | start 4 | 5 | test_name NOR_1 6 | mvi r1, 0 7 | mvi r2, 0 8 | nor r3, r1, r2 9 | check_r3 0xffffffff 10 | 11 | test_name NOR_2 12 | mvi r1, 0 13 | mvi r2, 1 14 | nor r3, r1, r2 15 | check_r3 0xfffffffe 16 | 17 | test_name NOR_3 18 | mvi r1, 1 19 | mvi r2, 1 20 | nor r3, r1, r2 21 | check_r3 0xfffffffe 22 | 23 | test_name NOR_4 24 | mvi r1, 1 25 | mvi r2, 0 26 | nor r3, r1, r2 27 | check_r3 0xfffffffe 28 | 29 | test_name NOR_5 30 | load r1 0xaa55aa55 31 | load r2 0x55aa55aa 32 | nor r3, r1, r2 33 | check_r3 0 34 | 35 | test_name NOR_6 36 | load r1 0xaa550000 37 | load r2 0x0000aa55 38 | nor r3, r1, r2 39 | check_r3 0x55aa55aa 40 | 41 | test_name NOR_7 42 | load r1 0xaa55aa55 43 | nor r3, r1, r1 44 | check_r3 0x55aa55aa 45 | 46 | test_name NOR_8 47 | load r3 0xaa55aa55 48 | nor r3, r3, r3 49 | check_r3 0x55aa55aa 50 | 51 | end 52 | -------------------------------------------------------------------------------- /tests/lm32/test_nori.S: -------------------------------------------------------------------------------- 1 | .include "macros.inc" 2 | 3 | start 4 | 5 | test_name NORI_1 6 | mvi r1, 0 7 | nori r3, r1, 0 8 | check_r3 0xffffffff 9 | 10 | test_name NORI_2 11 | mvi r1, 0 12 | nori r3, r1, 1 13 | check_r3 0xfffffffe 14 | 15 | test_name NORI_3 16 | mvi r1, 1 17 | nori r3, r1, 1 18 | check_r3 0xfffffffe 19 | 20 | test_name NORI_4 21 | mvi r1, 1 22 | nori r3, r1, 0 23 | check_r3 0xfffffffe 24 | 25 | test_name NORI_5 26 | load r1 0xaa55aa55 27 | nori r3, r1, 0x55aa 28 | check_r3 0x55aa0000 29 | 30 | test_name NORI_6 31 | load r3 0xaa55aa55 32 | nori r3, r3, 0x55aa 33 | check_r3 0x55aa0000 34 | 35 | end 36 | -------------------------------------------------------------------------------- /tests/lm32/test_or.S: -------------------------------------------------------------------------------- 1 | .include "macros.inc" 2 | 3 | start 4 | 5 | test_name OR_1 6 | mvi r1, 0 7 | mvi r2, 0 8 | or r3, r1, r2 9 | check_r3 0 10 | 11 | test_name OR_2 12 | mvi r1, 0 13 | mvi r2, 1 14 | or r3, r1, r2 15 | check_r3 1 16 | 17 | test_name OR_3 18 | mvi r1, 1 19 | mvi r2, 1 20 | or r3, r1, r2 21 | check_r3 1 22 | 23 | test_name OR_4 24 | mvi r1, 1 25 | mvi r2, 0 26 | or r3, r1, r2 27 | check_r3 1 28 | 29 | test_name OR_5 30 | load r1 0xaa55aa55 31 | load r2 0x55aa55aa 32 | or r3, r1, r2 33 | check_r3 0xffffffff 34 | 35 | test_name OR_6 36 | load r1 0xaa550000 37 | load r2 0x0000aa55 38 | or r3, r1, r2 39 | check_r3 0xaa55aa55 40 | 41 | test_name OR_7 42 | load r1 0xaa55aa55 43 | or r3, r1, r1 44 | check_r3 0xaa55aa55 45 | 46 | test_name OR_8 47 | load r3 0xaa55aa55 48 | or r3, r3, r3 49 | check_r3 0xaa55aa55 50 | 51 | end 52 | -------------------------------------------------------------------------------- /tests/lm32/test_orhi.S: -------------------------------------------------------------------------------- 1 | .include "macros.inc" 2 | 3 | start 4 | 5 | test_name ORHI_1 6 | mvi r1, 0 7 | orhi r3, r1, 0 8 | check_r3 0 9 | 10 | test_name ORHI_2 11 | mvi r1, 0 12 | orhi r3, r1, 1 13 | check_r3 0x00010000 14 | 15 | test_name ORHI_3 16 | load r1 0x00010000 17 | orhi r3, r1, 1 18 | check_r3 0x00010000 19 | 20 | test_name ORHI_4 21 | mvi r1, 1 22 | orhi r3, r1, 0 23 | check_r3 1 24 | 25 | test_name ORHI_5 26 | load r1 0xaa55aa55 27 | orhi r3, r1, 0x55aa 28 | check_r3 0xffffaa55 29 | 30 | test_name ORHI_6 31 | load r3 0xaa55aa55 32 | orhi r3, r3, 0x55aa 33 | check_r3 0xffffaa55 34 | 35 | end 36 | -------------------------------------------------------------------------------- /tests/lm32/test_ori.S: -------------------------------------------------------------------------------- 1 | .include "macros.inc" 2 | 3 | start 4 | 5 | test_name ORI_1 6 | mvi r1, 0 7 | ori r3, r1, 0 8 | check_r3 0 9 | 10 | test_name ORI_2 11 | mvi r1, 0 12 | ori r3, r1, 1 13 | check_r3 1 14 | 15 | test_name ORI_3 16 | mvi r1, 1 17 | ori r3, r1, 1 18 | check_r3 1 19 | 20 | test_name ORI_4 21 | mvi r1, 1 22 | ori r3, r1, 0 23 | check_r3 1 24 | 25 | test_name ORI_5 26 | load r1 0xaa55aa55 27 | ori r3, r1, 0x55aa 28 | check_r3 0xaa55ffff 29 | 30 | test_name ORI_6 31 | load r3 0xaa55aa55 32 | ori r3, r3, 0x55aa 33 | check_r3 0xaa55ffff 34 | 35 | end 36 | -------------------------------------------------------------------------------- /tests/lm32/test_ret.S: -------------------------------------------------------------------------------- 1 | .include "macros.inc" 2 | 3 | start 4 | 5 | test_name RET_1 6 | load ra mark 7 | ret 8 | 9 | tc_fail 10 | end 11 | 12 | mark: 13 | tc_pass 14 | end 15 | -------------------------------------------------------------------------------- /tests/lm32/test_sb.S: -------------------------------------------------------------------------------- 1 | .include "macros.inc" 2 | 3 | start 4 | 5 | test_name SB_1 6 | load r1 data 7 | load r2 0xf0f1f2aa 8 | sb (r1+0), r2 9 | check_mem data 0xaa000000 10 | 11 | test_name SB_2 12 | load r2 0xf0f1f2bb 13 | sb (r1+1), r2 14 | check_mem data 0xaabb0000 15 | 16 | test_name SB_3 17 | load r2 0xf0f1f2cc 18 | sb (r1+-1), r2 19 | check_mem data0 0x000000cc 20 | 21 | end 22 | 23 | .data 24 | .align 4 25 | data0: 26 | .byte 0, 0, 0, 0 27 | data: 28 | .byte 0, 0, 0, 0 29 | data1: 30 | .byte 0, 0, 0, 0 31 | -------------------------------------------------------------------------------- /tests/lm32/test_scall.S: -------------------------------------------------------------------------------- 1 | .include "macros.inc" 2 | 3 | start 4 | 5 | test_name SCALL_1 6 | mvi r1, 1 7 | wcsr IE, r1 8 | insn: 9 | scall 10 | check_excp 64 11 | 12 | test_name SCALL_2 13 | mv r3, ea 14 | check_r3 insn 15 | 16 | test_name SCALL_3 17 | rcsr r3, IE 18 | check_r3 2 19 | 20 | end 21 | -------------------------------------------------------------------------------- /tests/lm32/test_sextb.S: -------------------------------------------------------------------------------- 1 | .include "macros.inc" 2 | 3 | start 4 | 5 | test_name SEXTB_1 6 | mvi r1, 0 7 | sextb r3, r1 8 | check_r3 0 9 | 10 | test_name SEXTB_2 11 | mvi r1, 0x7f 12 | sextb r3, r1 13 | check_r3 0x0000007f 14 | 15 | test_name SEXTB_3 16 | mvi r1, 0x80 17 | sextb r3, r1 18 | check_r3 0xffffff80 19 | 20 | end 21 | -------------------------------------------------------------------------------- /tests/lm32/test_sexth.S: -------------------------------------------------------------------------------- 1 | .include "macros.inc" 2 | 3 | start 4 | 5 | test_name SEXTH_1 6 | mvi r1, 0 7 | sexth r3, r1 8 | check_r3 0 9 | 10 | test_name SEXTH_2 11 | load r1 0x7fff 12 | sexth r3, r1 13 | check_r3 0x00007fff 14 | 15 | test_name SEXTH_3 16 | load r1 0x8000 17 | sexth r3, r1 18 | check_r3 0xffff8000 19 | 20 | end 21 | -------------------------------------------------------------------------------- /tests/lm32/test_sh.S: -------------------------------------------------------------------------------- 1 | .include "macros.inc" 2 | 3 | start 4 | 5 | test_name SH_1 6 | load r1 data 7 | load r2 0xf0f1aaaa 8 | sh (r1+0), r2 9 | check_mem data 0xaaaa0000 10 | 11 | test_name SH_2 12 | load r2 0xf0f1bbbb 13 | sh (r1+2), r2 14 | check_mem data 0xaaaabbbb 15 | 16 | test_name SH_3 17 | load r2 0xf0f1cccc 18 | sh (r1+-2), r2 19 | check_mem data0 0x0000cccc 20 | 21 | end 22 | 23 | .data 24 | .align 4 25 | data0: 26 | .byte 0, 0, 0, 0 27 | data: 28 | .byte 0, 0, 0, 0 29 | data1: 30 | .byte 0, 0, 0, 0 31 | -------------------------------------------------------------------------------- /tests/lm32/test_sl.S: -------------------------------------------------------------------------------- 1 | .include "macros.inc" 2 | 3 | start 4 | 5 | test_name SL_1 6 | mvi r1, 1 7 | mvi r2, 0 8 | sl r3, r1, r2 9 | check_r3 1 10 | 11 | test_name SL_2 12 | mvi r1, 0 13 | mvi r2, 1 14 | sl r3, r1, r2 15 | check_r3 0 16 | 17 | test_name SL_3 18 | mvi r1, 1 19 | mvi r2, 31 20 | sl r3, r1, r2 21 | check_r3 0x80000000 22 | 23 | test_name SL_4 24 | mvi r1, 16 25 | mvi r2, 31 26 | sl r3, r1, r2 27 | check_r3 0 28 | 29 | test_name SL_5 30 | mvi r1, 1 31 | mvi r2, 34 32 | sl r3, r1, r2 33 | check_r3 4 34 | 35 | test_name SL_6 36 | mvi r1, 2 37 | sl r3, r1, r1 38 | check_r3 8 39 | 40 | test_name SL_7 41 | mvi r3, 2 42 | sl r3, r3, r3 43 | check_r3 8 44 | 45 | end 46 | -------------------------------------------------------------------------------- /tests/lm32/test_sli.S: -------------------------------------------------------------------------------- 1 | .include "macros.inc" 2 | 3 | start 4 | 5 | test_name SLI_1 6 | mvi r1, 1 7 | sli r3, r1, 0 8 | check_r3 1 9 | 10 | test_name SLI_2 11 | mvi r1, 0 12 | sli r3, r1, 1 13 | check_r3 0 14 | 15 | test_name SLI_3 16 | mvi r1, 1 17 | sli r3, r1, 31 18 | check_r3 0x80000000 19 | 20 | test_name SLI_4 21 | mvi r1, 16 22 | sli r3, r1, 31 23 | check_r3 0 24 | 25 | test_name SLI_7 26 | mvi r3, 2 27 | sli r3, r3, 2 28 | check_r3 8 29 | 30 | end 31 | -------------------------------------------------------------------------------- /tests/lm32/test_sr.S: -------------------------------------------------------------------------------- 1 | .include "macros.inc" 2 | 3 | start 4 | 5 | test_name SR_1 6 | mvi r1, 1 7 | mvi r2, 0 8 | sr r3, r1, r2 9 | check_r3 1 10 | 11 | test_name SR_2 12 | mvi r1, 0 13 | mvi r2, 1 14 | sr r3, r1, r2 15 | check_r3 0 16 | 17 | test_name SR_3 18 | load r1 0x40000000 19 | mvi r2, 30 20 | sr r3, r1, r2 21 | check_r3 1 22 | 23 | test_name SR_4 24 | load r1 0x40000000 25 | mvi r2, 31 26 | sr r3, r1, r2 27 | check_r3 0 28 | 29 | test_name SR_5 30 | mvi r1, 16 31 | mvi r2, 34 32 | sr r3, r1, r2 33 | check_r3 4 34 | 35 | test_name SR_6 36 | mvi r1, 2 37 | sr r3, r1, r1 38 | check_r3 0 39 | 40 | test_name SR_7 41 | mvi r3, 2 42 | sr r3, r3, r3 43 | check_r3 0 44 | 45 | test_name SR_8 46 | mvi r1, 0xfffffff0 47 | mvi r2, 2 48 | sr r3, r1, r2 49 | check_r3 0xfffffffc 50 | 51 | test_name SR_9 52 | mvi r1, 0xfffffff0 53 | mvi r2, 4 54 | sr r3, r1, r2 55 | check_r3 0xffffffff 56 | 57 | end 58 | -------------------------------------------------------------------------------- /tests/lm32/test_sri.S: -------------------------------------------------------------------------------- 1 | .include "macros.inc" 2 | 3 | start 4 | 5 | test_name SRI_1 6 | mvi r1, 1 7 | sri r3, r1, 0 8 | check_r3 1 9 | 10 | test_name SRI_2 11 | mvi r1, 0 12 | sri r3, r1, 1 13 | check_r3 0 14 | 15 | test_name SRI_3 16 | load r1 0x40000000 17 | sri r3, r1, 30 18 | check_r3 1 19 | 20 | test_name SRI_4 21 | load r1 0x40000000 22 | sri r3, r1, 31 23 | check_r3 0 24 | 25 | test_name SRI_5 26 | mvi r3, 2 27 | sri r3, r3, 2 28 | check_r3 0 29 | 30 | test_name SRI_6 31 | mvi r1, 0xfffffff0 32 | sri r3, r1, 2 33 | check_r3 0xfffffffc 34 | 35 | test_name SRI_7 36 | mvi r1, 0xfffffff0 37 | sri r3, r1, 4 38 | check_r3 0xffffffff 39 | 40 | end 41 | -------------------------------------------------------------------------------- /tests/lm32/test_sru.S: -------------------------------------------------------------------------------- 1 | .include "macros.inc" 2 | 3 | start 4 | 5 | test_name SRU_1 6 | mvi r1, 1 7 | mvi r2, 0 8 | sru r3, r1, r2 9 | check_r3 1 10 | 11 | test_name SRU_2 12 | mvi r1, 0 13 | mvi r2, 1 14 | sru r3, r1, r2 15 | check_r3 0 16 | 17 | test_name SRU_3 18 | load r1 0x40000000 19 | mvi r2, 30 20 | sru r3, r1, r2 21 | check_r3 1 22 | 23 | test_name SRU_4 24 | load r1 0x40000000 25 | mvi r2, 31 26 | sru r3, r1, r2 27 | check_r3 0 28 | 29 | test_name SRU_5 30 | mvi r1, 16 31 | mvi r2, 34 32 | sru r3, r1, r2 33 | check_r3 4 34 | 35 | test_name SRU_6 36 | mvi r1, 2 37 | sru r3, r1, r1 38 | check_r3 0 39 | 40 | test_name SRU_7 41 | mvi r3, 2 42 | sru r3, r3, r3 43 | check_r3 0 44 | 45 | test_name SRU_8 46 | mvi r1, 0xfffffff0 47 | mvi r2, 2 48 | sru r3, r1, r2 49 | check_r3 0x3ffffffc 50 | 51 | test_name SRU_9 52 | mvi r1, 0xfffffff0 53 | mvi r2, 4 54 | sru r3, r1, r2 55 | check_r3 0x0fffffff 56 | 57 | end 58 | -------------------------------------------------------------------------------- /tests/lm32/test_srui.S: -------------------------------------------------------------------------------- 1 | .include "macros.inc" 2 | 3 | start 4 | 5 | test_name SRUI_1 6 | mvi r1, 1 7 | srui r3, r1, 0 8 | check_r3 1 9 | 10 | test_name SRUI_2 11 | mvi r1, 0 12 | srui r3, r1, 1 13 | check_r3 0 14 | 15 | test_name SRUI_3 16 | load r1 0x40000000 17 | srui r3, r1, 30 18 | check_r3 1 19 | 20 | test_name SRUI_4 21 | load r1 0x40000000 22 | srui r3, r1, 31 23 | check_r3 0 24 | 25 | test_name SRUI_5 26 | mvi r3, 2 27 | srui r3, r3, 2 28 | check_r3 0 29 | 30 | test_name SRUI_6 31 | mvi r1, 0xfffffff0 32 | srui r3, r1, 2 33 | check_r3 0x3ffffffc 34 | 35 | test_name SRUI_7 36 | mvi r1, 0xfffffff0 37 | srui r3, r1, 4 38 | check_r3 0x0fffffff 39 | 40 | end 41 | -------------------------------------------------------------------------------- /tests/lm32/test_sw.S: -------------------------------------------------------------------------------- 1 | .include "macros.inc" 2 | 3 | start 4 | 5 | test_name SW_1 6 | load r1 data 7 | load r2 0xaabbccdd 8 | sw (r1+0), r2 9 | check_mem data 0xaabbccdd 10 | 11 | test_name SW_2 12 | load r2 0x00112233 13 | sw (r1+4), r2 14 | check_mem data1 0x00112233 15 | 16 | test_name SW_3 17 | load r2 0x44556677 18 | sw (r1+-4), r2 19 | check_mem data0 0x44556677 20 | 21 | test_name SW_4 22 | sw (r1+0), r1 23 | lw r3, (r1+0) 24 | check_r3 data 25 | 26 | end 27 | 28 | .data 29 | .align 4 30 | data0: 31 | .byte 0, 0, 0, 0 32 | data: 33 | .byte 0, 0, 0, 0 34 | data1: 35 | .byte 0, 0, 0, 0 36 | -------------------------------------------------------------------------------- /tests/lm32/test_xnor.S: -------------------------------------------------------------------------------- 1 | .include "macros.inc" 2 | 3 | start 4 | 5 | test_name XNOR_1 6 | mvi r1, 0 7 | mvi r2, 0 8 | xnor r3, r1, r2 9 | check_r3 0xffffffff 10 | 11 | test_name XNOR_2 12 | mvi r1, 0 13 | mvi r2, 1 14 | xnor r3, r1, r2 15 | check_r3 0xfffffffe 16 | 17 | test_name XNOR_3 18 | mvi r1, 1 19 | mvi r2, 1 20 | xnor r3, r1, r2 21 | check_r3 0xffffffff 22 | 23 | test_name XNOR_4 24 | mvi r1, 1 25 | mvi r2, 0 26 | xnor r3, r1, r2 27 | check_r3 0xfffffffe 28 | 29 | test_name XNOR_5 30 | load r1 0xaa55aa55 31 | load r2 0x55aa55aa 32 | xnor r3, r1, r2 33 | check_r3 0 34 | 35 | test_name XNOR_6 36 | load r1 0xaa550000 37 | load r2 0x0000aa55 38 | xnor r3, r1, r2 39 | check_r3 0x55aa55aa 40 | 41 | test_name XNOR_7 42 | load r1 0xaa55aa55 43 | xnor r3, r1, r1 44 | check_r3 0xffffffff 45 | 46 | test_name XNOR_8 47 | load r3 0xaa55aa55 48 | xnor r3, r3, r3 49 | check_r3 0xffffffff 50 | 51 | end 52 | -------------------------------------------------------------------------------- /tests/lm32/test_xnori.S: -------------------------------------------------------------------------------- 1 | .include "macros.inc" 2 | 3 | start 4 | 5 | test_name XNORI_1 6 | mvi r1, 0 7 | xnori r3, r1, 0 8 | check_r3 0xffffffff 9 | 10 | test_name XNORI_2 11 | mvi r1, 0 12 | xnori r3, r1, 1 13 | check_r3 0xfffffffe 14 | 15 | test_name XNORI_3 16 | mvi r1, 1 17 | xnori r3, r1, 1 18 | check_r3 0xffffffff 19 | 20 | test_name XNORI_4 21 | mvi r1, 1 22 | xnori r3, r1, 0 23 | check_r3 0xfffffffe 24 | 25 | test_name XNORI_5 26 | load r1 0xaa55aa55 27 | xnori r3, r1, 0x5555 28 | check_r3 0x55aa00ff 29 | 30 | test_name XNORI_6 31 | load r3 0xaa55aa55 32 | xnori r3, r3, 0x5555 33 | check_r3 0x55aa00ff 34 | 35 | end 36 | -------------------------------------------------------------------------------- /tests/lm32/test_xor.S: -------------------------------------------------------------------------------- 1 | .include "macros.inc" 2 | 3 | start 4 | 5 | test_name XOR_1 6 | mvi r1, 0 7 | mvi r2, 0 8 | xor r3, r1, r2 9 | check_r3 0 10 | 11 | test_name XOR_2 12 | mvi r1, 0 13 | mvi r2, 1 14 | xor r3, r1, r2 15 | check_r3 1 16 | 17 | test_name XOR_3 18 | mvi r1, 1 19 | mvi r2, 1 20 | xor r3, r1, r2 21 | check_r3 0 22 | 23 | test_name XOR_4 24 | mvi r1, 1 25 | mvi r2, 0 26 | xor r3, r1, r2 27 | check_r3 1 28 | 29 | test_name XOR_5 30 | load r1 0xaa55aa55 31 | load r2 0x55aa55aa 32 | xor r3, r1, r2 33 | check_r3 0xffffffff 34 | 35 | test_name XOR_6 36 | load r1 0xaa550000 37 | load r2 0x0000aa55 38 | xor r3, r1, r2 39 | check_r3 0xaa55aa55 40 | 41 | test_name XOR_7 42 | load r1 0xaa55aa55 43 | xor r3, r1, r1 44 | check_r3 0 45 | 46 | test_name XOR_8 47 | load r3 0xaa55aa55 48 | xor r3, r3, r3 49 | check_r3 0 50 | 51 | end 52 | -------------------------------------------------------------------------------- /tests/lm32/test_xori.S: -------------------------------------------------------------------------------- 1 | .include "macros.inc" 2 | 3 | start 4 | 5 | test_name XORI_1 6 | mvi r1, 0 7 | xori r3, r1, 0 8 | check_r3 0 9 | 10 | test_name XORI_2 11 | mvi r1, 0 12 | xori r3, r1, 1 13 | check_r3 1 14 | 15 | test_name XORI_3 16 | mvi r1, 1 17 | xori r3, r1, 1 18 | check_r3 0 19 | 20 | test_name XORI_4 21 | mvi r1, 1 22 | xori r3, r1, 0 23 | check_r3 1 24 | 25 | test_name XORI_5 26 | load r1 0xaa55aa55 27 | xori r3, r1, 0x5555 28 | check_r3 0xaa55ff00 29 | 30 | test_name XORI_6 31 | load r3 0xaa55aa55 32 | xori r3, r3, 0x5555 33 | check_r3 0xaa55ff00 34 | 35 | end 36 | -------------------------------------------------------------------------------- /tests/pi_10.com: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fossabot/qemu-ios/b3d8064980b1dac1884ff621e8fed7f5d823c795/tests/pi_10.com -------------------------------------------------------------------------------- /tests/test-arm-iwmmxt.s: -------------------------------------------------------------------------------- 1 | @ Checks whether iwMMXt is functional. 2 | .code 32 3 | .globl main 4 | 5 | main: 6 | ldr r0, =data0 7 | ldr r1, =data1 8 | ldr r2, =data2 9 | #ifndef FPA 10 | wldrd wr0, [r0, #0] 11 | wldrd wr1, [r0, #8] 12 | wldrd wr2, [r1, #0] 13 | wldrd wr3, [r1, #8] 14 | wsubb wr2, wr2, wr0 15 | wsubb wr3, wr3, wr1 16 | wldrd wr0, [r2, #0] 17 | wldrd wr1, [r2, #8] 18 | waddb wr0, wr0, wr2 19 | waddb wr1, wr1, wr3 20 | wstrd wr0, [r2, #0] 21 | wstrd wr1, [r2, #8] 22 | #else 23 | ldfe f0, [r0, #0] 24 | ldfe f1, [r0, #8] 25 | ldfe f2, [r1, #0] 26 | ldfe f3, [r1, #8] 27 | adfdp f2, f2, f0 28 | adfdp f3, f3, f1 29 | ldfe f0, [r2, #0] 30 | ldfe f1, [r2, #8] 31 | adfd f0, f0, f2 32 | adfd f1, f1, f3 33 | stfe f0, [r2, #0] 34 | stfe f1, [r2, #8] 35 | #endif 36 | mov r0, #1 37 | mov r1, r2 38 | mov r2, #0x11 39 | swi #0x900004 40 | mov r0, #0 41 | swi #0x900001 42 | 43 | .data 44 | data0: 45 | .string "aaaabbbbccccdddd" 46 | data1: 47 | .string "bbbbccccddddeeee" 48 | data2: 49 | .string "hvLLWs\x1fsdrs9\x1fNJ-\n" 50 | -------------------------------------------------------------------------------- /ui/sdl_zoom.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SDL_zoom - surface scaling 3 | * 4 | * Copyright (c) 2009 Citrix Systems, Inc. 5 | * 6 | * Derived from: SDL_rotozoom, LGPL (c) A. Schiffler from the SDL_gfx library. 7 | * Modifications by Stefano Stabellini. 8 | * 9 | * This work is licensed under the terms of the GNU GPL version 2. 10 | * See the COPYING file in the top-level directory. 11 | * 12 | */ 13 | 14 | #ifndef SDL_zoom_h 15 | #define SDL_zoom_h 16 | 17 | #include 18 | 19 | #define SMOOTHING_OFF 0 20 | #define SMOOTHING_ON 1 21 | 22 | int sdl_zoom_blit(SDL_Surface *src_sfc, SDL_Surface *dst_sfc, 23 | int smooth, SDL_Rect *src_rect); 24 | 25 | #endif /* SDL_zoom_h */ 26 | -------------------------------------------------------------------------------- /version.rc: -------------------------------------------------------------------------------- 1 | #include 2 | #include "config-host.h" 3 | 4 | VS_VERSION_INFO VERSIONINFO 5 | FILEVERSION CONFIG_FILEVERSION 6 | PRODUCTVERSION CONFIG_PRODUCTVERSION 7 | FILEFLAGSMASK VS_FFI_FILEFLAGSMASK 8 | FILEOS VOS_NT_WINDOWS32 9 | FILETYPE VFT_APP 10 | FILESUBTYPE VFT2_UNKNOWN 11 | { 12 | BLOCK "StringFileInfo" 13 | { 14 | BLOCK "040904E4" 15 | { 16 | VALUE "CompanyName", "http://www.qemu.org" 17 | VALUE "FileDescription", "QEMU machine emulators and tools" 18 | VALUE "FileVersion", QEMU_VERSION 19 | VALUE "LegalCopyright", "Copyright various authors. Released under the GNU General Public License." 20 | VALUE "LegalTrademarks", "QEMU is a trademark of Fabrice Bellard." 21 | VALUE "ProductName", "QEMU" 22 | } 23 | } 24 | BLOCK "VarFileInfo" 25 | { 26 | VALUE "Translation", 0x0409, 1252 27 | } 28 | } 29 | --------------------------------------------------------------------------------