├── VERSION ├── target-6502 ├── STATUS ├── machine.c └── helper.h ├── target-m68k ├── machine.c ├── m68k-qreg.h └── qregs.def ├── target-sh4 └── machine.c ├── qom ├── Makefile └── container.c ├── config.h ├── default-configs ├── s390x-softmmu.mak ├── cris-linux-user.mak ├── i386-bsd-user.mak ├── i386-linux-user.mak ├── mips-linux-user.mak ├── sh4-linux-user.mak ├── sparc-bsd-user.mak ├── x86_64-bsd-user.mak ├── alpha-linux-user.mak ├── i386-darwin-user.mak ├── mips64-linux-user.mak ├── mipsel-linux-user.mak ├── s390x-linux-user.mak ├── sh4eb-linux-user.mak ├── sparc-linux-user.mak ├── sparc64-bsd-user.mak ├── x86_64-linux-user.mak ├── mips64el-linux-user.mak ├── mipsn32-linux-user.mak ├── mipsn32el-linux-user.mak ├── sparc64-linux-user.mak ├── unicore32-linux-user.mak ├── microblaze-linux-user.mak ├── sparc32plus-linux-user.mak ├── 6502-softmmu.mak ├── microblazeel-linux-user.mak ├── arm-linux-user.mak ├── m68k-linux-user.mak ├── ppc-darwin-user.mak ├── ppc-linux-user.mak ├── armeb-linux-user.mak ├── ppc64-linux-user.mak ├── ppc64abi32-linux-user.mak ├── cris-softmmu.mak ├── m68k-softmmu.mak ├── xtensa-softmmu.mak ├── xtensaeb-softmmu.mak ├── microblaze-softmmu.mak ├── microblazeel-softmmu.mak ├── lm32-softmmu.mak ├── sh4-softmmu.mak ├── sh4eb-softmmu.mak ├── sparc-softmmu.mak ├── alpha-softmmu.mak ├── sparc64-softmmu.mak ├── pci.mak ├── i386-softmmu.mak ├── x86_64-softmmu.mak ├── arm-softmmu.mak ├── mips-softmmu.mak ├── mips64-softmmu.mak ├── mipsel-softmmu.mak ├── mips64el-softmmu.mak ├── ppc64-softmmu.mak ├── ppcemb-softmmu.mak └── ppc-softmmu.mak ├── linux-user ├── cpu-uname.h ├── unicore32 │ ├── termbits.h │ └── target_signal.h ├── sparc │ ├── syscall.h │ └── target_signal.h ├── sparc64 │ ├── syscall.h │ └── target_signal.h ├── sh4 │ ├── syscall.h │ └── target_signal.h ├── m68k │ ├── syscall.h │ └── target_signal.h ├── s390x │ ├── target_signal.h │ └── syscall.h ├── arm │ └── target_signal.h ├── i386 │ └── target_signal.h ├── target_flat.h ├── ppc │ └── target_signal.h ├── x86_64 │ └── target_signal.h ├── cris │ └── target_signal.h ├── microblaze │ └── target_signal.h ├── mips │ └── target_signal.h ├── mips64 │ └── target_signal.h ├── mipsn32 │ └── target_signal.h └── qemu-types.h ├── pc-bios ├── keymaps │ ├── nl-be │ ├── modifiers │ └── en-us ├── bios.bin ├── slof.bin ├── bamboo.dtb ├── ppc_rom.bin ├── sgabios.bin ├── vgabios.bin ├── kvmvapic.bin ├── linuxboot.bin ├── mpc8544ds.dtb ├── multiboot.bin ├── openbios-ppc ├── pxe-e1000.rom ├── pxe-pcnet.rom ├── s390-zipl.rom ├── openbios-sparc32 ├── openbios-sparc64 ├── palcode-clipper ├── pxe-eepro100.rom ├── pxe-ne2k_pci.rom ├── pxe-rtl8139.rom ├── pxe-virtio.rom ├── spapr-rtas.bin ├── vgabios-qxl.bin ├── vgabios-cirrus.bin ├── vgabios-stdvga.bin ├── vgabios-vmware.bin ├── petalogix-ml605.dtb ├── petalogix-s3adsp1800.dtb ├── Makefile └── spapr-rtas │ └── Makefile ├── hw ├── msmouse.h ├── empty_slot.h ├── sh7750_regnames.h ├── dec_pci.h ├── usb-ohci.h ├── 6502_keyboard.h ├── mips-bios.h ├── microblaze_pic_cpu.h ├── cris-boot.h ├── 6502_timer.h ├── apb_pci.h ├── usb-uhci.h ├── qdev-addr.h ├── vmware_vga.h ├── primecell.h ├── ioh3420.h ├── mc146818rtc.h ├── lm32_juart.h ├── vt82c686.h ├── xio3130_upstream.h ├── bitbang_i2c.h ├── escc.h ├── microblaze_boot.h ├── multiboot.h ├── audiodev.h ├── sharpsl.h ├── lm32_pic.h ├── ps2.h ├── mips_cpudevs.h ├── xio3130_downstream.h ├── esp.h ├── sparc32_dma.h ├── 9p.h ├── apm.h ├── kvm │ └── clock.h ├── xen_domainbuild.h ├── lm32.h ├── pm_smbus.h ├── framebuffer.h ├── xtensa_bootparam.h ├── alpha_sys.h ├── vhost_net.h ├── openpic.h ├── etraxfs_dma.h └── msix.h ├── tests ├── tcg │ ├── pi_10.com │ ├── alpha │ │ ├── hello-alpha.c │ │ ├── crt.s │ │ ├── test-ovf.c │ │ └── Makefile │ ├── cris │ │ ├── README │ │ ├── check_hello.c │ │ ├── check_openpf4.c │ │ ├── .gdbinit │ │ ├── crt.s │ │ ├── check_cmp-2.s │ │ ├── check_stat1.c │ │ ├── check_ret.s │ │ ├── check_stat2.c │ │ ├── check_time2.c │ │ ├── sys.h │ │ ├── check_movprv32.s │ │ ├── check_gcctorture_pr28634-1.c │ │ ├── check_clearfv32.s │ │ ├── check_openpf2.c │ │ ├── check_gcctorture_pr28634.c │ │ ├── check_sigalrm.c │ │ ├── check_movpr.s │ │ ├── check_not.s │ │ ├── check_mover.s │ │ ├── check_stat3.c │ │ ├── check_movscr.s │ │ ├── check_stat4.c │ │ ├── check_movdelsr1.s │ │ ├── check_movucr.s │ │ ├── check_movpmv32.s │ │ ├── check_movum.s │ │ ├── check_clrjmp1.s │ │ ├── check_orq.s │ │ ├── check_int64.c │ │ ├── check_mmap3.c │ │ ├── check_movsm.s │ │ ├── check_addq.s │ │ ├── check_dstep.s │ │ ├── check_moverm.s │ │ ├── check_movecr.s │ │ ├── check_andq.s │ │ ├── check_movur.s │ │ ├── check_mapbrk.c │ │ ├── check_mcp.s │ │ ├── check_movei.s │ │ ├── check_ftag.c │ │ ├── check_movsr.s │ │ ├── check_mulv32.s │ │ └── check_subq.s │ ├── xtensa │ │ ├── test_fail.S │ │ ├── test_mul32.S │ │ ├── crt.S │ │ ├── test_boolean.S │ │ ├── vectors.S │ │ ├── test_bz.S │ │ └── test_clamps.S │ ├── lm32 │ │ ├── test_b.S │ │ ├── test_ret.S │ │ ├── test_calli.S │ │ ├── test_call.S │ │ ├── test_bi.S │ │ ├── test_break.S │ │ ├── test_scall.S │ │ ├── test_sextb.S │ │ ├── test_sexth.S │ │ ├── test_sli.S │ │ ├── test_divu.S │ │ ├── test_bret.S │ │ ├── test_eret.S │ │ ├── test_sb.S │ │ ├── test_sh.S │ │ ├── test_lw.S │ │ ├── test_cmpei.S │ │ ├── test_modu.S │ │ ├── test_ori.S │ │ ├── test_cmpnei.S │ │ ├── test_xori.S │ │ ├── test_andi.S │ │ ├── test_be.S │ │ ├── test_sw.S │ │ ├── test_bne.S │ │ ├── test_orhi.S │ │ ├── test_cmpe.S │ │ ├── test_nori.S │ │ ├── test_andhi.S │ │ ├── test_cmpne.S │ │ ├── test_xnori.S │ │ ├── test_sri.S │ │ ├── test_srui.S │ │ ├── test_sl.S │ │ ├── test_and.S │ │ ├── test_muli.S │ │ ├── test_lb.S │ │ ├── test_lbu.S │ │ ├── test_lh.S │ │ ├── test_lhu.S │ │ ├── test_or.S │ │ ├── test_xor.S │ │ ├── test_addi.S │ │ ├── test_cmpgi.S │ │ ├── test_nor.S │ │ ├── test_cmpgei.S │ │ ├── test_cmpgui.S │ │ ├── test_sr.S │ │ ├── test_xnor.S │ │ ├── test_cmpgeui.S │ │ ├── test_sru.S │ │ └── test_bg.S │ └── hello-i386.c └── qemu-iotests │ ├── 030.out │ ├── .gitignore │ ├── Makefile │ ├── 006.out │ ├── 012.out │ ├── 007.out │ ├── 005.out │ ├── 029.out │ ├── 001.out │ ├── 008.out │ ├── 009.out │ ├── 015.out │ ├── group │ ├── README │ ├── 002.out │ ├── 003.out │ ├── 010.out │ ├── 027.out │ ├── 025.out │ └── 016.out ├── README ├── target-lm32 ├── TODO └── helper.h ├── linux-headers ├── README ├── asm-s390 │ └── kvm_para.h └── linux │ └── kvm_para.h ├── darwin-user ├── ioctls_types.h └── ioctls.h ├── tcg ├── LICENSE ├── TODO └── tcg-runtime.h ├── bt-host.h ├── bsd-user ├── sparc │ ├── syscall.h │ └── target_signal.h ├── sparc64 │ ├── syscall.h │ └── target_signal.h ├── x86_64 │ └── target_signal.h ├── i386 │ └── target_signal.h └── qemu-types.h ├── target-microblaze └── machine.c ├── trace └── stderr.h ├── qemu-x509.h ├── libcacard ├── libcacard.pc.in ├── eventt.h ├── link_test.c ├── vreadert.h ├── vevent.h └── cac.h ├── qemu-thread-posix.h ├── audio ├── audio_win_int.h └── audio_pt_int.h ├── target-cris └── mmu.h ├── Makefile.dis ├── qemu-thread-win32.h ├── target-xtensa ├── core-fsf.c └── core-dc232b.c ├── LICENSE ├── envlist.h ├── pflib.h ├── qapi ├── qapi-types-core.h ├── qmp-input-visitor.h ├── qapi-dealloc-visitor.h ├── string-input-visitor.h ├── qmp-output-visitor.h ├── string-output-visitor.h └── qapi-visit-impl.h ├── Makefile.user ├── block-migration.h ├── json-parser.h ├── qemu-objects.h ├── qemu-config.h ├── targphys.h ├── Makefile.hw ├── cpus.h ├── qbool.h ├── qint.h ├── fsdev └── qemu-fsdev-dummy.c ├── slirp ├── if.h ├── tftp.h └── sbuf.h ├── qfloat.h ├── ui └── sdl_zoom.h ├── .gitmodules ├── qemu-xattr.h ├── scripts ├── check-qerror.sh └── make_device_config.sh ├── balloon.h ├── event_notifier.h ├── error_int.h ├── target-ppc └── mfrom_table_gen.c ├── aes.h ├── qjson.h ├── block └── qed-gencb.c ├── iorange.h ├── version.rc └── qga └── service-win32.h /VERSION: -------------------------------------------------------------------------------- 1 | 1.0.50 2 | -------------------------------------------------------------------------------- /target-6502/STATUS: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /target-m68k/machine.c: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /target-sh4/machine.c: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /qom/Makefile: -------------------------------------------------------------------------------- 1 | qom-y = object.o container.o qom-qobject.o 2 | -------------------------------------------------------------------------------- /config.h: -------------------------------------------------------------------------------- 1 | #include "config-host.h" 2 | #include "config-target.h" 3 | -------------------------------------------------------------------------------- /default-configs/s390x-softmmu.mak: -------------------------------------------------------------------------------- 1 | CONFIG_VIRTIO=y 2 | CONFIG_VIRTIO_SCSI=y 3 | -------------------------------------------------------------------------------- /linux-user/cpu-uname.h: -------------------------------------------------------------------------------- 1 | const char *cpu_to_uname_machine(void *cpu_env); 2 | -------------------------------------------------------------------------------- /pc-bios/keymaps/nl-be: -------------------------------------------------------------------------------- 1 | # Dutch (Belgium) 2 | map 0x813 3 | include common 4 | -------------------------------------------------------------------------------- /target-6502/machine.c: -------------------------------------------------------------------------------- 1 | #include "hw/hw.h" 2 | #include "hw/boards.h" 3 | 4 | -------------------------------------------------------------------------------- /default-configs/cris-linux-user.mak: -------------------------------------------------------------------------------- 1 | # Default configuration for cris-linux-user 2 | -------------------------------------------------------------------------------- /default-configs/i386-bsd-user.mak: -------------------------------------------------------------------------------- 1 | # Default configuration for i386-bsd-user 2 | -------------------------------------------------------------------------------- /default-configs/i386-linux-user.mak: -------------------------------------------------------------------------------- 1 | # Default configuration for i386-linux-user 2 | -------------------------------------------------------------------------------- /default-configs/mips-linux-user.mak: -------------------------------------------------------------------------------- 1 | # Default configuration for mips-linux-user 2 | -------------------------------------------------------------------------------- /default-configs/sh4-linux-user.mak: -------------------------------------------------------------------------------- 1 | # Default configuration for sh4-linux-user 2 | -------------------------------------------------------------------------------- /default-configs/sparc-bsd-user.mak: -------------------------------------------------------------------------------- 1 | # Default configuration for sparc-bsd-user 2 | -------------------------------------------------------------------------------- /default-configs/x86_64-bsd-user.mak: -------------------------------------------------------------------------------- 1 | # Default configuration for x86_64-bsd-user 2 | -------------------------------------------------------------------------------- /default-configs/alpha-linux-user.mak: -------------------------------------------------------------------------------- 1 | # Default configuration for alpha-linux-user 2 | -------------------------------------------------------------------------------- /default-configs/i386-darwin-user.mak: -------------------------------------------------------------------------------- 1 | # Default configuration for i386-darwin-user 2 | -------------------------------------------------------------------------------- /default-configs/mips64-linux-user.mak: -------------------------------------------------------------------------------- 1 | # Default configuration for mips64-linux-user 2 | -------------------------------------------------------------------------------- /default-configs/mipsel-linux-user.mak: -------------------------------------------------------------------------------- 1 | # Default configuration for mipsel-linux-user 2 | -------------------------------------------------------------------------------- /default-configs/s390x-linux-user.mak: -------------------------------------------------------------------------------- 1 | # Default configuration for s390x-linux-user 2 | -------------------------------------------------------------------------------- /default-configs/sh4eb-linux-user.mak: -------------------------------------------------------------------------------- 1 | # Default configuration for sh4eb-linux-user 2 | -------------------------------------------------------------------------------- /default-configs/sparc-linux-user.mak: -------------------------------------------------------------------------------- 1 | # Default configuration for sparc-linux-user 2 | -------------------------------------------------------------------------------- /default-configs/sparc64-bsd-user.mak: -------------------------------------------------------------------------------- 1 | # Default configuration for sparc64-bsd-user 2 | -------------------------------------------------------------------------------- /default-configs/x86_64-linux-user.mak: -------------------------------------------------------------------------------- 1 | # Default configuration for x86_64-linux-user 2 | -------------------------------------------------------------------------------- /pc-bios/bios.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AVEx-6502/qemu-6502/HEAD/pc-bios/bios.bin -------------------------------------------------------------------------------- /pc-bios/slof.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AVEx-6502/qemu-6502/HEAD/pc-bios/slof.bin -------------------------------------------------------------------------------- /default-configs/mips64el-linux-user.mak: -------------------------------------------------------------------------------- 1 | # Default configuration for mips64el-linux-user 2 | -------------------------------------------------------------------------------- /default-configs/mipsn32-linux-user.mak: -------------------------------------------------------------------------------- 1 | # Default configuration for mipsn32-linux-user 2 | -------------------------------------------------------------------------------- /default-configs/mipsn32el-linux-user.mak: -------------------------------------------------------------------------------- 1 | # Default configuration for mipsn32el-linux-user 2 | -------------------------------------------------------------------------------- /default-configs/sparc64-linux-user.mak: -------------------------------------------------------------------------------- 1 | # Default configuration for sparc64-linux-user 2 | -------------------------------------------------------------------------------- /default-configs/unicore32-linux-user.mak: -------------------------------------------------------------------------------- 1 | # Default configuration for unicore32-linux-user 2 | -------------------------------------------------------------------------------- /hw/msmouse.h: -------------------------------------------------------------------------------- 1 | /* msmouse.c */ 2 | CharDriverState *qemu_chr_open_msmouse(QemuOpts *opts); 3 | -------------------------------------------------------------------------------- /pc-bios/bamboo.dtb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AVEx-6502/qemu-6502/HEAD/pc-bios/bamboo.dtb -------------------------------------------------------------------------------- /pc-bios/ppc_rom.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AVEx-6502/qemu-6502/HEAD/pc-bios/ppc_rom.bin -------------------------------------------------------------------------------- /pc-bios/sgabios.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AVEx-6502/qemu-6502/HEAD/pc-bios/sgabios.bin -------------------------------------------------------------------------------- /pc-bios/vgabios.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AVEx-6502/qemu-6502/HEAD/pc-bios/vgabios.bin -------------------------------------------------------------------------------- /tests/tcg/pi_10.com: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AVEx-6502/qemu-6502/HEAD/tests/tcg/pi_10.com -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | Read the documentation in qemu-doc.html or on http://wiki.qemu.org 2 | 3 | - QEMU team 4 | -------------------------------------------------------------------------------- /default-configs/microblaze-linux-user.mak: -------------------------------------------------------------------------------- 1 | # Default configuration for microblaze-linux-user 2 | -------------------------------------------------------------------------------- /default-configs/sparc32plus-linux-user.mak: -------------------------------------------------------------------------------- 1 | # Default configuration for sparc32plus-linux-user 2 | -------------------------------------------------------------------------------- /pc-bios/kvmvapic.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AVEx-6502/qemu-6502/HEAD/pc-bios/kvmvapic.bin -------------------------------------------------------------------------------- /pc-bios/linuxboot.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AVEx-6502/qemu-6502/HEAD/pc-bios/linuxboot.bin -------------------------------------------------------------------------------- /pc-bios/mpc8544ds.dtb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AVEx-6502/qemu-6502/HEAD/pc-bios/mpc8544ds.dtb -------------------------------------------------------------------------------- /pc-bios/multiboot.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AVEx-6502/qemu-6502/HEAD/pc-bios/multiboot.bin -------------------------------------------------------------------------------- /pc-bios/openbios-ppc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AVEx-6502/qemu-6502/HEAD/pc-bios/openbios-ppc -------------------------------------------------------------------------------- /pc-bios/pxe-e1000.rom: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AVEx-6502/qemu-6502/HEAD/pc-bios/pxe-e1000.rom -------------------------------------------------------------------------------- /pc-bios/pxe-pcnet.rom: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AVEx-6502/qemu-6502/HEAD/pc-bios/pxe-pcnet.rom -------------------------------------------------------------------------------- /pc-bios/s390-zipl.rom: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AVEx-6502/qemu-6502/HEAD/pc-bios/s390-zipl.rom -------------------------------------------------------------------------------- /default-configs/6502-softmmu.mak: -------------------------------------------------------------------------------- 1 | # Default configuration for 6502 2 | 3 | include pci.mak 4 | 5 | -------------------------------------------------------------------------------- /default-configs/microblazeel-linux-user.mak: -------------------------------------------------------------------------------- 1 | # Default configuration for microblazeel-linux-user 2 | -------------------------------------------------------------------------------- /pc-bios/openbios-sparc32: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AVEx-6502/qemu-6502/HEAD/pc-bios/openbios-sparc32 -------------------------------------------------------------------------------- /pc-bios/openbios-sparc64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AVEx-6502/qemu-6502/HEAD/pc-bios/openbios-sparc64 -------------------------------------------------------------------------------- /pc-bios/palcode-clipper: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AVEx-6502/qemu-6502/HEAD/pc-bios/palcode-clipper -------------------------------------------------------------------------------- /pc-bios/pxe-eepro100.rom: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AVEx-6502/qemu-6502/HEAD/pc-bios/pxe-eepro100.rom -------------------------------------------------------------------------------- /pc-bios/pxe-ne2k_pci.rom: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AVEx-6502/qemu-6502/HEAD/pc-bios/pxe-ne2k_pci.rom -------------------------------------------------------------------------------- /pc-bios/pxe-rtl8139.rom: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AVEx-6502/qemu-6502/HEAD/pc-bios/pxe-rtl8139.rom -------------------------------------------------------------------------------- /pc-bios/pxe-virtio.rom: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AVEx-6502/qemu-6502/HEAD/pc-bios/pxe-virtio.rom -------------------------------------------------------------------------------- /pc-bios/spapr-rtas.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AVEx-6502/qemu-6502/HEAD/pc-bios/spapr-rtas.bin -------------------------------------------------------------------------------- /pc-bios/vgabios-qxl.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AVEx-6502/qemu-6502/HEAD/pc-bios/vgabios-qxl.bin -------------------------------------------------------------------------------- /linux-user/unicore32/termbits.h: -------------------------------------------------------------------------------- 1 | /* NOTE: exactly the same as i386 */ 2 | #include "../i386/termbits.h" 3 | -------------------------------------------------------------------------------- /pc-bios/vgabios-cirrus.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AVEx-6502/qemu-6502/HEAD/pc-bios/vgabios-cirrus.bin -------------------------------------------------------------------------------- /pc-bios/vgabios-stdvga.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AVEx-6502/qemu-6502/HEAD/pc-bios/vgabios-stdvga.bin -------------------------------------------------------------------------------- /pc-bios/vgabios-vmware.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AVEx-6502/qemu-6502/HEAD/pc-bios/vgabios-vmware.bin -------------------------------------------------------------------------------- /target-lm32/TODO: -------------------------------------------------------------------------------- 1 | * disassembler (lm32-dis.c) 2 | * linux-user emulation 3 | * native bp/wp emulation (?) 4 | -------------------------------------------------------------------------------- /tests/tcg/alpha/hello-alpha.c: -------------------------------------------------------------------------------- 1 | int main (void) 2 | { 3 | write (1, "hello\n", 6); 4 | return 0; 5 | } 6 | -------------------------------------------------------------------------------- /default-configs/arm-linux-user.mak: -------------------------------------------------------------------------------- 1 | # Default configuration for arm-linux-user 2 | 3 | CONFIG_GDBSTUB_XML=y 4 | -------------------------------------------------------------------------------- /default-configs/m68k-linux-user.mak: -------------------------------------------------------------------------------- 1 | # Default configuration for m68k-linux-user 2 | 3 | CONFIG_GDBSTUB_XML=y 4 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /hw/empty_slot.h: -------------------------------------------------------------------------------- 1 | /* empty_slot.c */ 2 | void empty_slot_init(target_phys_addr_t addr, uint64_t slot_size); 3 | -------------------------------------------------------------------------------- /pc-bios/petalogix-ml605.dtb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AVEx-6502/qemu-6502/HEAD/pc-bios/petalogix-ml605.dtb -------------------------------------------------------------------------------- /default-configs/armeb-linux-user.mak: -------------------------------------------------------------------------------- 1 | # Default configuration for armeb-linux-user 2 | 3 | CONFIG_GDBSTUB_XML=y 4 | -------------------------------------------------------------------------------- /default-configs/ppc64-linux-user.mak: -------------------------------------------------------------------------------- 1 | # Default configuration for ppc64-linux-user 2 | 3 | CONFIG_GDBSTUB_XML=y 4 | -------------------------------------------------------------------------------- /pc-bios/petalogix-s3adsp1800.dtb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AVEx-6502/qemu-6502/HEAD/pc-bios/petalogix-s3adsp1800.dtb -------------------------------------------------------------------------------- /default-configs/ppc64abi32-linux-user.mak: -------------------------------------------------------------------------------- 1 | # Default configuration for ppc64abi32-linux-user 2 | 3 | CONFIG_GDBSTUB_XML=y 4 | -------------------------------------------------------------------------------- /linux-headers/README: -------------------------------------------------------------------------------- 1 | Automatically imported Linux kernel headers. 2 | Only use scripts/update-linux-headers.sh to update! 3 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/qemu-iotests/030.out: -------------------------------------------------------------------------------- 1 | ... 2 | ---------------------------------------------------------------------- 3 | Ran 3 tests 4 | 5 | OK 6 | -------------------------------------------------------------------------------- /tests/tcg/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 | -------------------------------------------------------------------------------- /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/m68k-softmmu.mak: -------------------------------------------------------------------------------- 1 | # Default configuration for m68k-softmmu 2 | 3 | include pci.mak 4 | CONFIG_GDBSTUB_XML=y 5 | CONFIG_PTIMER=y 6 | -------------------------------------------------------------------------------- /tests/tcg/cris/check_hello.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | int main () 4 | { 5 | printf ("pass\n"); 6 | exit (0); 7 | } 8 | -------------------------------------------------------------------------------- /default-configs/xtensa-softmmu.mak: -------------------------------------------------------------------------------- 1 | # Default configuration for Xtensa 2 | 3 | CONFIG_SERIAL=y 4 | CONFIG_OPENCORES_ETH=y 5 | CONFIG_PFLASH_CFI01=y 6 | -------------------------------------------------------------------------------- /default-configs/xtensaeb-softmmu.mak: -------------------------------------------------------------------------------- 1 | # Default configuration for Xtensa 2 | 3 | CONFIG_SERIAL=y 4 | CONFIG_OPENCORES_ETH=y 5 | CONFIG_PFLASH_CFI01=y 6 | -------------------------------------------------------------------------------- /tests/qemu-iotests/.gitignore: -------------------------------------------------------------------------------- 1 | check.log 2 | check.time 3 | *.out.bad 4 | *.notrun 5 | 6 | # ignore everything in the scratch directory 7 | scratch/ 8 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/tcg/xtensa/test_fail.S: -------------------------------------------------------------------------------- 1 | .include "macros.inc" 2 | 3 | test_suite fail 4 | 5 | test fail 6 | test_fail 7 | test_end 8 | 9 | test_suite_end 10 | -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/tcg/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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/tcg/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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/qemu-iotests/Makefile: -------------------------------------------------------------------------------- 1 | 2 | CLEANFILES= *.out.bad *.notrun check.log check.time 3 | 4 | # no default target 5 | default: 6 | 7 | clean: 8 | rm -f $(CLEANFILES) 9 | 10 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/tcg/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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /hw/6502_keyboard.h: -------------------------------------------------------------------------------- 1 | #ifndef QEMU_6502_KEYBOARD 2 | #define QEMU_6502_KEYBOARD 3 | 4 | void init_keyboard(void); 5 | char read_char(void); 6 | void write_char(char c); 7 | 8 | #endif // QEMU_6502_KEYBOARD 9 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/tcg/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/tcg/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 | -------------------------------------------------------------------------------- /hw/microblaze_pic_cpu.h: -------------------------------------------------------------------------------- 1 | #ifndef MICROBLAZE_PIC_CPU_H 2 | #define MICROBLAZE_PIC_CPU_H 3 | 4 | #include "qemu-common.h" 5 | 6 | qemu_irq *microblaze_pic_init_cpu(CPUState *env); 7 | 8 | #endif /* MICROBLAZE_PIC_CPU_H */ 9 | -------------------------------------------------------------------------------- /tests/qemu-iotests/006.out: -------------------------------------------------------------------------------- 1 | QA output created by 006 2 | 3 | creating 128GB image 4 | qemu-img: The image size is too large for file format 'vpc' 5 | Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=137438953472 6 | *** done 7 | -------------------------------------------------------------------------------- /tests/tcg/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/tcg/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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/tcg/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 | -------------------------------------------------------------------------------- /trace/stderr.h: -------------------------------------------------------------------------------- 1 | #ifndef TRACE_STDERR_H 2 | #define TRACE_STDERR_H 3 | 4 | typedef uint64_t TraceEventID; 5 | 6 | typedef struct { 7 | const char *tp_name; 8 | bool state; 9 | } TraceEvent; 10 | 11 | #endif /* ! TRACE_STDERR_H */ 12 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/tcg/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 | -------------------------------------------------------------------------------- /hw/6502_timer.h: -------------------------------------------------------------------------------- 1 | #ifndef QEMU_6502_TIMER 2 | #define QEMU_6502_TIMER 3 | 4 | typedef void (*timer_callback_t)(void); 5 | 6 | void init_timer(timer_callback_t callback); 7 | 8 | int get_timer_value(void); 9 | void set_timer_value(int value); 10 | 11 | #endif // QEMU_6502_TIMER 12 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/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/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 | -------------------------------------------------------------------------------- /libcacard/libcacard.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@PREFIX@ 2 | exec_prefix=${prefix} 3 | libdir=@LIBDIR@ 4 | includedir=@INCLUDEDIR@ 5 | 6 | Name: cacard 7 | Description: CA Card library 8 | Version: @VERSION@ 9 | 10 | Requires: nss 11 | Libs: -L${libdir} -lcacard 12 | Libs.private: 13 | Cflags: -I${includedir} 14 | -------------------------------------------------------------------------------- /tests/tcg/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/qemu-iotests/012.out: -------------------------------------------------------------------------------- 1 | QA output created by 012 2 | Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 3 | 4 | == mark image read-only 5 | 6 | == read from read-only image 7 | read 512/512 bytes at offset 0 8 | 512.000000 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) 9 | *** done 10 | -------------------------------------------------------------------------------- /tests/tcg/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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/tcg/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 | -------------------------------------------------------------------------------- /default-configs/alpha-softmmu.mak: -------------------------------------------------------------------------------- 1 | # Default configuration for alpha-softmmu 2 | 3 | include pci.mak 4 | CONFIG_SERIAL=y 5 | CONFIG_I8254=y 6 | CONFIG_PCKBD=y 7 | CONFIG_VGA=y 8 | CONFIG_VGA_PCI=y 9 | CONFIG_VGA_CIRRUS=y 10 | CONFIG_IDE_CORE=y 11 | CONFIG_IDE_QDEV=y 12 | CONFIG_VMWARE_VGA=y 13 | CONFIG_IDE_CMD646=y 14 | CONFIG_I8259=y 15 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/tcg/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 | -------------------------------------------------------------------------------- /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 DeviceState *pci_vmsvga_init(PCIBus *bus) 8 | { 9 | PCIDevice *dev; 10 | 11 | dev = pci_create_simple(bus, -1, "vmware-svga"); 12 | return &dev->qdev; 13 | } 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /tests/tcg/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 | -------------------------------------------------------------------------------- /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 | /* arm_sysctl GPIO lines */ 9 | #define ARM_SYSCTL_GPIO_MMC_WPROT 0 10 | #define ARM_SYSCTL_GPIO_MMC_CARDIN 1 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /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=y 8 | CONFIG_VGA_PCI=y 9 | CONFIG_VGA_CIRRUS=y 10 | CONFIG_SERIAL=y 11 | CONFIG_PARALLEL=y 12 | CONFIG_PCKBD=y 13 | CONFIG_FDC=y 14 | CONFIG_IDE_ISA=y 15 | CONFIG_IDE_CMD646=y 16 | -------------------------------------------------------------------------------- /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/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(ISABus *bus, 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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/qemu-iotests/007.out: -------------------------------------------------------------------------------- 1 | QA output created by 007 2 | 3 | creating image 4 | Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1048576 5 | savevm 1 6 | savevm 2 7 | savevm 3 8 | savevm 4 9 | savevm 5 10 | savevm 6 11 | savevm 7 12 | savevm 8 13 | savevm 9 14 | savevm 10 15 | 16 | checking image for errors 17 | No errors were found on the image. 18 | *** done 19 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/vt82c686.h: -------------------------------------------------------------------------------- 1 | #ifndef HW_VT82C686_H 2 | #define HW_VT82C686_H 3 | 4 | /* vt82c686.c */ 5 | ISABus *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/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 | -------------------------------------------------------------------------------- /tests/tcg/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 | -------------------------------------------------------------------------------- /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/escc.h: -------------------------------------------------------------------------------- 1 | /* escc.c */ 2 | #define ESCC_SIZE 4 3 | MemoryRegion *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/microblaze_boot.h: -------------------------------------------------------------------------------- 1 | #ifndef __MICROBLAZE_BOOT__ 2 | #define __MICROBLAZE_BOOT__ 3 | 4 | #include "hw.h" 5 | 6 | void microblaze_load_kernel(CPUState *env, target_phys_addr_t ddr_base, 7 | uint32_t ramsize, const char *dtb_filename, 8 | void (*machine_cpu_reset)(CPUState *)); 9 | 10 | #endif /* __MICROBLAZE_BOOT __ */ 11 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/tcg/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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/qemu-iotests/005.out: -------------------------------------------------------------------------------- 1 | QA output created by 005 2 | 3 | creating large image 4 | Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=5368709120000 5 | 6 | small read 7 | read 4096/4096 bytes at offset 1024 8 | 4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) 9 | 10 | small write 11 | read 4096/4096 bytes at offset 8192 12 | 4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) 13 | *** done 14 | -------------------------------------------------------------------------------- /tests/tcg/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/tcg/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 | -------------------------------------------------------------------------------- /hw/audiodev.h: -------------------------------------------------------------------------------- 1 | /* es1370.c */ 2 | int es1370_init(PCIBus *bus); 3 | 4 | /* sb16.c */ 5 | int SB16_init(ISABus *bus); 6 | 7 | /* adlib.c */ 8 | int Adlib_init(ISABus *bus); 9 | 10 | /* gus.c */ 11 | int GUS_init(ISABus *bus); 12 | 13 | /* ac97.c */ 14 | int ac97_init(PCIBus *bus); 15 | 16 | /* cs4231a.c */ 17 | int cs4231a_init(ISABus *bus); 18 | 19 | /* intel-hda.c + hda-audio.c */ 20 | int intel_hda_and_codec_init(PCIBus *bus); 21 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /target-6502/helper.h: -------------------------------------------------------------------------------- 1 | #include "def-helper.h" 2 | 3 | 4 | // Helpers for fake test instructions 5 | #ifdef DEBUG_6502 6 | DEF_HELPER_1(printchar, void, i32) 7 | DEF_HELPER_0(getchar, tl) 8 | DEF_HELPER_1(printnum, void, i32) 9 | DEF_HELPER_0(getnum, tl) 10 | DEF_HELPER_0(shutdown, void) 11 | DEF_HELPER_2(printstuff, void, i32, i32) 12 | #endif 13 | 14 | 15 | 16 | DEF_HELPER_2(excp, void, int, int) 17 | 18 | #include "def-helper.h" 19 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/tcg/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 | -------------------------------------------------------------------------------- /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 | void lm32_do_pic_info(Monitor *mon); 12 | void lm32_irq_info(Monitor *mon); 13 | 14 | #endif /* QEMU_HW_LM32_PIC_H */ 15 | -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /default-configs/pci.mak: -------------------------------------------------------------------------------- 1 | CONFIG_PCI=y 2 | CONFIG_VIRTIO_PCI=y 3 | CONFIG_VIRTIO_SCSI=y 4 | CONFIG_VIRTIO=y 5 | CONFIG_USB_UHCI=y 6 | CONFIG_USB_OHCI=y 7 | CONFIG_USB_EHCI=y 8 | CONFIG_USB_XHCI=y 9 | CONFIG_NE2000_PCI=y 10 | CONFIG_EEPRO100_PCI=y 11 | CONFIG_PCNET_PCI=y 12 | CONFIG_PCNET_COMMON=y 13 | CONFIG_LSI_SCSI_PCI=y 14 | CONFIG_RTL8139_PCI=y 15 | CONFIG_E1000_PCI=y 16 | CONFIG_IDE_CORE=y 17 | CONFIG_IDE_QDEV=y 18 | CONFIG_IDE_PCI=y 19 | CONFIG_AHCI=y 20 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/tcg/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/tcg/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/tcg/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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/tcg/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/tcg/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/tcg/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/tcg/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/tcg/xtensa/test_mul32.S: -------------------------------------------------------------------------------- 1 | .include "macros.inc" 2 | 3 | test_suite mul32 4 | 5 | test mull 6 | movi a2, 0x137f5a5a 7 | mov a3, a2 8 | movi a4, 0xa5a5137f 9 | movi a6, 0x5de480a6 10 | mull a5, a2, a4 11 | assert eq, a5, a6 12 | mull a2, a2, a4 13 | assert eq, a2, a6 14 | mull a3, a4, a3 15 | assert eq, a3, a6 16 | test_end 17 | 18 | /* unfortunately dc232b doesn't have muluh/mulsh*/ 19 | 20 | test_suite_end 21 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/tcg/xtensa/crt.S: -------------------------------------------------------------------------------- 1 | .section .init 2 | j 1f 3 | .section .init.text 4 | 1: 5 | movi a2, _start 6 | jx a2 7 | 8 | .text 9 | .global _start 10 | _start: 11 | movi a2, 1 12 | wsr a2, windowstart 13 | movi a2, 0 14 | wsr a2, windowbase 15 | movi a1, _fstack 16 | movi a2, 0x4000f 17 | wsr a2, ps 18 | isync 19 | 20 | call0 main 21 | 22 | mov a3, a2 23 | movi a2, 1 24 | simcall 25 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/qemu-iotests/029.out: -------------------------------------------------------------------------------- 1 | QA output created by 029 2 | Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 cluster_size=65536 3 | wrote 4096/4096 bytes at offset 0 4 | 4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) 5 | No errors were found on the image. 6 | Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=16777216 cluster_size=1024 7 | wrote 4194304/4194304 bytes at offset 0 8 | 4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) 9 | No errors were found on the image. 10 | *** done 11 | -------------------------------------------------------------------------------- /tests/tcg/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/tcg/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/tcg/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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /tests/tcg/xtensa/test_boolean.S: -------------------------------------------------------------------------------- 1 | .include "macros.inc" 2 | 3 | test_suite boolean 4 | 5 | test all4 6 | movi a2, 0xfec0 7 | wsr a2, br 8 | all4 b0, b0 9 | rsr a3, br 10 | assert eq, a2, a3 11 | all4 b0, b4 12 | rsr a3, br 13 | assert eq, a2, a3 14 | all4 b0, b8 15 | rsr a3, br 16 | assert eq, a2, a3 17 | all4 b0, b12 18 | rsr a3, br 19 | addi a2, a2, 1 20 | assert eq, a2, a3 21 | test_end 22 | 23 | test_suite_end 24 | -------------------------------------------------------------------------------- /tests/tcg/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/tcg/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/tcg/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 | -------------------------------------------------------------------------------- /hw/kvm/clock.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 | #ifdef CONFIG_KVM 15 | 16 | void kvmclock_create(void); 17 | 18 | #else /* CONFIG_KVM */ 19 | 20 | static inline void kvmclock_create(void) 21 | { 22 | } 23 | 24 | #endif /* !CONFIG_KVM */ 25 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /linux-headers/asm-s390/kvm_para.h: -------------------------------------------------------------------------------- 1 | /* 2 | * asm-s390/kvm_para.h - definition for paravirtual devices on s390 3 | * 4 | * Copyright IBM Corp. 2008 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License (version 2 only) 8 | * as published by the Free Software Foundation. 9 | * 10 | * Author(s): Christian Borntraeger 11 | */ 12 | 13 | #ifndef __S390_KVM_PARA_H 14 | #define __S390_KVM_PARA_H 15 | 16 | 17 | #endif /* __S390_KVM_PARA_H */ 18 | -------------------------------------------------------------------------------- /tests/qemu-iotests/001.out: -------------------------------------------------------------------------------- 1 | QA output created by 001 2 | Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 3 | 4 | == reading whole image == 5 | read 134217728/134217728 bytes at offset 0 6 | 128 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) 7 | 8 | == rewriting whole image == 9 | wrote 134217728/134217728 bytes at offset 0 10 | 128 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) 11 | 12 | == verify pattern == 13 | read 134217728/134217728 bytes at offset 0 14 | 128 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) 15 | *** done 16 | -------------------------------------------------------------------------------- /tests/qemu-iotests/008.out: -------------------------------------------------------------------------------- 1 | QA output created by 008 2 | Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 3 | 4 | == reading whole image == 5 | read 134217728/134217728 bytes at offset 0 6 | 128 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) 7 | 8 | == rewriting whole image == 9 | wrote 134217728/134217728 bytes at offset 0 10 | 128 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) 11 | 12 | == verify pattern == 13 | read 134217728/134217728 bytes at offset 0 14 | 128 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) 15 | *** done 16 | -------------------------------------------------------------------------------- /tests/tcg/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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/tcg/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/tcg/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/tcg/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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | typedef struct QemuThreadData QemuThreadData; 17 | struct QemuThread { 18 | QemuThreadData *data; 19 | unsigned tid; 20 | }; 21 | 22 | /* Only valid for joinable threads. */ 23 | HANDLE qemu_thread_get_handle(QemuThread *thread); 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /target-xtensa/core-fsf.c: -------------------------------------------------------------------------------- 1 | #include "cpu.h" 2 | #include "exec-all.h" 3 | #include "gdbstub.h" 4 | #include "host-utils.h" 5 | 6 | #include "core-fsf/core-isa.h" 7 | #include "overlay_tool.h" 8 | 9 | static const XtensaConfig fsf = { 10 | .name = "fsf", 11 | .options = XTENSA_OPTIONS, 12 | /* GDB for this core is not supported currently */ 13 | .nareg = XCHAL_NUM_AREGS, 14 | .ndepc = 1, 15 | EXCEPTIONS_SECTION, 16 | INTERRUPTS_SECTION, 17 | TLB_SECTION, 18 | DEBUG_SECTION, 19 | .clock_freq_khz = 10000, 20 | }; 21 | 22 | REGISTER_CORE(fsf) 23 | -------------------------------------------------------------------------------- /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 | Many hardware device emulation sources are released under the BSD license. 10 | 11 | 3) The Tiny Code Generator (TCG) is released under the BSD license 12 | (see license headers in files). 13 | 14 | 4) QEMU is a trademark of Fabrice Bellard. 15 | 16 | Fabrice Bellard. 17 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/tcg/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 | -------------------------------------------------------------------------------- /qapi/qapi-types-core.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Core Definitions for QAPI-generated Types 3 | * 4 | * Copyright IBM, Corp. 2011 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 QAPI_TYPES_CORE_H 15 | #define QAPI_TYPES_CORE_H 16 | 17 | #include "qemu-common.h" 18 | #include "error.h" 19 | 20 | /* FIXME this is temporary until we remove middle mode */ 21 | #include "monitor.h" 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /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 | for d in . trace; do \ 21 | rm -f $$d/*.o $$d/*.d $$d/*.a $$d/*~; \ 22 | done 23 | 24 | # Include automatically generated dependency files 25 | -include $(wildcard *.d */*.d) 26 | -------------------------------------------------------------------------------- /default-configs/i386-softmmu.mak: -------------------------------------------------------------------------------- 1 | # Default configuration for i386-softmmu 2 | 3 | include pci.mak 4 | CONFIG_VGA=y 5 | CONFIG_VGA_PCI=y 6 | CONFIG_VGA_ISA=y 7 | CONFIG_VGA_CIRRUS=y 8 | CONFIG_VMWARE_VGA=y 9 | CONFIG_VMMOUSE=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_IDE_ISA=y 20 | CONFIG_IDE_PIIX=y 21 | CONFIG_NE2000_ISA=y 22 | CONFIG_PIIX_PCI=y 23 | CONFIG_SOUND=y 24 | CONFIG_HPET=y 25 | CONFIG_APPLESMC=y 26 | CONFIG_I8259=y 27 | CONFIG_PFLASH_CFI01=y 28 | -------------------------------------------------------------------------------- /default-configs/x86_64-softmmu.mak: -------------------------------------------------------------------------------- 1 | # Default configuration for x86_64-softmmu 2 | 3 | include pci.mak 4 | CONFIG_VGA=y 5 | CONFIG_VGA_PCI=y 6 | CONFIG_VGA_ISA=y 7 | CONFIG_VGA_CIRRUS=y 8 | CONFIG_VMWARE_VGA=y 9 | CONFIG_VMMOUSE=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_IDE_ISA=y 20 | CONFIG_IDE_PIIX=y 21 | CONFIG_NE2000_ISA=y 22 | CONFIG_PIIX_PCI=y 23 | CONFIG_SOUND=y 24 | CONFIG_HPET=y 25 | CONFIG_APPLESMC=y 26 | CONFIG_I8259=y 27 | CONFIG_PFLASH_CFI01=y 28 | -------------------------------------------------------------------------------- /tests/tcg/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/tcg/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/tcg/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/tcg/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/tcg/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/tcg/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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/tcg/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/tcg/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/tcg/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/tcg/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/tcg/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 | -------------------------------------------------------------------------------- /hw/framebuffer.h: -------------------------------------------------------------------------------- 1 | #ifndef QEMU_FRAMEBUFFER_H 2 | #define QEMU_FRAMEBUFFER_H 3 | 4 | #include "memory.h" 5 | 6 | /* Framebuffer device helper routines. */ 7 | 8 | typedef void (*drawfn)(void *, uint8_t *, const uint8_t *, int, int); 9 | 10 | void framebuffer_update_display( 11 | DisplayState *ds, 12 | MemoryRegion *address_space, 13 | target_phys_addr_t base, 14 | int cols, 15 | int rows, 16 | int src_width, 17 | int dest_row_pitch, 18 | int dest_col_pitch, 19 | int invalidate, 20 | drawfn fn, 21 | void *opaque, 22 | int *first_row, 23 | int *last_row); 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /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 | #include "error.h" 20 | 21 | QObject *json_parser_parse(QList *tokens, va_list *ap); 22 | QObject *json_parser_parse_err(QList *tokens, va_list *ap, Error **errp); 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /linux-user/s390x/target_signal.h: -------------------------------------------------------------------------------- 1 | #ifndef TARGET_SIGNAL_H 2 | #define TARGET_SIGNAL_H 3 | 4 | #include "cpu.h" 5 | 6 | typedef struct target_sigaltstack { 7 | abi_ulong ss_sp; 8 | int ss_flags; 9 | abi_ulong ss_size; 10 | } target_stack_t; 11 | 12 | /* 13 | * sigaltstack controls 14 | */ 15 | #define TARGET_SS_ONSTACK 1 16 | #define TARGET_SS_DISABLE 2 17 | 18 | #define TARGET_MINSIGSTKSZ 2048 19 | #define TARGET_SIGSTKSZ 8192 20 | 21 | static inline abi_ulong get_sp_from_cpustate(CPUS390XState *state) 22 | { 23 | return state->regs[15]; 24 | } 25 | 26 | #endif /* TARGET_SIGNAL_H */ 27 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/tcg/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/tcg/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 | -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/tcg/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/tcg/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 | -------------------------------------------------------------------------------- /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.. 13 | QEMU_CFLAGS += -I$(SRC_PATH)/include 14 | 15 | include $(SRC_PATH)/Makefile.objs 16 | 17 | all: $(hw-obj-y) 18 | # Dummy command so that make thinks it has done something 19 | @true 20 | 21 | clean: 22 | rm -f *.o */*.o *.d */*.d *.a */*.a *~ */*~ 23 | 24 | # Include automatically generated dependency files 25 | -include $(wildcard *.d */*.d) 26 | -------------------------------------------------------------------------------- /cpus.h: -------------------------------------------------------------------------------- 1 | #ifndef QEMU_CPUS_H 2 | #define QEMU_CPUS_H 3 | 4 | /* cpus.c */ 5 | void qemu_init_cpu_loop(void); 6 | void resume_all_vcpus(void); 7 | void pause_all_vcpus(void); 8 | void cpu_stop_current(void); 9 | 10 | void cpu_synchronize_all_states(void); 11 | void cpu_synchronize_all_post_reset(void); 12 | void cpu_synchronize_all_post_init(void); 13 | 14 | /* vl.c */ 15 | extern int smp_cores; 16 | extern int smp_threads; 17 | void set_numa_modes(void); 18 | void set_cpu_log(const char *optarg); 19 | void set_cpu_log_filename(const char *optarg); 20 | void list_cpus(FILE *f, fprintf_function cpu_fprintf, const char *optarg); 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /linux-user/s390x/syscall.h: -------------------------------------------------------------------------------- 1 | /* this typedef defines how a Program Status Word looks like */ 2 | typedef struct { 3 | abi_ulong mask; 4 | abi_ulong addr; 5 | } __attribute__ ((aligned(8))) target_psw_t; 6 | 7 | /* 8 | * The pt_regs struct defines the way the registers are stored on 9 | * the stack during a system call. 10 | */ 11 | 12 | #define TARGET_NUM_GPRS 16 13 | 14 | struct target_pt_regs { 15 | abi_ulong args[1]; 16 | target_psw_t psw; 17 | abi_ulong gprs[TARGET_NUM_GPRS]; 18 | abi_ulong orig_gpr2; 19 | unsigned short ilc; 20 | unsigned short trap; 21 | }; 22 | 23 | #define UNAME_MACHINE "s390x" 24 | -------------------------------------------------------------------------------- /default-configs/arm-softmmu.mak: -------------------------------------------------------------------------------- 1 | # Default configuration for arm-softmmu 2 | 3 | include pci.mak 4 | CONFIG_GDBSTUB_XML=y 5 | CONFIG_VGA=y 6 | CONFIG_ISA_MMIO=y 7 | CONFIG_NAND=y 8 | CONFIG_ECC=y 9 | CONFIG_SERIAL=y 10 | CONFIG_PTIMER=y 11 | CONFIG_SD=y 12 | CONFIG_MAX7310=y 13 | CONFIG_WM8750=y 14 | CONFIG_TWL92230=y 15 | CONFIG_TSC2005=y 16 | CONFIG_LM832X=y 17 | CONFIG_TMP105=y 18 | CONFIG_STELLARIS_INPUT=y 19 | CONFIG_SSD0303=y 20 | CONFIG_SSD0323=y 21 | CONFIG_ADS7846=y 22 | CONFIG_MAX111X=y 23 | CONFIG_SSI=y 24 | CONFIG_SSI_SD=y 25 | CONFIG_LAN9118=y 26 | CONFIG_SMC91C111=y 27 | CONFIG_DS1338=y 28 | CONFIG_PFLASH_CFI01=y 29 | CONFIG_PFLASH_CFI02=y 30 | -------------------------------------------------------------------------------- /hw/xtensa_bootparam.h: -------------------------------------------------------------------------------- 1 | #ifndef HW_XTENSA_BOOTPARAM 2 | #define HW_XTENSA_BOOTPARAM 3 | 4 | typedef struct BpTag { 5 | uint16_t tag; 6 | uint16_t size; 7 | } BpTag; 8 | 9 | static inline ram_addr_t put_tag(ram_addr_t addr, uint16_t tag, 10 | size_t size, const void *data) 11 | { 12 | BpTag bp_tag = { 13 | .tag = tswap16(tag), 14 | .size = tswap16((size + 3) & ~3), 15 | }; 16 | 17 | cpu_physical_memory_write(addr, &bp_tag, sizeof(bp_tag)); 18 | addr += sizeof(bp_tag); 19 | cpu_physical_memory_write(addr, data, size); 20 | addr += (size + 3) & ~3; 21 | 22 | return addr; 23 | } 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/tcg/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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/qemu-iotests/009.out: -------------------------------------------------------------------------------- 1 | QA output created by 009 2 | 3 | creating image 4 | Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=6442450944 5 | 6 | creating pattern 7 | wrote 4096/4096 bytes at offset 2097152 8 | 4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) 9 | wrote 4096/4096 bytes at offset 4096 10 | 4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) 11 | wrote 4096/4096 bytes at offset 9437184 12 | 4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) 13 | read 8192/8192 bytes at offset 2093056 14 | 8 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) 15 | 16 | checking image for errors 17 | No errors were found on the image. 18 | *** done 19 | -------------------------------------------------------------------------------- /tests/tcg/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 | -------------------------------------------------------------------------------- /hw/alpha_sys.h: -------------------------------------------------------------------------------- 1 | /* Alpha cores and system support chips. */ 2 | 3 | #ifndef HW_ALPHA_H 4 | #define HW_ALPHA_H 1 5 | 6 | #include "pci.h" 7 | #include "pci_host.h" 8 | #include "ide.h" 9 | #include "net.h" 10 | #include "pc.h" 11 | #include "usb-ohci.h" 12 | #include "irq.h" 13 | 14 | 15 | PCIBus *typhoon_init(ram_addr_t, ISABus **, qemu_irq *, CPUState *[4], 16 | pci_map_irq_fn); 17 | 18 | /* alpha_pci.c. */ 19 | extern const MemoryRegionOps alpha_pci_bw_io_ops; 20 | extern const MemoryRegionOps alpha_pci_conf1_ops; 21 | extern const MemoryRegionOps alpha_pci_iack_ops; 22 | 23 | void alpha_pci_vga_setup(PCIBus *pci_bus); 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /fsdev/qemu-fsdev-dummy.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Virtio 9p 3 | * 4 | * Copyright IBM, Corp. 2010 5 | * 6 | * Authors: 7 | * Gautham R Shenoy 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 14 | #include 15 | #include "qemu-fsdev.h" 16 | #include "qemu-config.h" 17 | 18 | int qemu_fsdev_add(QemuOpts *opts) 19 | { 20 | return 0; 21 | } 22 | 23 | static void fsdev_register_config(void) 24 | { 25 | qemu_add_opts(&qemu_fsdev_opts); 26 | qemu_add_opts(&qemu_virtfs_opts); 27 | } 28 | machine_init(fsdev_register_config); 29 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | #endif 24 | -------------------------------------------------------------------------------- /tests/tcg/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/tcg/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 | -------------------------------------------------------------------------------- /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/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/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 | -------------------------------------------------------------------------------- /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/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/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/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 | -------------------------------------------------------------------------------- /tests/tcg/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/tcg/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/tcg/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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/tcg/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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /.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 | [submodule "roms/ipxe"] 11 | path = roms/ipxe 12 | url = git://git.qemu.org/ipxe.git 13 | [submodule "roms/openbios"] 14 | path = roms/openbios 15 | url = git://git.qemu.org/openbios.git 16 | [submodule "roms/qemu-palcode"] 17 | path = roms/qemu-palcode 18 | url = git://repo.or.cz/qemu-palcode.git 19 | [submodule "roms/sgabios"] 20 | path = roms/sgabios 21 | url = git://git.qemu.org/sgabios.git 22 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /qom/container.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Device Container 3 | * 4 | * Copyright IBM, Corp. 2012 5 | * 6 | * Authors: 7 | * Anthony Liguori 8 | * 9 | * This work is licensed under the terms of the GNU GPL, version 2 or later. 10 | * See the COPYING file in the top-level directory. 11 | */ 12 | 13 | #include "qemu/object.h" 14 | #include "module.h" 15 | 16 | static TypeInfo container_info = { 17 | .name = "container", 18 | .instance_size = sizeof(Object), 19 | .parent = TYPE_OBJECT, 20 | }; 21 | 22 | static void container_register_types(void) 23 | { 24 | type_register_static(&container_info); 25 | } 26 | 27 | type_init(container_register_types) 28 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/tcg/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/tcg/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 | -------------------------------------------------------------------------------- /target-xtensa/core-dc232b.c: -------------------------------------------------------------------------------- 1 | #include "cpu.h" 2 | #include "exec-all.h" 3 | #include "gdbstub.h" 4 | #include "host-utils.h" 5 | 6 | #include "core-dc232b/core-isa.h" 7 | #include "overlay_tool.h" 8 | 9 | static const XtensaConfig dc232b = { 10 | .name = "dc232b", 11 | .options = XTENSA_OPTIONS, 12 | .gdb_regmap = { 13 | .num_regs = 120, 14 | .num_core_regs = 52, 15 | .reg = { 16 | #include "core-dc232b/gdb-config.c" 17 | } 18 | }, 19 | .nareg = XCHAL_NUM_AREGS, 20 | .ndepc = 1, 21 | EXCEPTIONS_SECTION, 22 | INTERRUPTS_SECTION, 23 | TLB_SECTION, 24 | DEBUG_SECTION, 25 | .clock_freq_khz = 10000, 26 | }; 27 | 28 | REGISTER_CORE(dc232b) 29 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /qapi/qmp-input-visitor.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Input Visitor 3 | * 4 | * Copyright IBM, Corp. 2011 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 QMP_INPUT_VISITOR_H 15 | #define QMP_INPUT_VISITOR_H 16 | 17 | #include "qapi-visit-core.h" 18 | #include "qobject.h" 19 | 20 | typedef struct QmpInputVisitor QmpInputVisitor; 21 | 22 | QmpInputVisitor *qmp_input_visitor_new(QObject *obj); 23 | void qmp_input_visitor_cleanup(QmpInputVisitor *v); 24 | 25 | Visitor *qmp_input_get_visitor(QmpInputVisitor *v); 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /tests/tcg/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 | -------------------------------------------------------------------------------- /qapi/qapi-dealloc-visitor.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Dealloc Visitor 3 | * 4 | * Copyright IBM, Corp. 2011 5 | * 6 | * Authors: 7 | * Michael Roth 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 QAPI_DEALLOC_VISITOR_H 15 | #define QAPI_DEALLOC_VISITOR_H 16 | 17 | #include "qapi-visit-core.h" 18 | 19 | typedef struct QapiDeallocVisitor QapiDeallocVisitor; 20 | 21 | QapiDeallocVisitor *qapi_dealloc_visitor_new(void); 22 | void qapi_dealloc_visitor_cleanup(QapiDeallocVisitor *d); 23 | 24 | Visitor *qapi_dealloc_get_visitor(QapiDeallocVisitor *v); 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /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=y 7 | CONFIG_VGA_PCI=y 8 | CONFIG_VGA_ISA=y 9 | CONFIG_VGA_ISA_MM=y 10 | CONFIG_VGA_CIRRUS=y 11 | CONFIG_VMWARE_VGA=y 12 | CONFIG_SERIAL=y 13 | CONFIG_PARALLEL=y 14 | CONFIG_I8254=y 15 | CONFIG_PCSPK=y 16 | CONFIG_PCKBD=y 17 | CONFIG_FDC=y 18 | CONFIG_ACPI=y 19 | CONFIG_APM=y 20 | CONFIG_DMA=y 21 | CONFIG_PIIX4=y 22 | CONFIG_IDE_ISA=y 23 | CONFIG_IDE_PIIX=y 24 | CONFIG_NE2000_ISA=y 25 | CONFIG_SOUND=y 26 | CONFIG_RC4030=y 27 | CONFIG_DP8393X=y 28 | CONFIG_DS1225Y=y 29 | CONFIG_MIPSNET=y 30 | CONFIG_PFLASH_CFI01=y 31 | CONFIG_G364FB=y 32 | CONFIG_I8259=y 33 | CONFIG_JAZZ_LED=y 34 | -------------------------------------------------------------------------------- /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=y 7 | CONFIG_VGA_PCI=y 8 | CONFIG_VGA_ISA=y 9 | CONFIG_VGA_ISA_MM=y 10 | CONFIG_VGA_CIRRUS=y 11 | CONFIG_VMWARE_VGA=y 12 | CONFIG_SERIAL=y 13 | CONFIG_PARALLEL=y 14 | CONFIG_I8254=y 15 | CONFIG_PCSPK=y 16 | CONFIG_PCKBD=y 17 | CONFIG_FDC=y 18 | CONFIG_ACPI=y 19 | CONFIG_APM=y 20 | CONFIG_DMA=y 21 | CONFIG_PIIX4=y 22 | CONFIG_IDE_ISA=y 23 | CONFIG_IDE_PIIX=y 24 | CONFIG_NE2000_ISA=y 25 | CONFIG_SOUND=y 26 | CONFIG_RC4030=y 27 | CONFIG_DP8393X=y 28 | CONFIG_DS1225Y=y 29 | CONFIG_MIPSNET=y 30 | CONFIG_PFLASH_CFI01=y 31 | CONFIG_G364FB=y 32 | CONFIG_I8259=y 33 | CONFIG_JAZZ_LED=y 34 | -------------------------------------------------------------------------------- /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=y 7 | CONFIG_VGA_PCI=y 8 | CONFIG_VGA_ISA=y 9 | CONFIG_VGA_ISA_MM=y 10 | CONFIG_VGA_CIRRUS=y 11 | CONFIG_VMWARE_VGA=y 12 | CONFIG_SERIAL=y 13 | CONFIG_PARALLEL=y 14 | CONFIG_I8254=y 15 | CONFIG_PCSPK=y 16 | CONFIG_PCKBD=y 17 | CONFIG_FDC=y 18 | CONFIG_ACPI=y 19 | CONFIG_APM=y 20 | CONFIG_DMA=y 21 | CONFIG_PIIX4=y 22 | CONFIG_IDE_ISA=y 23 | CONFIG_IDE_PIIX=y 24 | CONFIG_NE2000_ISA=y 25 | CONFIG_SOUND=y 26 | CONFIG_RC4030=y 27 | CONFIG_DP8393X=y 28 | CONFIG_DS1225Y=y 29 | CONFIG_MIPSNET=y 30 | CONFIG_PFLASH_CFI01=y 31 | CONFIG_G364FB=y 32 | CONFIG_I8259=y 33 | CONFIG_JAZZ_LED=y 34 | -------------------------------------------------------------------------------- /qapi/string-input-visitor.h: -------------------------------------------------------------------------------- 1 | /* 2 | * String parsing Visitor 3 | * 4 | * Copyright Red Hat, Inc. 2012 5 | * 6 | * Author: Paolo Bonzini 7 | * 8 | * This work is licensed under the terms of the GNU LGPL, version 2.1 or later. 9 | * See the COPYING.LIB file in the top-level directory. 10 | * 11 | */ 12 | 13 | #ifndef STRING_INPUT_VISITOR_H 14 | #define STRING_INPUT_VISITOR_H 15 | 16 | #include "qapi-visit-core.h" 17 | 18 | typedef struct StringInputVisitor StringInputVisitor; 19 | 20 | StringInputVisitor *string_input_visitor_new(const char *str); 21 | void string_input_visitor_cleanup(StringInputVisitor *v); 22 | 23 | Visitor *string_input_get_visitor(StringInputVisitor *v); 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /tests/tcg/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 | -------------------------------------------------------------------------------- /qemu-xattr.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Host xattr.h abstraction 3 | * 4 | * Copyright 2011 Red Hat Inc. and/or its affiliates 5 | * 6 | * Authors: 7 | * Avi Kivity 8 | * 9 | * This work is licensed under the terms of the GNU GPL, version 2, or any 10 | * later version. See the COPYING file in the top-level directory. 11 | * 12 | */ 13 | #ifndef QEMU_XATTR_H 14 | #define QEMU_XATTR_H 15 | 16 | /* 17 | * Modern distributions (e.g. Fedora 15, have no libattr.so, place attr.h 18 | * in /usr/include/sys, and don't have ENOATTR. 19 | */ 20 | 21 | #include "config-host.h" 22 | 23 | #ifdef CONFIG_LIBATTR 24 | # include 25 | #else 26 | # define ENOATTR ENODATA 27 | # include 28 | #endif 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /scripts/check-qerror.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # This script verifies that qerror definitions and table entries are 3 | # alphabetically ordered. 4 | 5 | check_order() { 6 | errmsg=$1 7 | shift 8 | 9 | # sort -C verifies order but does not print a message. sort -c does print a 10 | # message. These options are both in POSIX. 11 | if ! "$@" | sort -C; then 12 | echo "$errmsg" 13 | "$@" | sort -c 14 | exit 1 15 | fi 16 | return 0 17 | } 18 | 19 | check_order 'Definitions in qerror.h must be in alphabetical order:' \ 20 | grep '^#define QERR_' qerror.h 21 | check_order 'Entries in qerror.c:qerror_table must be in alphabetical order:' \ 22 | sed -n '/^static.*qerror_table\[\]/,/^};/s/QERR_/&/gp' qerror.c 23 | -------------------------------------------------------------------------------- /tests/tcg/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 | -------------------------------------------------------------------------------- /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 | #include "qapi-types.h" 19 | 20 | typedef void (QEMUBalloonEvent)(void *opaque, ram_addr_t target); 21 | typedef void (QEMUBalloonStatus)(void *opaque, BalloonInfo *info); 22 | 23 | int qemu_add_balloon_handler(QEMUBalloonEvent *event_func, 24 | QEMUBalloonStatus *stat_func, void *opaque); 25 | void qemu_remove_balloon_handler(void *opaque); 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /event_notifier.h: -------------------------------------------------------------------------------- 1 | /* 2 | * event notifier support 3 | * 4 | * Copyright Red Hat, Inc. 2010 5 | * 6 | * Authors: 7 | * Michael S. Tsirkin 8 | * 9 | * This work is licensed under the terms of the GNU GPL, version 2 or later. 10 | * See the COPYING file in the top-level directory. 11 | */ 12 | 13 | #ifndef QEMU_EVENT_NOTIFIER_H 14 | #define QEMU_EVENT_NOTIFIER_H 15 | 16 | #include "qemu-common.h" 17 | 18 | struct EventNotifier { 19 | int fd; 20 | }; 21 | 22 | int event_notifier_init(EventNotifier *, int active); 23 | void event_notifier_cleanup(EventNotifier *); 24 | int event_notifier_get_fd(EventNotifier *); 25 | int event_notifier_test_and_clear(EventNotifier *); 26 | int event_notifier_test(EventNotifier *); 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /error_int.h: -------------------------------------------------------------------------------- 1 | /* 2 | * QEMU Error Objects 3 | * 4 | * Copyright IBM, Corp. 2011 5 | * 6 | * Authors: 7 | * Anthony Liguori 8 | * 9 | * This work is licensed under the terms of the GNU LGPL, version 2. See 10 | * the COPYING.LIB file in the top-level directory. 11 | */ 12 | #ifndef QEMU_ERROR_INT_H 13 | #define QEMU_ERROR_INT_H 14 | 15 | #include "qemu-common.h" 16 | #include "qobject.h" 17 | #include "qdict.h" 18 | #include "error.h" 19 | 20 | /** 21 | * Internal QEMU functions for working with Error. 22 | * 23 | * These are used to convert QErrors to Errors 24 | */ 25 | QDict *error_get_data(Error *err); 26 | QObject *error_get_qobject(Error *err); 27 | void error_set_qobject(Error **errp, QObject *obj); 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /linux-headers/linux/kvm_para.h: -------------------------------------------------------------------------------- 1 | #ifndef __LINUX_KVM_PARA_H 2 | #define __LINUX_KVM_PARA_H 3 | 4 | /* 5 | * This header file provides a method for making a hypercall to the host 6 | * Architectures should define: 7 | * - kvm_hypercall0, kvm_hypercall1... 8 | * - kvm_arch_para_features 9 | * - kvm_para_available 10 | */ 11 | 12 | /* Return values for hypercalls */ 13 | #define KVM_ENOSYS 1000 14 | #define KVM_EFAULT EFAULT 15 | #define KVM_E2BIG E2BIG 16 | #define KVM_EPERM EPERM 17 | 18 | #define KVM_HC_VAPIC_POLL_IRQ 1 19 | #define KVM_HC_MMU_OP 2 20 | #define KVM_HC_FEATURES 3 21 | #define KVM_HC_PPC_MAP_MAGIC_PAGE 4 22 | 23 | /* 24 | * hypercalls use architecture specific 25 | */ 26 | #include 27 | 28 | #endif /* __LINUX_KVM_PARA_H */ 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=y 7 | CONFIG_VGA_PCI=y 8 | CONFIG_VGA_ISA=y 9 | CONFIG_VGA_ISA_MM=y 10 | CONFIG_VGA_CIRRUS=y 11 | CONFIG_VMWARE_VGA=y 12 | CONFIG_SERIAL=y 13 | CONFIG_PARALLEL=y 14 | CONFIG_I8254=y 15 | CONFIG_PCSPK=y 16 | CONFIG_PCKBD=y 17 | CONFIG_FDC=y 18 | CONFIG_ACPI=y 19 | CONFIG_APM=y 20 | CONFIG_DMA=y 21 | CONFIG_PIIX4=y 22 | CONFIG_IDE_ISA=y 23 | CONFIG_IDE_PIIX=y 24 | CONFIG_IDE_VIA=y 25 | CONFIG_NE2000_ISA=y 26 | CONFIG_SOUND=y 27 | CONFIG_RC4030=y 28 | CONFIG_DP8393X=y 29 | CONFIG_DS1225Y=y 30 | CONFIG_MIPSNET=y 31 | CONFIG_PFLASH_CFI01=y 32 | CONFIG_FULONG=y 33 | CONFIG_G364FB=y 34 | CONFIG_I8259=y 35 | CONFIG_JAZZ_LED=y 36 | -------------------------------------------------------------------------------- /tests/qemu-iotests/015.out: -------------------------------------------------------------------------------- 1 | QA output created by 015 2 | 3 | creating image 4 | Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=37748736 cluster_size=1024 5 | creating first snapshot 6 | wrote 37748736/37748736 bytes at offset 0 7 | 36 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) 8 | creating second snapshot 9 | wrote 37748736/37748736 bytes at offset 0 10 | 36 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) 11 | checking first snapshot 12 | read 37748736/37748736 bytes at offset 0 13 | 36 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) 14 | checking second snapshot 15 | read 37748736/37748736 bytes at offset 0 16 | 36 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) 17 | 18 | checking image for errors 19 | No errors were found on the image. 20 | *** done 21 | -------------------------------------------------------------------------------- /tests/qemu-iotests/group: -------------------------------------------------------------------------------- 1 | # 2 | # QA groups control file 3 | # Defines test groups 4 | # - do not start group names with a digit 5 | # 6 | 7 | # 8 | # test-group association ... one line per test 9 | # 10 | 001 rw auto 11 | 002 rw auto 12 | 003 rw auto 13 | 004 rw auto 14 | 005 img auto 15 | 006 img auto 16 | 007 snapshot auto 17 | 008 rw auto 18 | 009 rw auto 19 | 010 rw auto 20 | 011 rw auto 21 | 012 auto 22 | 013 rw auto 23 | 014 rw auto 24 | 015 rw snapshot auto 25 | 016 rw auto 26 | 017 rw backing auto 27 | 018 rw backing auto 28 | 019 rw backing auto 29 | 020 rw backing auto 30 | 021 io auto 31 | 022 rw snapshot auto 32 | 023 rw auto 33 | 024 rw backing auto 34 | 025 rw auto 35 | 026 rw blkdbg auto 36 | 027 rw auto 37 | 028 rw backing auto 38 | 029 rw auto 39 | 030 rw auto 40 | -------------------------------------------------------------------------------- /tests/tcg/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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /qapi/qmp-output-visitor.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Output Visitor 3 | * 4 | * Copyright IBM, Corp. 2011 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 QMP_OUTPUT_VISITOR_H 15 | #define QMP_OUTPUT_VISITOR_H 16 | 17 | #include "qapi-visit-core.h" 18 | #include "qobject.h" 19 | 20 | typedef struct QmpOutputVisitor QmpOutputVisitor; 21 | 22 | QmpOutputVisitor *qmp_output_visitor_new(void); 23 | void qmp_output_visitor_cleanup(QmpOutputVisitor *v); 24 | 25 | QObject *qmp_output_get_qobject(QmpOutputVisitor *v); 26 | Visitor *qmp_output_get_visitor(QmpOutputVisitor *v); 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/tcg/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/tcg/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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /qapi/string-output-visitor.h: -------------------------------------------------------------------------------- 1 | /* 2 | * String printing Visitor 3 | * 4 | * Copyright Red Hat, Inc. 2012 5 | * 6 | * Author: Paolo Bonzini 7 | * 8 | * This work is licensed under the terms of the GNU LGPL, version 2.1 or later. 9 | * See the COPYING.LIB file in the top-level directory. 10 | * 11 | */ 12 | 13 | #ifndef STRING_OUTPUT_VISITOR_H 14 | #define STRING_OUTPUT_VISITOR_H 15 | 16 | #include "qapi-visit-core.h" 17 | 18 | typedef struct StringOutputVisitor StringOutputVisitor; 19 | 20 | StringOutputVisitor *string_output_visitor_new(void); 21 | void string_output_visitor_cleanup(StringOutputVisitor *v); 22 | 23 | char *string_output_get_string(StringOutputVisitor *v); 24 | Visitor *string_output_get_visitor(StringOutputVisitor *v); 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /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/tcg/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 | -------------------------------------------------------------------------------- /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=y 9 | CONFIG_VGA_PCI=y 10 | CONFIG_SERIAL=y 11 | CONFIG_I8254=y 12 | CONFIG_PCKBD=y 13 | CONFIG_FDC=y 14 | CONFIG_DMA=y 15 | CONFIG_OPENPIC=y 16 | CONFIG_PREP_PCI=y 17 | CONFIG_MACIO=y 18 | CONFIG_CUDA=y 19 | CONFIG_ADB=y 20 | CONFIG_MAC_NVRAM=y 21 | CONFIG_MAC_DBDMA=y 22 | CONFIG_HEATHROW_PIC=y 23 | CONFIG_GRACKLE_PCI=y 24 | CONFIG_UNIN_PCI=y 25 | CONFIG_DEC_PCI=y 26 | CONFIG_PPCE500_PCI=y 27 | CONFIG_IDE_ISA=y 28 | CONFIG_IDE_CMD646=y 29 | CONFIG_IDE_MACIO=y 30 | CONFIG_NE2000_ISA=y 31 | CONFIG_SOUND=y 32 | CONFIG_PFLASH_CFI01=y 33 | CONFIG_PFLASH_CFI02=y 34 | CONFIG_PTIMER=y 35 | CONFIG_I8259=y 36 | -------------------------------------------------------------------------------- /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=y 9 | CONFIG_VGA_PCI=y 10 | CONFIG_SERIAL=y 11 | CONFIG_I8254=y 12 | CONFIG_PCKBD=y 13 | CONFIG_FDC=y 14 | CONFIG_DMA=y 15 | CONFIG_OPENPIC=y 16 | CONFIG_PREP_PCI=y 17 | CONFIG_MACIO=y 18 | CONFIG_CUDA=y 19 | CONFIG_ADB=y 20 | CONFIG_MAC_NVRAM=y 21 | CONFIG_MAC_DBDMA=y 22 | CONFIG_HEATHROW_PIC=y 23 | CONFIG_GRACKLE_PCI=y 24 | CONFIG_UNIN_PCI=y 25 | CONFIG_DEC_PCI=y 26 | CONFIG_PPCE500_PCI=y 27 | CONFIG_IDE_ISA=y 28 | CONFIG_IDE_CMD646=y 29 | CONFIG_IDE_MACIO=y 30 | CONFIG_NE2000_ISA=y 31 | CONFIG_SOUND=y 32 | CONFIG_PFLASH_CFI01=y 33 | CONFIG_PFLASH_CFI02=y 34 | CONFIG_PTIMER=y 35 | CONFIG_I8259=y 36 | -------------------------------------------------------------------------------- /tests/qemu-iotests/README: -------------------------------------------------------------------------------- 1 | 2 | === This is the QEMU I/O test suite === 3 | 4 | * Intro 5 | 6 | This package contains a simple test suite for the I/O layer of qemu. 7 | It does not require a guest, but only the qemu, qemu-img and qemu-io 8 | binaries. This does limit it to exercise the low-level I/O path only 9 | but no actual block drivers like ide, scsi or virtio. 10 | 11 | * Usage 12 | 13 | Just run ./check to run all tests for the raw image format, or ./check 14 | -qcow2 to test the qcow2 image format. The output of ./check -h explains 15 | additional options to test further image formats or I/O methods. 16 | 17 | * Feedback and patches 18 | 19 | Please send improvements to the test suite, general feedback or just 20 | reports of failing tests cases to qemu-devel@savannah.nongnu.org. 21 | -------------------------------------------------------------------------------- /tests/tcg/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/tcg/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/tcg/xtensa/vectors.S: -------------------------------------------------------------------------------- 1 | .macro vector name 2 | 3 | .section .vector.\name 4 | j 1f 5 | .section .vector.\name\().text 6 | 1: 7 | wsr a2, excsave1 8 | movi a2, handler_\name 9 | l32i a2, a2, 0 10 | beqz a2, 1f 11 | jx a2 12 | 1: 13 | movi a3, 1b 14 | movi a2, 1 15 | simcall 16 | 17 | .align 4 18 | .global handler_\name 19 | handler_\name\(): .word 0 20 | 21 | .endm 22 | 23 | vector window_overflow_4 24 | vector window_overflow_8 25 | vector window_overflow_12 26 | vector window_underflow_4 27 | vector window_underflow_8 28 | vector window_underflow_12 29 | 30 | vector level2 31 | vector level3 32 | vector level4 33 | vector level5 34 | vector level6 35 | vector level7 36 | 37 | vector kernel 38 | vector user 39 | vector double 40 | -------------------------------------------------------------------------------- /qapi/qapi-visit-impl.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Core Definitions for QAPI Visitor implementations 3 | * 4 | * Copyright (C) 2012 Red Hat, Inc. 5 | * 6 | * Author: Paolo Bonizni 7 | * 8 | * This work is licensed under the terms of the GNU LGPL, version 2.1 or later. 9 | * See the COPYING.LIB file in the top-level directory. 10 | * 11 | */ 12 | #ifndef QAPI_VISITOR_IMPL_H 13 | #define QAPI_VISITOR_IMPL_H 14 | 15 | #include "qapi/qapi-types-core.h" 16 | #include "qapi/qapi-visit-core.h" 17 | 18 | void input_type_enum(Visitor *v, int *obj, const char *strings[], 19 | const char *kind, const char *name, Error **errp); 20 | void output_type_enum(Visitor *v, int *obj, const char *strings[], 21 | const char *kind, const char *name, Error **errp); 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /tests/qemu-iotests/002.out: -------------------------------------------------------------------------------- 1 | QA output created by 002 2 | Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 3 | 4 | == reading whole image == 5 | read 134217728/134217728 bytes at offset 0 6 | 128 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) 7 | 8 | == rewriting whole image == 9 | wrote 134217728/134217728 bytes at offset 0 10 | 128 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) 11 | 12 | == verify pattern == 13 | read 134217728/134217728 bytes at offset 0 14 | 128 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) 15 | 16 | unaligned pwrite 17 | wrote 42/42 bytes at offset 66 18 | 42.000000 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) 19 | 20 | verify pattern 21 | read 42/42 bytes at offset 66 22 | 42.000000 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) 23 | *** done 24 | -------------------------------------------------------------------------------- /linux-user/unicore32/target_signal.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2011 GUAN Xue-tao 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License version 2 as 6 | * published by the Free Software Foundation. 7 | */ 8 | #ifndef TARGET_SIGNAL_H 9 | #define TARGET_SIGNAL_H 10 | 11 | /* this struct defines a stack used during syscall handling */ 12 | typedef struct target_sigaltstack { 13 | abi_ulong ss_sp; 14 | abi_ulong ss_flags; 15 | abi_ulong ss_size; 16 | } target_stack_t; 17 | 18 | /* 19 | * sigaltstack controls 20 | */ 21 | #define TARGET_SS_ONSTACK 1 22 | #define TARGET_SS_DISABLE 2 23 | 24 | #define get_sp_from_cpustate(cpustate) (cpustate->regs[29]) 25 | 26 | #endif /* TARGET_SIGNAL_H */ 27 | -------------------------------------------------------------------------------- /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 | /* Extremely 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 | -------------------------------------------------------------------------------- /tests/tcg/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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /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 (MemoryRegion **pmem, int nb_cpus, 15 | qemu_irq **irqs, qemu_irq irq_out); 16 | qemu_irq *mpic_init (MemoryRegion *address_space, target_phys_addr_t base, 17 | int nb_cpus, qemu_irq **irqs, qemu_irq irq_out); 18 | #endif /* __OPENPIC_H__ */ 19 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/qemu-iotests/003.out: -------------------------------------------------------------------------------- 1 | QA output created by 003 2 | Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 3 | 4 | == reading whole image == 5 | read 134217728/134217728 bytes at offset 0 6 | 128 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) 7 | 8 | == rewriting whole image == 9 | wrote 134217728/134217728 bytes at offset 0 10 | 128 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) 11 | 12 | == verify pattern == 13 | read 134217728/134217728 bytes at offset 0 14 | 128 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) 15 | 16 | == vectored write == 17 | wrote 57344/57344 bytes at offset 70254592 18 | 56 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) 19 | 20 | == verify pattern == 21 | read 57344/57344 bytes at offset 70254592 22 | 56 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) 23 | *** done 24 | -------------------------------------------------------------------------------- /tests/tcg/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 | -------------------------------------------------------------------------------- /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 = g_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 | g_free(gencb); 31 | cb(user_opaque, ret); 32 | } 33 | -------------------------------------------------------------------------------- /tests/tcg/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 | -------------------------------------------------------------------------------- /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 | void (*destructor)(IORange *iorange); 15 | }; 16 | 17 | struct IORange { 18 | const IORangeOps *ops; 19 | uint64_t base; 20 | uint64_t len; 21 | }; 22 | 23 | static inline void iorange_init(IORange *iorange, const IORangeOps *ops, 24 | uint64_t base, uint64_t len) 25 | { 26 | iorange->ops = ops; 27 | iorange->base = base; 28 | iorange->len = len; 29 | } 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/tcg/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/tcg/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/tcg/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/tcg/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/tcg/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 | -------------------------------------------------------------------------------- /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=y 9 | CONFIG_VGA_PCI=y 10 | CONFIG_SERIAL=y 11 | CONFIG_I8254=y 12 | CONFIG_PCKBD=y 13 | CONFIG_FDC=y 14 | CONFIG_DMA=y 15 | CONFIG_I82374=y 16 | CONFIG_OPENPIC=y 17 | CONFIG_PREP_PCI=y 18 | CONFIG_I82378=y 19 | CONFIG_MACIO=y 20 | CONFIG_PCSPK=y 21 | CONFIG_CUDA=y 22 | CONFIG_ADB=y 23 | CONFIG_MAC_NVRAM=y 24 | CONFIG_MAC_DBDMA=y 25 | CONFIG_HEATHROW_PIC=y 26 | CONFIG_GRACKLE_PCI=y 27 | CONFIG_UNIN_PCI=y 28 | CONFIG_DEC_PCI=y 29 | CONFIG_PPCE500_PCI=y 30 | CONFIG_IDE_ISA=y 31 | CONFIG_IDE_CMD646=y 32 | CONFIG_IDE_MACIO=y 33 | CONFIG_NE2000_ISA=y 34 | CONFIG_SOUND=y 35 | CONFIG_PFLASH_CFI01=y 36 | CONFIG_PFLASH_CFI02=y 37 | CONFIG_PTIMER=y 38 | CONFIG_I8259=y 39 | -------------------------------------------------------------------------------- /tests/tcg/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/tcg/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/qemu-iotests/010.out: -------------------------------------------------------------------------------- 1 | QA output created by 010 2 | 3 | creating image 4 | Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=6442450944 5 | 6 | creating pattern 7 | wrote 4096/4096 bytes at offset 2097152 8 | 4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) 9 | wrote 4096/4096 bytes at offset 65536 10 | 4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) 11 | wrote 4096/4096 bytes at offset 9437184 12 | 4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) 13 | wrote 4096/4096 bytes at offset 2093056 14 | 4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) 15 | wrote 4096/4096 bytes at offset 8388608 16 | 4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) 17 | read 8192/8192 bytes at offset 2093056 18 | 8 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) 19 | 20 | checking image for errors 21 | No errors were found on the image. 22 | *** done 23 | -------------------------------------------------------------------------------- /tests/qemu-iotests/027.out: -------------------------------------------------------------------------------- 1 | QA output created by 027 2 | Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 3 | 4 | == writing first cluster to populate metadata == 5 | wrote 65536/65536 bytes at offset 65536 6 | 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) 7 | 8 | == writing at sub-cluster granularity == 9 | wrote 2048/2048 bytes at offset 1024 10 | 2 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) 11 | 12 | == verify pattern == 13 | read 2048/2048 bytes at offset 1024 14 | 2 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) 15 | 16 | == verify zeroes before sub-cluster pattern == 17 | read 2048/2048 bytes at offset 0 18 | 2 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) 19 | 20 | == verify zeroes after sub-cluster pattern == 21 | read 2560/2560 bytes at offset 1024 22 | 2 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) 23 | *** done 24 | -------------------------------------------------------------------------------- /tests/tcg/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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/tcg/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/tcg/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/tcg/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/tcg/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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/tcg/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/tcg/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/tcg/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/tcg/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 | -------------------------------------------------------------------------------- /hw/etraxfs_dma.h: -------------------------------------------------------------------------------- 1 | struct dma_context_metadata { 2 | /* data descriptor md */ 3 | uint16_t metadata; 4 | }; 5 | 6 | struct etraxfs_dma_client 7 | { 8 | /* DMA controller. */ 9 | int channel; 10 | void *ctrl; 11 | 12 | /* client. */ 13 | struct { 14 | int (*push)(void *opaque, unsigned char *buf, 15 | int len, bool eop); 16 | void (*pull)(void *opaque); 17 | void (*metadata_push)(void *opaque, 18 | const struct dma_context_metadata *md); 19 | void *opaque; 20 | } client; 21 | }; 22 | 23 | void *etraxfs_dmac_init(target_phys_addr_t base, int nr_channels); 24 | void etraxfs_dmac_connect(void *opaque, int channel, qemu_irq *line, 25 | int input); 26 | void etraxfs_dmac_connect_client(void *opaque, int c, 27 | struct etraxfs_dma_client *cl); 28 | int etraxfs_dmac_input(struct etraxfs_dma_client *client, 29 | void *buf, int len, int eop); 30 | -------------------------------------------------------------------------------- /tests/tcg/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/tcg/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/qemu-iotests/025.out: -------------------------------------------------------------------------------- 1 | QA output created by 025 2 | === Creating image 3 | 4 | Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 5 | 6 | === Writing whole image 7 | === IO: pattern 0xc5 8 | qemu-io> wrote 134217728/134217728 bytes at offset 0 9 | 128 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) 10 | qemu-io> No errors were found on the image. 11 | 12 | === Resizing image 13 | qemu-io> 128 MiB 14 | qemu-io> qemu-io> 384 MiB 15 | qemu-io> No errors were found on the image. 16 | 17 | === Verifying image size after reopen 18 | 384 MiB 19 | 20 | === Verifying resized image 21 | === IO: pattern 0xc5 22 | qemu-io> read 134217728/134217728 bytes at offset 0 23 | 128 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) 24 | qemu-io> === IO: pattern 0 25 | qemu-io> read 268435456/268435456 bytes at offset 134217728 26 | 256 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) 27 | qemu-io> *** done 28 | -------------------------------------------------------------------------------- /tests/tcg/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 | -------------------------------------------------------------------------------- /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 | 13 | static inline abi_ulong tswapal(abi_ulong v) 14 | { 15 | return tswap32(v); 16 | } 17 | 18 | #else 19 | typedef target_ulong abi_ulong; 20 | typedef target_long abi_long; 21 | #define TARGET_ABI_FMT_lx TARGET_FMT_lx 22 | #define TARGET_ABI_FMT_ld TARGET_FMT_ld 23 | #define TARGET_ABI_FMT_lu TARGET_FMT_lu 24 | #define TARGET_ABI_BITS TARGET_LONG_BITS 25 | /* for consistency, define ABI32 too */ 26 | #if TARGET_ABI_BITS == 32 27 | #define TARGET_ABI32 1 28 | #endif 29 | 30 | static inline abi_ulong tswapal(abi_ulong v) 31 | { 32 | return tswapl(v); 33 | } 34 | 35 | #endif 36 | #endif 37 | -------------------------------------------------------------------------------- /tests/tcg/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/tcg/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/tcg/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/qemu-iotests/016.out: -------------------------------------------------------------------------------- 1 | QA output created by 016 2 | Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 3 | 4 | == reading at EOF == 5 | read 512/512 bytes at offset 134217728 6 | 512.000000 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) 7 | 8 | == reading far past EOF == 9 | read 512/512 bytes at offset 268435456 10 | 512.000000 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) 11 | 12 | == writing at EOF == 13 | wrote 512/512 bytes at offset 134217728 14 | 512.000000 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) 15 | read 512/512 bytes at offset 134217728 16 | 512.000000 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) 17 | 18 | == writing far past EOF == 19 | wrote 512/512 bytes at offset 268435456 20 | 512.000000 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) 21 | read 512/512 bytes at offset 268435456 22 | 512.000000 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) 23 | *** done 24 | -------------------------------------------------------------------------------- /tests/tcg/xtensa/test_bz.S: -------------------------------------------------------------------------------- 1 | .include "macros.inc" 2 | 3 | test_suite bz 4 | 5 | test beqz 6 | movi a2, 0 7 | _beqz a2, 1f 8 | test_fail 9 | 1: 10 | movi a2, 1 11 | _beqz a2, 1f 12 | j 2f 13 | 1: 14 | test_fail 15 | 2: 16 | test_end 17 | 18 | test bnez 19 | movi a2, 1 20 | _bnez a2, 1f 21 | test_fail 22 | 1: 23 | movi a2, 0 24 | _bnez a2, 1f 25 | j 2f 26 | 1: 27 | test_fail 28 | 2: 29 | test_end 30 | 31 | test bltz 32 | movi a2, 0xffffffff 33 | bltz a2, 1f 34 | test_fail 35 | 1: 36 | movi a2, 0 37 | bltz a2, 1f 38 | j 2f 39 | 1: 40 | test_fail 41 | 2: 42 | test_end 43 | 44 | test bgez 45 | movi a2, 0 46 | bgez a2, 1f 47 | test_fail 48 | 1: 49 | movi a2, 0xffffffff 50 | bgez a2, 1f 51 | j 2f 52 | 1: 53 | test_fail 54 | 2: 55 | test_end 56 | 57 | test_suite_end 58 | -------------------------------------------------------------------------------- /tests/tcg/xtensa/test_clamps.S: -------------------------------------------------------------------------------- 1 | .include "macros.inc" 2 | 3 | test_suite clamps 4 | 5 | test clamps 6 | movi a2, 0 7 | movi a3, 0 8 | clamps a4, a2, 7 9 | assert eq, a3, a4 10 | 11 | movi a2, 0x7f 12 | movi a3, 0x7f 13 | clamps a4, a2, 7 14 | assert eq, a3, a4 15 | 16 | movi a2, 0xffffff80 17 | movi a3, 0xffffff80 18 | clamps a4, a2, 7 19 | assert eq, a3, a4 20 | 21 | movi a2, 0x80 22 | movi a3, 0x7f 23 | clamps a2, a2, 7 24 | assert eq, a3, a2 25 | 26 | movi a2, 0xffffff7f 27 | movi a3, 0xffffff80 28 | clamps a2, a2, 7 29 | assert eq, a3, a2 30 | 31 | movi a2, 0x7fffffff 32 | movi a3, 0x7f 33 | clamps a2, a2, 7 34 | assert eq, a3, a2 35 | 36 | movi a2, 0x80000000 37 | movi a3, 0xffffff80 38 | clamps a2, a2, 7 39 | assert eq, a3, a2 40 | test_end 41 | 42 | test_suite_end 43 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /qga/service-win32.h: -------------------------------------------------------------------------------- 1 | /* 2 | * QEMU Guest Agent helpers for win32 service management 3 | * 4 | * Copyright IBM Corp. 2012 5 | * 6 | * Authors: 7 | * Gal Hammer 8 | * Michael Roth 9 | * 10 | * This work is licensed under the terms of the GNU GPL, version 2 or later. 11 | * See the COPYING file in the top-level directory. 12 | */ 13 | #ifndef QGA_SERVICE_H 14 | #define QGA_SERVICE_H 15 | 16 | #include 17 | 18 | #define QGA_SERVICE_DISPLAY_NAME "QEMU Guest Agent" 19 | #define QGA_SERVICE_NAME "qemu-ga" 20 | #define QGA_SERVICE_DESCRIPTION "Enables integration with QEMU machine emulator and virtualizer." 21 | 22 | typedef struct GAService { 23 | SERVICE_STATUS status; 24 | SERVICE_STATUS_HANDLE status_handle; 25 | } GAService; 26 | 27 | int ga_install_service(const char *path, const char *logfile); 28 | int ga_uninstall_service(void); 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /tests/tcg/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/tcg/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 | -------------------------------------------------------------------------------- /hw/msix.h: -------------------------------------------------------------------------------- 1 | #ifndef QEMU_MSIX_H 2 | #define QEMU_MSIX_H 3 | 4 | #include "qemu-common.h" 5 | #include "pci.h" 6 | 7 | int msix_init(PCIDevice *pdev, unsigned short nentries, 8 | MemoryRegion *bar, 9 | unsigned bar_nr, unsigned bar_size); 10 | 11 | void msix_write_config(PCIDevice *pci_dev, uint32_t address, 12 | uint32_t val, int len); 13 | 14 | int msix_uninit(PCIDevice *d, MemoryRegion *bar); 15 | 16 | void msix_save(PCIDevice *dev, QEMUFile *f); 17 | void msix_load(PCIDevice *dev, QEMUFile *f); 18 | 19 | int msix_enabled(PCIDevice *dev); 20 | int msix_present(PCIDevice *dev); 21 | 22 | uint32_t msix_bar_size(PCIDevice *dev); 23 | 24 | int msix_vector_use(PCIDevice *dev, unsigned vector); 25 | void msix_vector_unuse(PCIDevice *dev, unsigned vector); 26 | void msix_unuse_all_vectors(PCIDevice *dev); 27 | 28 | void msix_notify(PCIDevice *dev, unsigned vector); 29 | 30 | void msix_reset(PCIDevice *dev); 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /tests/tcg/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 | --------------------------------------------------------------------------------