├── CONFIG ├── FTL_SETTING │ ├── link_bm │ ├── link_fast │ ├── link_last │ ├── link_pm │ ├── unlink_bm │ ├── unlink_fast │ ├── unlink_last │ └── unlink_pm ├── QEMU_MAKEFILE │ ├── Makefile_bm │ ├── Makefile_fast │ ├── Makefile_last │ └── Makefile_pm ├── ssd.conf ├── ssd_fast.conf ├── ssd_intel.conf ├── ssd_last.conf ├── vssim_config_manager.c └── vssim_config_manager.h ├── FIRMWARE ├── firm_buffer_manager.c ├── firm_buffer_manager.h ├── ssd.c └── ssd.h ├── FTL ├── BLOCK_MAP │ ├── ftl.c │ ├── ftl.h │ ├── ftl_cache.c │ ├── ftl_cache.h │ ├── ftl_gc_manager.c │ ├── ftl_gc_manager.h │ ├── ftl_inverse_mapping_manager.c │ ├── ftl_inverse_mapping_manager.h │ ├── ftl_mapping_manager.c │ ├── ftl_mapping_manager.h │ └── ftl_type.h ├── COMMON │ ├── common.h │ ├── ftl_perf_manager.c │ └── ftl_perf_manager.h ├── FAST │ ├── ftl.c │ ├── ftl.h │ ├── ftl_data_mapping_manager.c │ ├── ftl_data_mapping_manager.h │ ├── ftl_inverse_mapping_manager.c │ ├── ftl_inverse_mapping_manager.h │ ├── ftl_log_mapping_manager.c │ ├── ftl_log_mapping_manager.h │ └── ftl_type.h ├── LAST │ ├── ftl.c │ ├── ftl.h │ ├── ftl_buffer.c │ ├── ftl_buffer.h │ ├── ftl_data_mapping_manager.c │ ├── ftl_data_mapping_manager.h │ ├── ftl_inverse_mapping_manager.c │ ├── ftl_inverse_mapping_manager.h │ ├── ftl_log_mapping_manager.c │ ├── ftl_log_mapping_manager.h │ ├── ftl_perf_manager.c │ ├── ftl_perf_manager.h │ └── ftl_type.h └── PAGE_MAP │ ├── .svn │ ├── all-wcprops │ ├── entries │ ├── text-base │ │ ├── common.h.svn-base │ │ ├── ftl.c.svn-base │ │ ├── ftl.h.svn-base │ │ ├── ftl_config_manager.c.svn-base │ │ ├── ftl_config_manager.h.svn-base │ │ ├── ftl_mapping_manager.c.svn-base │ │ ├── ftl_mapping_manager.h.svn-base │ │ ├── ssd_io_manager.c.svn-base │ │ ├── ssd_io_manager.h.svn-base │ │ ├── ssd_log_manager.c.svn-base │ │ ├── ssd_log_manager.h.svn-base │ │ ├── ssd_trim_manager.c.svn-base │ │ ├── ssd_trim_manager.h.svn-base │ │ └── ssd_util.h.svn-base │ └── tmp │ │ ├── ssd_io_manager.c.2.tmp │ │ ├── ssd_io_manager.c.tmp │ │ └── tempfile.tmp │ ├── ftl.c │ ├── ftl.h │ ├── ftl_cache.c │ ├── ftl_cache.h │ ├── ftl_gc_manager.c │ ├── ftl_gc_manager.h │ ├── ftl_inverse_mapping_manager.c │ ├── ftl_inverse_mapping_manager.h │ ├── ftl_mapping_manager.c │ ├── ftl_mapping_manager.h │ └── ftl_type.h ├── MONITOR ├── SSD_MONITOR_HYBRID │ ├── main.cpp │ ├── monitorform.cpp │ ├── monitorform.h │ ├── monitorform.ui │ └── ssd_monitor_hybrid.pro └── SSD_MONITOR_PM │ ├── main.cpp │ ├── monitorform.cpp │ ├── monitorform.h │ ├── monitorform.ui │ ├── ssd.conf │ └── ssd_monitor_p.pro ├── OS └── empty.txt ├── QEMU ├── CODING_STYLE ├── COPYING ├── COPYING.LIB ├── Changelog ├── KVM_VERSION ├── LICENSE ├── MAINTAINERS ├── Makefile ├── Makefile.hw ├── README ├── TODO ├── VERSION ├── a.out.h ├── acl.c ├── acl.h ├── aes.c ├── aes.h ├── aio.c ├── alpha-dis.c ├── alpha.ld ├── arm-dis.c ├── arm-semi.c ├── arm.ld ├── audio │ ├── alsaaudio.c │ ├── audio.c │ ├── audio.h │ ├── audio_int.h │ ├── audio_pt_int.c │ ├── audio_pt_int.h │ ├── audio_template.h │ ├── coreaudio.c │ ├── dsound_template.h │ ├── dsoundaudio.c │ ├── esdaudio.c │ ├── fmodaudio.c │ ├── mixeng.c │ ├── mixeng.h │ ├── mixeng_template.h │ ├── noaudio.c │ ├── ossaudio.c │ ├── paaudio.c │ ├── rate_template.h │ ├── sdlaudio.c │ ├── wavaudio.c │ └── wavcapture.c ├── balloon.h ├── block.c ├── block.h ├── block │ ├── bochs.c │ ├── cloop.c │ ├── cow.c │ ├── curl.c │ ├── dmg.c │ ├── nbd.c │ ├── parallels.c │ ├── qcow.c │ ├── qcow2-cluster.c │ ├── qcow2-refcount.c │ ├── qcow2-snapshot.c │ ├── qcow2.c │ ├── qcow2.h │ ├── raw-posix.c │ ├── raw-win32.c │ ├── vmdk.c │ ├── vpc.c │ └── vvfat.c ├── block_int.h ├── bsd-user │ ├── bsd-mman.h │ ├── bsdload.c │ ├── elfload.c │ ├── errno_defs.h │ ├── freebsd │ │ ├── strace.list │ │ └── syscall_nr.h │ ├── i386 │ │ ├── syscall.h │ │ └── target_signal.h │ ├── main.c │ ├── mmap.c │ ├── netbsd │ │ ├── strace.list │ │ └── syscall_nr.h │ ├── openbsd │ │ ├── strace.list │ │ └── syscall_nr.h │ ├── path.c │ ├── qemu-types.h │ ├── qemu.h │ ├── signal.c │ ├── sparc │ │ ├── syscall.h │ │ └── target_signal.h │ ├── sparc64 │ │ ├── syscall.h │ │ └── target_signal.h │ ├── strace.c │ ├── syscall.c │ ├── syscall_defs.h │ ├── uaccess.c │ └── x86_64 │ │ ├── syscall.h │ │ └── target_signal.h ├── bswap.h ├── bt-host.c ├── bt-host.h ├── bt-vhci.c ├── buffered_file.c ├── buffered_file.h ├── cache-utils.c ├── cache-utils.h ├── cmd.c ├── cmd.h ├── cocoa.m ├── compatfd.c ├── compatfd.h ├── configure ├── console.c ├── console.h ├── cpu-all.h ├── cpu-common.h ├── cpu-defs.h ├── cpu-exec.c ├── create_config ├── cris-dis.c ├── curses.c ├── curses_keys.h ├── cutils.c ├── d3des.c ├── d3des.h ├── darwin-user │ ├── commpage.c │ ├── ioctls.h │ ├── ioctls_types.h │ ├── machload.c │ ├── main.c │ ├── mmap.c │ ├── qemu.h │ ├── signal.c │ ├── syscall.c │ └── syscalls.h ├── def-helper.h ├── device_tree.c ├── device_tree.h ├── dis-asm.h ├── disas.c ├── disas.h ├── dma-helpers.c ├── dma.h ├── dyngen-exec.h ├── elf.h ├── elf_ops.h ├── exec-all.h ├── exec.c ├── feature_to_c.sh ├── fpu │ ├── softfloat-macros.h │ ├── softfloat-native.c │ ├── softfloat-native.h │ ├── softfloat-specialize.h │ ├── softfloat.c │ └── softfloat.h ├── gdb-xml │ ├── arm-core.xml │ ├── arm-neon.xml │ ├── arm-vfp.xml │ ├── arm-vfp3.xml │ ├── cf-core.xml │ ├── cf-fp.xml │ ├── power-altivec.xml │ ├── power-core.xml │ ├── power-fpu.xml │ ├── power-spe.xml │ └── power64-core.xml ├── gdbstub.c ├── gdbstub.h ├── gen-icount.h ├── host-utils.c ├── host-utils.h ├── hostregs_helper.h ├── hpet.h ├── hppa-dis.c ├── hppa.ld ├── hw │ ├── ] │ ├── ac97.c │ ├── acpi.c │ ├── adb.c │ ├── adlib.c │ ├── ads7846.c │ ├── alpha_palcode.c │ ├── an5206.c │ ├── apb_pci.c │ ├── apic.c │ ├── arm-misc.h │ ├── arm_boot.c │ ├── arm_gic.c │ ├── arm_pic.c │ ├── arm_sysctl.c │ ├── arm_timer.c │ ├── armv7m.c │ ├── armv7m_nvic.c │ ├── audiodev.h │ ├── axis_dev88.c │ ├── baum.c │ ├── baum.h │ ├── blizzard.c │ ├── blizzard_template.h │ ├── boards.h │ ├── bt-hci-csr.c │ ├── bt-hci.c │ ├── bt-hid.c │ ├── bt-l2cap.c │ ├── bt-sdp.c │ ├── bt.c │ ├── bt.h │ ├── cbus.c │ ├── cdrom.c │ ├── cirrus_vga.c │ ├── cirrus_vga_rop.h │ ├── cirrus_vga_rop2.h │ ├── cris_pic_cpu.c │ ├── cs4231.c │ ├── cs4231a.c │ ├── cuda.c │ ├── device-assignment.c │ ├── device-assignment.h │ ├── device-hotplug.c │ ├── devices.h │ ├── dma.c │ ├── dp8393x.c │ ├── ds1225y.c │ ├── dummy_m68k.c │ ├── e1000.c │ ├── e1000_hw.h │ ├── ecc.c │ ├── eccmemctl.c │ ├── eepro100.c │ ├── eeprom93xx.c │ ├── eeprom93xx.h │ ├── es1370.c │ ├── escc.c │ ├── escc.h │ ├── esp.c │ ├── etraxfs.c │ ├── etraxfs.h │ ├── etraxfs_dma.c │ ├── etraxfs_dma.h │ ├── etraxfs_eth.c │ ├── etraxfs_pic.c │ ├── etraxfs_ser.c │ ├── etraxfs_timer.c │ ├── extboot.c │ ├── fdc.c │ ├── fdc.h │ ├── firmware_abi.h │ ├── flash.h │ ├── fmopl.c │ ├── fmopl.h │ ├── framebuffer.c │ ├── framebuffer.h │ ├── fw_cfg.c │ ├── fw_cfg.h │ ├── g364fb.c │ ├── grackle_pci.c │ ├── gt64xxx.c │ ├── gumstix.c │ ├── gus.c │ ├── gusemu.h │ ├── gusemu_hal.c │ ├── gusemu_mixer.c │ ├── gustate.h │ ├── heathrow_pic.c │ ├── hpet.c │ ├── hpet_emul.h │ ├── hw.h │ ├── i2c.c │ ├── i2c.h │ ├── i8254-kvm.c │ ├── i8254.c │ ├── i8254.h │ ├── i8259.c │ ├── ide.c │ ├── ide.c.backup │ ├── ide.c.bak │ ├── integratorcp.c │ ├── ioapic.c │ ├── iommu.c │ ├── ipf.c │ ├── irq.c │ ├── irq.h │ ├── isa.h │ ├── isa_mmio.c │ ├── jazz_led.c │ ├── lm832x.c │ ├── lsi53c895a.c │ ├── m48t59.c │ ├── mac_dbdma.c │ ├── mac_dbdma.h │ ├── mac_nvram.c │ ├── macio.c │ ├── mainstone.c │ ├── mainstone.h │ ├── max111x.c │ ├── max7310.c │ ├── mc146818rtc.c │ ├── mcf.h │ ├── mcf5206.c │ ├── mcf5208.c │ ├── mcf_fec.c │ ├── mcf_intc.c │ ├── mcf_uart.c │ ├── microblaze_pic_cpu.c │ ├── mips-bios.h │ ├── mips.h │ ├── mips_int.c │ ├── mips_jazz.c │ ├── mips_malta.c │ ├── mips_mipssim.c │ ├── mips_r4k.c │ ├── mips_timer.c │ ├── mipsnet.c │ ├── mpcore.c │ ├── msix.c │ ├── msix.h │ ├── msmouse.c │ ├── msmouse.h │ ├── mst_fpga.c │ ├── musicpal.c │ ├── nand.c │ ├── ne2000.c │ ├── nseries.c │ ├── nvram.h │ ├── omap.h │ ├── omap1.c │ ├── omap2.c │ ├── omap_clk.c │ ├── omap_dma.c │ ├── omap_dss.c │ ├── omap_i2c.c │ ├── omap_lcd_template.h │ ├── omap_lcdc.c │ ├── omap_mmc.c │ ├── omap_sx1.c │ ├── onenand.c │ ├── openpic.c │ ├── openpic.h │ ├── palm.c │ ├── parallel.c │ ├── pc.c │ ├── pc.h │ ├── pci-hotplug.c │ ├── pci.c │ ├── pci.h │ ├── pci_host.h │ ├── pci_ids.h │ ├── pckbd.c │ ├── pcmcia.h │ ├── pcnet.c │ ├── pcspk.c │ ├── petalogix_s3adsp1800_mmu.c │ ├── pflash_cfi01.c │ ├── pflash_cfi02.c │ ├── piix_pci.c │ ├── pixel_ops.h │ ├── pl011.c │ ├── pl022.c │ ├── pl031.c │ ├── pl050.c │ ├── pl061.c │ ├── pl080.c │ ├── pl110.c │ ├── pl110_template.h │ ├── pl181.c │ ├── pl190.c │ ├── poison.h │ ├── ppc.c │ ├── ppc.h │ ├── ppc405.h │ ├── ppc405_boards.c │ ├── ppc405_uc.c │ ├── ppc440.c │ ├── ppc440.h │ ├── ppc440_bamboo.c │ ├── ppc4xx.h │ ├── ppc4xx_devs.c │ ├── ppc4xx_pci.c │ ├── ppc_mac.h │ ├── ppc_newworld.c │ ├── ppc_oldworld.c │ ├── ppc_prep.c │ ├── ppce500.h │ ├── ppce500_mpc8544ds.c │ ├── ppce500_pci.c │ ├── prep_pci.c │ ├── primecell.h │ ├── ps2.c │ ├── ps2.h │ ├── ptimer.c │ ├── pxa.h │ ├── pxa2xx.c │ ├── pxa2xx_dma.c │ ├── pxa2xx_gpio.c │ ├── pxa2xx_keypad.c │ ├── pxa2xx_lcd.c │ ├── pxa2xx_mmci.c │ ├── pxa2xx_pcmcia.c │ ├── pxa2xx_pic.c │ ├── pxa2xx_template.h │ ├── pxa2xx_timer.c │ ├── qdev-addr.c │ ├── qdev-addr.h │ ├── qdev-properties.c │ ├── qdev.c │ ├── qdev.h │ ├── r2d.c │ ├── rc4030.c │ ├── realview.c │ ├── realview_gic.c │ ├── rtl8139.c │ ├── sb16.c │ ├── sbi.c │ ├── scsi-disk.c │ ├── scsi-disk.h │ ├── scsi-generic.c │ ├── scsi.h │ ├── sd.c │ ├── sd.h │ ├── serial.c │ ├── sh.h │ ├── sh7750.c │ ├── sh7750_regnames.c │ ├── sh7750_regnames.h │ ├── sh7750_regs.h │ ├── sh_intc.c │ ├── sh_intc.h │ ├── sh_pci.c │ ├── sh_serial.c │ ├── sh_timer.c │ ├── sharpsl.h │ ├── shix.c │ ├── slavio_intctl.c │ ├── slavio_misc.c │ ├── slavio_timer.c │ ├── sm501.c │ ├── sm501_template.h │ ├── smbios.c │ ├── smbios.h │ ├── smbus.c │ ├── smbus.h │ ├── smbus_eeprom.c │ ├── smc91c111.c │ ├── soc_dma.c │ ├── soc_dma.h │ ├── sparc32_dma.c │ ├── sparc32_dma.h │ ├── spitz.c │ ├── ssd0303.c │ ├── ssd0323.c │ ├── ssi-sd.c │ ├── ssi.c │ ├── ssi.h │ ├── stellaris.c │ ├── stellaris_enet.c │ ├── stellaris_input.c │ ├── sun4c_intctl.c │ ├── sun4m.c │ ├── sun4m.h │ ├── sun4u.c │ ├── syborg.c │ ├── syborg.h │ ├── syborg_fb.c │ ├── syborg_interrupt.c │ ├── syborg_keyboard.c │ ├── syborg_pointer.c │ ├── syborg_rtc.c │ ├── syborg_serial.c │ ├── syborg_timer.c │ ├── syborg_virtio.c │ ├── sysbus.c │ ├── sysbus.h │ ├── tags │ ├── tc58128.c │ ├── tc6393xb.c │ ├── tc6393xb_template.h │ ├── tcx.c │ ├── tmp105.c │ ├── tosa.c │ ├── tsc2005.c │ ├── tsc210x.c │ ├── tusb6010.c │ ├── twl92230.c │ ├── unin_pci.c │ ├── usb-bt.c │ ├── usb-hid.c │ ├── usb-hub.c │ ├── usb-msd.c │ ├── usb-musb.c │ ├── usb-net.c │ ├── usb-ohci.c │ ├── usb-serial.c │ ├── usb-uhci.c │ ├── usb-wacom.c │ ├── usb.c │ ├── usb.h │ ├── versatile_pci.c │ ├── versatilepb.c │ ├── vga.c │ ├── vga_int.h │ ├── vga_template.h │ ├── virtio-balloon.c │ ├── virtio-balloon.h │ ├── virtio-blk.c │ ├── virtio-blk.h │ ├── virtio-console.c │ ├── virtio-console.h │ ├── virtio-net.c │ ├── virtio-net.h │ ├── virtio-pci.c │ ├── virtio.c │ ├── virtio.h │ ├── vmmouse.c │ ├── vmport.c │ ├── vmware_vga.c │ ├── watchdog.c │ ├── watchdog.h │ ├── wdt_i6300esb.c │ ├── wdt_ib700.c │ ├── wm8750.c │ ├── xen.h │ ├── xen_backend.c │ ├── xen_backend.h │ ├── xen_blkif.h │ ├── xen_common.h │ ├── xen_console.c │ ├── xen_devconfig.c │ ├── xen_disk.c │ ├── xen_domainbuild.c │ ├── xen_domainbuild.h │ ├── xen_machine_pv.c │ ├── xen_nic.c │ ├── xenfb.c │ ├── xilinx.h │ ├── xilinx_ethlite.c │ ├── xilinx_intc.c │ ├── xilinx_timer.c │ ├── xilinx_uartlite.c │ └── zaurus.c ├── hxtool ├── i386-dis.c ├── i386.ld ├── ia64.ld ├── ia64intrin.h ├── ioport-user.c ├── ioport.c ├── ioport.h ├── keymaps.c ├── keymaps.h ├── kqemu.c ├── kqemu.h ├── kvm-all.c ├── kvm-tpr-opt.c ├── kvm.h ├── kvm │ ├── .gitignore │ ├── Makefile │ ├── bios │ │ ├── .cvsignore │ │ ├── Makefile │ │ ├── Makefile.in │ │ ├── acpi-dsdt.dsl │ │ ├── acpi-ssdt.dsl │ │ ├── apmbios.S │ │ ├── bios_usage │ │ ├── biossums.c │ │ ├── makesym.perl │ │ ├── notes │ │ ├── rombios.c │ │ ├── rombios.h │ │ ├── rombios32.c │ │ ├── rombios32.ld │ │ ├── rombios32start.S │ │ ├── usage.cc │ │ └── vapic.S │ ├── configure │ ├── doxygen.conf │ ├── extboot │ │ ├── Makefile │ │ ├── STATUS │ │ └── signrom.c │ ├── include │ │ ├── ia64 │ │ │ └── asm │ │ │ │ ├── kvm.h │ │ │ │ ├── kvm_host.h │ │ │ │ └── kvm_para.h │ │ ├── linux │ │ │ ├── kvm.h │ │ │ ├── kvm_host.h │ │ │ ├── kvm_para.h │ │ │ └── kvm_types.h │ │ ├── powerpc │ │ │ └── asm │ │ │ │ ├── kvm.h │ │ │ │ ├── kvm_44x.h │ │ │ │ ├── kvm_asm.h │ │ │ │ ├── kvm_e500.h │ │ │ │ ├── kvm_host.h │ │ │ │ ├── kvm_para.h │ │ │ │ └── kvm_ppc.h │ │ └── x86 │ │ │ └── asm │ │ │ ├── kvm.h │ │ │ ├── kvm_host.h │ │ │ ├── kvm_para.h │ │ │ ├── kvm_x86_emulate.h │ │ │ ├── svm.h │ │ │ ├── virtext.h │ │ │ └── vmx.h │ ├── kvm.spec │ ├── kvm_stat │ ├── libfdt │ │ ├── Makefile │ │ ├── README │ │ ├── fdt.c │ │ ├── fdt.h │ │ ├── fdt_ro.c │ │ ├── fdt_rw.c │ │ ├── fdt_strerror.c │ │ ├── fdt_sw.c │ │ ├── fdt_wip.c │ │ ├── libfdt.h │ │ ├── libfdt_env.h │ │ └── libfdt_internal.h │ ├── libkvm │ │ ├── Makefile │ │ ├── config-i386.mak │ │ ├── config-ia64.mak │ │ ├── config-ppc.mak │ │ ├── config-s390.mak │ │ ├── config-s390x.mak │ │ ├── config-x86_64.mak │ │ ├── kvm-common.h │ │ ├── kvm-ia64.h │ │ ├── kvm-powerpc.h │ │ ├── kvm-s390.h │ │ ├── kvm-x86.h │ │ ├── libkvm-ia64.c │ │ ├── libkvm-powerpc.c │ │ ├── libkvm-s390.c │ │ ├── libkvm-x86.c │ │ ├── libkvm.c │ │ └── libkvm.h │ ├── scripts │ │ ├── 65-kvm.rules │ │ ├── kvm │ │ ├── make-combined-release │ │ ├── make-release │ │ ├── mkbootdisk │ │ ├── qemu-ifup │ │ └── run_img │ ├── user │ │ ├── COPYRIGHT │ │ ├── Makefile │ │ ├── balloon_ctl.c │ │ ├── bootstrap.lds │ │ ├── config-i386.mak │ │ ├── config-ia64.mak │ │ ├── config-powerpc-440.mak │ │ ├── config-powerpc.mak │ │ ├── config-x86-common.mak │ │ ├── config-x86_64.mak │ │ ├── configure │ │ ├── flat.lds │ │ ├── formats │ │ ├── iotable.c │ │ ├── iotable.h │ │ ├── kvmtrace.c │ │ ├── kvmtrace_format │ │ ├── main-ppc.c │ │ ├── main.c │ │ └── test │ │ │ ├── lib │ │ │ ├── libcflat.h │ │ │ ├── panic.c │ │ │ ├── powerpc │ │ │ │ ├── 44x │ │ │ │ │ ├── map.c │ │ │ │ │ ├── timebase.S │ │ │ │ │ ├── timebase.h │ │ │ │ │ └── tlbwe.S │ │ │ │ └── io.c │ │ │ ├── printf.c │ │ │ ├── string.c │ │ │ └── x86 │ │ │ │ ├── fake-apic.h │ │ │ │ ├── io.c │ │ │ │ ├── smp.c │ │ │ │ └── smp.h │ │ │ ├── powerpc │ │ │ ├── 44x │ │ │ │ ├── tlbsx.S │ │ │ │ ├── tlbwe.S │ │ │ │ ├── tlbwe_16KB.S │ │ │ │ └── tlbwe_hole.S │ │ │ ├── cstart.S │ │ │ ├── exit.c │ │ │ ├── helloworld.c │ │ │ ├── io.S │ │ │ ├── spin.S │ │ │ └── sprg.S │ │ │ └── x86 │ │ │ ├── access.c │ │ │ ├── apic.c │ │ │ ├── apic.h │ │ │ ├── bootstrap.S │ │ │ ├── cstart.S │ │ │ ├── cstart64.S │ │ │ ├── emulator.c │ │ │ ├── exit.c │ │ │ ├── hypercall.c │ │ │ ├── ioram.h │ │ │ ├── irq.S │ │ │ ├── memtest1.S │ │ │ ├── msr.c │ │ │ ├── port80.c │ │ │ ├── print.S │ │ │ ├── print.h │ │ │ ├── realmode.c │ │ │ ├── realmode.lds │ │ │ ├── runtime.h │ │ │ ├── sieve.c │ │ │ ├── simple.S │ │ │ ├── smptest.c │ │ │ ├── stringio.S │ │ │ ├── test32.S │ │ │ ├── tsc.c │ │ │ ├── vm.c │ │ │ ├── vm.h │ │ │ └── vmexit.c │ └── vgabios │ │ ├── .cvsignore │ │ ├── BUGS │ │ ├── COPYING │ │ ├── ChangeLog │ │ ├── Makefile │ │ ├── Notes │ │ ├── README │ │ ├── TODO │ │ ├── biossums.c │ │ ├── clext.c │ │ ├── dataseghack │ │ ├── tests │ │ ├── lfbprof │ │ │ ├── Makefile │ │ │ ├── lfbprof.c │ │ │ └── lfbprof.h │ │ └── testbios.c │ │ ├── vbe.c │ │ ├── vbe.h │ │ ├── vbetables-gen.c │ │ ├── vgabios.c │ │ ├── vgabios.h │ │ ├── vgafonts.h │ │ └── vgatables.h ├── libfdt_env.h ├── libhw32 │ └── config.mak ├── libhw64 │ └── config.mak ├── linux-user │ ├── alpha │ │ ├── syscall.h │ │ ├── syscall_nr.h │ │ ├── target_signal.h │ │ └── termbits.h │ ├── arm │ │ ├── nwfpe │ │ │ ├── double_cpdo.c │ │ │ ├── extended_cpdo.c │ │ │ ├── fpa11.c │ │ │ ├── fpa11.h │ │ │ ├── fpa11.inl │ │ │ ├── fpa11_cpdo.c │ │ │ ├── fpa11_cpdt.c │ │ │ ├── fpa11_cprt.c │ │ │ ├── fpopcode.c │ │ │ ├── fpopcode.h │ │ │ ├── fpsr.h │ │ │ └── single_cpdo.c │ │ ├── syscall.h │ │ ├── syscall_nr.h │ │ ├── target_signal.h │ │ └── termbits.h │ ├── cris │ │ ├── syscall.h │ │ ├── syscall_nr.h │ │ ├── target_signal.h │ │ └── termbits.h │ ├── elfload.c │ ├── elfload32.c │ ├── envlist.c │ ├── envlist.h │ ├── errno_defs.h │ ├── flat.h │ ├── flatload.c │ ├── i386 │ │ ├── syscall.h │ │ ├── syscall_nr.h │ │ ├── target_signal.h │ │ └── termbits.h │ ├── ioctls.h │ ├── linux_loop.h │ ├── linuxload.c │ ├── m68k-sim.c │ ├── m68k │ │ ├── syscall.h │ │ ├── syscall_nr.h │ │ ├── target_signal.h │ │ └── termbits.h │ ├── main.c │ ├── microblaze │ │ ├── syscall.h │ │ ├── syscall_nr.h │ │ ├── target_signal.h │ │ └── termbits.h │ ├── mips │ │ ├── syscall.h │ │ ├── syscall_nr.h │ │ ├── target_signal.h │ │ └── termbits.h │ ├── mips64 │ │ ├── syscall.h │ │ ├── syscall_nr.h │ │ ├── target_signal.h │ │ └── termbits.h │ ├── mipsn32 │ │ ├── syscall.h │ │ ├── syscall_nr.h │ │ ├── target_signal.h │ │ └── termbits.h │ ├── mmap.c │ ├── path.c │ ├── ppc │ │ ├── syscall.h │ │ ├── syscall_nr.h │ │ ├── target_signal.h │ │ └── termbits.h │ ├── qemu-types.h │ ├── qemu.h │ ├── sh4 │ │ ├── syscall.h │ │ ├── syscall_nr.h │ │ ├── target_signal.h │ │ └── termbits.h │ ├── signal.c │ ├── socket.h │ ├── sparc │ │ ├── syscall.h │ │ ├── syscall_nr.h │ │ ├── target_signal.h │ │ └── termbits.h │ ├── sparc64 │ │ ├── syscall.h │ │ ├── syscall_nr.h │ │ ├── target_signal.h │ │ └── termbits.h │ ├── strace.c │ ├── strace.list │ ├── syscall.c │ ├── syscall_defs.h │ ├── syscall_types.h │ ├── uaccess.c │ ├── vm86.c │ └── x86_64 │ │ ├── syscall.h │ │ ├── syscall_nr.h │ │ ├── target_signal.h │ │ └── termbits.h ├── loader.c ├── m68k-dis.c ├── m68k-semi.c ├── m68k.ld ├── microblaze-dis.c ├── migration-exec.c ├── migration-tcp.c ├── migration.c ├── migration.h ├── mips-dis.c ├── mips.ld ├── mipsel.ld ├── module.c ├── module.h ├── monitor.c ├── monitor.h ├── nbd.c ├── nbd.h ├── net-checksum.c ├── net.c ├── net.h ├── osdep.c ├── osdep.h ├── pc-bios │ ├── Makefile │ ├── README │ ├── bamboo.dtb │ ├── bamboo.dts │ ├── bios-pq │ │ ├── 0001_bx-qemu.patch │ │ ├── 0002_kvm-bios-update-smbios-table-to-report-memory-above-4g.patch │ │ ├── 0003_kvm-bios-generate-mptable-unconditionally.patch │ │ ├── 0004_kvm-bios-resolve-memory-device-roll-over-reporting--issues-with-32g-guests.patch │ │ ├── 0005_kvm-bios-fix-smbios-memory-device-length-boundary--condition.patch │ │ ├── 0006_qemu-bios-use-preprocessor-for-pci-link-routing.patch │ │ ├── 0007_bios-add-26-pci-slots,-bringing-the-total-to-32.patch │ │ ├── 0008_qemu-bios-provide-gpe-_l0x-methods.patch │ │ ├── 0009_qemu-bios-pci-hotplug-support.patch │ │ ├── 0010_bios-mark-the-acpi-sci-interrupt-as-connected-to-irq-9.patch │ │ ├── 0011_read-additional-acpi-tables-from-a-vm.patch │ │ ├── 0012-load-smbios-entries-and-files-from-qemu.patch │ │ ├── 0013_fix-non-acpi-timer-interrupt-routing.patch │ │ ├── 0014_add-srat-acpi-table-support.patch │ │ ├── 0015_enable-power-button-even-generation.patch │ │ ├── 0016-use-correct-mask-to-size-pci-option-rom-bar.patch │ │ ├── 0017-bochs-bios-Move-QEMU_CFG-constants-to-rombios.h.patch │ │ ├── 0018-bochs-bios-Make-boot-prompt-optional.patch │ │ ├── 0019-bios-fix-multiple-calls.patch │ │ ├── HEAD │ │ └── series │ ├── bios-vista.diff │ ├── bios.bin │ ├── bochs-manifest │ ├── keymaps │ │ ├── ar │ │ ├── common │ │ ├── da │ │ ├── de │ │ ├── de-ch │ │ ├── en-gb │ │ ├── en-us │ │ ├── es │ │ ├── et │ │ ├── fi │ │ ├── fo │ │ ├── fr │ │ ├── fr-be │ │ ├── fr-ca │ │ ├── fr-ch │ │ ├── hr │ │ ├── hu │ │ ├── is │ │ ├── it │ │ ├── ja │ │ ├── lt │ │ ├── lv │ │ ├── mk │ │ ├── modifiers │ │ ├── nl │ │ ├── nl-be │ │ ├── no │ │ ├── pl │ │ ├── pt │ │ ├── pt-br │ │ ├── ru │ │ ├── sl │ │ ├── sv │ │ ├── th │ │ └── tr │ ├── mpc8544ds.dtb │ ├── mpc8544ds.dts │ ├── multiboot.bin │ ├── ohw.diff │ ├── openbios-ppc │ ├── openbios-sparc │ ├── openbios-sparc32 │ ├── openbios-sparc64 │ ├── optionrom │ │ ├── Makefile │ │ ├── extboot.S │ │ ├── multiboot.S │ │ └── signrom.sh │ ├── petalogix-s3adsp1800.dtb │ ├── ppc_rom.bin │ ├── pxe-e1000.bin │ ├── pxe-ne2k_pci.bin │ ├── pxe-pcnet.bin │ ├── pxe-rtl8139.bin │ ├── vgabios-cirrus.bin │ ├── vgabios-pq │ │ ├── HEAD │ │ └── series │ ├── vgabios.bin │ └── video.x ├── pci-ids.txt ├── posix-aio-compat.c ├── posix-aio-compat.h ├── ppc-dis.c ├── ppc.ld ├── ppc64.ld ├── qemu-aio.h ├── qemu-binfmt-conf.sh ├── qemu-char.c ├── qemu-char.h ├── qemu-common.h ├── qemu-doc.texi ├── qemu-img-cmds.hx ├── qemu-img.c ├── qemu-img.texi ├── qemu-io.c ├── qemu-kvm-helper.c ├── qemu-kvm-ia64.c ├── qemu-kvm-x86.c ├── qemu-kvm.c ├── qemu-kvm.h ├── qemu-lock.h ├── qemu-log.h ├── qemu-malloc.c ├── qemu-monitor.hx ├── qemu-nbd.c ├── qemu-nbd.texi ├── qemu-option.c ├── qemu-option.h ├── qemu-options.hx ├── qemu-sockets.c ├── qemu-tech.texi ├── qemu-thread.c ├── qemu-thread.h ├── qemu-timer.h ├── qemu-tool.c ├── qemu.sasl ├── qemu_socket.h ├── readline.c ├── readline.h ├── rules.mak ├── s390-dis.c ├── s390.ld ├── savevm.c ├── sdl.c ├── sdl_keysym.h ├── sdl_zoom.c ├── sdl_zoom.h ├── sdl_zoom_template.h ├── sh4-dis.c ├── slirp │ ├── COPYRIGHT │ ├── bootp.c │ ├── bootp.h │ ├── cksum.c │ ├── debug.h │ ├── if.c │ ├── if.h │ ├── ip.h │ ├── ip_icmp.c │ ├── ip_icmp.h │ ├── ip_input.c │ ├── ip_output.c │ ├── libslirp.h │ ├── main.h │ ├── mbuf.c │ ├── mbuf.h │ ├── misc.c │ ├── misc.h │ ├── sbuf.c │ ├── sbuf.h │ ├── slirp.c │ ├── slirp.h │ ├── slirp_config.h │ ├── socket.c │ ├── socket.h │ ├── tcp.h │ ├── tcp_input.c │ ├── tcp_output.c │ ├── tcp_subr.c │ ├── tcp_timer.c │ ├── tcp_timer.h │ ├── tcp_var.h │ ├── tcpip.h │ ├── tftp.c │ ├── tftp.h │ ├── udp.c │ └── udp.h ├── softmmu-semi.h ├── softmmu_defs.h ├── softmmu_exec.h ├── softmmu_header.h ├── softmmu_template.h ├── sparc-dis.c ├── sparc.ld ├── sparc64.ld ├── ssd.h ├── sys-queue.h ├── sysemu.h ├── tap-win32.c ├── target-alpha │ ├── STATUS │ ├── cpu.h │ ├── exec.h │ ├── helper.c │ ├── helper.h │ ├── op_helper.c │ └── translate.c ├── target-arm │ ├── cpu.h │ ├── exec.h │ ├── helper.c │ ├── helpers.h │ ├── iwmmxt_helper.c │ ├── machine.c │ ├── neon_helper.c │ ├── op_addsub.h │ ├── op_helper.c │ └── translate.c ├── target-cris │ ├── cpu.h │ ├── crisv32-decode.h │ ├── exec.h │ ├── helper.c │ ├── helper.h │ ├── machine.c │ ├── mmu.c │ ├── mmu.h │ ├── op_helper.c │ ├── opcode-cris.h │ └── translate.c ├── target-i386 │ ├── TODO │ ├── cpu.h │ ├── exec.h │ ├── fake-exec.c │ ├── helper.c │ ├── helper.h │ ├── helper_template.h │ ├── kvm.c │ ├── libkvm.h │ ├── machine.c │ ├── op_helper.c │ ├── ops_sse.h │ ├── ops_sse_header.h │ ├── svm.h │ └── translate.c ├── target-ia64 │ ├── cpu.h │ ├── exec.h │ ├── fake-exec.c │ ├── firmware.c │ ├── firmware.h │ ├── helper.c │ ├── libkvm.c │ ├── libkvm.h │ ├── machine.c │ ├── op.c │ ├── op_helper.c │ └── translate.c ├── target-m68k │ ├── cpu.h │ ├── exec.h │ ├── helper.c │ ├── helpers.h │ ├── m68k-qreg.h │ ├── machine.c │ ├── op_helper.c │ ├── qregs.def │ └── translate.c ├── target-microblaze │ ├── cpu.h │ ├── exec.h │ ├── helper.c │ ├── helper.h │ ├── machine.c │ ├── microblaze-decode.h │ ├── mmu.c │ ├── mmu.h │ ├── op_helper.c │ └── translate.c ├── target-mips │ ├── TODO │ ├── cpu.h │ ├── exec.h │ ├── helper.c │ ├── helper.h │ ├── machine.c │ ├── mips-defs.h │ ├── op_helper.c │ ├── translate.c │ └── translate_init.c ├── target-ppc │ ├── STATUS │ ├── cpu.h │ ├── exec.h │ ├── fake-exec.c │ ├── helper.c │ ├── helper.h │ ├── helper_regs.h │ ├── kvm.c │ ├── kvm_ppc.c │ ├── kvm_ppc.h │ ├── libkvm.c │ ├── libkvm.h │ ├── machine.c │ ├── mfrom_table.c │ ├── mfrom_table_gen.c │ ├── op_helper.c │ ├── translate.c │ └── translate_init.c ├── target-sh4 │ ├── README.sh4 │ ├── cpu.h │ ├── exec.h │ ├── helper.c │ ├── helper.h │ ├── machine.c │ ├── op_helper.c │ └── translate.c ├── target-sparc │ ├── TODO │ ├── cpu.h │ ├── exec.h │ ├── helper.c │ ├── helper.h │ ├── machine.c │ ├── op_helper.c │ └── translate.c ├── targphys.h ├── tcg │ ├── LICENSE │ ├── README │ ├── TODO │ ├── arm │ │ ├── tcg-target.c │ │ └── tcg-target.h │ ├── hppa │ │ ├── tcg-target.c │ │ └── tcg-target.h │ ├── i386 │ │ ├── tcg-target.c │ │ └── tcg-target.h │ ├── ppc │ │ ├── tcg-target.c │ │ └── tcg-target.h │ ├── ppc64 │ │ ├── tcg-target.c │ │ └── tcg-target.h │ ├── sparc │ │ ├── tcg-target.c │ │ └── tcg-target.h │ ├── tcg-op.h │ ├── tcg-opc.h │ ├── tcg-runtime.c │ ├── tcg.c │ ├── tcg.h │ └── x86_64 │ │ ├── tcg-target.c │ │ └── tcg-target.h ├── tests │ ├── Makefile │ ├── alpha │ │ ├── Makefile │ │ ├── crt.s │ │ ├── hello-alpha.c │ │ ├── test-cond.c │ │ └── test-ovf.c │ ├── cris │ │ ├── .gdbinit │ │ ├── Makefile │ │ ├── README │ │ ├── check_abs.c │ │ ├── check_addc.c │ │ ├── check_addcm.c │ │ ├── check_addi.s │ │ ├── check_addiv32.s │ │ ├── check_addm.s │ │ ├── check_addo.c │ │ ├── check_addoq.c │ │ ├── check_addq.s │ │ ├── check_addr.s │ │ ├── check_addxc.s │ │ ├── check_addxm.s │ │ ├── check_addxr.s │ │ ├── check_andc.s │ │ ├── check_andm.s │ │ ├── check_andq.s │ │ ├── check_andr.s │ │ ├── check_asr.s │ │ ├── check_ba.s │ │ ├── check_bas.s │ │ ├── check_bcc.s │ │ ├── check_bound.c │ │ ├── check_boundc.s │ │ ├── check_boundr.s │ │ ├── check_btst.s │ │ ├── check_clearfv32.s │ │ ├── check_clrjmp1.s │ │ ├── check_cmp-2.s │ │ ├── check_cmpc.s │ │ ├── check_cmpm.s │ │ ├── check_cmpq.s │ │ ├── check_cmpr.s │ │ ├── check_cmpxc.s │ │ ├── check_cmpxm.s │ │ ├── check_dstep.s │ │ ├── check_ftag.c │ │ ├── check_gcctorture_pr28634-1.c │ │ ├── check_gcctorture_pr28634.c │ │ ├── check_glibc_kernelversion.c │ │ ├── check_hello.c │ │ ├── check_int64.c │ │ ├── check_jsr.s │ │ ├── check_lapc.s │ │ ├── check_lsl.s │ │ ├── check_lsr.s │ │ ├── check_lz.c │ │ ├── check_mapbrk.c │ │ ├── check_mcp.s │ │ ├── check_mmap1.c │ │ ├── check_mmap2.c │ │ ├── check_mmap3.c │ │ ├── check_movdelsr1.s │ │ ├── check_movecr.s │ │ ├── check_movei.s │ │ ├── check_movemr.s │ │ ├── check_movemrv32.s │ │ ├── check_moveq.c │ │ ├── check_mover.s │ │ ├── check_moverm.s │ │ ├── check_movmp.s │ │ ├── check_movpmv32.s │ │ ├── check_movpr.s │ │ ├── check_movprv32.s │ │ ├── check_movscr.s │ │ ├── check_movsm.s │ │ ├── check_movsr.s │ │ ├── check_movucr.s │ │ ├── check_movum.s │ │ ├── check_movur.s │ │ ├── check_mulv32.s │ │ ├── check_mulx.s │ │ ├── check_neg.s │ │ ├── check_not.s │ │ ├── check_openpf1.c │ │ ├── check_openpf2.c │ │ ├── check_openpf3.c │ │ ├── check_openpf4.c │ │ ├── check_openpf5.c │ │ ├── check_orc.s │ │ ├── check_orm.s │ │ ├── check_orq.s │ │ ├── check_orr.s │ │ ├── check_ret.s │ │ ├── check_scc.s │ │ ├── check_settls1.c │ │ ├── check_sigalrm.c │ │ ├── check_stat1.c │ │ ├── check_stat2.c │ │ ├── check_stat3.c │ │ ├── check_stat4.c │ │ ├── check_subc.s │ │ ├── check_subm.s │ │ ├── check_subq.s │ │ ├── check_subr.s │ │ ├── check_swap.c │ │ ├── check_time1.c │ │ ├── check_time2.c │ │ ├── check_xarith.s │ │ ├── crisutils.h │ │ ├── crt.s │ │ ├── sys.c │ │ ├── sys.h │ │ └── testutils.inc │ ├── hello-arm.c │ ├── hello-i386.c │ ├── hello-mips.c │ ├── linux-test.c │ ├── pi_10.com │ ├── qruncom.c │ ├── runcom.c │ ├── sha1.c │ ├── test-arm-iwmmxt.s │ ├── test-i386-code16.S │ ├── test-i386-muldiv.h │ ├── test-i386-shift.h │ ├── test-i386-ssse3.c │ ├── test-i386-vm86.S │ ├── test-i386.c │ ├── test-i386.h │ ├── test-mmap.c │ ├── test_path.c │ └── testthread.c ├── texi2pod.pl ├── thunk.c ├── thunk.h ├── tool-osdep.c ├── translate-all.c ├── uboot_image.h ├── usb-bsd.c ├── usb-linux.c ├── usb-stub.c ├── vgafont.h ├── vl.c ├── vl.c.bak ├── vnc-auth-sasl.c ├── vnc-auth-sasl.h ├── vnc-auth-vencrypt.c ├── vnc-auth-vencrypt.h ├── vnc-tls.c ├── vnc-tls.h ├── vnc.c ├── vnc.h ├── vnc_keysym.h ├── vnchextile.h ├── x86_64-softmmu │ ├── config.h │ ├── data │ │ └── .ssd.conf.swo │ ├── rrun.sh │ ├── rrun_linux.sh │ ├── run.sh │ └── run_linux.sh ├── x86_64.ld ├── x_keymap.c └── x_keymap.h ├── RAMDISK └── ram_mount.sh ├── README.md └── SSD_MODULE ├── ssd_io_manager.c ├── ssd_io_manager.h ├── ssd_log_manager.c ├── ssd_log_manager.h ├── ssd_trim_manager.c ├── ssd_trim_manager.h └── ssd_util.h /CONFIG/ssd.conf: -------------------------------------------------------------------------------- 1 | FILE_NAME_HDA ../../RAMDISK/rd/ssd_hda.img 2 | FILE_NAME_HDB ../../RAMDISK/rd/ssd_hdb.img 3 | PAGE_SIZE 4096 4 | PAGE_NB 256 5 | SECTOR_SIZE 512 6 | FLASH_NB 20 7 | BLOCK_NB 1024 8 | PLANES_PER_FLASH 1 9 | 10 | LOG_RAND_BLOCK_NB 0 11 | LOG_SEQ_BLOCK_NB 0 12 | 13 | REG_WRITE_DELAY 82 14 | CELL_PROGRAM_DELAY 940 15 | REG_READ_DELAY 82 16 | CELL_READ_DELAY 140 17 | BLOCK_ERASE_DELAY 2000 18 | 19 | CHANNEL_SWITCH_DELAY_R 16 20 | CHANNEL_SWITCH_DELAY_W 33 21 | 22 | IO_PARALLELISM 0 23 | 24 | WRITE_BUFFER_FRAME_NB 2048 25 | READ_BUFFER_FRAME_NB 2048 26 | CACHE_IDX_SIZE 10 27 | 28 | CHANNEL_NB 10 29 | OVP 0 30 | -------------------------------------------------------------------------------- /CONFIG/ssd_fast.conf: -------------------------------------------------------------------------------- 1 | FILE_NAME_HDA ../../RAMDISK/rd/ssd_hda.img 2 | FILE_NAME_HDB ../../RAMDISK/rd/ssd_hdb.img 3 | PAGE_SIZE 4096 4 | PAGE_NB 256 5 | SECTOR_SIZE 512 6 | FLASH_NB 4 7 | BLOCK_NB 4096 8 | PLANES_PER_FLASH 2 9 | 10 | LOG_RAND_BLOCK_NB 16 11 | LOG_SEQ_BLOCK_NB 4 12 | 13 | REG_WRITE_DELAY 0 14 | CELL_PROGRAM_DELAY 0 15 | REG_READ_DELAY 0 16 | CELL_READ_DELAY 0 17 | BLOCK_ERASE_DELAY 0 18 | 19 | CHANNEL_SWITCH_DELAY_R 15 20 | CHANNEL_SWITCH_DELAY_W 30 21 | 22 | IO_PARALLELISM 0 23 | 24 | WRITE_BUFFER_FRAME_NB 65536 25 | READ_BUFFER_FRAME_NB 65536 26 | CACHE_IDX_SIZE 10 27 | 28 | CHANNEL_NB 4 29 | OVP 5 30 | -------------------------------------------------------------------------------- /CONFIG/ssd_intel.conf: -------------------------------------------------------------------------------- 1 | FILE_NAME_HDA ../../RAMDISK/rd/ssd_hda.img 2 | FILE_NAME_HDB ../../RAMDISK/rd/ssd_hdb.img 3 | PAGE_SIZE 4096 4 | PAGE_NB 256 5 | SECTOR_SIZE 512 6 | FLASH_NB 20 7 | BLOCK_NB 1024 8 | PLANES_PER_FLASH 1 9 | 10 | LOG_RAND_BLOCK_NB 0 11 | LOG_SEQ_BLOCK_NB 0 12 | 13 | REG_WRITE_DELAY 82 14 | CELL_PROGRAM_DELAY 940 15 | REG_READ_DELAY 82 16 | CELL_READ_DELAY 140 17 | BLOCK_ERASE_DELAY 2000 18 | 19 | CHANNEL_SWITCH_DELAY_R 16 20 | CHANNEL_SWITCH_DELAY_W 33 21 | 22 | IO_PARALLELISM 0 23 | 24 | WRITE_BUFFER_FRAME_NB 65536 25 | READ_BUFFER_FRAME_NB 65536 26 | CACHE_IDX_SIZE 10 27 | 28 | CHANNEL_NB 10 29 | OVP 5 30 | -------------------------------------------------------------------------------- /CONFIG/ssd_last.conf: -------------------------------------------------------------------------------- 1 | FILE_NAME_HDA ../../RAMDISK/rd/ssd_hda.img 2 | FILE_NAME_HDB ../../RAMDISK/rd/ssd_hdb.img 3 | PAGE_SIZE 4096 4 | PAGE_NB 256 5 | SECTOR_SIZE 512 6 | FLASH_NB 20 7 | BLOCK_NB 1024 8 | PLANES_PER_FLASH 1 9 | 10 | LOG_RAND_BLOCK_NB 4 11 | LOG_SEQ_BLOCK_NB 1 12 | 13 | REG_WRITE_DELAY 0 14 | CELL_PROGRAM_DELAY 0 15 | REG_READ_DELAY 0 16 | CELL_READ_DELAY 0 17 | BLOCK_ERASE_DELAY 0 18 | 19 | CHANNEL_SWITCH_DELAY_R 0 20 | CHANNEL_SWITCH_DELAY_W 0 21 | 22 | IO_PARALLELISM 0 23 | 24 | WRITE_BUFFER_FRAME_NB 16384 25 | READ_BUFFER_FRAME_NB 16384 26 | CACHE_IDX_SIZE 10 27 | 28 | CHANNEL_NB 10 29 | OVP 5 30 | -------------------------------------------------------------------------------- /FIRMWARE/ssd.h: -------------------------------------------------------------------------------- 1 | // File: ssd.h 2 | // Date: 2015. 01. 06. 3 | // Author: Jinsoo Yoo (jedisty@hanyang.ac.kr) 4 | // Copyright(c)2014 5 | // Hanyang University, Seoul, Korea 6 | // Embedded Software Systems Laboratory. All right reserved 7 | 8 | #ifndef _SSD_H_ 9 | #define _SSD_H_ 10 | 11 | #include "hw.h" 12 | 13 | 14 | //FILE *fp; 15 | void SSD_INIT(void); 16 | void SSD_TERM(void); 17 | 18 | void SSD_WRITE(unsigned int length, int32_t sector_nb); 19 | void SSD_READ(unsigned int length, int32_t sector_nb); 20 | void SSD_DSM_TRIM(unsigned int length, void* trim_data); 21 | int SSD_IS_SUPPORT_TRIM(void); 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /FTL/BLOCK_MAP/ftl.h: -------------------------------------------------------------------------------- 1 | // File: ftl.h 2 | // Date: 2018. 02. 08. 3 | // Author: Jinsoo Yoo (jedisty@hanyang.ac.kr) 4 | // Copyright(c)2018 5 | // Hanyang University, Seoul, Korea 6 | // Embedded Software Systems Laboratory. All right reserved 7 | 8 | #ifndef _FTL_H_ 9 | #define _FTL_H_ 10 | 11 | #include "common.h" 12 | 13 | void FTL_INIT(void); 14 | void FTL_TERM(void); 15 | 16 | void FTL_READ(int32_t sector_nb, unsigned int length); 17 | void FTL_WRITE(int32_t sector_nb, unsigned int length); 18 | 19 | int _FTL_READ(int32_t sector_nb, unsigned int length); 20 | int _FTL_WRITE(int32_t sector_nb, unsigned int length); 21 | 22 | //TEMP 23 | extern int data_block_nb; 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /FTL/BLOCK_MAP/ftl_gc_manager.h: -------------------------------------------------------------------------------- 1 | // File: ftl_gc_manager.h 2 | // Date: 2018. 02. 08. 3 | // Author: Jinsoo Yoo (jedisty@hanyang.ac.kr) 4 | // Copyright(c)2018 5 | // Hanyang University, Seoul, Korea 6 | // Embedded Software Systems Laboratory. All right reserved 7 | 8 | #ifndef _GC_MANAGER_H_ 9 | #define _GC_MANAGER_H_ 10 | 11 | extern unsigned int gc_count; 12 | 13 | void GC_CHECK(void); 14 | 15 | int GARBAGE_COLLECTION(void); 16 | int BM_GARBAGE_COLLECTION(int32_t victim_pbn); 17 | int32_t SELECT_VICTIM_BLOCK(void); 18 | 19 | int COPY_VALID_PAGES(int32_t old_pbn, int32_t new_pbn); 20 | int MERGE_RP_BLOCKS(int32_t old_pbn, int32_t new_pbn); 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /FTL/BLOCK_MAP/ftl_type.h: -------------------------------------------------------------------------------- 1 | // File: ftl_type.h 2 | // Date: 2018. 02. 08. 3 | // Author: Jinsoo Yoo (jedisty@hanyang.ac.kr) 4 | // Copyright(c)2018 5 | // Hanyang University, Seoul, Korea 6 | // Embedded Software Systems Laboratory. All right reserved 7 | 8 | 9 | #ifndef _FTL_TYPE_H_ 10 | #define _FTL_TYPE_H_ 11 | 12 | #define BLOCK_MAP 13 | #endif 14 | -------------------------------------------------------------------------------- /FTL/FAST/ftl.h: -------------------------------------------------------------------------------- 1 | // File: ftl.h 2 | // Date: 2018. 02. 08. 3 | // Author: Jinsoo Yoo (jedisty@hanyang.ac.kr) 4 | // Copyright(c)2018 5 | // Hanyang University, Seoul, Korea 6 | // Embedded Software Systems Laboratory. All right reserved 7 | 8 | #ifndef _FTL_H_ 9 | #define _FTL_H_ 10 | 11 | #include "common.h" 12 | 13 | void FTL_INIT(void); 14 | void FTL_TERM(void); 15 | 16 | void FTL_READ(int32_t sector_nb, unsigned int length); 17 | void FTL_WRITE(int32_t sector_nb, unsigned int length); 18 | 19 | int _FTL_READ(int32_t sector_nb, unsigned int length); 20 | int _FTL_WRITE(int32_t sector_nb, unsigned int length); 21 | #endif 22 | -------------------------------------------------------------------------------- /FTL/FAST/ftl_data_mapping_manager.h: -------------------------------------------------------------------------------- 1 | // File: ftl_data_mapping_manager.h 2 | // Date: 2018. 02. 08. 3 | // Author: Jinsoo Yoo (jedisty@hanyang.ac.kr) 4 | // Copyright(c)2018 5 | // Hanyang University, Seoul, Korea 6 | // Embedded Software Systems Laboratory. All right reserved 7 | 8 | #ifndef _DATA_MAPPING_MANAGER_H_ 9 | #define _DATA_MAPPING_MANAGER_H_ 10 | 11 | typedef struct data_block_mapping_entry 12 | { 13 | unsigned int phy_flash_nb; 14 | unsigned int phy_block_nb; 15 | 16 | }data_block_mapping_entry; 17 | 18 | void INIT_DATA_BLOCK_MAPPING(void); 19 | void TERM_DATA_BLOCK_MAPPING(void); 20 | 21 | int GET_DATA_BLOCK_MAPPING_INFO(unsigned int log_flash_nb, unsigned int log_block_nb, unsigned int* phy_flash_nb, unsigned int* phy_block_nb); 22 | data_block_mapping_entry* GET_DATA_BLOCK_MAPPING_ENTRY(unsigned int log_flash_nb, unsigned int log_block_nb); 23 | 24 | int UPDATE_DATA_BLOCK_MAPPING(unsigned int log_flash_nb, unsigned int log_block_nb, unsigned int phy_flash_nb, unsigned int phy_block_nb); 25 | 26 | int FIND_PAGE_IN_DATA_BLOCK(int64_t sector_nb, unsigned int* phy_flash_nb, unsigned int* phy_block_nb, unsigned int* phy_page_nb); 27 | #endif 28 | -------------------------------------------------------------------------------- /FTL/FAST/ftl_type.h: -------------------------------------------------------------------------------- 1 | // File: ftl_type.h 2 | // Date: 2018. 02. 08. 3 | // Author: Jinsoo Yoo (jedisty@hanyang.ac.kr) 4 | // Copyright(c)2018 5 | // Hanyang University, Seoul, Korea 6 | // Embedded Software Systems Laboratory. All right reserved 7 | 8 | 9 | #ifndef _FTL_TYPE_H_ 10 | #define _FTL_TYPE_H_ 11 | 12 | #define FAST_FTL 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /FTL/LAST/ftl.h: -------------------------------------------------------------------------------- 1 | // File: ftl.h 2 | // Date: 2018. 02. 08. 3 | // Author: Jinsoo Yoo (jedisty@hanyang.ac.kr) 4 | // Copyright(c)2018 5 | // Hanyang University, Seoul, Korea 6 | // Embedded Software Systems Laboratory. All right reserved 7 | 8 | #ifndef _FTL_H_ 9 | #define _FTL_H_ 10 | 11 | #include "common.h" 12 | 13 | void FTL_INIT(void); 14 | void FTL_TERM(void); 15 | 16 | void FTL_READ(int32_t sector_nb, unsigned int length); 17 | void FTL_WRITE(int32_t sector_nb, unsigned int length); 18 | 19 | int _FTL_READ(int32_t sector_nb, unsigned int length); 20 | int _FTL_WRITE(int32_t sector_nb, unsigned int length); 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /FTL/LAST/ftl_buffer.h: -------------------------------------------------------------------------------- 1 | // File: ftl_buffer.h 2 | // Date: 2018. 02. 08. 3 | // Author: Jinsoo Yoo (jedisty@hanyang.ac.kr) 4 | // Copyright(c)2018 5 | // Hanyang University, Seoul, Korea 6 | // Embedded Software Systems Laboratory. All right reserved 7 | 8 | #ifndef _FTL_BUFFER_H_ 9 | #define _FTL_BUFFER_H_ 10 | 11 | int FTL_BUFFER(int type, int64_t sector_nb, unsigned int length); 12 | void FTL_BUFFER_FLUSH(void); 13 | void InsertNode(int type, int64_t sector_nb, unsigned int length); 14 | 15 | typedef struct st_ftl_buff{ 16 | int type; 17 | int64_t sector_nb; 18 | unsigned int length; 19 | struct st_ftl_buff* next; 20 | }ftl_buff; 21 | 22 | //flt_buff* g_pHead = NULL; 23 | //ftl_buff* g_pTail = NULL; 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /FTL/LAST/ftl_data_mapping_manager.h: -------------------------------------------------------------------------------- 1 | // File: ftl_data_mapping_manager.h 2 | // Date: 2018. 02. 08. 3 | // Author: Jinsoo Yoo (jedisty@hanyang.ac.kr) 4 | // Copyright(c)2018 5 | // Hanyang University, Seoul, Korea 6 | // Embedded Software Systems Laboratory. All right reserved 7 | 8 | #ifndef _DATA_MAPPING_MANAGER_H_ 9 | #define _DATA_MAPPING_MANAGER_H_ 10 | 11 | typedef struct data_block_mapping_entry 12 | { 13 | unsigned int phy_flash_nb; 14 | unsigned int phy_block_nb; 15 | 16 | }data_block_mapping_entry; 17 | 18 | void INIT_DATA_BLOCK_MAPPING(void); 19 | void TERM_DATA_BLOCK_MAPPING(void); 20 | 21 | int GET_DATA_BLOCK_MAPPING_INFO(unsigned int log_flash_nb, unsigned int log_block_nb, unsigned int* phy_flash_nb, unsigned int* phy_block_nb); 22 | data_block_mapping_entry* GET_DATA_BLOCK_MAPPING_ENTRY(unsigned int log_flash_nb, unsigned int log_block_nb); 23 | 24 | int UPDATE_DATA_BLOCK_MAPPING(unsigned int log_flash_nb, unsigned int log_block_nb, unsigned int phy_flash_nb, unsigned int phy_block_nb); 25 | 26 | int FIND_PAGE_IN_DATA_BLOCK(int64_t sector_nb, unsigned int* phy_flash_nb, unsigned int* phy_block_nb, unsigned int* phy_page_nb); 27 | #endif 28 | -------------------------------------------------------------------------------- /FTL/LAST/ftl_perf_manager.h: -------------------------------------------------------------------------------- 1 | // File: ftl_perf_manager.h 2 | // Date: 2018. 02. 08. 3 | // Author: Jinsoo Yoo (jedisty@hanyang.ac.kr) 4 | // Copyright(c)2018 5 | // Hanyang University, Seoul, Korea 6 | // Embedded Software Systems Laboratory. All right reserved 7 | 8 | #ifndef _PERF_MANAGER_H_ 9 | #define _PERF_MANAGER_H_ 10 | 11 | void INIT_PERF_CHECKER(void); 12 | void TERM_PERF_CHECKER(void); 13 | 14 | void PERF_CHECKER(int op_type, int64_t op_delay); 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /FTL/LAST/ftl_type.h: -------------------------------------------------------------------------------- 1 | // File: ftl_type.h 2 | // Date: 2018. 02. 08. 3 | // Author: Jinsoo Yoo (jedisty@hanyang.ac.kr) 4 | // Copyright(c)2018 5 | // Hanyang University, Seoul, Korea 6 | // Embedded Software Systems Laboratory. All right reserved 7 | 8 | #ifndef _FTL_TYPE_H_ 9 | #define _FTL_TYPE_H_ 10 | 11 | #define LAST_FTL 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /FTL/PAGE_MAP/.svn/text-base/common.h.svn-base: -------------------------------------------------------------------------------- 1 | #ifndef _COMMON_H_ 2 | #define _COMMON_H_ 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | //typedef signed long long int64_t; 10 | 11 | #define SUCCESS 1 12 | #define FAIL 0 13 | 14 | #define VALID 50 15 | #define INVALID 51 16 | 17 | #define EMPTY_BLOCK 33 18 | #define DATA_BLOCK 34 19 | 20 | #define CHANNEL_IS_EMPTY 700 21 | #define CHANNEL_IS_WRITE 701 22 | #define CHANNEL_IS_READ 702 23 | #define CHANNEL_IS_ERASE 703 24 | 25 | #define REG_IS_EMPTY 705 26 | #define REG_IS_WRITE 706 27 | #define REG_IS_READ 707 28 | #define REG_IS_ERASE 708 29 | 30 | #define WRITE 801 31 | #define READ 802 32 | #define ERASE 803 33 | 34 | /* FTL Debugging */ 35 | //#define FTL_DEBUG 36 | //#define DEBUG_MODE1 37 | #define MNT_DEBUG 38 | #define MONITOR_ON 39 | 40 | //#define REMAIN_WRITE_DELAY // Remaining delay 41 | 42 | /* SSD Debugging */ 43 | //#define SSD_DEBUG 44 | #define SSD_CH_SWITCH_DELAY_R 45 | #define SSD_CH_SWITCH_DELAY_W 46 | 47 | //#define SSD_ERASE_ON 48 | 49 | //#define SSD_SYNC 50 | 51 | #define SPO_MONITOR 52 | 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /FTL/PAGE_MAP/.svn/text-base/ftl.h.svn-base: -------------------------------------------------------------------------------- 1 | #ifndef _FTL_H_ 2 | #define _FTL_H_ 3 | 4 | #include "common.h" 5 | 6 | void FTL_INIT(void); 7 | void FTL_TERM(void); 8 | 9 | void FTL_READ(int64_t sector_nb, unsigned int length); 10 | void FTL_WRITE(int64_t sector_nb, unsigned int length); 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /FTL/PAGE_MAP/.svn/text-base/ftl_mapping_manager.h.svn-base: -------------------------------------------------------------------------------- 1 | #ifndef _MAPPING_MANAGER_H_ 2 | #define _MAPPING_MANAGER_H_ 3 | 4 | extern void* mapping_table_start; 5 | extern void* block_table_start; 6 | 7 | extern unsigned int flash_index; 8 | extern unsigned int* plane_index; 9 | extern unsigned int* block_index; 10 | 11 | typedef struct mapping_table_entry 12 | { 13 | unsigned int phy_flash_nb; 14 | unsigned int phy_block_nb; 15 | unsigned int phy_page_nb; 16 | }mapping_table_entry; 17 | 18 | void INIT_MAPPING_TABLE(void); 19 | void TERM_MAPPING_TABLE(void); 20 | 21 | int GET_MAPPING_INFO(int64_t lba, unsigned int* phy_flash_nb, unsigned int* phy_block_nb, unsigned int* phy_page_nb); 22 | int GET_NEW_PAGE(unsigned int* new_phy_flash_nb, unsigned int* new_phy_block_nb, unsigned int* new_phy_page_nb); 23 | mapping_table_entry* GET_MAPPING_ENTRY(int64_t lba); 24 | 25 | int UPDATE_OLD_PAGE_MAPPING(int64_t lba); 26 | int UPDATE_NEW_PAGE_MAPPING(int64_t lba, unsigned int new_phy_flash_nb, unsigned int new_phy_block_nb, unsigned int new_phy_page_nb); 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /FTL/PAGE_MAP/.svn/text-base/ssd_io_manager.h.svn-base: -------------------------------------------------------------------------------- 1 | #ifndef _SSD_IO_MANAGER_H 2 | #define _SSD_IO_MANAGER_H 3 | 4 | extern int old_channel_nb; 5 | 6 | int64_t get_usec(void); 7 | 8 | int SSD_IO_INIT(void); 9 | 10 | int CELL_READ(unsigned int flash_nb, unsigned int block_nb, unsigned int page_nb); 11 | int CELL_WRITE(unsigned int flash_nb, unsigned int block_nb, unsigned int page_nb); 12 | int BLOCK_ERASE(unsigned int flash_nb, unsigned int block_nb); 13 | 14 | int CHANNEL_ACCESS_W(int channel); 15 | int CHANNEL_CHECK(int channel); 16 | int CHANNEL_ACCESS_R(int channel); 17 | 18 | int REG_ACCESS(int channel, int flag); 19 | 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /FTL/PAGE_MAP/.svn/text-base/ssd_log_manager.h.svn-base: -------------------------------------------------------------------------------- 1 | #ifndef _LOG_MANAGER_H_ 2 | #define _LOG_MANAGER_H_ 3 | 4 | void INIT_LOG_MANAGER(void); 5 | void TERM_LOG_MANAGER(void); 6 | void WRITE_LOG(char* szLog); 7 | 8 | void THREAD_SERVER(void* arg); 9 | void THREAD_CLIENT(void* arg); 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /FTL/PAGE_MAP/.svn/text-base/ssd_trim_manager.h.svn-base: -------------------------------------------------------------------------------- 1 | #ifndef _TRIM_MANAGER_H_ 2 | #define _TRIM_MANAGER_H_ 3 | #include "ssd_util.h" 4 | 5 | 6 | typedef struct sector_entry 7 | { 8 | int64_t sector_nb; 9 | unsigned long long int length; 10 | 11 | struct sector_entry* prev; 12 | struct sector_entry* next; 13 | }sector_entry; 14 | 15 | sector_entry* new_sector_entry(void); 16 | void add_sector_list(sector_entry* List, sector_entry* SE); 17 | void release_sector_list(sector_entry* SE); 18 | void remove_sector_entry(sector_entry* SE); 19 | 20 | void INSERT_TRIM_SECTORS(sector_entry* pSE); 21 | int EXIST_IN_TRIM_LIST(int64_t sector_nb); 22 | int REMOVE_TRIM_SECTOR(int64_t sector_nb); 23 | //int REMOVE_TRIM_SECTOR2(int64_t sector_nb, unsigned int length); 24 | 25 | 26 | void INIT_TRIM(void); 27 | void TERM_TRIM(void); 28 | 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /FTL/PAGE_MAP/.svn/text-base/ssd_util.h.svn-base: -------------------------------------------------------------------------------- 1 | #ifndef _SSD_UTIL_H_ 2 | #define _SSD_UTIL_H_ 3 | 4 | #ifndef WIN32 5 | #define SSD_EVALUATION 6 | #endif 7 | 8 | #ifndef _UTEST_ 9 | #include "hw.h" 10 | #else 11 | 12 | typedef signed long long int64_t; 13 | #include 14 | #include 15 | #include 16 | 17 | #endif 18 | 19 | #endif 20 | 21 | -------------------------------------------------------------------------------- /FTL/PAGE_MAP/ftl.h: -------------------------------------------------------------------------------- 1 | // File: ftl.h 2 | // Date: 2014. 12. 03. 3 | // Author: Jinsoo Yoo (jedisty@hanyang.ac.kr) 4 | // Copyright(c)2014 5 | // Hanyang University, Seoul, Korea 6 | // Embedded Software Systems Laboratory. All right reserved 7 | 8 | #ifndef _FTL_H_ 9 | #define _FTL_H_ 10 | 11 | #include "common.h" 12 | 13 | void FTL_INIT(void); 14 | void FTL_TERM(void); 15 | 16 | void FTL_READ(int32_t sector_nb, unsigned int length); 17 | void FTL_WRITE(int32_t sector_nb, unsigned int length); 18 | 19 | int _FTL_READ(int32_t sector_nb, unsigned int length); 20 | int _FTL_WRITE(int32_t sector_nb, unsigned int length); 21 | #endif 22 | -------------------------------------------------------------------------------- /FTL/PAGE_MAP/ftl_gc_manager.h: -------------------------------------------------------------------------------- 1 | // File: ftl_gc_manager.h 2 | // Date: 2014. 12. 03. 3 | // Author: Jinsoo Yoo (jedisty@hanyang.ac.kr) 4 | // Copyright(c)2014 5 | // Hanyang University, Seoul, Korea 6 | // Embedded Software Systems Laboratory. All right reserved 7 | 8 | #ifndef _GC_MANAGER_H_ 9 | #define _GC_MANAGER_H_ 10 | 11 | extern unsigned int gc_count; 12 | 13 | void GC_CHECK(unsigned int phy_flash_nb, unsigned int phy_block_nb); 14 | 15 | int GARBAGE_COLLECTION(void); 16 | int SELECT_VICTIM_BLOCK(unsigned int* phy_flash_nb, unsigned int* phy_block_nb); 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /FTL/PAGE_MAP/ftl_mapping_manager.h: -------------------------------------------------------------------------------- 1 | // File: ftl_mapping_manager.h 2 | // Date: 2014. 12. 03. 3 | // Author: Jinsoo Yoo (jedisty@hanyang.ac.kr) 4 | // Copyright(c)2014 5 | // Hanyang University, Seoul, Korea 6 | // Embedded Software Systems Laboratory. All right reserved 7 | 8 | #ifndef _MAPPING_MANAGER_H_ 9 | #define _MAPPING_MANAGER_H_ 10 | 11 | extern int32_t* mapping_table; 12 | extern void* block_table_start; 13 | 14 | extern unsigned int flash_index; 15 | extern unsigned int* plane_index; 16 | extern unsigned int* block_index; 17 | 18 | void INIT_MAPPING_TABLE(void); 19 | void TERM_MAPPING_TABLE(void); 20 | 21 | int32_t GET_MAPPING_INFO(int32_t lpn); 22 | int GET_NEW_PAGE(int mode, int mapping_index, int32_t* ppn); 23 | 24 | int UPDATE_OLD_PAGE_MAPPING(int32_t lpn); 25 | int UPDATE_NEW_PAGE_MAPPING(int32_t lpn, int32_t ppn); 26 | 27 | unsigned int CALC_FLASH(int32_t ppn); 28 | unsigned int CALC_BLOCK(int32_t ppn); 29 | unsigned int CALC_PAGE(int32_t ppn); 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /FTL/PAGE_MAP/ftl_type.h: -------------------------------------------------------------------------------- 1 | // File: ftl_type.h 2 | // Date: 2014. 12. 03. 3 | // Author: Jinsoo Yoo (jedisty@hanyang.ac.kr) 4 | // Copyright(c)2014 5 | // Hanyang University, Seoul, Korea 6 | // Embedded Software Systems Laboratory. All right reserved 7 | 8 | #ifndef _FTL_TYPE_H_ 9 | #define _FTL_TYPE_H_ 10 | 11 | #define PAGE_MAP 12 | #endif 13 | -------------------------------------------------------------------------------- /MONITOR/SSD_MONITOR_HYBRID/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * File: main.cpp 3 | * Date: 2016. 8. 8. 4 | * Author: Yongseok Jin (mnm102211@gmail.com) 5 | * Copyright(c)2016 6 | * Hanyang University, Seoul, Korea 7 | * Embedded Software Systems Laboratory, All right reserved 8 | */ 9 | 10 | #include "monitorform.h" 11 | #include 12 | 13 | int main(int argc, char *argv[]) 14 | { 15 | QApplication a(argc, argv); 16 | MonitorForm w; 17 | w.show(); 18 | 19 | return a.exec(); 20 | } 21 | -------------------------------------------------------------------------------- /MONITOR/SSD_MONITOR_HYBRID/ssd_monitor_hybrid.pro: -------------------------------------------------------------------------------- 1 | #------------------------------------------------- 2 | # 3 | # Project created by QtCreator 2016-05-21T19:22:52 4 | # 5 | #------------------------------------------------- 6 | 7 | QT += core gui network 8 | 9 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 10 | 11 | TARGET = ssd_monitor_hybrid 12 | TEMPLATE = app 13 | 14 | 15 | SOURCES += main.cpp\ 16 | monitorform.cpp 17 | 18 | HEADERS += monitorform.h 19 | 20 | FORMS += monitorform.ui 21 | -------------------------------------------------------------------------------- /MONITOR/SSD_MONITOR_PM/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * File: main.cpp 3 | * Date: 2016. 8. 8. 4 | * Author: Yongseok Jin 5 | * Copyright(c)2016 6 | * Hanyang University, Seoul, Korea 7 | * Embedded Software Systems Laboratory, All right reserved 8 | */ 9 | 10 | #include "monitorform.h" 11 | #include 12 | 13 | int main(int argc, char *argv[]) 14 | { 15 | QApplication a(argc, argv); 16 | MonitorForm w; 17 | w.show(); 18 | 19 | return a.exec(); 20 | } 21 | -------------------------------------------------------------------------------- /MONITOR/SSD_MONITOR_PM/ssd.conf: -------------------------------------------------------------------------------- 1 | ../../QEMU/x86_64-softmmu/data/ssd.conf -------------------------------------------------------------------------------- /MONITOR/SSD_MONITOR_PM/ssd_monitor_p.pro: -------------------------------------------------------------------------------- 1 | #------------------------------------------------- 2 | # 3 | # Project created by QtCreator 2016-05-21T19:22:52 4 | # 5 | #------------------------------------------------- 6 | 7 | QT += core gui network 8 | 9 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 10 | 11 | TARGET = ssd_monitor_p 12 | TEMPLATE = app 13 | 14 | 15 | SOURCES += main.cpp\ 16 | monitorform.cpp 17 | 18 | HEADERS += monitorform.h 19 | 20 | FORMS += monitorform.ui 21 | -------------------------------------------------------------------------------- /OS/empty.txt: -------------------------------------------------------------------------------- 1 | This is a folder where iso files of necessary OS are located when VSSIM installs Guest OS. 2 | -------------------------------------------------------------------------------- /QEMU/KVM_VERSION: -------------------------------------------------------------------------------- 1 | qemu-kvm-0.11.0 2 | -------------------------------------------------------------------------------- /QEMU/LICENSE: -------------------------------------------------------------------------------- 1 | The following points clarify the QEMU license: 2 | 3 | 1) QEMU as a whole is released under the GNU General Public License 4 | 5 | 2) Parts of QEMU have specific licenses which are compatible with the 6 | GNU General Public License. Hence each source file contains its own 7 | licensing information. 8 | 9 | In particular, the QEMU virtual CPU core library (libqemu.a) is 10 | released under the GNU Lesser General Public License. Many hardware 11 | device emulation sources are released under the BSD license. 12 | 13 | 3) The Tiny Code Generator (TCG) is released under the BSD license 14 | (see license headers in files). 15 | 16 | 4) QEMU is a trademark of Fabrice Bellard. 17 | 18 | Fabrice Bellard. 19 | -------------------------------------------------------------------------------- /QEMU/Makefile.hw: -------------------------------------------------------------------------------- 1 | # Makefile for qemu target independent devices. 2 | 3 | include config.mak 4 | include ../config-host.mak 5 | include $(SRC_PATH)/rules.mak 6 | 7 | .PHONY: all 8 | 9 | VPATH=$(SRC_PATH):$(SRC_PATH)/hw 10 | 11 | CPPFLAGS += -I. -I.. -I$(SRC_PATH) -MMD -MP -MT $@ 12 | CPPFLAGS += -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE 13 | CPPFLAGS+=-I$(SRC_PATH)/fpu 14 | 15 | obj-y = 16 | obj-y += virtio.o virtio-pci.o 17 | obj-y += fw_cfg.o 18 | obj-y += watchdog.o 19 | obj-y += nand.o ecc.o 20 | 21 | obj-y += m48t59.o escc.o 22 | 23 | # SCSI layer 24 | obj-y += lsi53c895a.o esp.o 25 | 26 | obj-y += dma-helpers.o sysbus.o qdev-addr.o 27 | 28 | all: $(HWLIB) 29 | # Dummy command so that make thinks it has done something 30 | @true 31 | 32 | $(HWLIB): $(obj-y) 33 | 34 | clean: 35 | rm -f *.o *.d *.a *~ 36 | 37 | # Include automatically generated dependency files 38 | -include $(wildcard *.d */*.d) 39 | -------------------------------------------------------------------------------- /QEMU/README: -------------------------------------------------------------------------------- 1 | Read the documentation in qemu-doc.html. 2 | 3 | Fabrice Bellard. 4 | -------------------------------------------------------------------------------- /QEMU/VERSION: -------------------------------------------------------------------------------- 1 | 0.11.0 2 | -------------------------------------------------------------------------------- /QEMU/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 | -------------------------------------------------------------------------------- /QEMU/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 | -------------------------------------------------------------------------------- /QEMU/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 "cpu-defs.h" 18 | 19 | typedef ram_addr_t (QEMUBalloonEvent)(void *opaque, ram_addr_t target); 20 | 21 | void qemu_add_balloon_handler(QEMUBalloonEvent *func, void *opaque); 22 | 23 | void qemu_balloon(ram_addr_t target); 24 | 25 | ram_addr_t qemu_balloon_status(void); 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /QEMU/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 | -------------------------------------------------------------------------------- /QEMU/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 | -------------------------------------------------------------------------------- /QEMU/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 | -------------------------------------------------------------------------------- /QEMU/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 | -------------------------------------------------------------------------------- /QEMU/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 | -------------------------------------------------------------------------------- /QEMU/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/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 | -------------------------------------------------------------------------------- /QEMU/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 | -------------------------------------------------------------------------------- /QEMU/buffered_file.h: -------------------------------------------------------------------------------- 1 | /* 2 | * QEMU buffered QEMUFile 3 | * 4 | * Copyright IBM, Corp. 2008 5 | * 6 | * Authors: 7 | * Anthony Liguori 8 | * 9 | * This work is licensed under the terms of the GNU GPL, version 2. See 10 | * the COPYING file in the top-level directory. 11 | * 12 | */ 13 | 14 | #ifndef QEMU_BUFFERED_FILE_H 15 | #define QEMU_BUFFERED_FILE_H 16 | 17 | #include "hw/hw.h" 18 | 19 | typedef ssize_t (BufferedPutFunc)(void *opaque, const void *data, size_t size); 20 | typedef void (BufferedPutReadyFunc)(void *opaque); 21 | typedef void (BufferedWaitForUnfreezeFunc)(void *opaque); 22 | typedef int (BufferedCloseFunc)(void *opaque); 23 | 24 | QEMUFile *qemu_fopen_ops_buffered(void *opaque, size_t xfer_limit, 25 | BufferedPutFunc *put_buffer, 26 | BufferedPutReadyFunc *put_ready, 27 | BufferedWaitForUnfreezeFunc *wait_for_unfreeze, 28 | BufferedCloseFunc *close); 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /QEMU/compatfd.h: -------------------------------------------------------------------------------- 1 | /* 2 | * signalfd/eventfd compatibility 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_COMPATFD_H 15 | #define QEMU_COMPATFD_H 16 | 17 | #include 18 | 19 | struct qemu_signalfd_siginfo { 20 | uint32_t ssi_signo; 21 | uint8_t pad[124]; 22 | }; 23 | 24 | int qemu_signalfd(const sigset_t *mask); 25 | 26 | int qemu_eventfd(int *fds); 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /QEMU/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 | -------------------------------------------------------------------------------- /QEMU/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 | -------------------------------------------------------------------------------- /QEMU/device_tree.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Header with function prototypes to help device tree manipulation using 3 | * libfdt. It also provides functions to read entries from device tree proc 4 | * interface. 5 | * 6 | * Copyright 2008 IBM Corporation. 7 | * Authors: Jerone Young 8 | * Hollis Blanchard 9 | * 10 | * This work is licensed under the GNU GPL license version 2 or later. 11 | * 12 | */ 13 | 14 | #ifndef __DEVICE_TREE_H__ 15 | #define __DEVICE_TREE_H__ 16 | 17 | void *load_device_tree(const char *filename_path, int *sizep); 18 | 19 | int qemu_devtree_setprop(void *fdt, const char *node_path, 20 | const char *property, uint32_t *val_array, int size); 21 | int qemu_devtree_setprop_cell(void *fdt, const char *node_path, 22 | const char *property, uint32_t val); 23 | int qemu_devtree_setprop_string(void *fdt, const char *node_path, 24 | const char *property, const char *string); 25 | 26 | #endif /* __DEVICE_TREE_H__ */ 27 | -------------------------------------------------------------------------------- /QEMU/gdb-xml/cf-fp.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | , 21 | 22 | 23 | -------------------------------------------------------------------------------- /QEMU/hpet.h: -------------------------------------------------------------------------------- 1 | #ifndef __HPET__ 2 | #define __HPET__ 1 3 | 4 | 5 | 6 | struct hpet_info { 7 | unsigned long hi_ireqfreq; /* Hz */ 8 | unsigned long hi_flags; /* information */ 9 | unsigned short hi_hpet; 10 | unsigned short hi_timer; 11 | }; 12 | 13 | #define HPET_INFO_PERIODIC 0x0001 /* timer is periodic */ 14 | 15 | #define HPET_IE_ON _IO('h', 0x01) /* interrupt on */ 16 | #define HPET_IE_OFF _IO('h', 0x02) /* interrupt off */ 17 | #define HPET_INFO _IOR('h', 0x03, struct hpet_info) 18 | #define HPET_EPI _IO('h', 0x04) /* enable periodic */ 19 | #define HPET_DPI _IO('h', 0x05) /* disable periodic */ 20 | #define HPET_IRQFREQ _IOW('h', 0x6, unsigned long) /* IRQFREQ usec */ 21 | 22 | #endif /* !__HPET__ */ 23 | -------------------------------------------------------------------------------- /QEMU/hw/audiodev.h: -------------------------------------------------------------------------------- 1 | /* es1370.c */ 2 | int es1370_init(PCIBus *bus); 3 | 4 | /* sb16.c */ 5 | int SB16_init(qemu_irq *pic); 6 | 7 | /* adlib.c */ 8 | int Adlib_init(qemu_irq *pic); 9 | 10 | /* gus.c */ 11 | int GUS_init(qemu_irq *pic); 12 | 13 | /* ac97.c */ 14 | int ac97_init(PCIBus *buf); 15 | 16 | /* cs4231a.c */ 17 | int cs4231a_init(qemu_irq *pic); 18 | -------------------------------------------------------------------------------- /QEMU/hw/boards.h: -------------------------------------------------------------------------------- 1 | /* Declarations for use by board files for creating devices. */ 2 | 3 | #ifndef HW_BOARDS_H 4 | #define HW_BOARDS_H 5 | 6 | #include "qdev.h" 7 | 8 | typedef void QEMUMachineInitFunc(ram_addr_t ram_size, 9 | const char *boot_device, 10 | const char *kernel_filename, 11 | const char *kernel_cmdline, 12 | const char *initrd_filename, 13 | const char *cpu_model); 14 | 15 | typedef struct QEMUMachine { 16 | const char *name; 17 | const char *alias; 18 | const char *desc; 19 | QEMUMachineInitFunc *init; 20 | int use_scsi; 21 | int max_cpus; 22 | int is_default; 23 | CompatProperty *compat_props; 24 | struct QEMUMachine *next; 25 | } QEMUMachine; 26 | 27 | int qemu_register_machine(QEMUMachine *m); 28 | 29 | extern QEMUMachine *current_machine; 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /QEMU/hw/ds1225y.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ESOS-Lab/VSSIM/a119bee2aae5e10e52feb3eec3d05f973aee54d1/QEMU/hw/ds1225y.c -------------------------------------------------------------------------------- /QEMU/hw/escc.h: -------------------------------------------------------------------------------- 1 | /* escc.c */ 2 | #define ESCC_SIZE 4 3 | int escc_init(target_phys_addr_t base, qemu_irq irqA, qemu_irq irqB, 4 | CharDriverState *chrA, CharDriverState *chrB, 5 | int clock, int it_shift); 6 | 7 | void slavio_serial_ms_kbd_init(target_phys_addr_t base, qemu_irq irq, 8 | int disabled, int clock, int it_shift); 9 | -------------------------------------------------------------------------------- /QEMU/hw/etraxfs_dma.h: -------------------------------------------------------------------------------- 1 | struct etraxfs_dma_client 2 | { 3 | /* DMA controller. */ 4 | int channel; 5 | void *ctrl; 6 | 7 | /* client. */ 8 | struct 9 | { 10 | int (*push)(void *opaque, unsigned char *buf, int len); 11 | void (*pull)(void *opaque); 12 | void *opaque; 13 | } client; 14 | }; 15 | 16 | void *etraxfs_dmac_init(target_phys_addr_t base, int nr_channels); 17 | void etraxfs_dmac_connect(void *opaque, int channel, qemu_irq *line, 18 | int input); 19 | void etraxfs_dmac_connect_client(void *opaque, int c, 20 | struct etraxfs_dma_client *cl); 21 | int etraxfs_dmac_input(struct etraxfs_dma_client *client, 22 | void *buf, int len, int eop); 23 | -------------------------------------------------------------------------------- /QEMU/hw/fdc.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ESOS-Lab/VSSIM/a119bee2aae5e10e52feb3eec3d05f973aee54d1/QEMU/hw/fdc.c -------------------------------------------------------------------------------- /QEMU/hw/fdc.h: -------------------------------------------------------------------------------- 1 | /* fdc.c */ 2 | #define MAX_FD 2 3 | 4 | typedef struct fdctrl_t fdctrl_t; 5 | 6 | fdctrl_t *fdctrl_init (qemu_irq irq, int dma_chann, int mem_mapped, 7 | target_phys_addr_t io_base, 8 | BlockDriverState **fds); 9 | fdctrl_t *sun4m_fdctrl_init (qemu_irq irq, target_phys_addr_t io_base, 10 | BlockDriverState **fds, qemu_irq *fdc_tc); 11 | int fdctrl_get_drive_type(fdctrl_t *fdctrl, int drive_num); 12 | -------------------------------------------------------------------------------- /QEMU/hw/framebuffer.h: -------------------------------------------------------------------------------- 1 | #ifndef QEMU_FRAMEBUFFER_H 2 | #define QEMU_FRAMEBUFFER_H 3 | 4 | /* Framebuffer device helper routines. */ 5 | 6 | typedef void (*drawfn)(void *, uint8_t *, const uint8_t *, int, int); 7 | 8 | void framebuffer_update_display( 9 | DisplayState *ds, 10 | target_phys_addr_t base, 11 | int cols, 12 | int rows, 13 | int src_width, 14 | int dest_row_pitch, 15 | int dest_col_pitch, 16 | int invalidate, 17 | drawfn fn, 18 | void *opaque, 19 | int *first_row, 20 | int *last_row); 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /QEMU/hw/irq.h: -------------------------------------------------------------------------------- 1 | #ifndef QEMU_IRQ_H 2 | #define QEMU_IRQ_H 3 | 4 | /* Generic IRQ/GPIO pin infrastructure. */ 5 | 6 | /* FIXME: Rmove one of these. */ 7 | typedef void (*qemu_irq_handler)(void *opaque, int n, int level); 8 | typedef void SetIRQFunc(void *opaque, int irq_num, int level); 9 | 10 | void qemu_set_irq(qemu_irq irq, int level); 11 | 12 | static inline void qemu_irq_raise(qemu_irq irq) 13 | { 14 | qemu_set_irq(irq, 1); 15 | } 16 | 17 | static inline void qemu_irq_lower(qemu_irq irq) 18 | { 19 | qemu_set_irq(irq, 0); 20 | } 21 | 22 | static inline void qemu_irq_pulse(qemu_irq irq) 23 | { 24 | qemu_set_irq(irq, 1); 25 | qemu_set_irq(irq, 0); 26 | } 27 | 28 | /* Returns an array of N IRQs. */ 29 | qemu_irq *qemu_allocate_irqs(qemu_irq_handler handler, void *opaque, int n); 30 | void qemu_free_irqs(qemu_irq *s); 31 | 32 | /* Returns a new IRQ with opposite polarity. */ 33 | qemu_irq qemu_irq_invert(qemu_irq irq); 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /QEMU/hw/isa.h: -------------------------------------------------------------------------------- 1 | #ifndef HW_ISA_H 2 | #define HW_ISA_H 3 | /* ISA bus */ 4 | 5 | #include "ioport.h" 6 | 7 | extern target_phys_addr_t isa_mem_base; 8 | 9 | void isa_mmio_init(target_phys_addr_t base, target_phys_addr_t size); 10 | 11 | /* dma.c */ 12 | int DMA_get_channel_mode (int nchan); 13 | int DMA_read_memory (int nchan, void *buf, int pos, int size); 14 | int DMA_write_memory (int nchan, void *buf, int pos, int size); 15 | void DMA_hold_DREQ (int nchan); 16 | void DMA_release_DREQ (int nchan); 17 | void DMA_schedule(int nchan); 18 | void DMA_init (int high_page_enable); 19 | void DMA_register_channel (int nchan, 20 | DMA_transfer_handler transfer_handler, 21 | void *opaque); 22 | #endif 23 | -------------------------------------------------------------------------------- /QEMU/hw/jazz_led.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ESOS-Lab/VSSIM/a119bee2aae5e10e52feb3eec3d05f973aee54d1/QEMU/hw/jazz_led.c -------------------------------------------------------------------------------- /QEMU/hw/mainstone.h: -------------------------------------------------------------------------------- 1 | /* 2 | * PXA270-based Intel Mainstone platforms. 3 | * 4 | * Copyright (c) 2007 by Armin Kuster or 5 | * 6 | * 7 | * This code is licensed under the GNU GPL v2. 8 | */ 9 | 10 | #ifndef __MAINSTONE_H__ 11 | #define __MAINSTONE_H__ 12 | 13 | /* Device addresses */ 14 | #define MST_FPGA_PHYS 0x08000000 15 | #define MST_ETH_PHYS 0x10000300 16 | #define MST_FLASH_0 0x00000000 17 | #define MST_FLASH_1 0x04000000 18 | 19 | /* IRQ definitions */ 20 | #define MMC_IRQ 0 21 | #define USIM_IRQ 1 22 | #define USBC_IRQ 2 23 | #define ETHERNET_IRQ 3 24 | #define AC97_IRQ 4 25 | #define PEN_IRQ 5 26 | #define MSINS_IRQ 6 27 | #define EXBRD_IRQ 7 28 | #define S0_CD_IRQ 9 29 | #define S0_STSCHG_IRQ 10 30 | #define S0_IRQ 11 31 | #define S1_CD_IRQ 13 32 | #define S1_STSCHG_IRQ 14 33 | #define S1_IRQ 15 34 | 35 | extern qemu_irq 36 | *mst_irq_init(PXA2xxState *cpu, uint32_t base, int irq); 37 | 38 | #endif /* __MAINSTONE_H__ */ 39 | -------------------------------------------------------------------------------- /QEMU/hw/mcf.h: -------------------------------------------------------------------------------- 1 | #ifndef HW_MCF_H 2 | #define HW_MCF_H 3 | /* Motorola ColdFire device prototypes. */ 4 | 5 | /* mcf_uart.c */ 6 | uint32_t mcf_uart_read(void *opaque, target_phys_addr_t addr); 7 | void mcf_uart_write(void *opaque, target_phys_addr_t addr, uint32_t val); 8 | void *mcf_uart_init(qemu_irq irq, CharDriverState *chr); 9 | void mcf_uart_mm_init(target_phys_addr_t base, qemu_irq irq, 10 | CharDriverState *chr); 11 | 12 | /* mcf_intc.c */ 13 | qemu_irq *mcf_intc_init(target_phys_addr_t base, CPUState *env); 14 | 15 | /* mcf_fec.c */ 16 | void mcf_fec_init(NICInfo *nd, target_phys_addr_t base, qemu_irq *irq); 17 | 18 | /* mcf5206.c */ 19 | qemu_irq *mcf5206_init(uint32_t base, CPUState *env); 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /QEMU/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 | -------------------------------------------------------------------------------- /QEMU/hw/msix.h: -------------------------------------------------------------------------------- 1 | #ifndef QEMU_MSIX_H 2 | #define QEMU_MSIX_H 3 | 4 | #include "qemu-common.h" 5 | 6 | int msix_init(PCIDevice *pdev, unsigned short nentries, 7 | unsigned bar_nr, unsigned bar_size); 8 | 9 | void msix_write_config(PCIDevice *pci_dev, uint32_t address, 10 | uint32_t val, int len); 11 | 12 | void msix_mmio_map(PCIDevice *pci_dev, int region_num, 13 | uint32_t addr, uint32_t size, int type); 14 | 15 | int msix_uninit(PCIDevice *d); 16 | 17 | void msix_save(PCIDevice *dev, QEMUFile *f); 18 | void msix_load(PCIDevice *dev, QEMUFile *f); 19 | 20 | int msix_enabled(PCIDevice *dev); 21 | int msix_present(PCIDevice *dev); 22 | 23 | uint32_t msix_bar_size(PCIDevice *dev); 24 | 25 | int msix_vector_use(PCIDevice *dev, unsigned vector); 26 | void msix_vector_unuse(PCIDevice *dev, unsigned vector); 27 | 28 | void msix_notify(PCIDevice *dev, unsigned vector); 29 | 30 | void msix_reset(PCIDevice *dev); 31 | 32 | extern int msix_supported; 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /QEMU/hw/msmouse.h: -------------------------------------------------------------------------------- 1 | /* msmouse.c */ 2 | CharDriverState *qemu_chr_open_msmouse(void); 3 | -------------------------------------------------------------------------------- /QEMU/hw/openpic.h: -------------------------------------------------------------------------------- 1 | #if !defined(__OPENPIC_H__) 2 | #define __OPENPIC_H__ 3 | 4 | /* OpenPIC have 5 outputs per CPU connected and one IRQ out single output */ 5 | enum { 6 | OPENPIC_OUTPUT_INT = 0, /* IRQ */ 7 | OPENPIC_OUTPUT_CINT, /* critical IRQ */ 8 | OPENPIC_OUTPUT_MCK, /* Machine check event */ 9 | OPENPIC_OUTPUT_DEBUG, /* Inconditional debug event */ 10 | OPENPIC_OUTPUT_RESET, /* Core reset event */ 11 | OPENPIC_OUTPUT_NB, 12 | }; 13 | 14 | qemu_irq *openpic_init (PCIBus *bus, int *pmem_index, int nb_cpus, 15 | qemu_irq **irqs, qemu_irq irq_out); 16 | qemu_irq *mpic_init (target_phys_addr_t base, int nb_cpus, 17 | qemu_irq **irqs, qemu_irq irq_out); 18 | #endif /* __OPENPIC_H__ */ 19 | -------------------------------------------------------------------------------- /QEMU/hw/ppc440.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Qemu PowerPC 440 board emualtion 3 | * 4 | * Copyright 2007 IBM Corporation. 5 | * Authors: Jerone Young 6 | * Christian Ehrhardt 7 | * 8 | * This work is licensed under the GNU GPL licence version 2 or later 9 | * 10 | */ 11 | 12 | #ifndef QEMU_PPC440_H 13 | #define QEMU_PPC440_H 14 | 15 | #include "hw.h" 16 | 17 | CPUState *ppc440ep_init(ram_addr_t *ram_size, PCIBus **pcip, 18 | const unsigned int pci_irq_nrs[4], int do_init, 19 | const char *cpu_model); 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /QEMU/hw/ppce500.h: -------------------------------------------------------------------------------- 1 | /* 2 | * QEMU PowerPC E500 emulation shared definitions 3 | * 4 | * Copyright (C) 2009 Freescale Semiconductor, Inc. All rights reserved. 5 | * 6 | * Author: Yu Liu, 7 | * 8 | * This file is derived from hw/ppc440.h 9 | * the copyright for that material belongs to the original owners. 10 | * 11 | * This is free software; you can redistribute it and/or modify 12 | * it under the terms of the GNU General Public License as published by 13 | * the Free Software Foundation; either version 2 of the License, or 14 | * (at your option) any later version. 15 | */ 16 | 17 | #if !defined(PPC_E500_H) 18 | #define PPC_E500_H 19 | 20 | PCIBus *ppce500_pci_init(qemu_irq *pic, target_phys_addr_t registers); 21 | 22 | #endif /* !defined(PPC_E500_H) */ 23 | -------------------------------------------------------------------------------- /QEMU/hw/primecell.h: -------------------------------------------------------------------------------- 1 | #ifndef PRIMECELL_H 2 | #define PRIMECELL_H 3 | 4 | /* Declarations for ARM PrimeCell based periperals. */ 5 | /* Also includes some devices that are currently only used by the 6 | ARM boards. */ 7 | 8 | /* pl080.c */ 9 | void *pl080_init(uint32_t base, qemu_irq irq, int nchannels); 10 | 11 | /* arm_sysctl.c */ 12 | void arm_sysctl_init(uint32_t base, uint32_t sys_id); 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /QEMU/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 | -------------------------------------------------------------------------------- /QEMU/hw/qdev-addr.c: -------------------------------------------------------------------------------- 1 | #include "qdev.h" 2 | #include "qdev-addr.h" 3 | #include "targphys.h" 4 | 5 | /* --- target physical address --- */ 6 | 7 | static int parse_taddr(DeviceState *dev, Property *prop, const char *str) 8 | { 9 | target_phys_addr_t *ptr = qdev_get_prop_ptr(dev, prop); 10 | 11 | *ptr = strtoull(str, NULL, 16); 12 | return 0; 13 | } 14 | 15 | static int print_taddr(DeviceState *dev, Property *prop, char *dest, size_t len) 16 | { 17 | target_phys_addr_t *ptr = qdev_get_prop_ptr(dev, prop); 18 | return snprintf(dest, len, "0x" TARGET_FMT_plx, *ptr); 19 | } 20 | 21 | PropertyInfo qdev_prop_taddr = { 22 | .name = "taddr", 23 | .type = PROP_TYPE_TADDR, 24 | .size = sizeof(target_phys_addr_t), 25 | .parse = parse_taddr, 26 | .print = print_taddr, 27 | }; 28 | 29 | void qdev_prop_set_taddr(DeviceState *dev, const char *name, target_phys_addr_t value) 30 | { 31 | qdev_prop_set(dev, name, &value, PROP_TYPE_TADDR); 32 | } 33 | -------------------------------------------------------------------------------- /QEMU/hw/qdev-addr.h: -------------------------------------------------------------------------------- 1 | extern PropertyInfo qdev_prop_taddr; 2 | void qdev_prop_set_taddr(DeviceState *dev, const char *name, target_phys_addr_t value); 3 | -------------------------------------------------------------------------------- /QEMU/hw/scsi.h: -------------------------------------------------------------------------------- 1 | /* esp.c */ 2 | #define ESP_MAX_DEVS 7 3 | typedef void (*espdma_memory_read_write)(void *opaque, uint8_t *buf, int len); 4 | void esp_init(target_phys_addr_t espaddr, int it_shift, 5 | espdma_memory_read_write dma_memory_read, 6 | espdma_memory_read_write dma_memory_write, 7 | void *dma_opaque, qemu_irq irq, qemu_irq *reset); 8 | -------------------------------------------------------------------------------- /QEMU/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 | -------------------------------------------------------------------------------- /QEMU/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 | typedef struct ScoopInfo ScoopInfo; 14 | ScoopInfo *scoop_init(PXA2xxState *cpu, 15 | int instance, target_phys_addr_t target_base); 16 | void scoop_gpio_set(void *opaque, int line, int level); 17 | qemu_irq *scoop_gpio_in_get(ScoopInfo *s); 18 | void scoop_gpio_out_set(ScoopInfo *s, int line, 19 | qemu_irq handler); 20 | 21 | #define SL_PXA_PARAM_BASE 0xa0000a00 22 | void sl_bootparam_write(target_phys_addr_t ptr); 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /QEMU/hw/sparc32_dma.h: -------------------------------------------------------------------------------- 1 | #ifndef SPARC32_DMA_H 2 | #define SPARC32_DMA_H 3 | 4 | /* sparc32_dma.c */ 5 | void *sparc32_dma_init(target_phys_addr_t daddr, qemu_irq parent_irq, 6 | void *iommu, qemu_irq *dev_irq, qemu_irq **reset); 7 | void ledma_memory_read(void *opaque, target_phys_addr_t addr, 8 | uint8_t *buf, int len, int do_bswap); 9 | void ledma_memory_write(void *opaque, target_phys_addr_t addr, 10 | uint8_t *buf, int len, int do_bswap); 11 | void espdma_memory_read(void *opaque, uint8_t *buf, int len); 12 | void espdma_memory_write(void *opaque, uint8_t *buf, int len); 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /QEMU/hw/syborg.h: -------------------------------------------------------------------------------- 1 | #ifndef _SYBORG_H 2 | #define _SYBORG_H 3 | 4 | #define SYBORG_ID_PLATFORM 0xc51d1000 5 | #define SYBORG_ID_INT 0xc51d0000 6 | #define SYBORG_ID_SERIAL 0xc51d0001 7 | #define SYBORG_ID_KEYBOARD 0xc51d0002 8 | #define SYBORG_ID_TIMER 0xc51d0003 9 | #define SYBORG_ID_RTC 0xc51d0004 10 | #define SYBORG_ID_MOUSE 0xc51d0005 11 | #define SYBORG_ID_TOUCHSCREEN 0xc51d0006 12 | #define SYBORG_ID_FRAMEBUFFER 0xc51d0007 13 | #define SYBORG_ID_HOSTFS 0xc51d0008 14 | #define SYBORG_ID_SNAPSHOT 0xc51d0009 15 | #define SYBORG_ID_VIRTIO 0xc51d000a 16 | #define SYBORG_ID_NAND 0xc51d000b 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /QEMU/hw/tc6393xb_template.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ESOS-Lab/VSSIM/a119bee2aae5e10e52feb3eec3d05f973aee54d1/QEMU/hw/tc6393xb_template.h -------------------------------------------------------------------------------- /QEMU/hw/virtio-balloon.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Virtio Support 3 | * 4 | * Copyright IBM, Corp. 2007-2008 5 | * 6 | * Authors: 7 | * Anthony Liguori 8 | * Rusty Russell 9 | * 10 | * This work is licensed under the terms of the GNU GPL, version 2. See 11 | * the COPYING file in the top-level directory. 12 | * 13 | */ 14 | 15 | #ifndef _QEMU_VIRTIO_BALLOON_H 16 | #define _QEMU_VIRTIO_BALLOON_H 17 | 18 | #include "virtio.h" 19 | #include "pci.h" 20 | 21 | /* from Linux's linux/virtio_balloon.h */ 22 | 23 | /* The ID for virtio_balloon */ 24 | #define VIRTIO_ID_BALLOON 5 25 | 26 | /* The feature bitmap for virtio balloon */ 27 | #define VIRTIO_BALLOON_F_MUST_TELL_HOST 0 /* Tell before reclaiming pages */ 28 | 29 | /* Size of a PFN in the balloon interface. */ 30 | #define VIRTIO_BALLOON_PFN_SHIFT 12 31 | 32 | struct virtio_balloon_config 33 | { 34 | /* Number of pages host wants Guest to give up. */ 35 | uint32_t num_pages; 36 | /* Number of pages we've actually got in balloon. */ 37 | uint32_t actual; 38 | }; 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /QEMU/hw/virtio-console.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Virtio Console Support 3 | * 4 | * Copyright IBM, Corp. 2008 5 | * 6 | * Authors: 7 | * Christian Ehrhardt 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 | #ifndef _QEMU_VIRTIO_CONSOLE_H 14 | #define _QEMU_VIRTIO_CONSOLE_H 15 | 16 | /* The ID for virtio console */ 17 | #define VIRTIO_ID_CONSOLE 3 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /QEMU/hw/vmport.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ESOS-Lab/VSSIM/a119bee2aae5e10e52feb3eec3d05f973aee54d1/QEMU/hw/vmport.c -------------------------------------------------------------------------------- /QEMU/hw/xen.h: -------------------------------------------------------------------------------- 1 | #ifndef QEMU_HW_XEN_H 2 | #define QEMU_HW_XEN_H 1 3 | /* 4 | * public xen header 5 | * stuff needed outside xen-*.c, i.e. interfaces to qemu. 6 | * must not depend on any xen headers being present in 7 | * /usr/include/xen, so it can be included unconditionally. 8 | */ 9 | #include 10 | 11 | /* xen-machine.c */ 12 | enum xen_mode { 13 | XEN_EMULATE = 0, // xen emulation, using xenner (default) 14 | XEN_CREATE, // create xen domain 15 | XEN_ATTACH // attach to xen domain created by xend 16 | }; 17 | 18 | extern uint32_t xen_domid; 19 | extern enum xen_mode xen_mode; 20 | 21 | #endif /* QEMU_HW_XEN_H */ 22 | -------------------------------------------------------------------------------- /QEMU/hw/xen_common.h: -------------------------------------------------------------------------------- 1 | #ifndef QEMU_HW_XEN_COMMON_H 2 | #define QEMU_HW_XEN_COMMON_H 1 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | #include 9 | #include 10 | 11 | #include "hw.h" 12 | #include "xen.h" 13 | #include "sys-queue.h" /* BSD list implementation */ 14 | 15 | /* 16 | * tweaks needed to build with different xen versions 17 | * 0x00030205 -> 3.1.0 18 | * 0x00030207 -> 3.2.0 19 | * 0x00030208 -> unstable 20 | */ 21 | #include 22 | #if __XEN_LATEST_INTERFACE_VERSION__ < 0x00030205 23 | # define evtchn_port_or_error_t int 24 | #endif 25 | #if __XEN_LATEST_INTERFACE_VERSION__ < 0x00030207 26 | # define xc_map_foreign_pages xc_map_foreign_batch 27 | #endif 28 | #if __XEN_LATEST_INTERFACE_VERSION__ < 0x00030208 29 | # define xen_mb() mb() 30 | # define xen_rmb() rmb() 31 | # define xen_wmb() wmb() 32 | #endif 33 | 34 | #endif /* QEMU_HW_XEN_COMMON_H */ 35 | -------------------------------------------------------------------------------- /QEMU/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 | -------------------------------------------------------------------------------- /QEMU/hxtool: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | hxtoh() 4 | { 5 | flag=1 6 | while read -r str; do 7 | case $str in 8 | HXCOMM*) 9 | ;; 10 | STEXI*|ETEXI*) flag=$(($flag^1)) 11 | ;; 12 | *) 13 | test $flag -eq 1 && printf "%s\n" "$str" 14 | ;; 15 | esac 16 | done 17 | } 18 | 19 | hxtotexi() 20 | { 21 | flag=0 22 | while read -r str; do 23 | case "$str" in 24 | HXCOMM*) 25 | ;; 26 | STEXI*|ETEXI*) flag=$(($flag^1)) 27 | ;; 28 | DEFHEADING*) 29 | echo "$(expr "$str" : "DEFHEADING(\(.*\))")" 30 | ;; 31 | *) 32 | test $flag -eq 1 && echo "$str" 33 | ;; 34 | esac 35 | done 36 | } 37 | 38 | case "$1" in 39 | "-h") hxtoh ;; 40 | "-t") hxtotexi ;; 41 | *) exit 1 ;; 42 | esac 43 | 44 | exit 0 45 | -------------------------------------------------------------------------------- /QEMU/kvm/bios/.cvsignore: -------------------------------------------------------------------------------- 1 | Makefile 2 | -------------------------------------------------------------------------------- /QEMU/kvm/bios/bios_usage: -------------------------------------------------------------------------------- 1 | #!/bin/csh -f 2 | gcc -E rombios.c | grep "^\.org" | sed -e 's/\.org //' | sed -e 's/ .*//' | sort >! temp.usage 3 | usage rombios.bin temp.usage 4 | /bin/rm temp.usage 5 | -------------------------------------------------------------------------------- /QEMU/kvm/bios/makesym.perl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | # 3 | # $Id: makesym.perl,v 1.1 2002/11/24 22:45:40 bdenney Exp $ 4 | # 5 | # Read output file from as86 (e.g. rombios.txt) and write out a symbol 6 | # table suitable for the Bochs debugger. 7 | # 8 | 9 | $WHERE_BEFORE_SYM_TABLE = 0; 10 | $WHERE_IN_SYM_TABLE = 1; 11 | $WHERE_AFTER_SYM_TABLE = 2; 12 | 13 | $where = $WHERE_BEFORE_SYM_TABLE; 14 | while () { 15 | chop; 16 | if ($where == WHERE_BEFORE_SYM_TABLE && /^Symbols:/) { 17 | $where = $WHERE_IN_SYM_TABLE; 18 | } elsif ($where == $WHERE_IN_SYM_TABLE && /^$/) { 19 | $where = $WHERE_AFTER_SYM_TABLE; 20 | } 21 | if ($where == $WHERE_IN_SYM_TABLE) { 22 | @F = split (/\s+/); 23 | ($name[0], $junk, $addr[0], $junk, $name[1], $junk, $addr[1]) = @F; 24 | foreach $col (0,1) { 25 | next if length $addr[$col] < 1; 26 | $addr[$col] =~ tr/A-Z/a-z/; 27 | $addr[$col] = "000f" . $addr[$col]; 28 | print "$addr[$col] $name[$col]\n"; 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /QEMU/kvm/bios/rombios32.ld: -------------------------------------------------------------------------------- 1 | OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386") 2 | OUTPUT_ARCH(i386) 3 | ENTRY(_start); 4 | SECTIONS 5 | { 6 | . = 0x000e0000; 7 | .text : { *(.text) } 8 | .rodata : { *(.rodata*) } 9 | . = ALIGN(64); 10 | fixup_start = .; 11 | .fixup : { *(.fixup) } 12 | fixup_end = .; 13 | . = ALIGN(4096); 14 | _end = . ; 15 | .data 0x700 : AT (_end) { __data_start = .; *(.data); __data_end = .;} 16 | .bss : { __bss_start = .; *(.bss) *(COMMON); __bss_end = .;} 17 | /DISCARD/ : { *(.stab) 18 | *(.stabstr) 19 | *(.comment) 20 | *(.note) 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /QEMU/kvm/extboot/STATUS: -------------------------------------------------------------------------------- 1 | Working 2 | ------- 3 | 4 | Ubuntu Server 7.04 (i386) 5 | Windows 2000 Professional (i386) 6 | Windows XP SP2 (i386) 7 | -------------------------------------------------------------------------------- /QEMU/kvm/libfdt/Makefile: -------------------------------------------------------------------------------- 1 | include ../config.mak 2 | include ../user/config.mak 3 | 4 | LIBFDT_SRCS = fdt.c fdt_ro.c fdt_wip.c fdt_sw.c fdt_rw.c fdt_strerror.c 5 | LIBFDT_INCLUDES = fdt.h libfdt.h 6 | LIBFDT_EXTRA = libfdt_internal.h 7 | LIBFDT_LIB = libfdt.a 8 | 9 | LIBFDT_OBJS = $(LIBFDT_SRCS:%.c=%.o) 10 | 11 | CFLAGS += -I . 12 | 13 | $(LIBFDT_LIB): $(LIBFDT_OBJS) 14 | $(AR) rcs $@ $^ 15 | 16 | all: $(LIBFDT_LIB) 17 | 18 | clean: 19 | rm -rf *.o *.a 20 | -------------------------------------------------------------------------------- /QEMU/kvm/libfdt/README: -------------------------------------------------------------------------------- 1 | libfdt was grabbed from dtc source. This is the upstream source for libfdt. 2 | It can be found here: 3 | http://www.jdl.com/software/ 4 | -------------------------------------------------------------------------------- /QEMU/kvm/libfdt/libfdt_env.h: -------------------------------------------------------------------------------- 1 | #ifndef _LIBFDT_ENV_H 2 | #define _LIBFDT_ENV_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | #if __BYTE_ORDER == __BIG_ENDIAN 11 | #define fdt32_to_cpu(x) (x) 12 | #define cpu_to_fdt32(x) (x) 13 | #define fdt64_to_cpu(x) (x) 14 | #define cpu_to_fdt64(x) (x) 15 | #else 16 | #define fdt32_to_cpu(x) (bswap_32((x))) 17 | #define cpu_to_fdt32(x) (bswap_32((x))) 18 | #define fdt64_to_cpu(x) (bswap_64((x))) 19 | #define cpu_to_fdt64(x) (bswap_64((x))) 20 | #endif 21 | 22 | #endif /* _LIBFDT_ENV_H */ 23 | -------------------------------------------------------------------------------- /QEMU/kvm/libkvm/config-i386.mak: -------------------------------------------------------------------------------- 1 | 2 | LIBDIR := /lib 3 | CFLAGS += -m32 4 | CFLAGS += -D__i386__ 5 | 6 | libkvm-$(ARCH)-objs := libkvm-x86.o 7 | -------------------------------------------------------------------------------- /QEMU/kvm/libkvm/config-ia64.mak: -------------------------------------------------------------------------------- 1 | 2 | LIBDIR := /lib 3 | CFLAGS += -D__ia64__ 4 | 5 | libkvm-$(ARCH)-objs := libkvm-ia64.o 6 | -------------------------------------------------------------------------------- /QEMU/kvm/libkvm/config-ppc.mak: -------------------------------------------------------------------------------- 1 | 2 | LIBDIR := /lib 3 | 4 | libkvm-$(ARCH)-objs := libkvm-powerpc.o 5 | -------------------------------------------------------------------------------- /QEMU/kvm/libkvm/config-s390.mak: -------------------------------------------------------------------------------- 1 | # s390 31bit mode 2 | LIBDIR := /lib 3 | libkvm-$(ARCH)-objs := libkvm-s390.o 4 | -------------------------------------------------------------------------------- /QEMU/kvm/libkvm/config-s390x.mak: -------------------------------------------------------------------------------- 1 | # s390 64 bit mode (arch=s390x) 2 | LIBDIR := /lib64 3 | libkvm-$(ARCH)-objs := libkvm-s390.o 4 | -------------------------------------------------------------------------------- /QEMU/kvm/libkvm/config-x86_64.mak: -------------------------------------------------------------------------------- 1 | 2 | LIBDIR := /lib64 3 | CFLAGS += -m64 4 | CFLAGS += -D__x86_64__ 5 | 6 | libkvm-$(ARCH)-objs := libkvm-x86.o 7 | -------------------------------------------------------------------------------- /QEMU/kvm/libkvm/kvm-ia64.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This header is for functions & variables that will ONLY be 3 | * used inside libkvm for x86. 4 | * THESE ARE NOT EXPOSED TO THE USER AND ARE ONLY FOR USE 5 | * WITHIN LIBKVM. 6 | * 7 | * derived from libkvm.c 8 | * 9 | * Copyright (C) 2006 Qumranet, Inc. 10 | * 11 | * Authors: 12 | * Avi Kivity 13 | * Yaniv Kamay 14 | * 15 | * This work is licensed under the GNU LGPL license, version 2. 16 | */ 17 | 18 | #ifndef KVM_IA64_H 19 | #define KVM_IA64_H 20 | 21 | #include "kvm-common.h" 22 | 23 | extern int kvm_page_size; 24 | 25 | #define PAGE_SIZE kvm_page_size 26 | #define PAGE_MASK (~(kvm_page_size - 1)) 27 | 28 | #define ia64_mf() asm volatile ("mf" ::: "memory") 29 | #define smp_wmb() ia64_mf() 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /QEMU/kvm/libkvm/kvm-powerpc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This header is for functions & variables that will ONLY be 3 | * used inside libkvm for powerpc. 4 | * THESE ARE NOT EXPOSED TO THE USER AND ARE ONLY FOR USE 5 | * WITHIN LIBKVM. 6 | * 7 | * Copyright (C) 2006 Qumranet, Inc. 8 | * 9 | * Authors: 10 | * Avi Kivity 11 | * Yaniv Kamay 12 | * 13 | * Copyright 2007 IBM Corporation. 14 | * Added by: Jerone Young 15 | * 16 | * This work is licensed under the GNU LGPL license, version 2. 17 | */ 18 | 19 | #ifndef KVM_POWERPC_H 20 | #define KVM_POWERPC_H 21 | 22 | #include "kvm-common.h" 23 | 24 | extern int kvm_page_size; 25 | 26 | #define PAGE_SIZE kvm_page_size 27 | #define PAGE_MASK (~(PAGE_SIZE - 1)) 28 | 29 | static inline void eieio(void) 30 | { 31 | asm volatile("eieio" : : : "memory"); 32 | } 33 | 34 | #define smp_wmb() eieio() 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /QEMU/kvm/libkvm/kvm-s390.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This header is for functions & variables that will ONLY be 3 | * used inside libkvm for s390. 4 | * THESE ARE NOT EXPOSED TO THE USER AND ARE ONLY FOR USE 5 | * WITHIN LIBKVM. 6 | * 7 | * Copyright (C) 2006 Qumranet, Inc. 8 | * 9 | * Authors: 10 | * Avi Kivity 11 | * Yaniv Kamay 12 | * 13 | * Copyright 2008 IBM Corporation. 14 | * Authors: 15 | * Carsten Otte 16 | * 17 | * This work is licensed under the GNU LGPL license, version 2. 18 | */ 19 | 20 | #ifndef KVM_S390_H 21 | #define KVM_S390_H 22 | 23 | #include 24 | #include "kvm-common.h" 25 | 26 | #define PAGE_SIZE 4096ul 27 | #define PAGE_MASK (~(PAGE_SIZE - 1)) 28 | 29 | #define smp_wmb() asm volatile("" ::: "memory") 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /QEMU/kvm/scripts/65-kvm.rules: -------------------------------------------------------------------------------- 1 | KERNEL=="kvm", NAME="%k", GROUP="kvm", MODE="0660" 2 | -------------------------------------------------------------------------------- /QEMU/kvm/scripts/make-combined-release: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | import sys, tarfile, os.path 4 | 5 | # usage: $0 combined.tar.gz qemu.tar.gz kvm-kmod.tar.gz 6 | 7 | outname, qemuname, kmodname = sys.argv[1:4] 8 | 9 | out = tarfile.open(name = outname, mode = 'w:gz') 10 | 11 | def tarcopy(dst, src, transform): 12 | for member in src: 13 | f = src.extractfile(member) 14 | member.name = transform(member.name) 15 | dst.addfile(member, f) 16 | 17 | def stem(fname): 18 | fname = os.path.basename(fname) 19 | if fname.endswith('.tar.gz'): 20 | fname = fname[:-7] 21 | return fname 22 | 23 | def transformer(old, new): 24 | def transform(fname): 25 | if fname.startswith(old + '/'): 26 | fname = new + fname[len(old):] 27 | return fname 28 | return transform 29 | 30 | tarcopy(out, tarfile.open(name = qemuname), 31 | transformer(stem(qemuname), stem(outname))) 32 | 33 | tarcopy(out, tarfile.open(name = kmodname), 34 | transformer(stem(kmodname), stem(outname) + '/kvm/kernel')) 35 | 36 | 37 | -------------------------------------------------------------------------------- /QEMU/kvm/scripts/mkbootdisk: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | kernel="$1" 6 | mnt_dir="/tmp/mkbootdisk/mnt" 7 | img_file="/tmp/mkbootdisk/boot.img" 8 | 9 | [[ -f "$kernel" ]] || { echo need kernel; exit 1; } 10 | 11 | mkdir -p $mnt_dir 12 | 13 | [[ -d "$mnt_dir" ]] || { echo mount dir err; exit 1; } 14 | 15 | dd < /dev/zero > $img_file bs=1M count=10 16 | mkfs -t vfat $img_file 17 | 18 | mount -o loop $img_file $mnt_dir 19 | 20 | cp "$kernel" $mnt_dir/kernel 21 | 22 | cat < $mnt_dir/SYSLINUX.CFG 23 | DEFAULT kernel 24 | APPEND console=ttyS0 25 | EOF 26 | 27 | umount $mnt_dir 28 | 29 | syslinux $img_file 30 | 31 | -------------------------------------------------------------------------------- /QEMU/kvm/scripts/qemu-ifup: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | switch=$(/sbin/ip route list | awk '/^default / { print $NF }') 4 | /sbin/ifconfig $1 0.0.0.0 up 5 | /usr/sbin/brctl addif ${switch} $1 6 | -------------------------------------------------------------------------------- /QEMU/kvm/scripts/run_img: -------------------------------------------------------------------------------- 1 | sudo /sbin/rmmod kvm 2 | sudo /sbin/insmod ../kernel/kvm.ko 3 | sudo chmod a+rw /dev/hvm 4 | ../qemu/x86_64-softmmu/qemu-system-x86_64 -boot c -L /usr/share/qemu -hda /tmp/mkbootdisk/boot.img -m 384 -serial file:/tmp/qemu_serial.out 5 | -------------------------------------------------------------------------------- /QEMU/kvm/user/COPYRIGHT: -------------------------------------------------------------------------------- 1 | Copyright (C) 2006 Qumranet. 2 | 3 | The files in this directory and its subdirectories are licensed under the 4 | GNU LGPL, version 2. 5 | -------------------------------------------------------------------------------- /QEMU/kvm/user/bootstrap.lds: -------------------------------------------------------------------------------- 1 | OUTPUT_FORMAT(binary) 2 | 3 | SECTIONS 4 | { 5 | . = 0; 6 | stext = .; 7 | .text : { *(.init) *(.text) } 8 | . = ALIGN(4K); 9 | .data : { *(.data) } 10 | . = ALIGN(16); 11 | .bss : { *(.bss) } 12 | . = ALIGN(4K); 13 | edata = .; 14 | } 15 | 16 | -------------------------------------------------------------------------------- /QEMU/kvm/user/config-i386.mak: -------------------------------------------------------------------------------- 1 | TEST_DIR=test/x86 2 | cstart.o = $(TEST_DIR)/cstart.o 3 | bits = 32 4 | ldarch = elf32-i386 5 | CFLAGS += -D__i386__ 6 | CFLAGS += -I $(KERNELDIR)/include 7 | 8 | tests= 9 | 10 | include config-x86-common.mak 11 | -------------------------------------------------------------------------------- /QEMU/kvm/user/config-ia64.mak: -------------------------------------------------------------------------------- 1 | bits = 64 2 | CFLAGS += -m64 3 | CFLAGS += -D__ia64__ 4 | CFLAGS += -I../include/ia64 5 | 6 | all: 7 | 8 | -------------------------------------------------------------------------------- /QEMU/kvm/user/config-powerpc-440.mak: -------------------------------------------------------------------------------- 1 | 2 | 3 | # for some reason binutils hates tlbsx unless we say we're 405 :( 4 | CFLAGS += -Wa,-m405 -I test/lib/powerpc/44x 5 | 6 | cflatobjs += \ 7 | test/lib/powerpc/44x/map.o \ 8 | test/lib/powerpc/44x/tlbwe.o \ 9 | test/lib/powerpc/44x/timebase.o 10 | 11 | simpletests += \ 12 | test/powerpc/44x/tlbsx.bin \ 13 | test/powerpc/44x/tlbwe_16KB.bin \ 14 | test/powerpc/44x/tlbwe_hole.bin \ 15 | test/powerpc/44x/tlbwe.bin 16 | -------------------------------------------------------------------------------- /QEMU/kvm/user/config-powerpc.mak: -------------------------------------------------------------------------------- 1 | CFLAGS += -I../include/powerpc 2 | CFLAGS += -Wa,-mregnames -I test/lib 3 | CFLAGS += -ffreestanding 4 | 5 | cstart := test/powerpc/cstart.o 6 | 7 | cflatobjs += \ 8 | test/lib/powerpc/io.o 9 | 10 | $(libcflat): LDFLAGS += -nostdlib 11 | 12 | # these tests do not use libcflat 13 | simpletests := \ 14 | test/powerpc/spin.bin \ 15 | test/powerpc/io.bin \ 16 | test/powerpc/sprg.bin 17 | 18 | # theses tests use cstart.o, libcflat, and libgcc 19 | tests := \ 20 | test/powerpc/exit.bin \ 21 | test/powerpc/helloworld.bin 22 | 23 | include config-powerpc-$(PROCESSOR).mak 24 | 25 | 26 | all: kvmtrace kvmctl $(libcflat) $(simpletests) $(tests) 27 | 28 | $(simpletests): %.bin: %.o 29 | $(CC) -nostdlib $^ -Wl,-T,flat.lds -o $@ 30 | 31 | $(tests): %.bin: $(cstart) %.o $(libcflat) 32 | $(CC) -nostdlib $^ $(libgcc) -Wl,-T,flat.lds -o $@ 33 | 34 | kvmctl_objs = main-ppc.o iotable.o ../libkvm/libkvm.a 35 | 36 | arch_clean: 37 | $(RM) $(simpletests) $(tests) $(cstart) 38 | $(RM) $(patsubst %.bin, %.elf, $(simpletests) $(tests)) 39 | $(RM) $(patsubst %.bin, %.o, $(simpletests) $(tests)) 40 | -------------------------------------------------------------------------------- /QEMU/kvm/user/config-x86_64.mak: -------------------------------------------------------------------------------- 1 | TEST_DIR=test/x86 2 | cstart.o = $(TEST_DIR)/cstart64.o 3 | bits = 64 4 | ldarch = elf64-x86-64 5 | CFLAGS += -D__x86_64__ 6 | 7 | tests = $(TEST_DIR)/access.flat $(TEST_DIR)/irq.flat $(TEST_DIR)/sieve.flat \ 8 | $(TEST_DIR)/simple.flat $(TEST_DIR)/stringio.flat \ 9 | $(TEST_DIR)/memtest1.flat $(TEST_DIR)/emulator.flat \ 10 | $(TEST_DIR)/hypercall.flat $(TEST_DIR)/apic.flat 11 | 12 | include config-x86-common.mak 13 | -------------------------------------------------------------------------------- /QEMU/kvm/user/flat.lds: -------------------------------------------------------------------------------- 1 | OUTPUT_FORMAT(binary) 2 | 3 | SECTIONS 4 | { 5 | . = 1M; 6 | stext = .; 7 | .text : { *(.init) *(.text) *(.text.*) } 8 | . = ALIGN(4K); 9 | .data : { *(.data) } 10 | . = ALIGN(16); 11 | .rodata : { *(.rodata) } 12 | . = ALIGN(16); 13 | .bss : { *(.bss) } 14 | . = ALIGN(4K); 15 | edata = .; 16 | } 17 | 18 | -------------------------------------------------------------------------------- /QEMU/kvm/user/iotable.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Kernel-based Virtual Machine test driver 3 | * 4 | * This test driver provides a simple way of testing kvm, without a full 5 | * device model. 6 | * 7 | * Copyright (C) 2006 Qumranet 8 | * 9 | * Authors: 10 | * 11 | * Avi Kivity 12 | * Yaniv Kamay 13 | * 14 | * This work is licensed under the GNU LGPL license, version 2. 15 | */ 16 | 17 | #include 18 | 19 | #define MAX_IO_TABLE 50 20 | 21 | typedef int (io_table_handler_t)(void *, int, int, uint64_t, uint64_t *); 22 | 23 | struct io_table_entry 24 | { 25 | uint64_t start; 26 | uint64_t end; 27 | io_table_handler_t *handler; 28 | void *opaque; 29 | }; 30 | 31 | struct io_table 32 | { 33 | int nr_entries; 34 | struct io_table_entry entries[MAX_IO_TABLE]; 35 | }; 36 | 37 | struct io_table_entry *io_table_lookup(struct io_table *io_table, 38 | uint64_t addr); 39 | int io_table_register(struct io_table *io_table, uint64_t start, uint64_t size, 40 | io_table_handler_t *handler, void *opaque); 41 | -------------------------------------------------------------------------------- /QEMU/kvm/user/test/lib/panic.c: -------------------------------------------------------------------------------- 1 | #include "libcflat.h" 2 | 3 | void panic(char *fmt, ...) 4 | { 5 | va_list va; 6 | char buf[2000]; 7 | 8 | va_start(va, fmt); 9 | vsnprintf(buf, sizeof(buf), fmt, va); 10 | va_end(va); 11 | puts(buf); 12 | exit(-1); 13 | } 14 | -------------------------------------------------------------------------------- /QEMU/kvm/user/test/lib/powerpc/44x/timebase.S: -------------------------------------------------------------------------------- 1 | /* 2 | * This program is free software; you can redistribute it and/or modify 3 | * it under the terms of the GNU General Public License, version 2, as 4 | * published by the Free Software Foundation. 5 | * 6 | * This program is distributed in the hope that it will be useful, 7 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 8 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 9 | * GNU General Public License for more details. 10 | * 11 | * You should have received a copy of the GNU General Public License 12 | * along with this program; if not, write to the Free Software 13 | * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 14 | * 15 | * Copyright IBM Corp. 2008 16 | * 17 | * Authors: Hollis Blanchard 18 | */ 19 | 20 | /* unsigned long long mftb(void); */ 21 | .global mftb 22 | mftb: 23 | mftbu r5 24 | mftbl r4 25 | mftbu r3 26 | cmpw r3, r5 27 | bne mftb 28 | blr 29 | -------------------------------------------------------------------------------- /QEMU/kvm/user/test/lib/powerpc/44x/timebase.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This program is free software; you can redistribute it and/or modify 3 | * it under the terms of the GNU General Public License, version 2, as 4 | * published by the Free Software Foundation. 5 | * 6 | * This program is distributed in the hope that it will be useful, 7 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 8 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 9 | * GNU General Public License for more details. 10 | * 11 | * You should have received a copy of the GNU General Public License 12 | * along with this program; if not, write to the Free Software 13 | * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 14 | * 15 | * Copyright IBM Corp. 2008 16 | * 17 | * Authors: Hollis Blanchard 18 | */ 19 | 20 | #ifndef __TIMEBASE_H__ 21 | #define __TIMEBASE_H__ 22 | 23 | unsigned long long mftb(void); 24 | 25 | #endif /* __TIMEBASE_H__ */ 26 | -------------------------------------------------------------------------------- /QEMU/kvm/user/test/lib/powerpc/44x/tlbwe.S: -------------------------------------------------------------------------------- 1 | /* 2 | * This program is free software; you can redistribute it and/or modify 3 | * it under the terms of the GNU General Public License, version 2, as 4 | * published by the Free Software Foundation. 5 | * 6 | * This program is distributed in the hope that it will be useful, 7 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 8 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 9 | * GNU General Public License for more details. 10 | * 11 | * You should have received a copy of the GNU General Public License 12 | * along with this program; if not, write to the Free Software 13 | * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 14 | * 15 | * Copyright IBM Corp. 2008 16 | * 17 | * Authors: Hollis Blanchard 18 | */ 19 | 20 | #define SPRN_MMUCR 0x3b2 21 | 22 | /* tlbwe(uint index, uint8_t tid, uint word0, uint word1, uint word2) */ 23 | .global tlbwe 24 | tlbwe: 25 | mtspr SPRN_MMUCR, r4 26 | tlbwe r5, r3, 0 27 | tlbwe r6, r3, 1 28 | tlbwe r7, r3, 2 29 | blr 30 | -------------------------------------------------------------------------------- /QEMU/kvm/user/test/lib/powerpc/io.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This program is free software; you can redistribute it and/or modify 3 | * it under the terms of the GNU General Public License, version 2, as 4 | * published by the Free Software Foundation. 5 | * 6 | * This program is distributed in the hope that it will be useful, 7 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 8 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 9 | * GNU General Public License for more details. 10 | * 11 | * You should have received a copy of the GNU General Public License 12 | * along with this program; if not, write to the Free Software 13 | * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 14 | * 15 | * Copyright IBM Corp. 2008 16 | * 17 | * Authors: Hollis Blanchard 18 | */ 19 | 20 | #include "libcflat.h" 21 | 22 | #define BASE 0xf0000000 23 | #define _putc ((volatile char *)(BASE)) 24 | #define _exit ((volatile char *)(BASE+1)) 25 | 26 | void puts(const char *s) 27 | { 28 | while (*s != '\0') 29 | *_putc = *s++; 30 | } 31 | 32 | void exit(int code) 33 | { 34 | *_exit = code; 35 | } 36 | -------------------------------------------------------------------------------- /QEMU/kvm/user/test/lib/string.c: -------------------------------------------------------------------------------- 1 | #include "libcflat.h" 2 | 3 | unsigned long strlen(const char *buf) 4 | { 5 | unsigned long len = 0; 6 | 7 | while (*buf++) 8 | ++len; 9 | return len; 10 | } 11 | 12 | char *strcat(char *dest, const char *src) 13 | { 14 | char *p = dest; 15 | 16 | while (*p) 17 | ++p; 18 | while ((*p++ = *src++) != 0) 19 | ; 20 | return dest; 21 | } 22 | -------------------------------------------------------------------------------- /QEMU/kvm/user/test/lib/x86/fake-apic.h: -------------------------------------------------------------------------------- 1 | #ifndef SILLY_APIC_H 2 | #define SILLY_APIC_H 3 | 4 | #define APIC_BASE 0x1000 5 | #define APIC_SIZE 0x100 6 | 7 | #define APIC_REG_NCPU 0x00 8 | #define APIC_REG_ID 0x04 9 | #define APIC_REG_SIPI_ADDR 0x08 10 | #define APIC_REG_SEND_SIPI 0x0c 11 | #define APIC_REG_IPI_VECTOR 0x10 12 | #define APIC_REG_SEND_IPI 0x14 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /QEMU/kvm/user/test/lib/x86/io.c: -------------------------------------------------------------------------------- 1 | #include "libcflat.h" 2 | #include "smp.h" 3 | 4 | static struct spinlock lock; 5 | 6 | static void print_serial(const char *buf) 7 | { 8 | unsigned long len = strlen(buf); 9 | 10 | asm volatile ("rep/outsb" : "+S"(buf), "+c"(len) : "d"(0xf1)); 11 | } 12 | 13 | void puts(const char *s) 14 | { 15 | spin_lock(&lock); 16 | print_serial(s); 17 | spin_unlock(&lock); 18 | } 19 | 20 | void exit(int code) 21 | { 22 | asm volatile("out %0, %1" : : "a"(code), "d"((short)0xf4)); 23 | } 24 | -------------------------------------------------------------------------------- /QEMU/kvm/user/test/lib/x86/smp.h: -------------------------------------------------------------------------------- 1 | #ifndef __SMP_H 2 | #define __SMP_H 3 | 4 | struct spinlock { 5 | int v; 6 | }; 7 | 8 | void smp_init(void (*smp_main)(void)); 9 | 10 | int cpu_count(void); 11 | int smp_id(void); 12 | void on_cpu(int cpu, void (*function)(void *data), void *data); 13 | void spin_lock(struct spinlock *lock); 14 | void spin_unlock(struct spinlock *lock); 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /QEMU/kvm/user/test/powerpc/44x/tlbsx.S: -------------------------------------------------------------------------------- 1 | #define SPRN_MMUCR 0x3b2 2 | 3 | #define TLBWORD0 0x10000210 4 | #define TLBWORD1 0x10000000 5 | #define TLBWORD2 0x00000003 6 | 7 | .global _start 8 | _start: 9 | li r4, 0 10 | mtspr SPRN_MMUCR, r4 11 | 12 | li r3, 23 13 | 14 | lis r4, TLBWORD0@h 15 | ori r4, r4, TLBWORD0@l 16 | tlbwe r4, r3, 0 17 | 18 | lis r4, TLBWORD1@h 19 | ori r4, r4, TLBWORD1@l 20 | tlbwe r4, r3, 1 21 | 22 | lis r4, TLBWORD2@h 23 | ori r4, r4, TLBWORD2@l 24 | tlbwe r4, r3, 2 25 | 26 | lis r4, 0x1000 27 | tlbsx r5, r4, r0 28 | cmpwi r5, 23 29 | beq good 30 | trap 31 | 32 | good: 33 | b . 34 | -------------------------------------------------------------------------------- /QEMU/kvm/user/test/powerpc/44x/tlbwe.S: -------------------------------------------------------------------------------- 1 | #define SPRN_MMUCR 0x3b2 2 | 3 | /* Create a mapping at 4MB */ 4 | #define TLBWORD0 0x00400210 5 | #define TLBWORD1 0x00400000 6 | #define TLBWORD2 0x00000003 7 | 8 | .global _start 9 | _start: 10 | li r4, 0 11 | mtspr SPRN_MMUCR, r4 12 | 13 | li r3, 23 14 | 15 | lis r4, TLBWORD0@h 16 | ori r4, r4, TLBWORD0@l 17 | tlbwe r4, r3, 0 18 | 19 | lis r4, TLBWORD1@h 20 | ori r4, r4, TLBWORD1@l 21 | tlbwe r4, r3, 1 22 | 23 | lis r4, TLBWORD2@h 24 | ori r4, r4, TLBWORD2@l 25 | tlbwe r4, r3, 2 26 | 27 | b . 28 | -------------------------------------------------------------------------------- /QEMU/kvm/user/test/powerpc/44x/tlbwe_16KB.S: -------------------------------------------------------------------------------- 1 | #define SPRN_MMUCR 0x3b2 2 | 3 | /* 16KB mapping at 4MB */ 4 | #define TLBWORD0 0x00400220 5 | #define TLBWORD1 0x00400000 6 | #define TLBWORD2 0x00000003 7 | 8 | .global _start 9 | _start: 10 | li r4, 0 11 | mtspr SPRN_MMUCR, r4 12 | 13 | li r3, 5 14 | 15 | lis r4, TLBWORD0@h 16 | ori r4, r4, TLBWORD0@l 17 | tlbwe r4, r3, 0 18 | 19 | lis r4, TLBWORD1@h 20 | ori r4, r4, TLBWORD1@l 21 | tlbwe r4, r3, 1 22 | 23 | lis r4, TLBWORD2@h 24 | ori r4, r4, TLBWORD2@l 25 | tlbwe r4, r3, 2 26 | 27 | /* load from 4MB */ 28 | lis r3, 0x0040 29 | lwz r4, 0(r3) 30 | 31 | /* load from 4MB+8KB */ 32 | ori r3, r3, 0x2000 33 | lwz r4, 0(r3) 34 | 35 | b . 36 | -------------------------------------------------------------------------------- /QEMU/kvm/user/test/powerpc/44x/tlbwe_hole.S: -------------------------------------------------------------------------------- 1 | #define SPRN_MMUCR 0x3b2 2 | 3 | /* Try to map real address 1GB. */ 4 | #define TLBWORD0 0x40000210 5 | #define TLBWORD1 0x40000000 6 | #define TLBWORD2 0x00000003 7 | 8 | .global _start 9 | _start: 10 | li r4, 0 11 | mtspr SPRN_MMUCR, r4 12 | 13 | li r3, 23 14 | 15 | lis r4, TLBWORD0@h 16 | ori r4, r4, TLBWORD0@l 17 | tlbwe r4, r3, 0 18 | 19 | lis r4, TLBWORD1@h 20 | ori r4, r4, TLBWORD1@l 21 | tlbwe r4, r3, 1 22 | 23 | lis r4, TLBWORD2@h 24 | ori r4, r4, TLBWORD2@l 25 | tlbwe r4, r3, 2 26 | 27 | b . 28 | -------------------------------------------------------------------------------- /QEMU/kvm/user/test/powerpc/exit.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This program is free software; you can redistribute it and/or modify 3 | * it under the terms of the GNU General Public License, version 2, as 4 | * published by the Free Software Foundation; 5 | * 6 | * This program is distributed in the hope that it will be useful, 7 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 8 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 9 | * GNU General Public License for more details. 10 | * 11 | * You should have received a copy of the GNU General Public License 12 | * along with this program; if not, write to the Free Software 13 | * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 14 | * 15 | * Copyright IBM Corp. 2008 16 | * 17 | * Authors: Hollis Blanchard 18 | */ 19 | 20 | int main(void) 21 | { 22 | return 1; 23 | } 24 | -------------------------------------------------------------------------------- /QEMU/kvm/user/test/powerpc/helloworld.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This program is free software; you can redistribute it and/or modify 3 | * it under the terms of the GNU General Public License, version 2, as 4 | * published by the Free Software Foundation; 5 | * 6 | * This program is distributed in the hope that it will be useful, 7 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 8 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 9 | * GNU General Public License for more details. 10 | * 11 | * You should have received a copy of the GNU General Public License 12 | * along with this program; if not, write to the Free Software 13 | * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 14 | * 15 | * Copyright IBM Corp. 2008 16 | * 17 | * Authors: Deepa Srinivasan 18 | */ 19 | 20 | #include "libcflat.h" 21 | 22 | int main() 23 | { 24 | printf("Hello World\n"); 25 | 26 | return 1; 27 | } 28 | -------------------------------------------------------------------------------- /QEMU/kvm/user/test/powerpc/io.S: -------------------------------------------------------------------------------- 1 | #define SPRN_MMUCR 0x3b2 2 | 3 | #define TLBWORD0 0xf0000210 4 | #define TLBWORD1 0xf0000000 5 | #define TLBWORD2 0x00000003 6 | 7 | .global _start 8 | _start: 9 | li r4, 0 10 | mtspr SPRN_MMUCR, r4 11 | 12 | li r3, 2 13 | 14 | lis r4, TLBWORD0@h 15 | ori r4, r4, TLBWORD0@l 16 | tlbwe r4, r3, 0 17 | 18 | lis r4, TLBWORD1@h 19 | ori r4, r4, TLBWORD1@l 20 | tlbwe r4, r3, 1 21 | 22 | lis r4, TLBWORD2@h 23 | ori r4, r4, TLBWORD2@l 24 | tlbwe r4, r3, 2 25 | 26 | lis r3, 0xf000 27 | lis r4, 0x1234 28 | ori r4, r4, 0x5678 29 | stb r4, 0(r3) 30 | lbz r5, 0(r3) 31 | 32 | b . 33 | -------------------------------------------------------------------------------- /QEMU/kvm/user/test/powerpc/spin.S: -------------------------------------------------------------------------------- 1 | 2 | .global _start 3 | _start: 4 | b . 5 | -------------------------------------------------------------------------------- /QEMU/kvm/user/test/powerpc/sprg.S: -------------------------------------------------------------------------------- 1 | 2 | .global _start 3 | _start: 4 | li r3, 42 5 | mtsprg 0, r3 6 | mfsprg r4, 0 7 | b . 8 | -------------------------------------------------------------------------------- /QEMU/kvm/user/test/x86/cstart.S: -------------------------------------------------------------------------------- 1 | 2 | 3 | .bss 4 | 5 | .section .init 6 | call main 7 | push %eax 8 | call exit 9 | 10 | 11 | -------------------------------------------------------------------------------- /QEMU/kvm/user/test/x86/exit.c: -------------------------------------------------------------------------------- 1 | #include "runtime.h" 2 | 3 | void exit(unsigned code) 4 | { 5 | asm volatile("out %al, %dx" : : "a"(code), "d"(0xf4)); 6 | asm volatile("cli; hlt"); 7 | } 8 | -------------------------------------------------------------------------------- /QEMU/kvm/user/test/x86/hypercall.c: -------------------------------------------------------------------------------- 1 | #include "libcflat.h" 2 | 3 | #define KVM_HYPERCALL_INTEL ".byte 0x0f,0x01,0xc1" 4 | #define KVM_HYPERCALL_AMD ".byte 0x0f,0x01,0xd9" 5 | 6 | static inline long kvm_hypercall0_intel(unsigned int nr) 7 | { 8 | long ret; 9 | asm volatile(KVM_HYPERCALL_INTEL 10 | : "=a"(ret) 11 | : "a"(nr)); 12 | return ret; 13 | } 14 | 15 | static inline long kvm_hypercall0_amd(unsigned int nr) 16 | { 17 | long ret; 18 | asm volatile(KVM_HYPERCALL_AMD 19 | : "=a"(ret) 20 | : "a"(nr)); 21 | return ret; 22 | } 23 | 24 | int main(int ac, char **av) 25 | { 26 | kvm_hypercall0_intel(-1u); 27 | printf("Hypercall via VMCALL: OK\n"); 28 | kvm_hypercall0_amd(-1u); 29 | printf("Hypercall via VMMCALL: OK\n"); 30 | return 0; 31 | } 32 | -------------------------------------------------------------------------------- /QEMU/kvm/user/test/x86/ioram.h: -------------------------------------------------------------------------------- 1 | #ifndef __IO_RAM_H 2 | #define __IO_RAM_H 3 | 4 | #define IORAM_BASE_PHYS 0xff000000UL 5 | #define IORAM_LEN 0x10000UL 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /QEMU/kvm/user/test/x86/memtest1.S: -------------------------------------------------------------------------------- 1 | .text 2 | 3 | start: 4 | mov $0x1000,%r8 5 | mov $0x0a,%ecx 6 | 7 | init_page: 8 | dec %ecx 9 | jne no_io 10 | mov $0x0,%al 11 | out %al,$0x80 12 | mov $0x0a,%ecx 13 | 14 | no_io: 15 | mov %r8,(%r8) 16 | add $0x1000,%r8 17 | cmp $0x8000000,%r8 18 | jne init_page 19 | mov $0x1000,%r8 20 | mov $0x0a,%ecx 21 | 22 | test_loop: 23 | dec %ecx 24 | jne no_io2 25 | mov $0x0,%al 26 | out %al,$0x80 27 | mov $0x0a,%ecx 28 | 29 | no_io2: 30 | mov (%r8),%r9 31 | cmp %r8,%r9 32 | jne err 33 | add $0x1000,%r8 34 | cmp $0x8000000,%r8 35 | jne test_loop 36 | mov $0x1000,%r8 37 | jmp test_loop 38 | 39 | err: 40 | mov $0xffffffffffffffff,%r12 41 | mov $0xffffffffffffffff,%r13 42 | mov $0x0,%al 43 | out %al,$0x80 44 | jmp err 45 | -------------------------------------------------------------------------------- /QEMU/kvm/user/test/x86/port80.c: -------------------------------------------------------------------------------- 1 | #include "libcflat.h" 2 | 3 | int main() 4 | { 5 | int i; 6 | 7 | printf("begining port 0x80 write test\n"); 8 | for (i = 0; i < 10000000; ++i) 9 | asm volatile("outb %al, $0x80"); 10 | printf("done\n"); 11 | return 0; 12 | } 13 | -------------------------------------------------------------------------------- /QEMU/kvm/user/test/x86/print.S: -------------------------------------------------------------------------------- 1 | 2 | #include "print.h" 3 | 4 | #define PSEUDO_SERIAL_PORT 0xf1 5 | 6 | 7 | .text 8 | PRINT "boo" 9 | hlt 10 | 1: jmp 1b 11 | 12 | .globl print 13 | print: 14 | push %rax 15 | push %rsi 16 | push %rdx 17 | 18 | mov %rdi, %rsi 19 | mov $(PSEUDO_SERIAL_PORT), %edx 20 | 21 | putchar: 22 | cmpb $0, (%rsi) 23 | jz done 24 | outsb 25 | jmp putchar 26 | done: 27 | 28 | pop %rdx 29 | pop %rsi 30 | pop %rax 31 | ret 32 | -------------------------------------------------------------------------------- /QEMU/kvm/user/test/x86/print.h: -------------------------------------------------------------------------------- 1 | #ifndef PRINT_H 2 | #define PRINT_H 3 | 4 | .macro PRINT text 5 | 6 | .data 7 | 8 | 333: .asciz "\text\n" 9 | 10 | .previous 11 | 12 | push %rdi 13 | lea 333b, %rdi 14 | call print 15 | pop %rdi 16 | 17 | .endm 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /QEMU/kvm/user/test/x86/realmode.lds: -------------------------------------------------------------------------------- 1 | OUTPUT_FORMAT(binary) 2 | 3 | SECTIONS 4 | { 5 | . = 0; 6 | stext = .; 7 | .text : { *(.init) *(.text) } 8 | . = ALIGN(4K); 9 | .data : { *(.data) *(.rodata*) } 10 | . = ALIGN(16); 11 | .bss : { *(.bss) } 12 | . = 0xfff0; 13 | .boot : { *(.boot) } 14 | edata = .; 15 | } 16 | 17 | -------------------------------------------------------------------------------- /QEMU/kvm/user/test/x86/runtime.h: -------------------------------------------------------------------------------- 1 | #ifndef H_RUNTIME 2 | #define H_RUNTIME 3 | 4 | void exit(unsigned code) __attribute__((__noreturn__)); 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /QEMU/kvm/user/test/x86/simple.S: -------------------------------------------------------------------------------- 1 | 2 | .text 3 | 4 | mov $0, %al 5 | mov $10000, %ebx 6 | 1: 7 | mov %rbx, %rcx 8 | 2: 9 | loop 2b 10 | out %al, $0x80 11 | inc %al 12 | add $10000, %rbx 13 | jmp 1b 14 | -------------------------------------------------------------------------------- /QEMU/kvm/user/test/x86/smptest.c: -------------------------------------------------------------------------------- 1 | #include "libcflat.h" 2 | #include "smp.h" 3 | 4 | static void ipi_test(void *data) 5 | { 6 | int n = (long)data; 7 | 8 | printf("ipi called, cpu %d\n", n); 9 | if (n != smp_id()) 10 | printf("but wrong cpu %d\n", smp_id()); 11 | } 12 | 13 | static void smp_main(void) 14 | { 15 | printf("smp main %d\n", smp_id()); 16 | while (1) 17 | asm volatile ("hlt" : : : "memory"); 18 | } 19 | 20 | int main() 21 | { 22 | int ncpus; 23 | int i; 24 | 25 | smp_init(smp_main); 26 | ncpus = cpu_count(); 27 | printf("found %d cpus\n", ncpus); 28 | for (i = 0; i < ncpus; ++i) 29 | on_cpu(i, ipi_test, (void *)(long)i); 30 | return 0; 31 | } 32 | -------------------------------------------------------------------------------- /QEMU/kvm/user/test/x86/stringio.S: -------------------------------------------------------------------------------- 1 | 2 | .data 3 | 4 | .macro str name, value 5 | 6 | \name : .long 1f-2f 7 | 2: .ascii "\value" 8 | 1: 9 | .endm 10 | 11 | str "forward", "forward" 12 | str "backward", "backward" 13 | 14 | .text 15 | 16 | 17 | cld 18 | movl forward, %ecx 19 | lea 4+forward, %rsi 20 | movw $1, %dx 21 | rep outsb 22 | 23 | std 24 | movl backward, %ecx 25 | lea 4+backward-1(%rcx), %rsi 26 | movw $2, %dx 27 | rep outsb 28 | 29 | hlt 30 | 31 | 32 | -------------------------------------------------------------------------------- /QEMU/kvm/user/test/x86/test32.S: -------------------------------------------------------------------------------- 1 | .code32 2 | 3 | .text 4 | 5 | 1: 6 | mov $0x12, %al 7 | out %al, $0x80 8 | jmp 1b 9 | -------------------------------------------------------------------------------- /QEMU/kvm/user/test/x86/tsc.c: -------------------------------------------------------------------------------- 1 | #include "libcflat.h" 2 | 3 | typedef unsigned long long u64; 4 | 5 | u64 rdtsc(void) 6 | { 7 | unsigned a, d; 8 | 9 | asm volatile("rdtsc" : "=a"(a), "=d"(d)); 10 | return a | (u64)d << 32; 11 | } 12 | 13 | void wrtsc(u64 tsc) 14 | { 15 | unsigned a = tsc, d = tsc >> 32; 16 | 17 | asm volatile("wrmsr" : : "a"(a), "d"(d), "c"(0x10)); 18 | } 19 | 20 | void test_wrtsc(u64 t1) 21 | { 22 | u64 t2; 23 | 24 | wrtsc(t1); 25 | t2 = rdtsc(); 26 | printf("rdtsc after wrtsc(%lld): %lld\n", t1, t2); 27 | } 28 | 29 | int main() 30 | { 31 | u64 t1, t2; 32 | 33 | t1 = rdtsc(); 34 | t2 = rdtsc(); 35 | printf("rdtsc latency %lld\n", (unsigned)(t2 - t1)); 36 | 37 | test_wrtsc(0); 38 | test_wrtsc(100000000000ull); 39 | return 0; 40 | } 41 | -------------------------------------------------------------------------------- /QEMU/kvm/user/test/x86/vm.h: -------------------------------------------------------------------------------- 1 | #ifndef VM_H 2 | #define VM_H 3 | 4 | void setup_vm(); 5 | 6 | void *vmalloc(unsigned long size); 7 | void vfree(void *mem); 8 | void *vmap(unsigned long long phys, unsigned long size); 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /QEMU/kvm/user/test/x86/vmexit.c: -------------------------------------------------------------------------------- 1 | 2 | #include "libcflat.h" 3 | 4 | static inline unsigned long long rdtsc() 5 | { 6 | long long r; 7 | 8 | #ifdef __x86_64__ 9 | unsigned a, d; 10 | 11 | asm volatile ("rdtsc" : "=a"(a), "=d"(d)); 12 | r = a | ((long long)d << 32); 13 | #else 14 | asm volatile ("rdtsc" : "=A"(r)); 15 | #endif 16 | return r; 17 | } 18 | 19 | #define N (1 << 22) 20 | 21 | #ifdef __x86_64__ 22 | # define R "r" 23 | #else 24 | # define R "e" 25 | #endif 26 | 27 | int main() 28 | { 29 | int i; 30 | unsigned long long t1, t2; 31 | 32 | t1 = rdtsc(); 33 | for (i = 0; i < N; ++i) 34 | asm volatile ("push %%"R "bx; cpuid; pop %%"R "bx" 35 | : : : "eax", "ecx", "edx"); 36 | t2 = rdtsc(); 37 | printf("vmexit latency: %d\n", (int)((t2 - t1) / N)); 38 | return 0; 39 | } 40 | -------------------------------------------------------------------------------- /QEMU/kvm/vgabios/.cvsignore: -------------------------------------------------------------------------------- 1 | vbetables.h 2 | -------------------------------------------------------------------------------- /QEMU/kvm/vgabios/BUGS: -------------------------------------------------------------------------------- 1 | Not all the functions have been implemented yet. 2 | 3 | Please report any bugs to 4 | -------------------------------------------------------------------------------- /QEMU/kvm/vgabios/Notes: -------------------------------------------------------------------------------- 1 | Development notes 2 | ----------------- 3 | 4 | - need to split video init function 5 | 1. set bios variables 6 | 2. do the real init with io based on bios variables 7 | 8 | - characters format switching will set the bios 9 | variables and call function #2 above 10 | 11 | - need to rework the tables as explained in Interrupt list 12 | -------------------------------------------------------------------------------- /QEMU/kvm/vgabios/TODO: -------------------------------------------------------------------------------- 1 | Short term : 2 | ------------ 3 | 4 | General 5 | - Fix init mode (ah=00). Should use more BIOS variables 6 | - Add new functionalities and modify static functionality table 7 | - Performance : 16 bits IO 8 | 9 | v0.7 10 | - Implement the remaining functions (don't know if all are needed): 11 | - chargen ax=1120, ax=1121, ax=1122, ax=1123, ax=1124 12 | - display switch interface ah=12 bl=35 13 | - video refresh control ah=12 bl=36 14 | - Graphic modes 15 | 16 | v1.0 17 | - Bugfixes 18 | 19 | 20 | ================================================================================================= 21 | VBE: 22 | ---- 23 | Long term: 24 | - have plex86 host side display interface 25 | - have text io functions in vbe mode 26 | 27 | -------------------------------------------------------------------------------- /QEMU/kvm/vgabios/dataseghack: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | awk \ 4 | 'BEGIN { }\ 5 | /^\.text/,/DATA_SEG_DEFS_HERE/ { print }\ 6 | END { }'\ 7 | $1 > temp.awk.1 8 | 9 | awk \ 10 | 'BEGIN { i = 0; last = "hello" }\ 11 | /BLOCK_STRINGS_BEGIN/,/^\.bss/ { if ( i > 1 ) { print last } last = $0; i = i + 1 }\ 12 | END { }'\ 13 | $1 > temp.awk.2 14 | 15 | awk \ 16 | 'BEGIN { }\ 17 | /DATA_SEG_DEFS_HERE/,/BLOCK_STRINGS_BEGIN/ { print }\ 18 | END { }'\ 19 | $1 > temp.awk.3 20 | 21 | cp $1 $1.orig 22 | cat temp.awk.1 temp.awk.2 temp.awk.3 | sed -e 's/^\.data//' -e 's/^\.bss//' -e 's/^\.text//' > $1 23 | /bin/rm -f temp.awk.1 temp.awk.2 temp.awk.3 $1.orig 24 | -------------------------------------------------------------------------------- /QEMU/kvm/vgabios/tests/lfbprof/Makefile: -------------------------------------------------------------------------------- 1 | # Very simple makefile for LFBPROF.C using Watcom C++ 10.0a with DOS4GW 2 | 3 | lfbprof.exe: lfbprof.c lfbprof.h 4 | wcl386 -zq -s -d2 lfbprof.c 5 | 6 | -------------------------------------------------------------------------------- /QEMU/libhw32/config.mak: -------------------------------------------------------------------------------- 1 | HWLIB=libqemuhw32.a 2 | CPPFLAGS=-DTARGET_PHYS_ADDR_BITS=32 3 | -------------------------------------------------------------------------------- /QEMU/libhw64/config.mak: -------------------------------------------------------------------------------- 1 | HWLIB=libqemuhw64.a 2 | CPPFLAGS=-DTARGET_PHYS_ADDR_BITS=64 3 | -------------------------------------------------------------------------------- /QEMU/linux-user/alpha/syscall.h: -------------------------------------------------------------------------------- 1 | /* default linux values for the selectors */ 2 | #define __USER_DS (1) 3 | 4 | struct target_pt_regs { 5 | abi_ulong r0; 6 | abi_ulong r1; 7 | abi_ulong r2; 8 | abi_ulong r3; 9 | abi_ulong r4; 10 | abi_ulong r5; 11 | abi_ulong r6; 12 | abi_ulong r7; 13 | abi_ulong r8; 14 | abi_ulong r19; 15 | abi_ulong r20; 16 | abi_ulong r21; 17 | abi_ulong r22; 18 | abi_ulong r23; 19 | abi_ulong r24; 20 | abi_ulong r25; 21 | abi_ulong r26; 22 | abi_ulong r27; 23 | abi_ulong r28; 24 | abi_ulong hae; 25 | /* JRP - These are the values provided to a0-a2 by PALcode */ 26 | abi_ulong trap_a0; 27 | abi_ulong trap_a1; 28 | abi_ulong trap_a2; 29 | /* These are saved by PAL-code: */ 30 | abi_ulong ps; 31 | abi_ulong pc; 32 | abi_ulong gp; 33 | abi_ulong r16; 34 | abi_ulong r17; 35 | abi_ulong r18; 36 | /* Those is needed by qemu to temporary store the user stack pointer */ 37 | abi_ulong usp; 38 | abi_ulong unique; 39 | }; 40 | 41 | #define UNAME_MACHINE "alpha" 42 | -------------------------------------------------------------------------------- /QEMU/linux-user/alpha/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 | static inline abi_ulong get_sp_from_cpustate(CPUAlphaState *state) 25 | { 26 | return state->ir[IR_SP]; 27 | } 28 | 29 | #endif /* TARGET_SIGNAL_H */ 30 | -------------------------------------------------------------------------------- /QEMU/linux-user/arm/nwfpe/fpopcode.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ESOS-Lab/VSSIM/a119bee2aae5e10e52feb3eec3d05f973aee54d1/QEMU/linux-user/arm/nwfpe/fpopcode.h -------------------------------------------------------------------------------- /QEMU/linux-user/arm/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 uregs[18]; 7 | }; 8 | 9 | #define ARM_cpsr uregs[16] 10 | #define ARM_pc uregs[15] 11 | #define ARM_lr uregs[14] 12 | #define ARM_sp uregs[13] 13 | #define ARM_ip uregs[12] 14 | #define ARM_fp uregs[11] 15 | #define ARM_r10 uregs[10] 16 | #define ARM_r9 uregs[9] 17 | #define ARM_r8 uregs[8] 18 | #define ARM_r7 uregs[7] 19 | #define ARM_r6 uregs[6] 20 | #define ARM_r5 uregs[5] 21 | #define ARM_r4 uregs[4] 22 | #define ARM_r3 uregs[3] 23 | #define ARM_r2 uregs[2] 24 | #define ARM_r1 uregs[1] 25 | #define ARM_r0 uregs[0] 26 | #define ARM_ORIG_r0 uregs[17] 27 | 28 | #define ARM_SYSCALL_BASE 0x900000 29 | #define ARM_THUMB_SYSCALL 0 30 | 31 | #define ARM_NR_BASE 0xf0000 32 | #define ARM_NR_cacheflush (ARM_NR_BASE + 2) 33 | #define ARM_NR_set_tls (ARM_NR_BASE + 5) 34 | 35 | #define ARM_NR_semihosting 0x123456 36 | #define ARM_NR_thumb_semihosting 0xAB 37 | 38 | #if defined(TARGET_WORDS_BIGENDIAN) 39 | #define UNAME_MACHINE "armv5teb" 40 | #else 41 | #define UNAME_MACHINE "armv5tel" 42 | #endif 43 | -------------------------------------------------------------------------------- /QEMU/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 | -------------------------------------------------------------------------------- /QEMU/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 | -------------------------------------------------------------------------------- /QEMU/linux-user/elfload32.c: -------------------------------------------------------------------------------- 1 | #define TARGET_ABI32 2 | #define load_elf_binary load_elf_binary32 3 | #define do_init_thread do_init_thread32 4 | 5 | #include "elfload.c" 6 | 7 | #undef load_elf_binary 8 | #undef do_init_thread 9 | 10 | int load_elf_binary(struct linux_binprm *bprm, struct target_pt_regs *regs, 11 | struct image_info *info); 12 | 13 | int load_elf_binary_multi(struct linux_binprm *bprm, 14 | struct target_pt_regs *regs, 15 | struct image_info *info) 16 | { 17 | struct elfhdr *elf_ex; 18 | int retval; 19 | 20 | elf_ex = (struct elfhdr *) bprm->buf; /* exec-header */ 21 | if (elf_ex->e_ident[EI_CLASS] == ELFCLASS64) { 22 | retval = load_elf_binary(bprm, regs, info); 23 | } else { 24 | retval = load_elf_binary32(bprm, regs, info); 25 | if (personality(info->personality) == PER_LINUX) 26 | info->personality = PER_LINUX32; 27 | } 28 | 29 | return retval; 30 | } 31 | -------------------------------------------------------------------------------- /QEMU/linux-user/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 | extern envlist_t *envlist_create(void); 11 | extern void envlist_free(envlist_t *); 12 | extern int envlist_setenv(envlist_t *, const char *); 13 | extern int envlist_unsetenv(envlist_t *, const char *); 14 | extern int envlist_parse_set(envlist_t *, const char *); 15 | extern int envlist_parse_unset(envlist_t *, const char *); 16 | extern char **envlist_to_environ(const envlist_t *, size_t *); 17 | 18 | #ifdef __cplusplus 19 | } 20 | #endif 21 | 22 | #endif /* ENVLIST_H */ 23 | -------------------------------------------------------------------------------- /QEMU/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 | -------------------------------------------------------------------------------- /QEMU/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 | -------------------------------------------------------------------------------- /QEMU/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 | -------------------------------------------------------------------------------- /QEMU/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 | -------------------------------------------------------------------------------- /QEMU/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 | -------------------------------------------------------------------------------- /QEMU/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 | -------------------------------------------------------------------------------- /QEMU/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 | -------------------------------------------------------------------------------- /QEMU/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 | -------------------------------------------------------------------------------- /QEMU/linux-user/qemu-types.h: -------------------------------------------------------------------------------- 1 | #ifndef QEMU_TYPES_H 2 | #define QEMU_TYPES_H 3 | #include "cpu.h" 4 | 5 | #ifdef TARGET_ABI32 6 | typedef uint32_t abi_ulong; 7 | typedef int32_t abi_long; 8 | #define TARGET_ABI_FMT_lx "%08x" 9 | #define TARGET_ABI_FMT_ld "%d" 10 | #define TARGET_ABI_FMT_lu "%u" 11 | #define TARGET_ABI_BITS 32 12 | #else 13 | typedef target_ulong abi_ulong; 14 | typedef target_long abi_long; 15 | #define TARGET_ABI_FMT_lx TARGET_FMT_lx 16 | #define TARGET_ABI_FMT_ld TARGET_FMT_ld 17 | #define TARGET_ABI_FMT_lu TARGET_FMT_lu 18 | #define TARGET_ABI_BITS TARGET_LONG_BITS 19 | /* for consistency, define ABI32 too */ 20 | #if TARGET_ABI_BITS == 32 21 | #define TARGET_ABI32 1 22 | #endif 23 | #endif 24 | #endif 25 | -------------------------------------------------------------------------------- /QEMU/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 | -------------------------------------------------------------------------------- /QEMU/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 | -------------------------------------------------------------------------------- /QEMU/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 | -------------------------------------------------------------------------------- /QEMU/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 | -------------------------------------------------------------------------------- /QEMU/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 | -------------------------------------------------------------------------------- /QEMU/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 | -------------------------------------------------------------------------------- /QEMU/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 | -------------------------------------------------------------------------------- /QEMU/monitor.h: -------------------------------------------------------------------------------- 1 | #ifndef MONITOR_H 2 | #define MONITOR_H 3 | 4 | #include "qemu-common.h" 5 | #include "qemu-char.h" 6 | #include "block.h" 7 | 8 | extern Monitor *cur_mon; 9 | 10 | /* flags for monitor_init */ 11 | #define MONITOR_IS_DEFAULT 0x01 12 | #define MONITOR_USE_READLINE 0x02 13 | 14 | void monitor_init(CharDriverState *chr, int flags); 15 | 16 | int monitor_suspend(Monitor *mon); 17 | void monitor_resume(Monitor *mon); 18 | 19 | void monitor_read_bdrv_key_start(Monitor *mon, BlockDriverState *bs, 20 | BlockDriverCompletionFunc *completion_cb, 21 | void *opaque); 22 | 23 | int monitor_get_fd(Monitor *mon, const char *fdname); 24 | 25 | void monitor_vprintf(Monitor *mon, const char *fmt, va_list ap); 26 | void monitor_printf(Monitor *mon, const char *fmt, ...) 27 | __attribute__ ((__format__ (__printf__, 2, 3))); 28 | void monitor_print_filename(Monitor *mon, const char *filename); 29 | void monitor_flush(Monitor *mon); 30 | 31 | #endif /* !MONITOR_H */ 32 | -------------------------------------------------------------------------------- /QEMU/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 | -------------------------------------------------------------------------------- /QEMU/pc-bios/bamboo.dtb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ESOS-Lab/VSSIM/a119bee2aae5e10e52feb3eec3d05f973aee54d1/QEMU/pc-bios/bamboo.dtb -------------------------------------------------------------------------------- /QEMU/pc-bios/bios-pq/0001_bx-qemu.patch: -------------------------------------------------------------------------------- 1 | --- bochs-2.3.7.orig/bios/rombios.h 2 | +++ bochs-2.3.7/bios/rombios.h 3 | @@ -19,7 +19,7 @@ 4 | // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 5 | 6 | /* define it to include QEMU specific code */ 7 | -//#define BX_QEMU 8 | +#define BX_QEMU 9 | 10 | #ifndef LEGACY 11 | # define BX_ROMBIOS32 1 12 | -------------------------------------------------------------------------------- /QEMU/pc-bios/bios-pq/0003_kvm-bios-generate-mptable-unconditionally.patch: -------------------------------------------------------------------------------- 1 | generate mptable unconditionally (Avi Kivity) 2 | 3 | VMware ESX requires an mptable even for uniprocessor guests. 4 | 5 | Signed-off-by: Avi Kivity 6 | Signed-off-by: Anthony Liguori 7 | 8 | Index: bochs/bios/rombios32.c 9 | =================================================================== 10 | --- bochs.orig/bios/rombios32.c 11 | +++ bochs/bios/rombios32.c 12 | @@ -970,11 +970,6 @@ static void mptable_init(void) 13 | int ioapic_id, i, len; 14 | int mp_config_table_size; 15 | 16 | -#ifdef BX_QEMU 17 | - if (smp_cpus <= 1) 18 | - return; 19 | -#endif 20 | - 21 | #ifdef BX_USE_EBDA_TABLES 22 | mp_config_table = (uint8_t *)(ram_size - ACPI_DATA_SIZE - MPTABLE_MAX_SIZE); 23 | #else 24 | 25 | 26 | -------------------------------------------------------------------------------- /QEMU/pc-bios/bios-pq/0005_kvm-bios-fix-smbios-memory-device-length-boundary--condition.patch: -------------------------------------------------------------------------------- 1 | fix smbios memory device length boundary condition (Bill Rieske) 2 | 3 | dev_memsize ends up 0 when it shouldn't be on 16G boundary conditions. 4 | 5 | Signed-off-by: Bill Rieske 6 | Signed-off-by: Avi Kivity 7 | Signed-off-by: Anthony Liguori 8 | 9 | Index: bochs/bios/rombios32.c 10 | =================================================================== 11 | --- bochs.orig/bios/rombios32.c 12 | +++ bochs/bios/rombios32.c 13 | @@ -2218,7 +2218,7 @@ void smbios_init(void) 14 | for ( i = 0; i < nr_mem_devs; i++ ) 15 | { 16 | uint32_t dev_memsize = ((i == (nr_mem_devs - 1)) 17 | - ? (memsize & 0x3fff) : 0x4000); 18 | + ? (((memsize-1) & 0x3fff)+1) : 0x4000); 19 | add_struct(smbios_type_17_init(p, dev_memsize, i)); 20 | add_struct(smbios_type_19_init(p, dev_memsize, i)); 21 | add_struct(smbios_type_20_init(p, dev_memsize, i)); 22 | 23 | 24 | -------------------------------------------------------------------------------- /QEMU/pc-bios/bios-pq/0010_bios-mark-the-acpi-sci-interrupt-as-connected-to-irq-9.patch: -------------------------------------------------------------------------------- 1 | bios: mark the acpi sci interrupt as connected to irq 9 (Avi Kivity) 2 | 3 | Due to a chipset bug, the sci interrupt is hardwired to irq 9. Set the 4 | pci interrupt line register accordingly. 5 | 6 | Signed-off-by: Avi Kivity 7 | Signed-off-by: Anthony Liguori 8 | 9 | Index: bochs/bios/rombios32.c 10 | =================================================================== 11 | --- bochs.orig/bios/rombios32.c 12 | +++ bochs/bios/rombios32.c 13 | @@ -981,6 +981,8 @@ static void pci_bios_init_device(PCIDevi 14 | /* PIIX4 Power Management device (for ACPI) */ 15 | pm_io_base = PM_IO_BASE; 16 | smb_io_base = SMB_IO_BASE; 17 | + // acpi sci is hardwired to 9 18 | + pci_config_writeb(d, PCI_INTERRUPT_LINE, 9); 19 | pm_sci_int = pci_config_readb(d, PCI_INTERRUPT_LINE); 20 | piix4_pm_enable(d); 21 | acpi_enabled = 1; 22 | 23 | -- 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /QEMU/pc-bios/bios-pq/0015_enable-power-button-even-generation.patch: -------------------------------------------------------------------------------- 1 | Enable power button event generation. 2 | 3 | Signed-off-by: Gleb Natapov 4 | Signed-off-by: Anthony Liguori 5 | 6 | diff --git a/bios/rombios32.c b/bios/rombios32.c 7 | index 81e3bad..9986531 100644 8 | --- a/bios/rombios32.c 9 | +++ b/bios/rombios32.c 10 | @@ -1767,8 +1767,8 @@ void acpi_bios_init(void) 11 | fadt->plvl3_lat = cpu_to_le16(0xfff); // C3 state not supported 12 | fadt->gpe0_blk = cpu_to_le32(0xafe0); 13 | fadt->gpe0_blk_len = 4; 14 | - /* WBINVD + PROC_C1 + PWR_BUTTON + SLP_BUTTON + FIX_RTC */ 15 | - fadt->flags = cpu_to_le32((1 << 0) | (1 << 2) | (1 << 4) | (1 << 5) | (1 << 6)); 16 | + /* WBINVD + PROC_C1 + SLP_BUTTON + FIX_RTC */ 17 | + fadt->flags = cpu_to_le32((1 << 0) | (1 << 2) | (1 << 5) | (1 << 6)); 18 | acpi_build_table_header((struct acpi_table_header *)fadt, "FACP", 19 | sizeof(*fadt), 1); 20 | 21 | -------------------------------------------------------------------------------- /QEMU/pc-bios/bios-pq/HEAD: -------------------------------------------------------------------------------- 1 | 04387139e3b5ac97b5633cd40b3d87cdf45efd6c 2 | -------------------------------------------------------------------------------- /QEMU/pc-bios/bios-pq/series: -------------------------------------------------------------------------------- 1 | 0001_bx-qemu.patch 2 | 0002_kvm-bios-update-smbios-table-to-report-memory-above-4g.patch 3 | 0003_kvm-bios-generate-mptable-unconditionally.patch 4 | 0004_kvm-bios-resolve-memory-device-roll-over-reporting--issues-with-32g-guests.patch 5 | 0005_kvm-bios-fix-smbios-memory-device-length-boundary--condition.patch 6 | 0006_qemu-bios-use-preprocessor-for-pci-link-routing.patch 7 | 0007_bios-add-26-pci-slots,-bringing-the-total-to-32.patch 8 | 0008_qemu-bios-provide-gpe-_l0x-methods.patch 9 | 0009_qemu-bios-pci-hotplug-support.patch 10 | 0010_bios-mark-the-acpi-sci-interrupt-as-connected-to-irq-9.patch 11 | 0011_read-additional-acpi-tables-from-a-vm.patch 12 | 0012-load-smbios-entries-and-files-from-qemu.patch 13 | 0013_fix-non-acpi-timer-interrupt-routing.patch 14 | 0014_add-srat-acpi-table-support.patch 15 | 0015_enable-power-button-even-generation.patch 16 | 0016-use-correct-mask-to-size-pci-option-rom-bar.patch 17 | 0017-bochs-bios-Move-QEMU_CFG-constants-to-rombios.h.patch 18 | 0018-bochs-bios-Make-boot-prompt-optional.patch 19 | 0019-bios-fix-multiple-calls.patch 20 | -------------------------------------------------------------------------------- /QEMU/pc-bios/bios-vista.diff: -------------------------------------------------------------------------------- 1 | Index: rombios32.c 2 | =================================================================== 3 | RCS file: /cvsroot/bochs/bochs/bios/rombios32.c,v 4 | retrieving revision 1.9 5 | diff -u -w -r1.9 rombios32.c 6 | --- rombios32.c 20 Feb 2007 09:36:55 -0000 1.9 7 | +++ rombios32.c 2 May 2007 06:07:31 -0000 8 | @@ -1191,7 +1191,7 @@ 9 | { 10 | memcpy(h->signature, sig, 4); 11 | h->length = cpu_to_le32(len); 12 | - h->revision = 0; 13 | + h->revision = 1; 14 | #ifdef BX_QEMU 15 | memcpy(h->oem_id, "QEMU ", 6); 16 | memcpy(h->oem_table_id, "QEMU", 4); 17 | 18 | -------------------------------------------------------------------------------- /QEMU/pc-bios/bios.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ESOS-Lab/VSSIM/a119bee2aae5e10e52feb3eec3d05f973aee54d1/QEMU/pc-bios/bios.bin -------------------------------------------------------------------------------- /QEMU/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 | -------------------------------------------------------------------------------- /QEMU/pc-bios/keymaps/fr-ca: -------------------------------------------------------------------------------- 1 | # Canadian French 2 | # By Simon Germain 3 | include common 4 | map 0xc0c 5 | 6 | backslash 0x29 altgr 7 | plusminus 0x2 altgr 8 | at 0x3 altgr 9 | sterling 0x4 altgr 10 | cent 0x5 altgr 11 | currency 0x6 altgr 12 | notsign 0x7 altgr 13 | bar 0x29 shift 14 | twosuperior 0x9 altgr 15 | threesuperior 0xa altgr 16 | onequarter 0xb altgr 17 | onehalf 0xc altgr 18 | threequarters 0xd altgr 19 | section 0x18 altgr 20 | paragraph 0x19 altgr 21 | bracketleft 0x1a altgr 22 | bracketright 0x1b altgr 23 | asciitilde 0x27 altgr 24 | braceleft 0x28 altgr 25 | braceright 0x2b altgr 26 | less 0x2b 27 | greater 0x2b shift 28 | guillemotleft 0x56 29 | guillemotright 0x56 shift 30 | degree 0x56 altgr 31 | mu 0x32 altgr 32 | eacute 0x35 33 | dead_acute 0x35 altgr 34 | dead_grave 0x28 35 | dead_circumflex 0x1a 36 | dead_circumflex 0x1a shift 37 | dead_cedilla 0x1b 38 | dead_diaeresis 0x1b shift 39 | exclam 0x2 shift 40 | quotedbl 0x3 shift 41 | slash 0x4 shift 42 | dollar 0x5 shift 43 | percent 0x6 shift 44 | question 0x7 shift 45 | ampersand 0x8 shift 46 | asterisk 0x9 shift 47 | parenleft 0xa shift 48 | parenright 0xb shift 49 | underscore 0xc shift 50 | plus 0xd shift 51 | -------------------------------------------------------------------------------- /QEMU/pc-bios/keymaps/is: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ESOS-Lab/VSSIM/a119bee2aae5e10e52feb3eec3d05f973aee54d1/QEMU/pc-bios/keymaps/is -------------------------------------------------------------------------------- /QEMU/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 | -------------------------------------------------------------------------------- /QEMU/pc-bios/keymaps/nl-be: -------------------------------------------------------------------------------- 1 | # Dutch (Belgium) 2 | map 0x813 3 | include common 4 | -------------------------------------------------------------------------------- /QEMU/pc-bios/mpc8544ds.dtb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ESOS-Lab/VSSIM/a119bee2aae5e10e52feb3eec3d05f973aee54d1/QEMU/pc-bios/mpc8544ds.dtb -------------------------------------------------------------------------------- /QEMU/pc-bios/multiboot.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ESOS-Lab/VSSIM/a119bee2aae5e10e52feb3eec3d05f973aee54d1/QEMU/pc-bios/multiboot.bin -------------------------------------------------------------------------------- /QEMU/pc-bios/openbios-ppc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ESOS-Lab/VSSIM/a119bee2aae5e10e52feb3eec3d05f973aee54d1/QEMU/pc-bios/openbios-ppc -------------------------------------------------------------------------------- /QEMU/pc-bios/openbios-sparc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ESOS-Lab/VSSIM/a119bee2aae5e10e52feb3eec3d05f973aee54d1/QEMU/pc-bios/openbios-sparc -------------------------------------------------------------------------------- /QEMU/pc-bios/openbios-sparc32: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ESOS-Lab/VSSIM/a119bee2aae5e10e52feb3eec3d05f973aee54d1/QEMU/pc-bios/openbios-sparc32 -------------------------------------------------------------------------------- /QEMU/pc-bios/openbios-sparc64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ESOS-Lab/VSSIM/a119bee2aae5e10e52feb3eec3d05f973aee54d1/QEMU/pc-bios/openbios-sparc64 -------------------------------------------------------------------------------- /QEMU/pc-bios/petalogix-s3adsp1800.dtb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ESOS-Lab/VSSIM/a119bee2aae5e10e52feb3eec3d05f973aee54d1/QEMU/pc-bios/petalogix-s3adsp1800.dtb -------------------------------------------------------------------------------- /QEMU/pc-bios/ppc_rom.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ESOS-Lab/VSSIM/a119bee2aae5e10e52feb3eec3d05f973aee54d1/QEMU/pc-bios/ppc_rom.bin -------------------------------------------------------------------------------- /QEMU/pc-bios/pxe-e1000.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ESOS-Lab/VSSIM/a119bee2aae5e10e52feb3eec3d05f973aee54d1/QEMU/pc-bios/pxe-e1000.bin -------------------------------------------------------------------------------- /QEMU/pc-bios/pxe-ne2k_pci.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ESOS-Lab/VSSIM/a119bee2aae5e10e52feb3eec3d05f973aee54d1/QEMU/pc-bios/pxe-ne2k_pci.bin -------------------------------------------------------------------------------- /QEMU/pc-bios/pxe-pcnet.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ESOS-Lab/VSSIM/a119bee2aae5e10e52feb3eec3d05f973aee54d1/QEMU/pc-bios/pxe-pcnet.bin -------------------------------------------------------------------------------- /QEMU/pc-bios/pxe-rtl8139.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ESOS-Lab/VSSIM/a119bee2aae5e10e52feb3eec3d05f973aee54d1/QEMU/pc-bios/pxe-rtl8139.bin -------------------------------------------------------------------------------- /QEMU/pc-bios/vgabios-cirrus.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ESOS-Lab/VSSIM/a119bee2aae5e10e52feb3eec3d05f973aee54d1/QEMU/pc-bios/vgabios-cirrus.bin -------------------------------------------------------------------------------- /QEMU/pc-bios/vgabios-pq/HEAD: -------------------------------------------------------------------------------- 1 | 86ccbd96bf82d046d219141ac56cd4b26256889b 2 | -------------------------------------------------------------------------------- /QEMU/pc-bios/vgabios-pq/series: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ESOS-Lab/VSSIM/a119bee2aae5e10e52feb3eec3d05f973aee54d1/QEMU/pc-bios/vgabios-pq/series -------------------------------------------------------------------------------- /QEMU/pc-bios/vgabios.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ESOS-Lab/VSSIM/a119bee2aae5e10e52feb3eec3d05f973aee54d1/QEMU/pc-bios/vgabios.bin -------------------------------------------------------------------------------- /QEMU/pc-bios/video.x: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ESOS-Lab/VSSIM/a119bee2aae5e10e52feb3eec3d05f973aee54d1/QEMU/pc-bios/video.x -------------------------------------------------------------------------------- /QEMU/pci-ids.txt: -------------------------------------------------------------------------------- 1 | 2 | PCI IDs for qemu 3 | ================ 4 | 5 | Red Hat, Inc. donates a part of its device ID range to qemu, to be used for 6 | virtual devices. The vendor ID is 1af4 (formerly Qumranet ID). 7 | 8 | The 1000 -> 10ff device ID range is used for VirtIO devices. 9 | 10 | The 1100 device ID is used as PCI Subsystem ID for existing hardware 11 | devices emulated by qemu. 12 | 13 | All other device IDs are reserved. 14 | 15 | 16 | VirtIO Device IDs 17 | ----------------- 18 | 19 | 1af4:1000 network device 20 | 1af4:1001 block device 21 | 1af4:1002 balloon device 22 | 1af4:1003 console device 23 | 24 | 1af4:1004 Reserved. 25 | to Contact Gerd Hoffmann to get a 26 | 1af4:10ef device ID assigned for your new virtio device. 27 | 28 | 1af4:10f0 Available for experimental usage without registration. Must get 29 | to official ID when the code leaves the test lab (i.e. when seeking 30 | 1af4:10ff upstream merge or shipping a distro/product) to avoid conflicts. 31 | 32 | -------------------------------------------------------------------------------- /QEMU/qemu-doc.texi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ESOS-Lab/VSSIM/a119bee2aae5e10e52feb3eec3d05f973aee54d1/QEMU/qemu-doc.texi -------------------------------------------------------------------------------- /QEMU/qemu-kvm-helper.c: -------------------------------------------------------------------------------- 1 | 2 | #include "config.h" 3 | #include "config-host.h" 4 | 5 | #include "exec.h" 6 | 7 | #include "qemu-kvm.h" 8 | 9 | void qemu_kvm_call_with_env(void (*func)(void *), void *data, CPUState *newenv) 10 | { 11 | CPUState *oldenv; 12 | #define DECLARE_HOST_REGS 13 | #include "hostregs_helper.h" 14 | 15 | oldenv = newenv; 16 | 17 | #define SAVE_HOST_REGS 18 | #include "hostregs_helper.h" 19 | 20 | env = newenv; 21 | 22 | env_to_regs(); 23 | func(data); 24 | regs_to_env(); 25 | 26 | env = oldenv; 27 | 28 | #include "hostregs_helper.h" 29 | } 30 | 31 | static void call_helper_cpuid(void *junk) 32 | { 33 | helper_cpuid(); 34 | } 35 | 36 | void qemu_kvm_cpuid_on_env(CPUState *env) 37 | { 38 | qemu_kvm_call_with_env(call_helper_cpuid, NULL, env); 39 | } 40 | 41 | -------------------------------------------------------------------------------- /QEMU/rules.mak: -------------------------------------------------------------------------------- 1 | 2 | %.o: %.c 3 | $(call quiet-command,$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<," CC $(TARGET_DIR)$@") 4 | 5 | %.o: %.S 6 | $(call quiet-command,$(CC) $(CPPFLAGS) -c -o $@ $<," AS $(TARGET_DIR)$@") 7 | 8 | %.o: %.m 9 | $(call quiet-command,$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<," OBJC $(TARGET_DIR)$@") 10 | 11 | LINK = $(call quiet-command,$(CC) $(LDFLAGS) -o $@ $(1) $(ARLIBS_BEGIN) $(ARLIBS) $(ARLIBS_END) $(LIBS)," LINK $(TARGET_DIR)$@") 12 | 13 | %$(EXESUF): %.o 14 | $(call LINK,$^) 15 | 16 | %.a: 17 | $(call quiet-command,rm -f $@ && $(AR) rcs $@ $^," AR $(TARGET_DIR)$@") 18 | 19 | quiet-command = $(if $(V),$1,$(if $(2),@echo $2 && $1, @$1)) 20 | -------------------------------------------------------------------------------- /QEMU/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 | -------------------------------------------------------------------------------- /QEMU/slirp/debug.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1995 Danny Gasparovski. 3 | * 4 | * Please read the file COPYRIGHT for the 5 | * terms and conditions of the copyright. 6 | */ 7 | 8 | //#define DEBUG 1 9 | 10 | #ifdef DEBUG 11 | 12 | #define DBG_CALL 0x1 13 | #define DBG_MISC 0x2 14 | #define DBG_ERROR 0x4 15 | 16 | #define dfd stderr 17 | 18 | extern int slirp_debug; 19 | 20 | #define DEBUG_CALL(x) if (slirp_debug & DBG_CALL) { fprintf(dfd, "%s...\n", x); fflush(dfd); } 21 | #define DEBUG_ARG(x, y) if (slirp_debug & DBG_CALL) { fputc(' ', dfd); fprintf(dfd, x, y); fputc('\n', dfd); fflush(dfd); } 22 | #define DEBUG_ARGS(x) if (slirp_debug & DBG_CALL) { fprintf x ; fflush(dfd); } 23 | #define DEBUG_MISC(x) if (slirp_debug & DBG_MISC) { fprintf x ; fflush(dfd); } 24 | #define DEBUG_ERROR(x) if (slirp_debug & DBG_ERROR) {fprintf x ; fflush(dfd); } 25 | 26 | #else 27 | 28 | #define DEBUG_CALL(x) 29 | #define DEBUG_ARG(x, y) 30 | #define DEBUG_ARGS(x) 31 | #define DEBUG_MISC(x) 32 | #define DEBUG_ERROR(x) 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /QEMU/slirp/if.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1995 Danny Gasparovski. 3 | * 4 | * Please read the file COPYRIGHT for the 5 | * terms and conditions of the copyright. 6 | */ 7 | 8 | #ifndef _IF_H_ 9 | #define _IF_H_ 10 | 11 | #define IF_COMPRESS 0x01 /* We want compression */ 12 | #define IF_NOCOMPRESS 0x02 /* Do not do compression */ 13 | #define IF_AUTOCOMP 0x04 /* Autodetect (default) */ 14 | #define IF_NOCIDCOMP 0x08 /* CID compression */ 15 | 16 | #define IF_MTU 1500 17 | #define IF_MRU 1500 18 | #define IF_COMP IF_AUTOCOMP /* Flags for compression */ 19 | 20 | /* 2 for alignment, 14 for ethernet, 40 for TCP/IP */ 21 | #define IF_MAXLINKHDR (2 + 14 + 40) 22 | 23 | #define ifs_init(ifm) ((ifm)->ifs_next = (ifm)->ifs_prev = (ifm)) 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /QEMU/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 | -------------------------------------------------------------------------------- /QEMU/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 | u_int16_t tp_op; 20 | union { 21 | struct { 22 | u_int16_t tp_block_nr; 23 | u_int8_t tp_buf[512]; 24 | } tp_data; 25 | struct { 26 | u_int16_t tp_error_code; 27 | u_int8_t tp_msg[512]; 28 | } tp_error; 29 | u_int8_t 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 | u_int16_t client_port; 39 | 40 | int timestamp; 41 | }; 42 | 43 | void tftp_input(struct mbuf *m); 44 | -------------------------------------------------------------------------------- /QEMU/ssd.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ESOS-Lab/VSSIM/a119bee2aae5e10e52feb3eec3d05f973aee54d1/QEMU/ssd.h -------------------------------------------------------------------------------- /QEMU/target-cris/helper.h: -------------------------------------------------------------------------------- 1 | #include "def-helper.h" 2 | 3 | DEF_HELPER_1(raise_exception, void, i32) 4 | DEF_HELPER_1(tlb_flush_pid, void, i32) 5 | DEF_HELPER_1(spc_write, void, i32) 6 | DEF_HELPER_3(dump, void, i32, i32, i32) 7 | DEF_HELPER_0(rfe, void); 8 | DEF_HELPER_0(rfn, void); 9 | 10 | DEF_HELPER_2(movl_sreg_reg, void, i32, i32) 11 | DEF_HELPER_2(movl_reg_sreg, void, i32, i32) 12 | 13 | DEF_HELPER_FLAGS_1(lz, TCG_CALL_PURE, i32, i32); 14 | DEF_HELPER_FLAGS_3(btst, TCG_CALL_PURE, i32, i32, i32, i32); 15 | 16 | DEF_HELPER_FLAGS_3(evaluate_flags_muls, TCG_CALL_PURE, i32, i32, i32, i32) 17 | DEF_HELPER_FLAGS_3(evaluate_flags_mulu, TCG_CALL_PURE, i32, i32, i32, i32) 18 | DEF_HELPER_FLAGS_4(evaluate_flags_mcp, TCG_CALL_PURE, i32, i32, i32, i32, i32) 19 | DEF_HELPER_FLAGS_4(evaluate_flags_alu_4, TCG_CALL_PURE, i32, i32, i32, i32, i32) 20 | DEF_HELPER_FLAGS_4(evaluate_flags_sub_4, TCG_CALL_PURE, i32, i32, i32, i32, i32) 21 | DEF_HELPER_FLAGS_2(evaluate_flags_move_4, TCG_CALL_PURE, i32, i32, i32) 22 | DEF_HELPER_FLAGS_2(evaluate_flags_move_2, TCG_CALL_PURE, i32, i32, i32) 23 | DEF_HELPER_0(evaluate_flags, void) 24 | DEF_HELPER_0(top_evaluate_flags, void) 25 | 26 | #include "def-helper.h" 27 | -------------------------------------------------------------------------------- /QEMU/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); 18 | -------------------------------------------------------------------------------- /QEMU/target-i386/libkvm.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This header is for functions & variables that will ONLY be 3 | * used inside libkvm for x86. 4 | * THESE ARE NOT EXPOSED TO THE USER AND ARE ONLY FOR USE 5 | * WITHIN LIBKVM. 6 | * 7 | * derived from libkvm.c 8 | * 9 | * Copyright (C) 2006 Qumranet, Inc. 10 | * 11 | * Authors: 12 | * Avi Kivity 13 | * Yaniv Kamay 14 | * 15 | * This work is licensed under the GNU LGPL license, version 2. 16 | */ 17 | 18 | #ifndef KVM_X86_H 19 | #define KVM_X86_H 20 | 21 | #define PAGE_SIZE 4096ul 22 | #define PAGE_MASK (~(PAGE_SIZE - 1)) 23 | 24 | int kvm_set_tss_addr(kvm_context_t kvm, unsigned long addr); 25 | 26 | #define smp_wmb() asm volatile("" ::: "memory") 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /QEMU/target-ia64/helper.c: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * IA64 emulation helpers for qemu. (Leave it as blank now.) 4 | * 5 | */ 6 | -------------------------------------------------------------------------------- /QEMU/target-ia64/libkvm.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This header is for functions & variables that will ONLY be 3 | * used inside libkvm for x86. 4 | * THESE ARE NOT EXPOSED TO THE USER AND ARE ONLY FOR USE 5 | * WITHIN LIBKVM. 6 | * 7 | * derived from libkvm.c 8 | * 9 | * Copyright (C) 2006 Qumranet, Inc. 10 | * 11 | * Authors: 12 | * Avi Kivity 13 | * Yaniv Kamay 14 | * 15 | * This work is licensed under the GNU LGPL license, version 2. 16 | */ 17 | 18 | #ifndef KVM_IA64_H 19 | #define KVM_IA64_H 20 | 21 | #include "libkvm-all.h" 22 | 23 | extern int kvm_page_size; 24 | 25 | #define PAGE_SIZE kvm_page_size 26 | #define PAGE_MASK (~(kvm_page_size - 1)) 27 | 28 | #define ia64_mf() asm volatile ("mf" ::: "memory") 29 | #define smp_wmb() ia64_mf() 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /QEMU/target-ia64/machine.c: -------------------------------------------------------------------------------- 1 | #include "hw/hw.h" 2 | #include "hw/boards.h" 3 | 4 | #include "exec-all.h" 5 | #include "qemu-kvm.h" 6 | 7 | void cpu_save(QEMUFile *f, void *opaque) 8 | { 9 | CPUState *env = opaque; 10 | 11 | if (kvm_enabled()) { 12 | kvm_save_registers(env); 13 | kvm_arch_save_mpstate(env); 14 | } 15 | } 16 | 17 | int cpu_load(QEMUFile *f, void *opaque, int version_id) 18 | { 19 | CPUState *env = opaque; 20 | 21 | if (kvm_enabled()) { 22 | kvm_load_registers(env); 23 | kvm_arch_load_mpstate(env); 24 | } 25 | return 0; 26 | } 27 | 28 | extern QEMUMachine ipf_machine; 29 | 30 | static void ipf_machine_init(void) 31 | { 32 | qemu_register_machine(&ipf_machine); 33 | } 34 | 35 | machine_init(ipf_machine_init); 36 | -------------------------------------------------------------------------------- /QEMU/target-ia64/op.c: -------------------------------------------------------------------------------- 1 | /* 2 | * IA64 micro operations 3 | * 4 | * Leave it blank for future implementation 5 | * 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 2 of the License, or (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with this library; if not, write to the Free Software 19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | */ 21 | 22 | 23 | -------------------------------------------------------------------------------- /QEMU/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/target-m68k/machine.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ESOS-Lab/VSSIM/a119bee2aae5e10e52feb3eec3d05f973aee54d1/QEMU/target-m68k/machine.c -------------------------------------------------------------------------------- /QEMU/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 | -------------------------------------------------------------------------------- /QEMU/target-microblaze/helper.h: -------------------------------------------------------------------------------- 1 | #include "def-helper.h" 2 | 3 | DEF_HELPER_1(raise_exception, void, i32) 4 | DEF_HELPER_0(debug, void) 5 | DEF_HELPER_4(addkc, i32, i32, i32, i32, i32) 6 | DEF_HELPER_4(subkc, i32, i32, i32, i32, i32) 7 | DEF_HELPER_2(cmp, i32, i32, i32) 8 | DEF_HELPER_2(cmpu, i32, i32, i32) 9 | 10 | DEF_HELPER_2(divs, i32, i32, i32) 11 | DEF_HELPER_2(divu, i32, i32, i32) 12 | 13 | DEF_HELPER_FLAGS_2(pcmpbf, TCG_CALL_PURE | TCG_CALL_CONST, i32, i32, i32) 14 | #if !defined(CONFIG_USER_ONLY) 15 | DEF_HELPER_1(mmu_read, i32, i32) 16 | DEF_HELPER_2(mmu_write, void, i32, i32) 17 | #endif 18 | 19 | #include "def-helper.h" 20 | -------------------------------------------------------------------------------- /QEMU/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 | -------------------------------------------------------------------------------- /QEMU/target-ppc/kvm_ppc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008 IBM Corporation. 3 | * Authors: Hollis Blanchard 4 | * 5 | * This work is licensed under the GNU GPL license version 2 or later. 6 | * 7 | */ 8 | 9 | #ifndef __KVM_PPC_H__ 10 | #define __KVM_PPC_H__ 11 | 12 | void kvmppc_init(void); 13 | void kvmppc_fdt_update(void *fdt); 14 | int kvmppc_read_host_property(const char *node_path, const char *prop, 15 | void *val, size_t len); 16 | 17 | #endif /* __KVM_PPC_H__ */ 18 | -------------------------------------------------------------------------------- /QEMU/target-ppc/libkvm.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This header is for functions & variables that will ONLY be 3 | * used inside libkvm for powerpc. 4 | * THESE ARE NOT EXPOSED TO THE USER AND ARE ONLY FOR USE 5 | * WITHIN LIBKVM. 6 | * 7 | * Copyright (C) 2006 Qumranet, Inc. 8 | * 9 | * Authors: 10 | * Avi Kivity 11 | * Yaniv Kamay 12 | * 13 | * Copyright 2007 IBM Corporation. 14 | * Added by: Jerone Young 15 | * 16 | * This work is licensed under the GNU LGPL license, version 2. 17 | */ 18 | 19 | #ifndef KVM_POWERPC_H 20 | #define KVM_POWERPC_H 21 | 22 | #include "libkvm-all.h" 23 | 24 | extern int kvm_page_size; 25 | 26 | #define PAGE_SIZE kvm_page_size 27 | #define PAGE_MASK (~(PAGE_SIZE - 1)) 28 | 29 | static inline void eieio(void) 30 | { 31 | asm volatile("eieio" : : : "memory"); 32 | } 33 | 34 | #define smp_wmb() eieio() 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /QEMU/target-ppc/mfrom_table_gen.c: -------------------------------------------------------------------------------- 1 | #define _GNU_SOURCE 2 | #include 3 | #include 4 | #include 5 | 6 | int main (void) 7 | { 8 | double d; 9 | uint8_t n; 10 | int i; 11 | 12 | printf("static const uint8_t mfrom_ROM_table[602] =\n{\n "); 13 | for (i = 0; i < 602; i++) { 14 | /* Extremly decomposed: 15 | * -T0 / 256 16 | * T0 = 256 * log10(10 + 1.0) + 0.5 17 | */ 18 | d = -i; 19 | d /= 256.0; 20 | d = exp10(d); 21 | d += 1.0; 22 | d = log10(d); 23 | d *= 256; 24 | d += 0.5; 25 | n = d; 26 | printf("%3d, ", n); 27 | if ((i & 7) == 7) 28 | printf("\n "); 29 | } 30 | printf("\n};\n"); 31 | 32 | return 0; 33 | } 34 | -------------------------------------------------------------------------------- /QEMU/target-sh4/machine.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ESOS-Lab/VSSIM/a119bee2aae5e10e52feb3eec3d05f973aee54d1/QEMU/target-sh4/machine.c -------------------------------------------------------------------------------- /QEMU/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'). We have sizeof(target_phys_addr) 9 | = max(sizeof(unsigned long), 10 | sizeof(size_of_target_physical_address)) because we must pass a 11 | host pointer to memory operations in some cases */ 12 | 13 | #if TARGET_PHYS_ADDR_BITS == 32 14 | typedef uint32_t target_phys_addr_t; 15 | #define TARGET_PHYS_ADDR_MAX UINT32_MAX 16 | #define TARGET_FMT_plx "%08x" 17 | #elif TARGET_PHYS_ADDR_BITS == 64 18 | typedef uint64_t target_phys_addr_t; 19 | #define TARGET_PHYS_ADDR_MAX UINT64_MAX 20 | #define TARGET_FMT_plx "%016" PRIx64 21 | #endif 22 | #endif 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /QEMU/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 | -------------------------------------------------------------------------------- /QEMU/tcg/TODO: -------------------------------------------------------------------------------- 1 | - Add new instructions such as: setcond, 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 | -------------------------------------------------------------------------------- /QEMU/tests/alpha/Makefile: -------------------------------------------------------------------------------- 1 | CROSS=alpha-linux-gnu- 2 | CC=$(CROSS)gcc 3 | AS=$(CROSS)as 4 | 5 | SIM=../../alpha-linux-user/qemu-alpha 6 | 7 | CFLAGS=-O 8 | LINK=$(CC) -o $@ crt.o $< -nostdlib 9 | 10 | TESTS=test-cond test-cmov 11 | 12 | all: hello-alpha $(TESTS) 13 | 14 | hello-alpha: hello-alpha.o crt.o 15 | $(LINK) 16 | 17 | test-cond: test-cond.o crt.o 18 | $(LINK) 19 | 20 | test-cmov.o: test-cond.c 21 | $(CC) -c $(CFLAGS) -DTEST_CMOV -o $@ $< 22 | 23 | test-cmov: test-cmov.o crt.o 24 | $(LINK) 25 | 26 | test-ovf: test-ovf.o crt.o 27 | $(LINK) 28 | 29 | check: $(TESTS) 30 | for f in $(TESTS); do $(SIM) $$f || exit 1; done 31 | 32 | clean: 33 | $(RM) *.o *~ hello-alpha $(TESTS) 34 | 35 | .PHONY: clean all check 36 | -------------------------------------------------------------------------------- /QEMU/tests/alpha/crt.s: -------------------------------------------------------------------------------- 1 | .text 2 | 3 | .globl _start 4 | .ent _start,0 5 | _start: 6 | .frame $15,0,$15 7 | br $29,1f 8 | 1: ldgp $29, 0($29) 9 | .prologue 0 10 | ldq $27,main($29) !literal!1 11 | jsr $26,($27) 12 | or $0,$0,$16 13 | .end _start 14 | 15 | .globl _exit 16 | _exit: 17 | lda $0,1 18 | callsys 19 | 20 | call_pal 0 21 | 22 | .globl write 23 | write: 24 | lda $0,4 25 | callsys 26 | ret 27 | -------------------------------------------------------------------------------- /QEMU/tests/alpha/hello-alpha.c: -------------------------------------------------------------------------------- 1 | int main (void) 2 | { 3 | write (1, "hello\n", 6); 4 | return 0; 5 | } 6 | -------------------------------------------------------------------------------- /QEMU/tests/alpha/test-ovf.c: -------------------------------------------------------------------------------- 1 | static long test_subqv (long a, long b) 2 | { 3 | long res; 4 | 5 | asm ("subq/v %1,%2,%0" 6 | : "=r" (res) : "r" (a), "r" (b)); 7 | return res; 8 | } 9 | static struct { 10 | long (*func)(long, long); 11 | long a; 12 | long b; 13 | long r; 14 | } vectors[] = 15 | { 16 | {test_subqv, 0, 0x7d54000, 0xfffffffff82ac000L} 17 | }; 18 | 19 | int main (void) 20 | { 21 | int i; 22 | 23 | for (i = 0; i < sizeof (vectors)/sizeof(vectors[0]); i++) 24 | if ((*vectors[i].func)(vectors[i].a, vectors[i].b) != vectors[i].r) { 25 | write(1, "Failed\n", 7); 26 | } 27 | write(1, "OK\n", 3); 28 | return 0; 29 | } 30 | -------------------------------------------------------------------------------- /QEMU/tests/cris/.gdbinit: -------------------------------------------------------------------------------- 1 | b main 2 | b _fail 3 | b exit 4 | display /i $pc 5 | display /x $srp 6 | display /x $r0 7 | display /x $r1 8 | display /x $r2 9 | display /x $r3 10 | display /x $r4 11 | display /t $ccs 12 | -------------------------------------------------------------------------------- /QEMU/tests/cris/README: -------------------------------------------------------------------------------- 1 | Test-suite for the cris port. Heavily based on the test-suite for the CRIS port of sim by Hans-Peter Nilsson. 2 | -------------------------------------------------------------------------------- /QEMU/tests/cris/check_abs.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include "sys.h" 5 | #include "crisutils.h" 6 | 7 | extern inline int cris_abs(int n) { 8 | int r; 9 | asm ("abs\t%1, %0\n" : "=r" (r) : "r" (n)); 10 | return r; 11 | } 12 | 13 | extern inline void 14 | verify_abs(int val, int res, 15 | const int n, const int z, const int v, const int c) 16 | { 17 | int r; 18 | 19 | cris_tst_cc_init(); 20 | r = cris_abs(val); 21 | cris_tst_cc(n, z, v, c); 22 | if (r != res) 23 | err(); 24 | } 25 | 26 | int main(void) 27 | { 28 | verify_abs(-1, 1, 0, 0, 0, 0); 29 | verify_abs(0x80000000, 0x80000000, 1, 0, 0, 0); 30 | verify_abs(0x7fffffff, 0x7fffffff, 0, 0, 0, 0); 31 | verify_abs(42, 42, 0, 0, 0, 0); 32 | verify_abs(1, 1, 0, 0, 0, 0); 33 | verify_abs(0xffff, 0xffff, 0, 0, 0, 0); 34 | verify_abs(0xffff, 0xffff, 0, 0, 0, 0); 35 | verify_abs(-31, 0x1f, 0, 0, 0, 0); 36 | verify_abs(0, 0, 0, 1, 0, 0); 37 | pass(); 38 | return 0; 39 | } 40 | -------------------------------------------------------------------------------- /QEMU/tests/cris/check_addi.s: -------------------------------------------------------------------------------- 1 | # mach: crisv0 crisv3 crisv8 crisv10 crisv32 2 | # output: 0\n1\n2\n4\nbe02460f\n69d035a6\nc16c14d4\n 3 | 4 | .include "testutils.inc" 5 | start 6 | moveq 0,r3 7 | moveq 0,r4 8 | clearf zcvn 9 | addi r4.b,r3 10 | test_cc 0 0 0 0 11 | checkr3 0 12 | 13 | moveq 0,r3 14 | moveq 1,r4 15 | setf zcvn 16 | addi r4.b,r3 17 | test_cc 1 1 1 1 18 | checkr3 1 19 | 20 | moveq 0,r3 21 | moveq 1,r4 22 | setf cv 23 | clearf zn 24 | addi r4.w,r3 25 | test_cc 0 0 1 1 26 | checkr3 2 27 | 28 | moveq 0,r3 29 | moveq 1,r4 30 | clearf cv 31 | setf zn 32 | addi r4.d,r3 33 | test_cc 1 1 0 0 34 | checkr3 4 35 | 36 | move.d 0x12345678,r3 37 | move.d 0xabcdef97,r4 38 | clearf cn 39 | setf zv 40 | addi r4.b,r3 41 | test_cc 0 1 1 0 42 | checkr3 be02460f 43 | 44 | move.d 0x12345678,r3 45 | move.d 0xabcdef97,r4 46 | setf cn 47 | clearf zv 48 | addi r4.w,r3 49 | test_cc 1 0 0 1 50 | checkr3 69d035a6 51 | 52 | move.d 0x12345678,r3 53 | move.d 0xabcdef97,r4 54 | addi r4.d,r3 55 | checkr3 c16c14d4 56 | 57 | quit 58 | -------------------------------------------------------------------------------- /QEMU/tests/cris/check_addoq.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include "sys.h" 5 | #include "crisutils.h" 6 | 7 | /* this would be better to do in asm, it's an orgy in GCC inline asm now. */ 8 | 9 | /* ACR will be clobbered. */ 10 | #define cris_addoq(o, v) \ 11 | asm volatile ("addoq\t%1, %0, $acr\n" : : "r" (v), "i" (o) : "acr"); 12 | 13 | 14 | int main(void) 15 | { 16 | int x[3] = {0x55aa77ff, 0xccff2244, 0x88ccee19}; 17 | int *p, *t = x + 1; 18 | 19 | cris_tst_cc_init(); 20 | asm volatile ("setf\tzvnc\n"); 21 | cris_addoq(0, t); 22 | cris_tst_cc(1, 1, 1, 1); 23 | asm volatile ("move.d\t$acr, %0\n" : "=r" (p)); 24 | if (*p != 0xccff2244) 25 | err(); 26 | 27 | cris_tst_cc_init(); 28 | asm volatile ("setf\tzvnc\n"); 29 | cris_addoq(4, t); 30 | cris_tst_cc(1, 1, 1, 1); 31 | asm volatile ("move.d\t$acr, %0\n" : "=r" (p)); 32 | if (*p != 0x88ccee19) 33 | err(); 34 | 35 | cris_tst_cc_init(); 36 | asm volatile ("clearf\tzvnc\n"); 37 | cris_addoq(-8, t + 1); 38 | cris_tst_cc(0, 0, 0, 0); 39 | asm volatile ("move.d\t$acr, %0\n" : "=r" (p)); 40 | if (*p != 0x55aa77ff) 41 | err(); 42 | pass(); 43 | return 0; 44 | } 45 | -------------------------------------------------------------------------------- /QEMU/tests/cris/check_addq.s: -------------------------------------------------------------------------------- 1 | # mach: crisv3 crisv8 crisv10 crisv32 2 | # output: ffffffff\n0\n1\n100\n10000\n47\n67\na6\n80000001\n 3 | 4 | .include "testutils.inc" 5 | start 6 | moveq -2,r3 7 | addq 1,r3 8 | test_cc 1 0 0 0 9 | checkr3 ffffffff 10 | 11 | addq 1,r3 12 | test_cc 0 1 0 1 13 | checkr3 0 14 | 15 | addq 1,r3 16 | test_cc 0 0 0 0 17 | checkr3 1 18 | 19 | move.d 0xff,r3 20 | addq 1,r3 21 | test_cc 0 0 0 0 22 | checkr3 100 23 | 24 | move.d 0xffff,r3 25 | addq 1,r3 26 | test_cc 0 0 0 0 27 | checkr3 10000 28 | 29 | move.d 0x42,r3 30 | addq 5,r3 31 | test_cc 0 0 0 0 32 | checkr3 47 33 | 34 | addq 32,r3 35 | test_cc 0 0 0 0 36 | checkr3 67 37 | 38 | addq 63,r3 39 | test_cc 0 0 0 0 40 | checkr3 a6 41 | 42 | move.d 0x7ffffffe,r3 43 | addq 3,r3 44 | test_cc 1 0 1 0 45 | checkr3 80000001 46 | 47 | quit 48 | -------------------------------------------------------------------------------- /QEMU/tests/cris/check_andq.s: -------------------------------------------------------------------------------- 1 | # mach: crisv0 crisv3 crisv8 crisv10 crisv32 2 | # output: 2\n2\nffff\nffffffff\n1f\nffffffe0\n78134452\n0\n 3 | 4 | .include "testutils.inc" 5 | start 6 | moveq -1,r3 7 | andq 2,r3 8 | test_move_cc 0 0 0 0 9 | checkr3 2 10 | 11 | moveq 2,r3 12 | andq -1,r3 13 | test_move_cc 0 0 0 0 14 | checkr3 2 15 | 16 | move.d 0xffff,r3 17 | andq -1,r3 18 | test_move_cc 0 0 0 0 19 | checkr3 ffff 20 | 21 | moveq -1,r3 22 | andq -1,r3 23 | test_move_cc 1 0 0 0 24 | checkr3 ffffffff 25 | 26 | moveq -1,r3 27 | andq 31,r3 28 | test_move_cc 0 0 0 0 29 | checkr3 1f 30 | 31 | moveq -1,r3 32 | andq -32,r3 33 | test_move_cc 1 0 0 0 34 | checkr3 ffffffe0 35 | 36 | move.d 0x78134457,r3 37 | andq -14,r3 38 | test_move_cc 0 0 0 0 39 | checkr3 78134452 40 | 41 | moveq 0,r3 42 | andq -14,r3 43 | test_move_cc 0 1 0 0 44 | checkr3 0 45 | 46 | quit 47 | -------------------------------------------------------------------------------- /QEMU/tests/cris/check_clearfv32.s: -------------------------------------------------------------------------------- 1 | # mach: crisv32 2 | # output: ef\nef\n 3 | 4 | ; Check that "clearf x" doesn't trivially fail. 5 | 6 | .include "testutils.inc" 7 | start 8 | setf puixnzvc 9 | clearf x ; Actually, x would be cleared by almost-all other insns. 10 | move ccs,r3 11 | and.d 0xff, $r3 12 | checkr3 ef 13 | 14 | setf puixnzvc 15 | moveq 0, $r3 ; moveq should only clear the xflag. 16 | move ccs,r3 17 | and.d 0xff, $r3 18 | checkr3 ef 19 | quit 20 | -------------------------------------------------------------------------------- /QEMU/tests/cris/check_clrjmp1.s: -------------------------------------------------------------------------------- 1 | # mach: crisv3 crisv8 crisv10 crisv32 2 | # output: ffffff00\n 3 | 4 | ; A bug resulting in a non-effectual clear.b discovered running the GCC 5 | ; testsuite; jump actually wrote to p0. 6 | 7 | .include "testutils.inc" 8 | 9 | start 10 | jump 1f 11 | nop 12 | .p2align 8 13 | 1: 14 | move.d y,r4 15 | 16 | .if 0 ;0 == ..asm.arch.cris.v32 17 | ; There was a bug causing this insn to set special register p0 18 | ; (byte-clear) to 8 (low 8 bits of location after insn). 19 | jump [r4+] 20 | .endif 21 | 22 | 1: 23 | move.d 0f,r4 24 | 25 | ; The corresponding bug would cause this insn too, to set p0. 26 | jump r4 27 | nop 28 | quit 29 | 0: 30 | moveq -1,r3 31 | clear.b r3 32 | checkr3 ffffff00 33 | quit 34 | 35 | y: 36 | .dword 1b 37 | -------------------------------------------------------------------------------- /QEMU/tests/cris/check_cmp-2.s: -------------------------------------------------------------------------------- 1 | 2 | 3 | .include "testutils.inc" 4 | 5 | start 6 | 7 | move.d 4294967283, $r0 8 | move.d $r0, $r10 9 | cmp.d $r0, $r10 10 | beq 1f 11 | move.d $r10, $r3 12 | fail 13 | 1: 14 | pass 15 | quit 16 | -------------------------------------------------------------------------------- /QEMU/tests/cris/check_dstep.s: -------------------------------------------------------------------------------- 1 | # mach: crisv0 crisv3 crisv8 crisv10 crisv32 2 | # output: fffffffc\n4\nffff\nfffffffe\n9bf3911b\n0\n 3 | 4 | .include "testutils.inc" 5 | start 6 | moveq -1,r3 7 | moveq 2,r4 8 | dstep r4,r3 9 | test_move_cc 1 0 0 0 10 | checkr3 fffffffc 11 | 12 | moveq 2,r3 13 | moveq -1,r4 14 | dstep r4,r3 15 | test_move_cc 0 0 0 0 16 | checkr3 4 17 | 18 | move.d 0xffff,r4 19 | move.d r4,r3 20 | dstep r4,r3 21 | test_move_cc 0 0 0 0 22 | checkr3 ffff 23 | 24 | moveq -1,r4 25 | move.d r4,r3 26 | dstep r4,r3 27 | test_move_cc 1 0 0 0 28 | checkr3 fffffffe 29 | 30 | move.d 0x5432f789,r4 31 | move.d 0x78134452,r3 32 | dstep r4,r3 33 | test_move_cc 1 0 0 0 34 | checkr3 9bf3911b 35 | 36 | move.d 0xffff,r3 37 | move.d 0x1fffe,r4 38 | dstep r4,r3 39 | test_move_cc 0 1 0 0 40 | checkr3 0 41 | 42 | quit 43 | -------------------------------------------------------------------------------- /QEMU/tests/cris/check_ftag.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include "sys.h" 5 | #include "crisutils.h" 6 | 7 | extern inline void cris_ftag_i(unsigned int x) { 8 | register unsigned int v asm("$r10") = x; 9 | asm ("ftagi\t[%0]\n" : : "r" (v) ); 10 | } 11 | extern inline void cris_ftag_d(unsigned int x) { 12 | register unsigned int v asm("$r10") = x; 13 | asm ("ftagd\t[%0]\n" : : "r" (v) ); 14 | } 15 | extern inline void cris_fidx_i(unsigned int x) { 16 | register unsigned int v asm("$r10") = x; 17 | asm ("fidxi\t[%0]\n" : : "r" (v) ); 18 | } 19 | extern inline void cris_fidx_d(unsigned int x) { 20 | register unsigned int v asm("$r10") = x; 21 | asm ("fidxd\t[%0]\n" : : "r" (v) ); 22 | } 23 | 24 | 25 | int main(void) 26 | { 27 | cris_ftag_i(0); 28 | cris_ftag_d(0); 29 | cris_fidx_i(0); 30 | cris_fidx_d(0); 31 | pass(); 32 | return 0; 33 | } 34 | -------------------------------------------------------------------------------- /QEMU/tests/cris/check_gcctorture_pr28634-1.c: -------------------------------------------------------------------------------- 1 | /* PR rtl-optimization/28634. On targets with delayed branches, 2 | dbr_schedule could do the next iteration's addition in the 3 | branch delay slot, then subtract the value again if the branch 4 | wasn't taken. This can lead to rounding errors. */ 5 | int x = -1; 6 | int y = 1; 7 | int 8 | main (void) 9 | { 10 | while (y > 0) 11 | y += x; 12 | if (y != x + 1) 13 | abort (); 14 | exit (0); 15 | } 16 | -------------------------------------------------------------------------------- /QEMU/tests/cris/check_gcctorture_pr28634.c: -------------------------------------------------------------------------------- 1 | /* PR rtl-optimization/28634. On targets with delayed branches, 2 | dbr_schedule could do the next iteration's addition in the 3 | branch delay slot, then subtract the value again if the branch 4 | wasn't taken. This can lead to rounding errors. */ 5 | double x = -0x1.0p53; 6 | double y = 1; 7 | int 8 | main (void) 9 | { 10 | while (y > 0) 11 | y += x; 12 | if (y != x + 1) 13 | abort (); 14 | exit (0); 15 | } 16 | -------------------------------------------------------------------------------- /QEMU/tests/cris/check_hello.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | int main () 4 | { 5 | printf ("pass\n"); 6 | exit (0); 7 | } 8 | -------------------------------------------------------------------------------- /QEMU/tests/cris/check_int64.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include "sys.h" 5 | #include "crisutils.h" 6 | 7 | 8 | extern inline int64_t add64(const int64_t a, const int64_t b) { 9 | return a + b; 10 | } 11 | 12 | extern inline int64_t sub64(const int64_t a, const int64_t b) { 13 | return a - b; 14 | } 15 | 16 | int main(void) 17 | { 18 | int64_t a = 1; 19 | int64_t b = 2; 20 | 21 | /* FIXME: add some tests. */ 22 | a = add64(a, b); 23 | if (a != 3) 24 | err(); 25 | 26 | a = sub64(a, b); 27 | if (a != 1) 28 | err(); 29 | 30 | a = add64(a, -4); 31 | if (a != -3) 32 | err(); 33 | 34 | a = add64(a, 3); 35 | if (a != 0) 36 | err(); 37 | 38 | a = 0; 39 | a = sub64(a, 1); 40 | if (a != -1) 41 | err(); 42 | 43 | pass(); 44 | return 0; 45 | } 46 | -------------------------------------------------------------------------------- /QEMU/tests/cris/check_lapc.s: -------------------------------------------------------------------------------- 1 | # mach: crisv32 2 | # output: 0\n0\nfffffffa\nfffffffe\nffffffda\n1e\n1e\n0\n 3 | 4 | .include "testutils.inc" 5 | 6 | ; To accommodate dumpr3 with more than one instruction, keep it 7 | ; out of lapc operand ranges and difference calculations. 8 | 9 | start 10 | lapc.d 0f,r3 11 | 0: 12 | sub.d .,r3 13 | checkr3 0 14 | 15 | lapcq 0f,r3 16 | 0: 17 | sub.d .,r3 18 | checkr3 0 19 | 20 | lapc.d .,r3 21 | sub.d .,r3 22 | checkr3 fffffffa 23 | 24 | lapcq .,r3 25 | sub.d .,r3 26 | checkr3 fffffffe 27 | 28 | 0: 29 | .rept 16 30 | nop 31 | .endr 32 | lapc.d 0b,r3 33 | sub.d .,r3 34 | checkr3 ffffffda 35 | 36 | setf zcvn 37 | lapc.d 0f,r3 38 | test_cc 1 1 1 1 39 | sub.d .,r3 40 | nop 41 | nop 42 | nop 43 | nop 44 | nop 45 | nop 46 | nop 47 | nop 48 | nop 49 | nop 50 | nop 51 | nop 52 | 0: 53 | checkr3 1e 54 | 0: 55 | lapcq 0f,r3 56 | sub.d 0b,r3 57 | nop 58 | nop 59 | nop 60 | nop 61 | nop 62 | nop 63 | nop 64 | nop 65 | nop 66 | nop 67 | nop 68 | 0: 69 | checkr3 1e 70 | clearf cn 71 | setf zv 72 | 1: 73 | lapcq .,r3 74 | test_cc 0 1 1 0 75 | sub.d 1b,r3 76 | checkr3 0 77 | 78 | quit 79 | -------------------------------------------------------------------------------- /QEMU/tests/cris/check_lz.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include "sys.h" 5 | 6 | extern inline int cris_lz(int x) 7 | { 8 | int r; 9 | asm ("lz\t%1, %0\n" : "=r" (r) : "r" (x)); 10 | return r; 11 | } 12 | 13 | void check_lz(void) 14 | { 15 | int i; 16 | 17 | if (cris_lz(0) != 32) 18 | err(); 19 | if (cris_lz(1) != 31) 20 | err(); 21 | if (cris_lz(2) != 30) 22 | err(); 23 | if (cris_lz(4) != 29) 24 | err(); 25 | if (cris_lz(8) != 28) 26 | err(); 27 | 28 | /* try all positions with a single bit. */ 29 | for (i = 1; i < 32; i++) { 30 | if (cris_lz(1 << (i-1)) != (32 - i)) 31 | err(); 32 | } 33 | 34 | /* try all positions with all bits. */ 35 | for (i = 1; i < 32; i++) { 36 | /* split up this computation to clarify it. */ 37 | uint32_t val; 38 | val = (unsigned int)-1 >> (32 - i); 39 | if (cris_lz(val) != (32 - i)) 40 | err(); 41 | } 42 | } 43 | 44 | int main(void) 45 | { 46 | check_lz(); 47 | pass(); 48 | exit(0); 49 | } 50 | -------------------------------------------------------------------------------- /QEMU/tests/cris/check_mapbrk.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | /* Basic sanity check that syscalls to implement malloc (brk, mmap2, 5 | munmap) are trivially functional. */ 6 | 7 | int main () 8 | { 9 | void *p1, *p2, *p3, *p4, *p5, *p6; 10 | 11 | if ((p1 = malloc (8100)) == NULL 12 | || (p2 = malloc (16300)) == NULL 13 | || (p3 = malloc (4000)) == NULL 14 | || (p4 = malloc (500)) == NULL 15 | || (p5 = malloc (1023*1024)) == NULL 16 | || (p6 = malloc (8191*1024)) == NULL) 17 | { 18 | printf ("fail\n"); 19 | exit (1); 20 | } 21 | 22 | free (p1); 23 | free (p2); 24 | free (p3); 25 | free (p4); 26 | free (p5); 27 | free (p6); 28 | 29 | p1 = malloc (64000); 30 | if (p1 == NULL) 31 | { 32 | printf ("fail\n"); 33 | exit (1); 34 | } 35 | free (p1); 36 | 37 | printf ("pass\n"); 38 | exit (0); 39 | } 40 | -------------------------------------------------------------------------------- /QEMU/tests/cris/check_mcp.s: -------------------------------------------------------------------------------- 1 | # mach: crisv32 2 | # output: fffffffe\n1\n1ffff\nfffffffe\ncc463bdc\n4c463bdc\n0\n 3 | 4 | .include "testutils.inc" 5 | start 6 | 7 | ; Set R, clear C. 8 | move 0x100,ccs 9 | moveq -5,r3 10 | move 2,mof 11 | mcp mof,r3 12 | test_cc 1 0 0 0 13 | checkr3 fffffffe 14 | 15 | moveq 2,r3 16 | move -1,srp 17 | mcp srp,r3 18 | test_cc 0 0 0 0 19 | checkr3 1 20 | 21 | move 0xffff,srp 22 | move srp,r3 23 | mcp srp,r3 24 | test_cc 0 0 0 0 25 | checkr3 1ffff 26 | 27 | move -1,mof 28 | move mof,r3 29 | mcp mof,r3 30 | test_cc 1 0 0 0 31 | checkr3 fffffffe 32 | 33 | move 0x5432f789,mof 34 | move.d 0x78134452,r3 35 | mcp mof,r3 36 | test_cc 1 0 1 0 37 | checkr3 cc463bdc 38 | 39 | move 0x80000000,srp 40 | mcp srp,r3 41 | test_cc 0 0 1 0 42 | checkr3 4c463bdc 43 | 44 | move 0xb3b9c423,srp 45 | mcp srp,r3 46 | test_cc 0 1 0 0 47 | checkr3 0 48 | 49 | quit 50 | -------------------------------------------------------------------------------- /QEMU/tests/cris/check_mmap1.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 | #include 14 | 15 | int main (int argc, char *argv[]) 16 | { 17 | int fd = open (argv[0], O_RDONLY); 18 | struct stat sb; 19 | int size; 20 | void *a; 21 | const char *str = "a string you'll only find in the program"; 22 | 23 | if (fd == -1) 24 | { 25 | perror ("open"); 26 | abort (); 27 | } 28 | 29 | if (fstat (fd, &sb) < 0) 30 | { 31 | perror ("fstat"); 32 | abort (); 33 | } 34 | 35 | size = sb.st_size; 36 | 37 | /* We want to test mmapping a size that isn't exactly a page. */ 38 | if ((size & 8191) == 0) 39 | size--; 40 | 41 | a = mmap (NULL, size, PROT_READ, MAP_PRIVATE, fd, 0); 42 | 43 | if (memmem (a, size, str, strlen (str) + 1) == NULL) 44 | abort (); 45 | 46 | printf ("pass\n"); 47 | exit (0); 48 | } 49 | -------------------------------------------------------------------------------- /QEMU/tests/cris/check_mmap2.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 | #include 14 | 15 | int main (int argc, char *argv[]) 16 | { 17 | int fd = open (argv[0], O_RDONLY); 18 | struct stat sb; 19 | int size; 20 | void *a; 21 | const char *str = "a string you'll only find in the program"; 22 | 23 | if (fd == -1) 24 | { 25 | perror ("open"); 26 | abort (); 27 | } 28 | 29 | if (fstat (fd, &sb) < 0) 30 | { 31 | perror ("fstat"); 32 | abort (); 33 | } 34 | 35 | size = sb.st_size; 36 | 37 | /* We want to test mmapping a size that isn't exactly a page. */ 38 | if ((size & 8191) == 0) 39 | size--; 40 | 41 | a = mmap (NULL, size, PROT_READ, MAP_SHARED, fd, 0); 42 | 43 | if (memmem (a, size, str, strlen (str) + 1) == NULL) 44 | abort (); 45 | 46 | printf ("pass\n"); 47 | exit (0); 48 | } 49 | -------------------------------------------------------------------------------- /QEMU/tests/cris/check_mmap3.c: -------------------------------------------------------------------------------- 1 | /* 2 | #notarget: cris*-*-elf 3 | */ 4 | 5 | #define _GNU_SOURCE 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | int main (int argc, char *argv[]) 15 | { 16 | volatile unsigned char *a; 17 | 18 | /* Check that we can map a non-multiple of a page and still get a full page. */ 19 | a = mmap (NULL, 0x4c, PROT_READ | PROT_WRITE | PROT_EXEC, 20 | MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); 21 | if (a == NULL || a == (unsigned char *) -1) 22 | abort (); 23 | 24 | a[0] = 0xbe; 25 | a[8191] = 0xef; 26 | memset ((char *) a + 1, 0, 8190); 27 | 28 | if (a[0] != 0xbe || a[8191] != 0xef) 29 | abort (); 30 | 31 | printf ("pass\n"); 32 | exit (0); 33 | } 34 | -------------------------------------------------------------------------------- /QEMU/tests/cris/check_movdelsr1.s: -------------------------------------------------------------------------------- 1 | # mach: crisv0 crisv3 crisv8 crisv10 crisv32 2 | # output: aa117acd\n 3 | # output: eeaabb42\n 4 | 5 | ; Bug with move to special register in delay slot, due to 6 | ; special flush-insn-cache simulator use. Ordinary move worked; 7 | ; special register caused branch to fail. 8 | 9 | .include "testutils.inc" 10 | start 11 | move -1,srp 12 | 13 | move.d 0xaa117acd,r1 14 | moveq 3,r9 15 | cmpq 1,r9 16 | bhi 0f 17 | move.d r1,r3 18 | 19 | fail 20 | 0: 21 | checkr3 aa117acd 22 | 23 | move.d 0xeeaabb42,r1 24 | moveq 3,r9 25 | cmpq 1,r9 26 | bhi 0f 27 | move r1,srp 28 | 29 | fail 30 | 0: 31 | move srp,r3 32 | checkr3 eeaabb42 33 | quit 34 | -------------------------------------------------------------------------------- /QEMU/tests/cris/check_movecr.s: -------------------------------------------------------------------------------- 1 | # mach: crisv3 crisv8 crisv10 crisv32 2 | # output: ffffff42\n94\nffff4321\n9234\n76543210\n76540000\n 3 | 4 | ; Move constant byte, word, dword to register. Check that no extension is 5 | ; performed, that only part of the register is set. 6 | 7 | .include "testutils.inc" 8 | startnostack 9 | moveq -1,r3 10 | move.b 0x42,r3 11 | test_move_cc 0 0 0 0 12 | checkr3 ffffff42 13 | 14 | moveq 0,r3 15 | move.b 0x94,r3 16 | test_move_cc 1 0 0 0 17 | checkr3 94 18 | 19 | moveq -1,r3 20 | move.w 0x4321,r3 21 | test_move_cc 0 0 0 0 22 | checkr3 ffff4321 23 | 24 | moveq 0,r3 25 | move.w 0x9234,r3 26 | test_move_cc 1 0 0 0 27 | checkr3 9234 28 | 29 | move.d 0x76543210,r3 30 | test_move_cc 0 0 0 0 31 | checkr3 76543210 32 | 33 | move.w 0,r3 34 | test_move_cc 0 1 0 0 35 | checkr3 76540000 36 | 37 | quit 38 | -------------------------------------------------------------------------------- /QEMU/tests/cris/check_movei.s: -------------------------------------------------------------------------------- 1 | # mach: crisv32 2 | # output: fffffffe\n 3 | # output: fffffffe\n 4 | 5 | ; Check basic integral-write semantics regarding flags. 6 | 7 | .include "testutils.inc" 8 | start 9 | 10 | move.d 0, $r3 11 | ; A write that works. Check that flags are set correspondingly. 12 | move.d d,r4 13 | ;; store to bring it into the tlb with the right prot bits 14 | move.d r3,[r4] 15 | moveq -2,r5 16 | setf c 17 | clearf p 18 | move.d [r4],r3 19 | ax 20 | move.d r5,[r4] 21 | move.d [r4],r3 22 | 23 | bcc 0f 24 | nop 25 | fail 26 | 27 | 0: 28 | checkr3 fffffffe 29 | 30 | ; A write that fails; check flags too. 31 | move.d d,r4 32 | moveq 23,r5 33 | setf p 34 | clearf c 35 | move.d [r4],r3 36 | ax 37 | move.d r5,[r4] 38 | move.d [r4],r3 39 | 40 | bcs 0f 41 | nop 42 | fail 43 | 44 | 0: 45 | checkr3 fffffffe 46 | quit 47 | 48 | .data 49 | d: 50 | .dword 42424242 51 | -------------------------------------------------------------------------------- /QEMU/tests/cris/check_moveq.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include "sys.h" 5 | #include "crisutils.h" 6 | 7 | #define cris_moveq(dst, src) \ 8 | asm volatile ("moveq %1, %0\n" : "=r" (dst) : "i" (src)); 9 | 10 | 11 | 12 | int main(void) 13 | { 14 | int t; 15 | 16 | cris_tst_cc_init(); 17 | asm volatile ("setf\tzvnc\n"); 18 | cris_moveq(t, 10); 19 | cris_tst_cc(1, 1, 1, 1); 20 | if (t != 10) 21 | err(); 22 | 23 | /* make sure moveq doesnt clobber the zflag. */ 24 | cris_tst_cc_init(); 25 | asm volatile ("setf vnc\n"); 26 | asm volatile ("clearf z\n"); 27 | cris_moveq(t, 0); 28 | cris_tst_cc(1, 0, 1, 1); 29 | if (t != 0) 30 | err(); 31 | 32 | /* make sure moveq doesnt clobber the nflag. 33 | Also check large immediates */ 34 | cris_tst_cc_init(); 35 | asm volatile ("setf zvc\n"); 36 | asm volatile ("clearf n\n"); 37 | cris_moveq(t, -31); 38 | cris_tst_cc(0, 1, 1, 1); 39 | if (t != -31) 40 | err(); 41 | 42 | cris_tst_cc_init(); 43 | asm volatile ("setf nzvc\n"); 44 | cris_moveq(t, 31); 45 | cris_tst_cc(1, 1, 1, 1); 46 | if (t != 31) 47 | err(); 48 | 49 | pass(); 50 | return 0; 51 | } 52 | -------------------------------------------------------------------------------- /QEMU/tests/cris/check_mover.s: -------------------------------------------------------------------------------- 1 | # mach: crisv3 crisv8 crisv10 crisv32 2 | # output: ffffff05\nffff0005\n5\nffffff00\n 3 | 4 | ; Move between registers. Check that just the subreg is copied. 5 | 6 | .include "testutils.inc" 7 | startnostack 8 | moveq -30,r3 9 | moveq 5,r4 10 | move.b r4,r3 11 | test_move_cc 0 0 0 0 ; FIXME 12 | checkr3 ffffff05 13 | 14 | move.w r4,r3 15 | test_move_cc 0 0 0 0 16 | checkr3 ffff0005 17 | 18 | move.d r4,r3 19 | test_move_cc 0 0 0 0 20 | checkr3 5 21 | 22 | moveq -1,r3 23 | moveq 0,r4 24 | move.b r4,r3 25 | test_move_cc 0 1 0 0 26 | checkr3 ffffff00 27 | 28 | quit 29 | -------------------------------------------------------------------------------- /QEMU/tests/cris/check_moverm.s: -------------------------------------------------------------------------------- 1 | # mach: crisv3 crisv8 crisv10 crisv32 2 | # output: 7823fec2\n10231879\n102318fe\n 3 | 4 | .include "testutils.inc" 5 | start 6 | 7 | .data 8 | mem1: 9 | .dword 0x12345678 10 | mem2: 11 | .word 0x4567 12 | mem3: 13 | .byte 0x23 14 | .dword 0x76543210 15 | .byte 0xaa,0x11,0x99 16 | 17 | .text 18 | move.d mem1,r2 19 | move.d 0x7823fec2,r4 20 | setf nzvc 21 | move.d r4,[r2+] 22 | test_cc 1 1 1 1 23 | subq 4,r2 24 | move.d [r2],r3 25 | checkr3 7823fec2 26 | 27 | move.d mem2,r3 28 | move.d 0x45231879,r4 29 | clearf nzvc 30 | move.w r4,[r3] 31 | test_cc 0 0 0 0 32 | move.d [r3],r3 33 | checkr3 10231879 34 | 35 | move.d mem2,r2 36 | moveq -2,r4 37 | clearf nc 38 | setf zv 39 | move.b r4,[r2+] 40 | test_cc 0 1 1 0 41 | subq 1,r2 42 | move.d [r2],r3 43 | checkr3 102318fe 44 | 45 | quit 46 | -------------------------------------------------------------------------------- /QEMU/tests/cris/check_movpmv32.s: -------------------------------------------------------------------------------- 1 | # mach: crisv32 2 | # output: 11223320\nbb113344\naa557711\n 3 | 4 | # Test v32-specific special registers. FIXME: more registers. 5 | 6 | .include "testutils.inc" 7 | start 8 | .data 9 | store: 10 | .dword 0x11223344 11 | .dword 0x77665544 12 | 13 | .text 14 | moveq -1,r3 15 | move.d store,r4 16 | move vr,[r4] 17 | move [r4+],mof 18 | move mof,r3 19 | checkr3 11223320 20 | 21 | moveq -1,r3 22 | clearf zcvn 23 | move 0xbb113344,mof 24 | test_cc 0 0 0 0 25 | move mof,r3 26 | checkr3 bb113344 27 | 28 | setf zcvn 29 | move 0xaa557711,mof 30 | test_cc 1 1 1 1 31 | move mof,[r4] 32 | move.d [r4],r3 33 | checkr3 aa557711 34 | 35 | quit 36 | -------------------------------------------------------------------------------- /QEMU/tests/cris/check_movpr.s: -------------------------------------------------------------------------------- 1 | # mach: crisv3 crisv8 crisv10 crisv32 2 | # output: ffffff00\nffff0000\n0\nbb113344\n 3 | 4 | # Test generic "move Ps,Rd" and "move Rs,Pd" insns; the ones with 5 | # functionality common to all models. 6 | 7 | .include "testutils.inc" 8 | start 9 | moveq -1,r3 10 | clear.b r3 11 | checkr3 ffffff00 12 | 13 | moveq -1,r3 14 | clear.w r3 15 | checkr3 ffff0000 16 | 17 | moveq -1,r3 18 | clear.d r3 19 | checkr3 0 20 | 21 | moveq -1,r3 22 | move.d 0xbb113344,r4 23 | setf zcvn 24 | move r4,srp 25 | move srp,r3 26 | test_cc 1 1 1 1 27 | checkr3 bb113344 28 | quit 29 | -------------------------------------------------------------------------------- /QEMU/tests/cris/check_movprv32.s: -------------------------------------------------------------------------------- 1 | # mach: crisv32 2 | # output: ffffff20\nbb113344\n 3 | 4 | # Test v32-specific special registers. FIXME: more registers. 5 | 6 | .include "testutils.inc" 7 | start 8 | moveq -1,r3 9 | setf zcvn 10 | move vr,r3 11 | test_cc 1 1 1 1 12 | checkr3 ffffff20 13 | 14 | moveq -1,r3 15 | move.d 0xbb113344,r4 16 | clearf cvnz 17 | move r4,mof 18 | test_cc 0 0 0 0 19 | move mof,r3 20 | checkr3 bb113344 21 | quit 22 | -------------------------------------------------------------------------------- /QEMU/tests/cris/check_movscr.s: -------------------------------------------------------------------------------- 1 | # mach: crisv3 crisv8 crisv10 crisv32 2 | # output: 42\nffffff85\n7685\nffff8765\n0\n 3 | 4 | ; Move constant byte, word, dword to register. Check that sign-extension 5 | ; is performed. 6 | 7 | .include "testutils.inc" 8 | start 9 | moveq -1,r3 10 | movs.b 0x42,r3 11 | checkr3 42 12 | 13 | movs.b 0x85,r3 14 | test_move_cc 1 0 0 0 15 | checkr3 ffffff85 16 | 17 | movs.w 0x7685,r3 18 | test_move_cc 0 0 0 0 19 | checkr3 7685 20 | 21 | movs.w 0x8765,r3 22 | test_move_cc 1 0 0 0 23 | checkr3 ffff8765 24 | 25 | movs.w 0,r3 26 | test_move_cc 0 1 0 0 27 | checkr3 0 28 | 29 | quit 30 | -------------------------------------------------------------------------------- /QEMU/tests/cris/check_movsm.s: -------------------------------------------------------------------------------- 1 | # mach: crisv3 crisv8 crisv10 crisv32 2 | # output: 5\nfffffff5\n5\nfffffff5\n0\n 3 | 4 | ; Movs between registers. Check that sign-extension is performed and the 5 | ; full register is set. 6 | 7 | .include "testutils.inc" 8 | 9 | .data 10 | x: 11 | .byte 5,-11 12 | .word 5,-11 13 | .word 0 14 | 15 | start 16 | move.d x,r5 17 | 18 | moveq -1,r3 19 | movs.b [r5+],r3 20 | test_move_cc 0 0 0 0 21 | checkr3 5 22 | 23 | moveq 0,r3 24 | movs.b [r5],r3 25 | test_move_cc 1 0 0 0 26 | addq 1,r5 27 | checkr3 fffffff5 28 | 29 | moveq -1,r3 30 | movs.w [r5+],r3 31 | test_move_cc 0 0 0 0 32 | checkr3 5 33 | 34 | moveq 0,r3 35 | movs.w [r5],r3 36 | test_move_cc 1 0 0 0 37 | addq 2,r5 38 | checkr3 fffffff5 39 | 40 | movs.w [r5],r3 41 | test_move_cc 0 1 0 0 42 | checkr3 0 43 | 44 | quit 45 | -------------------------------------------------------------------------------- /QEMU/tests/cris/check_movsr.s: -------------------------------------------------------------------------------- 1 | # mach: crisv3 crisv8 crisv10 crisv32 2 | # output: 5\nfffffff5\n5\nfffffff5\n0\n 3 | 4 | ; Movs between registers. Check that sign-extension is performed and the 5 | ; full register is set. 6 | 7 | .include "testutils.inc" 8 | start 9 | moveq -1,r5 10 | moveq 5,r4 11 | move.b r4,r5 12 | moveq -1,r3 13 | movs.b r5,r3 14 | test_move_cc 0 0 0 0 15 | checkr3 5 16 | 17 | moveq 0,r5 18 | moveq -11,r4 19 | move.b r4,r5 20 | moveq 0,r3 21 | movs.b r5,r3 22 | test_move_cc 1 0 0 0 23 | checkr3 fffffff5 24 | 25 | moveq -1,r5 26 | moveq 5,r4 27 | move.w r4,r5 28 | moveq -1,r3 29 | movs.w r5,r3 30 | test_move_cc 0 0 0 0 31 | checkr3 5 32 | 33 | moveq 0,r5 34 | moveq -11,r4 35 | move.w r4,r5 36 | moveq 0,r3 37 | movs.w r5,r3 38 | test_move_cc 1 0 0 0 39 | checkr3 fffffff5 40 | 41 | moveq 0,r5 42 | movs.b r5,r3 43 | test_move_cc 0 1 0 0 44 | checkr3 0 45 | 46 | quit 47 | -------------------------------------------------------------------------------- /QEMU/tests/cris/check_movucr.s: -------------------------------------------------------------------------------- 1 | # mach: crisv3 crisv8 crisv10 crisv32 2 | # output: 42\n85\n7685\n8765\n0\n 3 | 4 | ; Move constant byte, word, dword to register. Check that zero-extension 5 | ; is performed. 6 | 7 | .include "testutils.inc" 8 | start 9 | moveq -1,r3 10 | movu.b 0x42,r3 11 | test_move_cc 0 0 0 0 12 | checkr3 42 13 | 14 | moveq -1,r3 15 | movu.b 0x85,r3 16 | test_move_cc 0 0 0 0 17 | checkr3 85 18 | 19 | moveq -1,r3 20 | movu.w 0x7685,r3 21 | test_move_cc 0 0 0 0 22 | checkr3 7685 23 | 24 | moveq -1,r3 25 | movu.w 0x8765,r3 26 | test_move_cc 0 0 0 0 27 | checkr3 8765 28 | 29 | movu.b 0,r3 30 | test_move_cc 0 1 0 0 31 | checkr3 0 32 | 33 | quit 34 | -------------------------------------------------------------------------------- /QEMU/tests/cris/check_movum.s: -------------------------------------------------------------------------------- 1 | # mach: crisv3 crisv8 crisv10 crisv32 2 | # output: 5\nf5\n5\nfff5\n0\n 3 | 4 | ; Movu between registers. Check that zero-extension is performed and the 5 | ; full register is set. 6 | 7 | .include "testutils.inc" 8 | 9 | .data 10 | x: 11 | .byte 5,-11 12 | .word 5,-11 13 | .word 0 14 | 15 | start 16 | move.d x,r5 17 | 18 | movu.b [r5+],r3 19 | test_move_cc 0 0 0 0 20 | checkr3 5 21 | 22 | movu.b [r5],r3 23 | test_move_cc 0 0 0 0 24 | addq 1,r5 25 | checkr3 f5 26 | 27 | movu.w [r5+],r3 28 | test_move_cc 0 0 0 0 29 | checkr3 5 30 | 31 | movu.w [r5],r3 32 | test_move_cc 0 0 0 0 33 | addq 2,r5 34 | checkr3 fff5 35 | 36 | movu.w [r5],r3 37 | test_move_cc 0 1 0 0 38 | checkr3 0 39 | 40 | quit 41 | -------------------------------------------------------------------------------- /QEMU/tests/cris/check_movur.s: -------------------------------------------------------------------------------- 1 | # mach: crisv3 crisv8 crisv10 crisv32 2 | # output: 5\nf5\n5\nfff5\n0\n 3 | 4 | ; Movu between registers. Check that zero-extension is performed and the 5 | ; full register is set. 6 | 7 | .include "testutils.inc" 8 | start 9 | moveq -1,r5 10 | moveq 5,r4 11 | move.b r4,r5 12 | moveq -1,r3 13 | movu.b r5,r3 14 | test_move_cc 0 0 0 0 15 | checkr3 5 16 | 17 | moveq 0,r5 18 | moveq -11,r4 19 | move.b r4,r5 20 | moveq -1,r3 21 | movu.b r5,r3 22 | test_move_cc 0 0 0 0 23 | checkr3 f5 24 | 25 | moveq -1,r5 26 | moveq 5,r4 27 | move.w r4,r5 28 | moveq -1,r3 29 | movu.w r5,r3 30 | test_move_cc 0 0 0 0 31 | checkr3 5 32 | 33 | moveq 0,r5 34 | moveq -11,r4 35 | move.w r4,r5 36 | moveq -1,r3 37 | movu.w r5,r3 38 | test_move_cc 0 0 0 0 39 | checkr3 fff5 40 | 41 | movu.w 0,r3 42 | test_move_cc 0 1 0 0 43 | checkr3 0 44 | 45 | quit 46 | -------------------------------------------------------------------------------- /QEMU/tests/cris/check_mulv32.s: -------------------------------------------------------------------------------- 1 | # mach: crisv32 2 | # output: fffffffe\n 3 | # output: ffffffff\n 4 | # output: fffffffe\n 5 | # output: 1\n 6 | # output: fffffffe\n 7 | # output: ffffffff\n 8 | # output: fffffffe\n 9 | # output: 1\n 10 | 11 | ; Check that carry is not modified on v32. 12 | 13 | .include "testutils.inc" 14 | start 15 | moveq -1,r3 16 | moveq 2,r4 17 | setf c 18 | muls.d r4,r3 19 | test_cc 1 0 0 1 20 | checkr3 fffffffe 21 | move mof,r3 22 | checkr3 ffffffff 23 | 24 | moveq -1,r3 25 | moveq 2,r4 26 | setf c 27 | mulu.d r4,r3 28 | test_cc 0 0 1 1 29 | checkr3 fffffffe 30 | move mof,r3 31 | checkr3 1 32 | 33 | moveq -1,r3 34 | moveq 2,r4 35 | clearf c 36 | muls.d r4,r3 37 | test_cc 1 0 0 0 38 | checkr3 fffffffe 39 | move mof,r3 40 | checkr3 ffffffff 41 | 42 | moveq -1,r3 43 | moveq 2,r4 44 | clearf c 45 | mulu.d r4,r3 46 | test_cc 0 0 1 0 47 | checkr3 fffffffe 48 | move mof,r3 49 | checkr3 1 50 | 51 | quit 52 | -------------------------------------------------------------------------------- /QEMU/tests/cris/check_not.s: -------------------------------------------------------------------------------- 1 | # mach: crisv0 crisv3 crisv8 crisv10 crisv32 2 | # output: fffffffe\nfffffffd\nffff0f00\n0\n87ecbbad\n 3 | 4 | .include "testutils.inc" 5 | start 6 | moveq 1,r3 7 | not r3 8 | test_move_cc 1 0 0 0 9 | checkr3 fffffffe 10 | 11 | moveq 2,r3 12 | not r3 13 | test_move_cc 1 0 0 0 14 | checkr3 fffffffd 15 | 16 | move.d 0xf0ff,r3 17 | not r3 18 | test_move_cc 1 0 0 0 19 | checkr3 ffff0f00 20 | 21 | moveq -1,r3 22 | not r3 23 | test_move_cc 0 1 0 0 24 | checkr3 0 25 | 26 | move.d 0x78134452,r3 27 | not r3 28 | test_move_cc 1 0 0 0 29 | checkr3 87ecbbad 30 | 31 | quit 32 | -------------------------------------------------------------------------------- /QEMU/tests/cris/check_openpf1.c: -------------------------------------------------------------------------------- 1 | /* Check that --sysroot is applied to open(2). 2 | #sim: --sysroot=@exedir@ 3 | 4 | We assume, with EXE being the name of the executable: 5 | - The simulator executes with cwd the same directory where the executable 6 | is located (so argv[0] contains a plain filename without directory 7 | components). 8 | - There's no /EXE on the host file system. */ 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | int main (int argc, char *argv[]) 15 | { 16 | char *fnam = argv[0]; 17 | FILE *f; 18 | if (argv[0][0] != '/') 19 | { 20 | fnam = malloc (strlen (argv[0]) + 2); 21 | if (fnam == NULL) 22 | abort (); 23 | strcpy (fnam, "/"); 24 | strcat (fnam, argv[0]); 25 | } 26 | 27 | f = fopen (fnam, "rb"); 28 | if (f == NULL) 29 | abort (); 30 | close (f); 31 | 32 | /* Cover another execution path. */ 33 | if (fopen ("/nonexistent", "rb") != NULL 34 | || errno != ENOENT) 35 | abort (); 36 | printf ("pass\n"); 37 | return 0; 38 | } 39 | -------------------------------------------------------------------------------- /QEMU/tests/cris/check_openpf2.c: -------------------------------------------------------------------------------- 1 | /* Check that the simulator has chdir:ed to the --sysroot argument 2 | #sim: --sysroot=@srcdir@ 3 | (or that --sysroot is applied to relative file paths). */ 4 | 5 | #include 6 | #include 7 | #include 8 | int main (int argc, char *argv[]) 9 | { 10 | FILE *f = fopen ("check_openpf2.c", "rb"); 11 | if (f == NULL) 12 | abort (); 13 | close (f); 14 | printf ("pass\n"); 15 | return 0; 16 | } 17 | -------------------------------------------------------------------------------- /QEMU/tests/cris/check_openpf3.c: -------------------------------------------------------------------------------- 1 | /* Basic file operations (rename, unlink); once without sysroot. We 2 | also test that the simulator has chdir:ed to PREFIX, when defined. */ 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | #ifndef PREFIX 12 | #define PREFIX 13 | #endif 14 | 15 | void err (const char *s) 16 | { 17 | perror (s); 18 | abort (); 19 | } 20 | 21 | int main (int argc, char *argv[]) 22 | { 23 | FILE *f; 24 | struct stat buf; 25 | 26 | unlink (PREFIX "testfoo2.tmp"); 27 | 28 | f = fopen ("testfoo1.tmp", "w"); 29 | if (f == NULL) 30 | err ("open"); 31 | fclose (f); 32 | 33 | if (rename (PREFIX "testfoo1.tmp", PREFIX "testfoo2.tmp") != 0) 34 | err ("rename"); 35 | 36 | if (stat (PREFIX "testfoo2.tmp", &buf) != 0 37 | || !S_ISREG (buf.st_mode)) 38 | err ("stat 1"); 39 | 40 | if (stat ("testfoo2.tmp", &buf) != 0 41 | || !S_ISREG (buf.st_mode)) 42 | err ("stat 2"); 43 | 44 | if (unlink (PREFIX "testfoo2.tmp") != 0) 45 | err ("unlink"); 46 | 47 | printf ("pass\n"); 48 | return 0; 49 | } 50 | -------------------------------------------------------------------------------- /QEMU/tests/cris/check_openpf4.c: -------------------------------------------------------------------------------- 1 | /* Basic file operations, now *with* sysroot. 2 | #sim: --sysroot=@exedir@ 3 | */ 4 | #define PREFIX "/" 5 | #include "check_openpf3.c" 6 | -------------------------------------------------------------------------------- /QEMU/tests/cris/check_orq.s: -------------------------------------------------------------------------------- 1 | # mach: crisv0 crisv3 crisv8 crisv10 crisv32 2 | # output: 3\n3\nffffffff\nffffffff\n1f\nffffffe0\n7813445e\n 3 | 4 | .include "testutils.inc" 5 | start 6 | moveq 1,r3 7 | orq 2,r3 8 | test_move_cc 0 0 0 0 9 | checkr3 3 10 | 11 | moveq 2,r3 12 | orq 1,r3 13 | test_move_cc 0 0 0 0 14 | checkr3 3 15 | 16 | move.d 0xf0ff,r3 17 | orq -1,r3 18 | test_move_cc 1 0 0 0 19 | checkr3 ffffffff 20 | 21 | moveq 0,r3 22 | orq -1,r3 23 | test_move_cc 1 0 0 0 24 | checkr3 ffffffff 25 | 26 | moveq 0,r3 27 | orq 31,r3 28 | test_move_cc 0 0 0 0 29 | checkr3 1f 30 | 31 | moveq 0,r3 32 | orq -32,r3 33 | test_move_cc 1 0 0 0 34 | checkr3 ffffffe0 35 | 36 | move.d 0x78134452,r3 37 | orq 12,r3 38 | test_move_cc 0 0 0 0 39 | checkr3 7813445e 40 | 41 | quit 42 | -------------------------------------------------------------------------------- /QEMU/tests/cris/check_ret.s: -------------------------------------------------------------------------------- 1 | # mach: crisv3 crisv8 crisv10 2 | # output: 3\n 3 | 4 | # Test that ret works. 5 | 6 | .include "testutils.inc" 7 | start 8 | x: 9 | moveq 0,r3 10 | jsr z 11 | w: 12 | quit 13 | y: 14 | addq 1,r3 15 | checkr3 3 16 | quit 17 | 18 | z: 19 | addq 1,r3 20 | move srp,r2 21 | add.d y-w,r2 22 | move r2,srp 23 | ret 24 | addq 1,r3 25 | quit 26 | -------------------------------------------------------------------------------- /QEMU/tests/cris/check_settls1.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | #include 7 | 8 | #ifndef SYS_set_thread_area 9 | #define SYS_set_thread_area 243 10 | #endif 11 | 12 | int main (void) 13 | { 14 | unsigned long tp; 15 | int ret; 16 | 17 | ret = syscall (SYS_set_thread_area, 0xf0); 18 | if (ret != -1 || errno != EINVAL) { 19 | perror ("Invalid thread area accepted:"); 20 | abort(); 21 | } 22 | 23 | ret = syscall (SYS_set_thread_area, 0xeddeed00); 24 | if (ret != 0) { 25 | perror ("Valid thread area not accepted: "); 26 | abort (); 27 | } 28 | 29 | asm ("move $pid,%0" : "=r" (tp)); 30 | tp &= ~0xff; 31 | 32 | if (tp != 0xeddeed00) { 33 | perror ("tls2"); 34 | abort (); 35 | } 36 | 37 | printf ("pass\n"); 38 | return EXIT_SUCCESS; 39 | } 40 | -------------------------------------------------------------------------------- /QEMU/tests/cris/check_sigalrm.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | #define MAGIC (0xdeadbeef) 7 | 8 | int s = 0; 9 | void sighandler(int sig) 10 | { 11 | s = MAGIC; 12 | } 13 | 14 | int main(int argc, char **argv) 15 | { 16 | int p; 17 | 18 | p = getpid(); 19 | signal(SIGALRM, sighandler); 20 | kill(p, SIGALRM); 21 | if (s != MAGIC) 22 | return EXIT_FAILURE; 23 | 24 | printf ("passed\n"); 25 | return EXIT_SUCCESS; 26 | } 27 | -------------------------------------------------------------------------------- /QEMU/tests/cris/check_stat1.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | int main (void) 8 | { 9 | struct stat buf; 10 | 11 | if (stat (".", &buf) != 0 12 | || !S_ISDIR (buf.st_mode)) 13 | abort (); 14 | printf ("pass\n"); 15 | exit (0); 16 | } 17 | -------------------------------------------------------------------------------- /QEMU/tests/cris/check_stat2.c: -------------------------------------------------------------------------------- 1 | /* 2 | #notarget: cris*-*-elf 3 | */ 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | int main (void) 12 | { 13 | struct stat buf; 14 | 15 | if (lstat (".", &buf) != 0 16 | || !S_ISDIR (buf.st_mode)) 17 | abort (); 18 | printf ("pass\n"); 19 | exit (0); 20 | } 21 | -------------------------------------------------------------------------------- /QEMU/tests/cris/check_stat3.c: -------------------------------------------------------------------------------- 1 | /* Simulator options: 2 | #sim: --sysroot=@exedir@ 3 | */ 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | int main (int argc, char *argv[]) 12 | { 13 | char path[1024] = "/"; 14 | struct stat buf; 15 | 16 | strcat (path, argv[0]); 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 | -------------------------------------------------------------------------------- /QEMU/tests/cris/check_stat4.c: -------------------------------------------------------------------------------- 1 | /* Simulator options: 2 | #notarget: cris*-*-elf 3 | #sim: --sysroot=@exedir@ 4 | */ 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | int main (int argc, char *argv[]) 14 | { 15 | char path[1024] = "/"; 16 | struct stat buf; 17 | 18 | strcat (path, argv[0]); 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 | -------------------------------------------------------------------------------- /QEMU/tests/cris/check_subq.s: -------------------------------------------------------------------------------- 1 | # mach: crisv3 crisv8 crisv10 crisv32 2 | # output: 0\nffffffff\nfffffffe\nffff\nff\n56788f9\n56788d9\n567889a\n0\n7ffffffc\n 3 | 4 | .include "testutils.inc" 5 | start 6 | moveq 1,r3 7 | subq 1,r3 8 | test_cc 0 1 0 0 9 | checkr3 0 10 | 11 | subq 1,r3 12 | test_cc 1 0 0 1 13 | checkr3 ffffffff 14 | 15 | subq 1,r3 16 | test_cc 1 0 0 0 17 | checkr3 fffffffe 18 | 19 | move.d 0x10000,r3 20 | subq 1,r3 21 | test_cc 0 0 0 0 22 | checkr3 ffff 23 | 24 | move.d 0x100,r3 25 | subq 1,r3 26 | test_cc 0 0 0 0 27 | checkr3 ff 28 | 29 | move.d 0x5678900,r3 30 | subq 7,r3 31 | test_cc 0 0 0 0 32 | checkr3 56788f9 33 | 34 | subq 32,r3 35 | test_cc 0 0 0 0 36 | checkr3 56788d9 37 | 38 | subq 63,r3 39 | test_cc 0 0 0 0 40 | checkr3 567889a 41 | 42 | move.d 34,r3 43 | subq 34,r3 44 | test_cc 0 1 0 0 45 | checkr3 0 46 | 47 | move.d 0x80000024,r3 48 | subq 40,r3 49 | test_cc 0 0 1 0 50 | checkr3 7ffffffc 51 | 52 | quit 53 | -------------------------------------------------------------------------------- /QEMU/tests/cris/check_time1.c: -------------------------------------------------------------------------------- 1 | /* Basic time functionality test: check that milliseconds are 2 | incremented for each syscall (does not work on host). */ 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | void err (const char *s) 10 | { 11 | perror (s); 12 | abort (); 13 | } 14 | 15 | int 16 | main (void) 17 | { 18 | struct timeval t_m = {0, 0}; 19 | struct timezone t_z = {0, 0}; 20 | struct timeval t_m1 = {0, 0}; 21 | int i; 22 | 23 | if (gettimeofday (&t_m, &t_z) != 0) 24 | err ("gettimeofday"); 25 | 26 | for (i = 1; i < 10000; i++) 27 | if (gettimeofday (&t_m1, NULL) != 0) 28 | err ("gettimeofday 1"); 29 | else 30 | if (t_m1.tv_sec * 1000000 + t_m1.tv_usec 31 | != (t_m.tv_sec * 1000000 + t_m.tv_usec + i * 1000)) 32 | { 33 | fprintf (stderr, "t0 (%ld, %ld), i %d, t1 (%ld, %ld)\n", 34 | t_m.tv_sec, t_m.tv_usec, i, t_m1.tv_sec, t_m1.tv_usec); 35 | abort (); 36 | } 37 | 38 | if (time (NULL) != t_m1.tv_sec) 39 | { 40 | fprintf (stderr, "time != gettod\n"); 41 | abort (); 42 | } 43 | 44 | printf ("pass\n"); 45 | exit (0); 46 | } 47 | -------------------------------------------------------------------------------- /QEMU/tests/cris/check_time2.c: -------------------------------------------------------------------------------- 1 | /* CB_SYS_time doesn't implement the Linux time syscall; the return 2 | value isn't written to the argument. */ 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | int 9 | main (void) 10 | { 11 | time_t x = (time_t) -1; 12 | time_t t = time (&x); 13 | 14 | if (t == (time_t) -1 || t != x) 15 | abort (); 16 | printf ("pass\n"); 17 | exit (0); 18 | } 19 | -------------------------------------------------------------------------------- /QEMU/tests/cris/check_xarith.s: -------------------------------------------------------------------------------- 1 | 2 | .include "testutils.inc" 3 | 4 | start 5 | 6 | moveq -1, $r0 7 | moveq 0, $r1 8 | addq 1, $r0 9 | ax 10 | addq 0, $r1 11 | 12 | move.d $r0, $r3 13 | checkr3 0 14 | move.d $r1, $r3 15 | checkr3 1 16 | 17 | move.d 0, $r0 18 | moveq -1, $r1 19 | subq 1, $r0 20 | ax 21 | subq 0, $r1 22 | 23 | move.d $r0, $r3 24 | checkr3 ffffffff 25 | move.d $r1, $r3 26 | checkr3 fffffffe 27 | 28 | 29 | moveq -1, $r0 30 | moveq -1, $r1 31 | cmpq -1, $r0 32 | ax 33 | cmpq -1, $r1 34 | beq 1f 35 | nop 36 | fail 37 | 1: 38 | cmpq 0, $r0 39 | ax 40 | cmpq -1, $r1 41 | bne 1f 42 | nop 43 | fail 44 | 1: 45 | 46 | ;; test for broken X sequence, run it several times. 47 | moveq 8, $r0 48 | 1: 49 | moveq 0, $r3 50 | move.d $r0, $r1 51 | andq 1, $r1 52 | lslq 4, $r1 53 | moveq 1, $r2 54 | or.d $r1, $r2 55 | ba 2f 56 | move $r2, $ccs 57 | 2: 58 | addq 0, $r3 59 | move.d $r0, $r4 60 | move.d $r1, $r5 61 | move.d $r2, $r6 62 | move.d $r3, $r7 63 | lsrq 4, $r1 64 | move.d $r1, $r8 65 | xor $r1, $r3 66 | checkr3 0 67 | subq 1, $r0 68 | bne 1b 69 | nop 70 | 71 | pass 72 | quit 73 | -------------------------------------------------------------------------------- /QEMU/tests/cris/crt.s: -------------------------------------------------------------------------------- 1 | .data 2 | _stack_start: 3 | .space 8192, 0 4 | _stack_end: 5 | .text 6 | .global _start 7 | _start: 8 | move.d _stack_end, $sp 9 | jsr main 10 | nop 11 | moveq 0, $r10 12 | jump exit 13 | nop 14 | -------------------------------------------------------------------------------- /QEMU/tests/cris/sys.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | static inline int mystrlen(char *s) { 6 | int i = 0; 7 | while (s[i]) 8 | i++; 9 | return i; 10 | } 11 | 12 | void pass(void) { 13 | char s[] = "passed.\n"; 14 | write (1, s, sizeof (s) - 1); 15 | exit (0); 16 | } 17 | 18 | void _fail(char *reason) { 19 | char s[] = "\nfailed: "; 20 | int len = mystrlen(reason); 21 | write (1, s, sizeof (s) - 1); 22 | write (1, reason, len); 23 | write (1, "\n", 1); 24 | // exit (1); 25 | } 26 | 27 | void *memset (void *s, int c, size_t n) { 28 | char *p = s; 29 | int i; 30 | for (i = 0; i < n; i++) 31 | p[i] = c; 32 | return p; 33 | } 34 | 35 | void exit (int status) { 36 | asm volatile ("moveq 1, $r9\n" /* NR_exit. */ 37 | "break 13\n"); 38 | while(1) 39 | ; 40 | } 41 | 42 | ssize_t write (int fd, const void *buf, size_t count) { 43 | int r; 44 | asm ("move.d %0, $r10\n" 45 | "move.d %1, $r11\n" 46 | "move.d %2, $r12\n" 47 | "moveq 4, $r9\n" /* NR_write. */ 48 | "break 13\n" : : "r" (fd), "r" (buf), "r" (count) : "memory"); 49 | asm ("move.d $r10, %0\n" : "=r" (r)); 50 | return r; 51 | } 52 | -------------------------------------------------------------------------------- /QEMU/tests/cris/sys.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #define STRINGIFY(x) #x 4 | #define TOSTRING(x) STRINGIFY(x) 5 | 6 | #define CURRENT_LOCATION __FILE__ ":" TOSTRING(__LINE__) 7 | 8 | #define err() \ 9 | { \ 10 | _fail("at " CURRENT_LOCATION " "); \ 11 | } 12 | 13 | #define mb() asm volatile ("" : : : "memory") 14 | 15 | extern void pass(void); 16 | extern void _fail(char *reason); 17 | -------------------------------------------------------------------------------- /QEMU/tests/hello-i386.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | extern 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 | extern 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 | -------------------------------------------------------------------------------- /QEMU/tests/pi_10.com: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ESOS-Lab/VSSIM/a119bee2aae5e10e52feb3eec3d05f973aee54d1/QEMU/tests/pi_10.com -------------------------------------------------------------------------------- /QEMU/tests/test-arm-iwmmxt.s: -------------------------------------------------------------------------------- 1 | @ Checks whether iwMMXt is functional. 2 | .code 32 3 | .globl main 4 | 5 | main: 6 | ldr r0, =data0 7 | ldr r1, =data1 8 | ldr r2, =data2 9 | #ifndef FPA 10 | wldrd wr0, [r0, #0] 11 | wldrd wr1, [r0, #8] 12 | wldrd wr2, [r1, #0] 13 | wldrd wr3, [r1, #8] 14 | wsubb wr2, wr2, wr0 15 | wsubb wr3, wr3, wr1 16 | wldrd wr0, [r2, #0] 17 | wldrd wr1, [r2, #8] 18 | waddb wr0, wr0, wr2 19 | waddb wr1, wr1, wr3 20 | wstrd wr0, [r2, #0] 21 | wstrd wr1, [r2, #8] 22 | #else 23 | ldfe f0, [r0, #0] 24 | ldfe f1, [r0, #8] 25 | ldfe f2, [r1, #0] 26 | ldfe f3, [r1, #8] 27 | adfdp f2, f2, f0 28 | adfdp f3, f3, f1 29 | ldfe f0, [r2, #0] 30 | ldfe f1, [r2, #8] 31 | adfd f0, f0, f2 32 | adfd f1, f1, f3 33 | stfe f0, [r2, #0] 34 | stfe f1, [r2, #8] 35 | #endif 36 | mov r0, #1 37 | mov r1, r2 38 | mov r2, #0x11 39 | swi #0x900004 40 | mov r0, #0 41 | swi #0x900001 42 | 43 | .data 44 | data0: 45 | .string "aaaabbbbccccdddd" 46 | data1: 47 | .string "bbbbccccddddeeee" 48 | data2: 49 | .string "hvLLWs\x1fsdrs9\x1fNJ-\n" 50 | -------------------------------------------------------------------------------- /QEMU/tool-osdep.c: -------------------------------------------------------------------------------- 1 | /* Hack to provide a version of osdep.o for qemu-img without conflicting with 2 | the (kqemu) target specific osdep.o. */ 3 | #include "osdep.c" 4 | 5 | -------------------------------------------------------------------------------- /QEMU/x86_64-softmmu/config.h: -------------------------------------------------------------------------------- 1 | /* Automatically generated by configure - do not modify */ 2 | #include "../config-host.h" 3 | #define CONFIG_QEMU_PREFIX "/usr/gnemul/qemu-x86_64" 4 | #define TARGET_ARCH "x86_64" 5 | #define TARGET_X86_64 1 6 | #define TARGET_I386 1 7 | #define CONFIG_KVM 1 8 | #define CONFIG_KVM 1 9 | #define USE_KVM_PIT 1 10 | #define USE_KVM_DEVICE_ASSIGNMENT 1 11 | #define TARGET_PHYS_ADDR_BITS 64 12 | #define CONFIG_SOFTMMU 1 13 | -------------------------------------------------------------------------------- /QEMU/x86_64-softmmu/data/.ssd.conf.swo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ESOS-Lab/VSSIM/a119bee2aae5e10e52feb3eec3d05f973aee54d1/QEMU/x86_64-softmmu/data/.ssd.conf.swo -------------------------------------------------------------------------------- /QEMU/x86_64-softmmu/rrun.sh: -------------------------------------------------------------------------------- 1 | ## VSSIM Windows re-run script 2 | ## Copyright(c)2014 3 | ## Hanyang University, Seoul, Korea 4 | ## Embedded Software Systems Laboratory. All right reserved 5 | 6 | ./qemu-system-x86_64 -m 2048 -cpu core2duo -hda /mnt/rd/ssd.img -cdrom ../../OS/MW_WIN7_AIO_FINAL_FF_DVD.iso -usbdevice tablet 7 | -------------------------------------------------------------------------------- /QEMU/x86_64-softmmu/rrun_linux.sh: -------------------------------------------------------------------------------- 1 | ## VSSIM Linux re-run script 2 | ## Copyright(c)2014 3 | ## Hanyang University, Seoul, Korea 4 | ## Embedded Software Systems Laboratory. All right reserved 5 | 6 | ./qemu-system-x86_64 -m 2048 -cpu core2duo -hda ../../RAMDISK/rd/ssd_hda.img -cdrom ../../OS/ubuntu-10.04.1-desktop-i386.iso -usbdevice tablet 7 | -------------------------------------------------------------------------------- /QEMU/x86_64-softmmu/run.sh: -------------------------------------------------------------------------------- 1 | ## VSSIM Windows run script 2 | ## Copyright(c)2014 3 | ## Hanyang University, Seoul, Korea 4 | ## Embedded Software Systems Laboratory. All right reserved 5 | 6 | #!/bin/bash 7 | 8 | rm -rf data/*.dat 9 | qemu-img create -f qcow ../../RAMDISK/rd/ssd_hda.img 20G 10 | ./qemu-system-x86_64 -m 2048 -cpu core2duo -hda ../../RAMDISK/rd/ssd_hda.img -cdrom ../../OS/MW_WIN7_AIO_FINAL_FF_DVD.iso -usbdevice tablet 11 | -------------------------------------------------------------------------------- /QEMU/x86_64-softmmu/run_linux.sh: -------------------------------------------------------------------------------- 1 | ## VSSIM linux run script 2 | ## Copyright(c)2014 3 | ## Hanyang University, Seoul, Korea 4 | ## Embedded Software Systems Laboratory. All right reserved 5 | 6 | #!/bin/bash 7 | 8 | rm -rf data/*.dat 9 | qemu-img create -f qcow ../../RAMDISK/rd/ssd_hda.img 20G 10 | ./qemu-system-x86_64 -m 2048 -cpu core2duo -hda ../../RAMDISK/rd/ssd_hda.img -cdrom ../../OS/ubuntu-10.04.4-desktop-i386.iso -usbdevice tablet 11 | -------------------------------------------------------------------------------- /RAMDISK/ram_mount.sh: -------------------------------------------------------------------------------- 1 | # File: ram_mount.sh 2 | # Date: 2014. 12. 03. 3 | # Author: Jinsoo Yoo (jedisty@hanyang.ac.kr) 4 | # Copyright(c)2014 5 | # Hanyang University, Seoul, Korea 6 | # Embedded Software Systems Laboratory. All right reserved 7 | 8 | mkdir rd 9 | chmod 0755 rd 10 | sudo mount -t tmpfs -o size=20g tmpfs ./rd 11 | -------------------------------------------------------------------------------- /SSD_MODULE/ssd_log_manager.h: -------------------------------------------------------------------------------- 1 | // File: ssd_log_manager.h 2 | // Date: 2014. 12. 03. 3 | // Author: Jinsoo Yoo (jedisty@hanyang.ac.kr) 4 | // Copyright(c)2014 5 | // Hanyang University, Seoul, Korea 6 | // Embedded Software Systems Laboratory. All right reserved 7 | 8 | #ifndef _LOG_MANAGER_H_ 9 | #define _LOG_MANAGER_H_ 10 | 11 | void INIT_LOG_MANAGER(void); 12 | void TERM_LOG_MANAGER(void); 13 | void WRITE_LOG(char* szLog); 14 | 15 | void THREAD_SERVER(void* arg); 16 | void THREAD_CLIENT(void* arg); 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /SSD_MODULE/ssd_trim_manager.h: -------------------------------------------------------------------------------- 1 | // File: ssd_trim_manager.h 2 | // Date: 2014. 12. 03. 3 | // Author: Jinsoo Yoo (jedisty@hanyang.ac.kr) 4 | // Copyright(c)2014 5 | // Hanyang University, Seoul, Korea 6 | // Embedded Software Systems Laboratory. All right reserved 7 | 8 | #ifndef _TRIM_MANAGER_H_ 9 | #define _TRIM_MANAGER_H_ 10 | 11 | #ifndef VSSIM_BENCH 12 | #include "ssd_util.h" 13 | #endif 14 | 15 | typedef struct sector_entry 16 | { 17 | int64_t sector_nb; 18 | unsigned long long int length; 19 | 20 | struct sector_entry* prev; 21 | struct sector_entry* next; 22 | }sector_entry; 23 | 24 | sector_entry* new_sector_entry(void); 25 | void add_sector_list(sector_entry* List, sector_entry* SE); 26 | void release_sector_list(sector_entry* SE); 27 | void remove_sector_entry(sector_entry* SE); 28 | 29 | void INSERT_TRIM_SECTORS(sector_entry* pSE); 30 | int EXIST_IN_TRIM_LIST(int64_t sector_nb); 31 | int REMOVE_TRIM_SECTOR(int64_t sector_nb); 32 | //int REMOVE_TRIM_SECTOR2(int64_t sector_nb, unsigned int length); 33 | 34 | 35 | void INIT_TRIM(void); 36 | void TERM_TRIM(void); 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /SSD_MODULE/ssd_util.h: -------------------------------------------------------------------------------- 1 | // File: ssd_util.h 2 | // Date: 2014. 12. 03. 3 | // Author: Jinsoo Yoo (jedisty@hanyang.ac.kr) 4 | // Copyright(c)2014 5 | // Hanyang University, Seoul, Korea 6 | // Embedded Software Systems Laboratory. All right reserved 7 | 8 | #ifndef _SSD_UTIL_H_ 9 | #define _SSD_UTIL_H_ 10 | 11 | #ifndef _UTEST_ 12 | #include "hw.h" 13 | #else 14 | 15 | typedef signed long long int64_t; 16 | #include 17 | #include 18 | #include 19 | 20 | #endif 21 | 22 | #endif 23 | 24 | --------------------------------------------------------------------------------