├── .github └── ISSUE_TEMPLATE │ └── bug_report.md ├── .gitignore ├── Makefile ├── README ├── README.md ├── debian ├── changelog ├── compat ├── control ├── copyright ├── fio_values ├── iomemory-vsl-source.install ├── iomemory-vsl.install ├── iomemory-vsl.postinst ├── iomemory-vsl.postrm ├── iomemory-vsl.prerm └── rules ├── fio-driver.spec ├── root ├── etc │ └── ld.so.conf.d │ │ └── fio.conf └── usr │ ├── lib │ └── fio │ │ └── libvsl.so │ ├── share │ └── doc │ │ ├── fio │ │ └── NOTICE.libvsl │ │ └── iomemory-vsl │ │ ├── License │ │ └── NOTICE.iomemory-vsl │ └── src │ └── iomemory-vsl-3.2.16 │ ├── Kbuild │ ├── Makefile │ ├── cdev.c │ ├── check_target_kernel.conf │ ├── check_target_kernel.sh │ ├── dkms.conf │ ├── driver_init.c │ ├── errno.c │ ├── include │ ├── fio │ │ └── port │ │ │ ├── align.h │ │ │ ├── arch │ │ │ ├── bits.h │ │ │ ├── mips_atomic.h │ │ │ ├── mips_cache.h │ │ │ ├── ppc_atomic.h │ │ │ ├── ppc_cache.h │ │ │ ├── x86_64 │ │ │ │ └── bits.h │ │ │ ├── x86_atomic.h │ │ │ └── x86_cache.h │ │ │ ├── atomic_list.h │ │ │ ├── bitops.h │ │ │ ├── byteswap.h │ │ │ ├── cdev.h │ │ │ ├── common-linux │ │ │ ├── commontypes.h │ │ │ ├── div64.h │ │ │ ├── errno.h │ │ │ ├── kassert.h │ │ │ ├── kblock.h │ │ │ ├── kcondvar.h │ │ │ ├── kfile.h │ │ │ ├── kfio.h │ │ │ ├── kpci.h │ │ │ ├── kscsi_config.h │ │ │ ├── kscsi_host.h │ │ │ ├── stdint.h │ │ │ └── ufio.h │ │ │ ├── commontypes.h │ │ │ ├── compiler.h │ │ │ ├── csr_simulator.h │ │ │ ├── dbgset.h │ │ │ ├── errno.h │ │ │ ├── fio-poppack.h │ │ │ ├── fio-port.h │ │ │ ├── fio-pshpack1.h │ │ │ ├── fio-stat.h │ │ │ ├── fiostring.h │ │ │ ├── gcc │ │ │ ├── align.h │ │ │ └── compiler.h │ │ │ ├── ifio.h │ │ │ ├── ioctl.h │ │ │ ├── kbio.h │ │ │ ├── kblock.h │ │ │ ├── kcache.h │ │ │ ├── kcondvar.h │ │ │ ├── kcpu.h │ │ │ ├── kcsr.h │ │ │ ├── kfio.h │ │ │ ├── kfio_config.h │ │ │ ├── kglobal.h │ │ │ ├── kinfo.h │ │ │ ├── kmem.h │ │ │ ├── kpci.h │ │ │ ├── kscatter.h │ │ │ ├── kscsi.h │ │ │ ├── ktime.h │ │ │ ├── ktypes.h │ │ │ ├── ktypes_32.h │ │ │ ├── ktypes_64.h │ │ │ ├── libgen.h │ │ │ ├── linux │ │ │ ├── ktypes.h │ │ │ └── utypes.h │ │ │ ├── list.h │ │ │ ├── pci.h │ │ │ ├── port_config.h │ │ │ ├── port_config_macros.h │ │ │ ├── port_config_macros_clear.h │ │ │ ├── port_config_vars_externs.h │ │ │ ├── sched.h │ │ │ ├── state.h │ │ │ ├── stdint.h │ │ │ ├── trim_completion.h │ │ │ ├── trimmon_attach.h │ │ │ ├── ufio.h │ │ │ ├── unaligned.h │ │ │ ├── utypes.h │ │ │ └── vararg.h │ ├── kblock_meta.h │ ├── kfile_meta.h │ └── sysrq_meta.h │ ├── kblock.c │ ├── kcache.c │ ├── kcondvar.c │ ├── kcpu.c │ ├── kcsr.c │ ├── kexports.c │ ├── kfile.c │ ├── kfio.c │ ├── kfio │ ├── README.md │ ├── function_hashes.txt │ ├── kfio_operations.sh │ ├── x86_64_cc41_libkfio.o_shipped │ ├── x86_64_cc43_libkfio.o_shipped │ ├── x86_64_cc44_libkfio.o_shipped │ ├── x86_64_cc48_libkfio.o_shipped │ ├── x86_64_cc49_libkfio.o_shipped │ ├── x86_64_cc53_libkfio.o_shipped │ ├── x86_64_cc54_libkfio.o_shipped │ ├── x86_64_cc63_libkfio.o_shipped │ └── x86_64_latest_libkfio.o_shipped │ ├── kfio_common.c │ ├── kfio_config.sh │ ├── khotplug.c │ ├── kinfo.c │ ├── kmem.c │ ├── kscatter.c │ ├── kscsi.c │ ├── kscsi_host.c │ ├── ktime.c │ ├── main.c │ ├── module_operations.sh │ ├── module_param.c │ ├── pci.c │ ├── port-internal.h │ ├── sched.c │ ├── state.c │ └── sysrq.c └── tools ├── efi ├── README.md └── install-ubuntu.sh └── udev └── rules.d └── 60-persistent-fio.rules /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: "[BUG]" 5 | labels: bug 6 | assignees: '' 7 | 8 | --- 9 | 10 | --- 11 | name: Bug report 12 | about: Something broke 13 | title: '' 14 | labels: '' 15 | assignees: '' 16 | 17 | --- 18 | 19 | ### Bug description 20 | Describe the issue, or paste the full error encountered here. 21 | 22 | ### How to reproduce 23 | What are the steps to reproduce the reported issue. 24 | ``` 25 | git clone https://github.com/snuf/iomemory-vsl.git 26 | cd iomemory-vsl 27 | git checkout 28 | make module 29 | ** poof, broken token ** 30 | ``` 31 | 32 | ### Possible solution 33 | Is a solution know, or type any plausible suggestions here, if none leave clear. 34 | 35 | ### Environment information 36 | Information about the system the module is used on 37 | 1. Linux kernel compiled against (uname -a) 38 | 2. The C compiler version used (gcc --version) 39 | 3. distribution, and version (cat /etc/os-release) 40 | 4. The hash. tag and/or Branch of iomemory-vsl that is being compiled (`git branch -v`) 41 | 5. FIO device used, if applicable 42 | * fio-status 43 | * lspci -b -nn 44 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .vs 2 | ioMemory-vsl* 3 | root/.vs 4 | **/license.c 5 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | FIO_DRIVER = $(shell grep fio_driver_name fio-driver.spec | awk '{print $$3}' | head -1) 2 | FIO_VERSION = $(shell grep fio_version fio-driver.spec | awk '{print $$3}' | head -1) 3 | FIO_SRC_DIR = root/usr/src/$(shell ls root/usr/src) 4 | FIO_DIR = $(shell git rev-parse --show-toplevel) 5 | 6 | all: help 7 | 8 | .PHONY: dkms 9 | dkms: clean 10 | cd ${FIO_SRC_DIR} && \ 11 | $(MAKE) dkms 12 | 13 | .PHONY: dpkg 14 | dpkg: clean patch_module_version 15 | # patch fio_version, fio_short_version in debian/fio_values 16 | cd ${FIO_DIR} && \ 17 | dpkg-buildpackage -rfakeroot --no-check-builddeps --no-sign 18 | 19 | .PHONY: rpm 20 | rpm: clean patch_module_version 21 | # patch fio_version in fio-driver.spec 22 | mkdir -p ~/rpmbuild/SOURCES && \ 23 | tar -zcvf ~/rpmbuild/SOURCES/${FIO_DRIVER}-${FIO_VERSION}.tar.gz \ 24 | --transform s/${FIO_DRIVER}/${FIO_DRIVER}-${FIO_VERSION}/ \ 25 | ../${FIO_DRIVER} && \ 26 | cd ${FIO_DIR} && \ 27 | rpmbuild -ba fio-driver.spec 28 | 29 | .PHONY: module 30 | module: clean 31 | cd ${FIO_SRC_DIR} && \ 32 | $(MAKE) gpl 33 | 34 | clean: 35 | cd ${FIO_SRC_DIR} && \ 36 | $(MAKE) clean 37 | 38 | patch_module_version: 39 | cd ${FIO_SRC_DIR} && \ 40 | $(MAKE) patch_module_version 41 | 42 | 43 | define usage 44 | @echo Stub for making dkms, dpkg, the module and clean 45 | @echo usage: make "(dkms|dpkg|rpm|module|clean)" 46 | endef 47 | help: 48 | $(usage) 49 | -------------------------------------------------------------------------------- /debian/compat: -------------------------------------------------------------------------------- 1 | 9 2 | -------------------------------------------------------------------------------- /debian/control: -------------------------------------------------------------------------------- 1 | Source: iomemory-vsl 2 | Section: non-free 3 | Priority: extra 4 | Maintainer: Support 5 | Build-Depends: debhelper (>= 5), linux-headers | linux-headers-amd64, gcc, make, rsync 6 | Standards-Version: 3.7.3 7 | Homepage: http://support.fusionio.com 8 | 9 | Package: iomemory-vsl-5.3.0-64-generic 10 | Architecture: amd64 11 | Provides: iomemory-vsl, 12 | iomemory-vsl-${fio-version}, 13 | iomemory-vsl, 14 | libvsl 15 | Conflicts: iodrive-driver, fio-driver, libvsl, iomemory-vsl-source 16 | Replaces: iodrive-driver, fio-driver, libvsl 17 | Description: Driver for SanDisk Fusion ioMemory devices 18 | Driver for SanDisk Fusion ioMemory devices 19 | 20 | Package: iomemory-vsl-config-5.3.0-64-generic 21 | Architecture: amd64 22 | Provides: iomemory-vsl-config, 23 | iomemory-vsl-config-${fio-version} 24 | Description: Configuration of iomemory-vsl for SanDisk Fusion ioMemory drivers 25 | Configuration of iomemory-vsl for SanDisk Fusion ioMemory drivers 26 | 27 | Package: iomemory-vsl-source 28 | Architecture: amd64 29 | Depends: linux-headers | linux-headers-amd64, gcc, make, lsb-release 30 | Provides: iomemory-vsl, 31 | iomemory-vsl-${fio-version}, 32 | iomemory-vsl, 33 | libvsl 34 | Conflicts: iomemory-vsl-${fio-version}, iomemory-vsl 35 | Description: Source to build driver for SanDisk Fusion ioMemory devices 36 | Source to build driver for SanDisk Fusion ioMemory devices 37 | 38 | Package: iomemory-vsl-di-5.3.0-64-generic 39 | Package-Type: udeb 40 | Architecture: amd64 41 | Depends: 42 | XB-Kernel-Version: 5.3.0-64-generic 43 | Section: debian-installer 44 | Description: Source to build driver for SanDisk Fusion ioMemory devices 45 | Source to build driver for SanDisk Fusion ioMemory devices 46 | 47 | Package: iomemory-vsl-initrd-5.3.0-64-generic 48 | Architecture: amd64 49 | Depends: iomemory-vsl 50 | XB-Modaliases: 51 | Description: Driver for SanDisk Fusion ioMemory devices for inclusion in ram disk 52 | Driver for SanDisk Fusion ioMemory devices for inclusion in ram disk 53 | 54 | -------------------------------------------------------------------------------- /debian/fio_values: -------------------------------------------------------------------------------- 1 | fio_oem_name := fusionio 2 | fio_oem_name_short := fio 3 | fio_sourcedir := /usr/src 4 | fio_driver_name := iomemory-vsl 5 | fio_version := 3.2.16.1732 6 | fio_short_version := 3.2.16 7 | fio_docdir := /usr/share/doc 8 | kfio_scsi_device := False 9 | -------------------------------------------------------------------------------- /debian/iomemory-vsl.install: -------------------------------------------------------------------------------- 1 | usr/share/doc/fio/NOTICE.libvsl 2 | usr/share/doc/iomemory-vsl/NOTICE.iomemory-vsl 3 | usr/share/doc/iomemory-vsl/License 4 | -------------------------------------------------------------------------------- /debian/iomemory-vsl.postinst: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RemixVSL/iomemory-vsl/c0f364fe7eeccbbd605137a88613b3c8d02246a4/debian/iomemory-vsl.postinst -------------------------------------------------------------------------------- /debian/iomemory-vsl.postrm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RemixVSL/iomemory-vsl/c0f364fe7eeccbbd605137a88613b3c8d02246a4/debian/iomemory-vsl.postrm -------------------------------------------------------------------------------- /debian/iomemory-vsl.prerm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RemixVSL/iomemory-vsl/c0f364fe7eeccbbd605137a88613b3c8d02246a4/debian/iomemory-vsl.prerm -------------------------------------------------------------------------------- /root/etc/ld.so.conf.d/fio.conf: -------------------------------------------------------------------------------- 1 | # fio drive support 2 | /usr/lib/fio 3 | -------------------------------------------------------------------------------- /root/usr/lib/fio/libvsl.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RemixVSL/iomemory-vsl/c0f364fe7eeccbbd605137a88613b3c8d02246a4/root/usr/lib/fio/libvsl.so -------------------------------------------------------------------------------- /root/usr/share/doc/fio/NOTICE.libvsl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RemixVSL/iomemory-vsl/c0f364fe7eeccbbd605137a88613b3c8d02246a4/root/usr/share/doc/fio/NOTICE.libvsl -------------------------------------------------------------------------------- /root/usr/share/doc/iomemory-vsl/NOTICE.iomemory-vsl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RemixVSL/iomemory-vsl/c0f364fe7eeccbbd605137a88613b3c8d02246a4/root/usr/share/doc/iomemory-vsl/NOTICE.iomemory-vsl -------------------------------------------------------------------------------- /root/usr/src/iomemory-vsl-3.2.16/Kbuild: -------------------------------------------------------------------------------- 1 | # -*- makefile -*- 2 | ifndef FIO_DRIVER_NAME 3 | $(error FIO_DRIVER_NAME is not defined) 4 | endif 5 | 6 | ifndef KFIO_LIB 7 | $(error KFIO_LIB is not defined - this is the path to the libkfio.o_shipped file) 8 | endif 9 | 10 | 11 | $(src)/license.c: $(src)/Kbuild 12 | printf '#include "linux/module.h"\nMODULE_LICENSE("GPL");\n' >$@ 13 | 14 | obj-m := $(FIO_DRIVER_NAME).o 15 | 16 | $(FIO_DRIVER_NAME)-y := main.o 17 | $(FIO_DRIVER_NAME)-y += license.o 18 | $(FIO_DRIVER_NAME)-y += pci.o 19 | $(FIO_DRIVER_NAME)-y += sysrq.o 20 | $(FIO_DRIVER_NAME)-y += driver_init.o 21 | $(FIO_DRIVER_NAME)-y += kfio.o 22 | $(FIO_DRIVER_NAME)-y += errno.o 23 | $(FIO_DRIVER_NAME)-y += state.o 24 | $(FIO_DRIVER_NAME)-y += kcache.o 25 | $(FIO_DRIVER_NAME)-y += kfile.o 26 | $(FIO_DRIVER_NAME)-y += kmem.o 27 | $(FIO_DRIVER_NAME)-y += kfio_common.o 28 | $(FIO_DRIVER_NAME)-y += kcpu.o 29 | $(FIO_DRIVER_NAME)-y += kscatter.o 30 | $(FIO_DRIVER_NAME)-y += ktime.o 31 | $(FIO_DRIVER_NAME)-y += sched.o 32 | $(FIO_DRIVER_NAME)-y += cdev.o 33 | 34 | ifeq ($(FIO_SCSI_DEVICE),True) 35 | $(FIO_DRIVER_NAME)-y += kscsi.o 36 | $(FIO_DRIVER_NAME)-y += kscsi_host.o 37 | else 38 | $(FIO_DRIVER_NAME)-y += kblock.o 39 | endif 40 | 41 | $(FIO_DRIVER_NAME)-y += kcondvar.o 42 | $(FIO_DRIVER_NAME)-y += kinfo.o 43 | $(FIO_DRIVER_NAME)-y += kexports.o 44 | $(FIO_DRIVER_NAME)-y += khotplug.o 45 | $(FIO_DRIVER_NAME)-y += kcsr.o 46 | $(FIO_DRIVER_NAME)-y += $(patsubst %_shipped,%,$(KFIO_LIB)) 47 | $(FIO_DRIVER_NAME)-y += module_param.o 48 | 49 | EXTRA_CFLAGS:= -I$(INCLUDE_DIR) 50 | 51 | # This includes a kernel-specific config file (if one exists). 52 | # The file should be put in 53 | # include/fio/port/linux/kfio_config-$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) 54 | # and #defines the macros that are enumerated in 55 | # include/fio/port/linux/kfio_config.h. 56 | KFIOC_H-VER := fio/port/linux/kfio_config-$(KERNELRELEASE).h 57 | KFIOC_H := $(wildcard $(INCLUDE_DIR)/$(KFIOC_H-VER)) 58 | EXTRA_CFLAGS += $(if $(KFIOC_H),-include "$(KFIOC_H-VER)") 59 | 60 | INSTALL_MOD_DIR ?= extra/fio 61 | 62 | ifneq ($(FIREHOSE_INSTALL_ROOT),) 63 | EXTRA_ARGS=INSTALL_MOD_PATH="$(FIREHOSE_INSTALL_ROOT)" 64 | endif 65 | -------------------------------------------------------------------------------- /root/usr/src/iomemory-vsl-3.2.16/Makefile: -------------------------------------------------------------------------------- 1 | # KERNELRELEASE is set by the kernel build system. This is used 2 | # as a test to know if the build is being driven by the kernel. 3 | ifneq ($(KERNELRELEASE),) 4 | # Kernel build 5 | 6 | # Older kernel scripts/Makefile.build only process Makefile so 7 | # we include the Kbuild file here. Newer kernel scripts/Makefile.build 8 | # include Kbuild directly and never process Makefile (this file). 9 | include $(FUSION_DRIVER_DIR)/Kbuild 10 | 11 | else 12 | 13 | ifneq ($(CROSS_COMPILE),) 14 | FIOCC=$(CROSS_COMPILE)gcc 15 | else 16 | FIOCC=$(CC) 17 | endif 18 | $(info FIOCC is $(FIOCC)) 19 | 20 | FIO_DRIVER_NAME ?= $(shell cat dkms.conf | grep BUILT_MODULE_NAME | awk -F= '{ print $$2 }') 21 | FIO_DRIVER_SUBDIR ?= extra/fio 22 | FUSION_DEBUG ?= 0 23 | FIO_SCSI_DEVICE ?= 0 24 | 25 | ifneq ($(DKMS_KERNEL_VERSION),) 26 | KERNELVER = $(DKMS_KERNEL_VERSION) 27 | else 28 | KERNELVER ?= $(shell uname -r) 29 | endif 30 | KERNEL_BUILD = /lib/modules/$(KERNELVER)/build 31 | CFLAGS = -I$(shell pwd)/include -DBUILDING_MODULE -DLINUX_IO_SCHED -Wall 32 | 33 | # Older systems (Debian 6) have the kernel headers in a different directory than the kernel build directory. 34 | # Start in this source directory, and fix it up in the config shell script if it isn't right. 35 | KERNEL_SRC = /lib/modules/$(KERNELVER)/source 36 | 37 | # Set PORT_NO_WERROR=0 to compile without -Werror compilation flag 38 | ifneq ($(PORT_NO_WERROR),1) 39 | CFLAGS += -Werror 40 | endif 41 | 42 | # Set FUSION_DEBUG=0 to compile without debugging symbols 43 | ifeq ($(FUSION_DEBUG),1) 44 | CFLAGS += -g -ggdb 45 | endif 46 | # Target should be a mix of compiler version, platform and cpu this will allow 47 | # us to build multiple targets in the same tree without overlapping objects 48 | # and libs. We will need to build multiple objects where kernel ifdefs 49 | # differ. 50 | FIOARCH ?= $(shell uname -m) 51 | CCMAJOR ?= $(shell echo __GNUC__ | $(FIOCC) -E -xc - | tail -n 1) 52 | CCMINOR ?= $(shell echo __GNUC_MINOR__ | $(FIOCC) -E -xc - | tail -n 1) 53 | CCVER=$(CCMAJOR)$(CCMINOR) 54 | LAST_CCVER := $(shell ls -1 kfio | sed -n 's/.*_cc\([0-9][0-9]*\)_.*/\1/p' | tail -1) 55 | # Get the tag and push it in here too.... if not too long... 56 | MODULE_VERSION ?= $(shell git rev-parse --short HEAD) 57 | 58 | TARGET ?= $(FIOARCH)_cc$(CCMAJOR)$(CCMINOR) 59 | 60 | KFIO_LIB ?= kfio/$(TARGET)_libkfio.o 61 | LAST_KFIO_LIB := x86_64_latest_libkfio.o_shipped 62 | KFIO_LIB_CMD ?= kfio/.$(TARGET)_libkfio.o.cmd 63 | 64 | NCPUS:=$(shell grep -c ^processor /proc/cpuinfo) 65 | 66 | all: fake_license modules patch_module_version 67 | 68 | gpl: fake_license modules patch_module_version 69 | 70 | .PHONY: fake_license 71 | fake_license: 72 | sed -i 's/Proprietary/GPL/g' Kbuild 73 | 74 | .PHONY: check_n_fix_kfio_ccver 75 | check_n_fix_kfio_ccver: 76 | if [ ! -f "${KFIO_LIB}" ];then \ 77 | cp kfio/${LAST_KFIO_LIB} ${KFIO_LIB}; \ 78 | fi \ 79 | $(shell touch ${KFIO_LIB_CMD}) 80 | 81 | 82 | clean modules_clean: 83 | $(MAKE) \ 84 | -j$(NCPUS) \ 85 | -C $(KERNEL_BUILD) \ 86 | FIO_DRIVER_NAME=$(FIO_DRIVER_NAME) \ 87 | FUSION_DRIVER_DIR=$(shell pwd) \ 88 | M=$(shell pwd) \ 89 | EXTRA_CFLAGS+="$(CFLAGS)" \ 90 | KFIO_LIB=$(KFIO_LIB) \ 91 | clean 92 | rm -rf include/fio/port/linux/kfio_config.h kfio_config 93 | 94 | include/fio/port/linux/kfio_config.h: kfio_config.sh 95 | ./$< -a $(FIOARCH) -o $@ -k $(KERNEL_BUILD) -p -d $(CURDIR)/kfio_config -l $(FUSION_DEBUG) -s $(KERNEL_SRC) 96 | 97 | .PHONY: check_target_kernel 98 | check_target_kernel: 99 | @ret="$$(./check_target_kernel.sh "$(KERNELVER)" "$(KERNEL_BUILD)")" ; \ 100 | if [ -n "$$ret" ] ; then \ 101 | echo "" ; \ 102 | echo "Change found in target kernel: $$ret" ; \ 103 | echo "Running clean before building driver" ; \ 104 | echo "" ; \ 105 | $(MAKE) clean ; \ 106 | fi 107 | 108 | .PHONY: add_module_version patch_module_version 109 | add_module_version patch_module_version: 110 | @ret="$$("$(shell pwd)"/module_operations.sh -n "$(FIO_DRIVER_NAME)" -v "$(MODULE_VERSION)")" ; \ 111 | if [ -n "$$ret" ] ; then \ 112 | echo "" ; \ 113 | echo ""$$ret"" ; \ 114 | echo "" ; \ 115 | fi 116 | 117 | .PHONY: dkms 118 | dkms: 119 | sudo ./module_operations.sh -n "$(FIO_DRIVER_NAME)" -v "$(MODULE_VERSION)" -l ${LAST_KFIO_LIB} -d 120 | 121 | .PHONY: dpkg 122 | dpkg: 123 | # patch fio_version, fio_short_version in debian/fio_values 124 | cd $(shell git rev-parse --show-toplevel) && \ 125 | $(MAKE) dpkg 126 | 127 | .PHONY: dpkg 128 | rpm: 129 | # patch fio_version, fio_short_version in debian/fio_values 130 | cd $(shell git rev-parse --show-toplevel) && \ 131 | $(MAKE) rpm 132 | 133 | modules modules_install: check_target_kernel check_n_fix_kfio_ccver include/fio/port/linux/kfio_config.h add_module_version 134 | $(MAKE) \ 135 | -j$(NCPUS) \ 136 | -C $(KERNEL_BUILD) \ 137 | FIO_DRIVER_NAME=$(FIO_DRIVER_NAME) \ 138 | FUSION_DRIVER_DIR=$(shell pwd) \ 139 | M=$(shell pwd) \ 140 | EXTRA_CFLAGS+="$(CFLAGS)" \ 141 | INSTALL_MOD_DIR=$(FIO_DRIVER_SUBDIR) \ 142 | INSTALL_MOD_PATH=$(INSTALL_ROOT) \ 143 | KFIO_LIB=$(KFIO_LIB) \ 144 | $@ 145 | 146 | endif 147 | 148 | # 4.3.7.1205 bryce@a7e621e6fb50 -tag=7bd0632 149 | # 3.2.16.1731 pinnacles@4870ad45b7ea 150 | -------------------------------------------------------------------------------- /root/usr/src/iomemory-vsl-3.2.16/check_target_kernel.conf: -------------------------------------------------------------------------------- 1 | PREV_KERNELVER="6.8.0-52-generic" 2 | PREV_KERNEL_SRC="/lib/modules/6.8.0-52-generic/build" 3 | -------------------------------------------------------------------------------- /root/usr/src/iomemory-vsl-3.2.16/check_target_kernel.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Sets PREV_KERNELVER, PREV_KERNEL_SRC 4 | CONF="./check_target_kernel.conf" 5 | 6 | # kfio_config.h 7 | KFIO_CONFIG_H="include/fio/port/linux/kfio_config.h" 8 | 9 | if [ -e "$CONF" ] ; then 10 | . "$CONF" 11 | else 12 | PREV_KERNELVER="" 13 | PREV_KERNEL_SRC="" 14 | fi 15 | 16 | CUR_KERNELVER="$1" 17 | CUR_KERNEL_SRC="$2" 18 | 19 | RET=0 20 | if [ "$CUR_KERNELVER" != "$PREV_KERNELVER" ] ; then 21 | RET=1 22 | if [ "$PREV_KERNELVER" != "" ] ; then 23 | echo -n "KERNELVER " 24 | fi 25 | fi 26 | if [ "$CUR_KERNEL_SRC" != "$PREV_KERNEL_SRC" ] ; then 27 | RET=1 28 | if [ "$PREV_KERNEL_SRC" != "" ] ; then 29 | echo -n "KERNEL_SRC " 30 | fi 31 | fi 32 | echo "PREV_KERNELVER=\"$CUR_KERNELVER\"" > "$CONF" 33 | echo "PREV_KERNEL_SRC=\"$CUR_KERNEL_SRC\"" >> "$CONF" 34 | 35 | exit $RET 36 | -------------------------------------------------------------------------------- /root/usr/src/iomemory-vsl-3.2.16/dkms.conf: -------------------------------------------------------------------------------- 1 | MAKE="'make' DKMS_KERNEL_VERSION=$kernelver" 2 | CLEAN="'make' clean" 3 | BUILT_MODULE_NAME=iomemory-vsl 4 | BUILT_MODULE_LOCATION='' 5 | PACKAGE_NAME=iomemory-vsl 6 | PACKAGE_VERSION=3.2.16.2 7 | DEST_MODULE_LOCATION=/kernel/drivers/block 8 | AUTOINSTALL="Yes" 9 | # REMAKE_INITRD=yes -------------------------------------------------------------------------------- /root/usr/src/iomemory-vsl-3.2.16/driver_init.c: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------------------- 2 | // Copyright (c) 2006-2014, Fusion-io, Inc.(acquired by SanDisk Corp. 2014) 3 | // Copyright (c) 2014-2016 SanDisk Corp. and/or all its affiliates. All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // * Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // * Neither the name of the SanDisk Corp. nor the names of its contributors 13 | // may be used to endorse or promote products derived from this software 14 | // without specific prior written permission. 15 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 17 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 18 | // A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | // IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 20 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 21 | // OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | // ----------------------------------------------------------------------------- 28 | #include 29 | 30 | #include 31 | 32 | #include "fio/port/kfio.h" 33 | 34 | #define AUTO_ATTACH_DEFAULT 1 35 | 36 | /** 37 | * @ingroup PORT_COMMON_LINUX 38 | * @{ 39 | */ 40 | 41 | // Global driver options 42 | char *numa_node_override[MAX_PCI_DEVICES]; 43 | int num_numa_node_override; 44 | extern int numa_node_forced_local; 45 | 46 | KFIO_MODULE_PARAM(numa_node_forced_local, int, S_IRUGO | S_IWUSR); 47 | KFIO_MODULE_PARAM_DESC(numa_node_forced_local, "Only schedule fio-wq completion threads for use on NUMA node local to fct-worker"); 48 | 49 | KFIO_MODULE_PARAM_DESC(numa_node_override, "Override device to NUMA node binding"); 50 | KFIO_MODULE_PARAM_ARRAY(numa_node_override, charp, &num_numa_node_override, S_IRUGO | S_IWUSR); 51 | 52 | int use_workqueue = USE_QUEUE_NONE; 53 | 54 | KFIO_MODULE_PARAM(use_workqueue, int, S_IRUGO | S_IWUSR); 55 | 56 | /** 57 | * @} 58 | */ 59 | -------------------------------------------------------------------------------- /root/usr/src/iomemory-vsl-3.2.16/include/fio/port/align.h: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------------------- 2 | // Copyright (c) 2011-2014, Fusion-io, Inc.(acquired by SanDisk Corp. 2014) 3 | // Copyright (c) 2014 SanDisk Corp. and/or all its affiliates. All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // * Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // * Neither the name of the SanDisk Corp. nor the names of its contributors 13 | // may be used to endorse or promote products derived from this software 14 | // without specific prior written permission. 15 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 17 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 18 | // A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | // IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 20 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 21 | // OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | //----------------------------------------------------------------------------- 28 | 29 | #ifndef __FIO_PORT_ALIGN_H__ 30 | #define __FIO_PORT_ALIGN_H__ 31 | 32 | /* 33 | * This header is for the defintion of FUSION_STRUCT_ALIGN 34 | * and the verification macro FUSION_STRUCT_ALIGN_VERIFY. 35 | * 36 | * The proper way to use FUSION_STRUCT_ALIGN is thus: 37 | * struct FUSION_STRUCT_ALIGN(8) my_struct 38 | * { 39 | * uint32_t my_32_member; 40 | * }; 41 | * FUSION_STRUCT_ALIGN_VERIFY(8, struct my_struct); 42 | * 43 | * or 44 | * typedef struct FUSION_STRUCT_ALIGN(8) my_struct 45 | * { 46 | * uint32_t my_32_member; 47 | * } my_struct_t; 48 | * FUSION_STRUCT_ALIGN_VERIFY(8, my_struct_t); 49 | * 50 | * Since some incorrect uses of FUSION_STRUCT_ALIGN don't produce a compile 51 | * error nor do they align, all common code uses of FUSION_STRUCT_ALIGN 52 | * should verify proper alignment by calling FUSION_STRUCT_ALIGN_VERIFY. 53 | * 54 | * As well we add DECLARE_RESERVE 55 | */ 56 | 57 | #if defined(__GNUC__) 58 | #include 59 | #elif defined(WINNT) || defined(WIN32) || defined(_MSC_VER) 60 | #include 61 | #else 62 | #error Unsupported compiler - needs alignment macros defined 63 | #endif 64 | 65 | #endif 66 | -------------------------------------------------------------------------------- /root/usr/src/iomemory-vsl-3.2.16/include/fio/port/arch/bits.h: -------------------------------------------------------------------------------- 1 | 2 | //----------------------------------------------------------------------------- 3 | // Copyright (c) 2006-2014, Fusion-io, Inc.(acquired by SanDisk Corp. 2014) 4 | // Copyright (c) 2014 SanDisk Corp. and/or all its affiliates. All rights reserved. 5 | // 6 | // Redistribution and use in source and binary forms, with or without 7 | // modification, are permitted provided that the following conditions are met: 8 | // * Redistributions of source code must retain the above copyright notice, 9 | // this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above copyright notice, 11 | // this list of conditions and the following disclaimer in the documentation 12 | // and/or other materials provided with the distribution. 13 | // * Neither the name of the SanDisk Corp. nor the names of its contributors 14 | // may be used to endorse or promote products derived from this software 15 | // without specific prior written permission. 16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 18 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 19 | // A PARTICULAR PURPOSE ARE DISCLAIMED. 20 | // IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 21 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 22 | // OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 23 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 24 | // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 25 | // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | //----------------------------------------------------------------------------- 29 | 30 | #ifndef __FUSION_ARCH_BITS__ 31 | #define __FUSION_ARCH_BITS__ 32 | 33 | #include 34 | 35 | typedef uint32_t fusion_bits_t; 36 | 37 | /** 38 | * @brief: returns 1 iff bit # v is set in *p else returns 0. 39 | */ 40 | FIO_NONNULL_PARAMS static inline int fio_test_bit(int v, const volatile fusion_bits_t *p) 41 | { 42 | return ((1U << (v & 31)) & *p) != 0; 43 | } 44 | 45 | /** 46 | * @brief atomic set of bit # v of *p. 47 | */ 48 | FIO_NONNULL_PARAMS static inline void fio_set_bit(int v, volatile fusion_bits_t *p) 49 | { 50 | __asm__ __volatile__("\n\tlock; btsl %1, %0" 51 | :"=m"(*p) 52 | :"Ir"(v), "m"(*p) 53 | : "cc", "memory" ); 54 | 55 | } 56 | 57 | /** 58 | * @brief atomic clear of bit # v of *p. 59 | */ 60 | FIO_NONNULL_PARAMS static inline void fio_clear_bit(int v, volatile fusion_bits_t *p) 61 | { 62 | __asm__ __volatile__("\n\tlock; btrl %1, %0" 63 | :"=m"(*p) 64 | :"Ir"(v), "m"(*p) 65 | : "cc", "memory" ); 66 | 67 | } 68 | 69 | /** 70 | * @brief atomic set of bit # v of *p, returns old value. 71 | */ 72 | FIO_NONNULL_PARAMS static inline unsigned char fio_test_and_set_bit(int v, volatile fusion_bits_t *p) 73 | { 74 | unsigned char bit_set; 75 | 76 | __asm__ __volatile__("\n\tlock; btsl %2, %0" 77 | "\n\tsetb %1" 78 | :"=m"(*p), "=r"(bit_set) 79 | :"Ir"(v), "m"(*p) 80 | : "cc", "memory" ); 81 | return bit_set; 82 | } 83 | 84 | /** 85 | * @brief atomic clear of bit # v of *p, returns old value. 86 | */ 87 | FIO_NONNULL_PARAMS static inline unsigned char fio_test_and_clear_bit(int v, volatile fusion_bits_t *p) 88 | { 89 | unsigned char bit_set; 90 | 91 | __asm__ __volatile__("\n\tlock; btrl %2, %0" 92 | "\n\tsetb %1" 93 | :"=m"(*p), "=r"(bit_set) 94 | :"Ir"(v), "m"(*p) 95 | : "cc", "memory" ); 96 | return bit_set; 97 | } 98 | #endif //__FUSION_ARCH_BITS__ 99 | -------------------------------------------------------------------------------- /root/usr/src/iomemory-vsl-3.2.16/include/fio/port/arch/mips_atomic.h: -------------------------------------------------------------------------------- 1 | 2 | //----------------------------------------------------------------------------- 3 | // Copyright (c) 2006-2014, Fusion-io, Inc.(acquired by SanDisk Corp. 2014) 4 | // Copyright (c) 2014 SanDisk Corp. and/or all its affiliates. All rights reserved. 5 | // 6 | // Redistribution and use in source and binary forms, with or without 7 | // modification, are permitted provided that the following conditions are met: 8 | // * Redistributions of source code must retain the above copyright notice, 9 | // this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above copyright notice, 11 | // this list of conditions and the following disclaimer in the documentation 12 | // and/or other materials provided with the distribution. 13 | // * Neither the name of the SanDisk Corp. nor the names of its contributors 14 | // may be used to endorse or promote products derived from this software 15 | // without specific prior written permission. 16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 18 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 19 | // A PARTICULAR PURPOSE ARE DISCLAIMED. 20 | // IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 21 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 22 | // OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 23 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 24 | // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 25 | // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | //----------------------------------------------------------------------------- 29 | 30 | #ifndef _FIO_PORT_ARCH_MIPS_ATOMIC_H 31 | #define _FIO_PORT_ARCH_MIPS_ATOMIC_H 32 | 33 | // Use the sync builtins. If they're unavailable then we'll need 34 | // to use mips assembly, see x86_atomic.h for more info 35 | 36 | #define fusion_atomic_set(x,y) ((x)->value = (y)) 37 | #define fusion_atomic_read(x) (x)->value 38 | 39 | int kfio_atomic_sub(int val, fusion_atomic_t *p); 40 | int kfio_atomic_add(int val, fusion_atomic_t *p); 41 | 42 | #define fusion_atomic_add(y,x) \ 43 | do { \ 44 | fusion_atomic_t z; \ 45 | z = kfio_atomic_add(y, x); \ 46 | } while(0); 47 | 48 | #define fusion_atomic_inc(x) \ 49 | do { \ 50 | fusion_atomic_t z; \ 51 | z = kfio_atomic_add(1, x); \ 52 | } while(0); 53 | 54 | #define fusion_atomic_incr(x) kfio_atomic_add(1, x) 55 | 56 | #define fusion_atomic_add_return(y,x) \ 57 | do { \ 58 | fusion_atomic_t z; \ 59 | z = kfio_atomic_add(y, x); \ 60 | } while(0); 61 | 62 | #define fusion_atomic_dec(x) \ 63 | do { \ 64 | fusion_atomic_t z; \ 65 | z = kfio_atomic_sub(1, x); \ 66 | } while(0); 67 | 68 | #define fusion_atomic_decr(x) kfio_atomic_sub(1, x) 69 | 70 | #define fusion_atomic_sub(y, x) \ 71 | do { \ 72 | fusion_atomic_t z; \ 73 | z = kfio_atomic_sub(y, x); \ 74 | } while(0); 75 | 76 | #define fusion_atomic_sub_return(y, x) \ 77 | do { \ 78 | fusion_atomic_t z; \ 79 | z = kfio_atomic_sub(y, x); \ 80 | } while(0); 81 | 82 | /* 83 | Taken from http://gcc.gnu.org/onlinedocs/gcc-4.1.0/gcc/Atomic-Builtins.html 84 | 85 | This builtin (__sync_lock_test_and_set), as described by Intel, is not a 86 | traditional test-and-set operation, but rather an atomic exchange operation. 87 | It writes value into *ptr, and returns the previous contents of *ptr. 88 | 89 | Many targets have only minimal support for such locks, and do not support a full 90 | exchange operation. In this case, a target may support reduced functionality here 91 | by which the only valid value to store is the immediate constant 1. The exact value 92 | actually stored in *ptr is implementation defined. 93 | 94 | This builtin is not a full barrier, but rather an acquire barrier. This means that 95 | references after the builtin cannot move to (or be speculated to) before the builtin, 96 | but previous memory stores may not be globally visible yet, and previous memory loads 97 | may not yet be satisfied. 98 | */ 99 | #define fusion_atomic_exchange(ptr, val) \ 100 | __sync_lock_test_and_set(&(ptr)->value, val) 101 | 102 | #endif /* _FIO_PORT_ARCH_MIPS_ATOMIC_H */ 103 | -------------------------------------------------------------------------------- /root/usr/src/iomemory-vsl-3.2.16/include/fio/port/arch/mips_cache.h: -------------------------------------------------------------------------------- 1 | 2 | //----------------------------------------------------------------------------- 3 | // Copyright (c) 2006-2014, Fusion-io, Inc.(acquired by SanDisk Corp. 2014) 4 | // Copyright (c) 2014 SanDisk Corp. and/or all its affiliates. All rights reserved. 5 | // 6 | // Redistribution and use in source and binary forms, with or without 7 | // modification, are permitted provided that the following conditions are met: 8 | // * Redistributions of source code must retain the above copyright notice, 9 | // this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above copyright notice, 11 | // this list of conditions and the following disclaimer in the documentation 12 | // and/or other materials provided with the distribution. 13 | // * Neither the name of the SanDisk Corp. nor the names of its contributors 14 | // may be used to endorse or promote products derived from this software 15 | // without specific prior written permission. 16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 18 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 19 | // A PARTICULAR PURPOSE ARE DISCLAIMED. 20 | // IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 21 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 22 | // OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 23 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 24 | // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 25 | // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | //----------------------------------------------------------------------------- 29 | 30 | #ifndef __FIO_PORT_MIPS_CACHE__ 31 | #define __FIO_PORT_MIPS_CACHE__ 32 | 33 | #define FUSION_CACHE_LINE_SIZE 64 34 | #define FUSION_HAS_PREFETCH 0 35 | 36 | static inline void fusion_prefetch_t0(char *addr) 37 | { 38 | } 39 | 40 | static inline void fusion_prefetch_nta(char *addr) 41 | { 42 | } 43 | 44 | static inline void fusion_prefetch_page(void *addr) 45 | { 46 | } 47 | 48 | #endif /* __FIO_PORT_MIPS_CACHE__ */ 49 | -------------------------------------------------------------------------------- /root/usr/src/iomemory-vsl-3.2.16/include/fio/port/arch/ppc_atomic.h: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------------------- 2 | // Copyright (c) 2006-2014, Fusion-io, Inc.(acquired by SanDisk Corp. 2014) 3 | // Copyright (c) 2014 SanDisk Corp. and/or all its affiliates. All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // * Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // * Neither the name of the SanDisk Corp. nor the names of its contributors 13 | // may be used to endorse or promote products derived from this software 14 | // without specific prior written permission. 15 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 17 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 18 | // A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | // IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 20 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 21 | // OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | //----------------------------------------------------------------------------- 28 | 29 | #ifndef _FIO_PORT_ARCH_PPC_ATOMIC_H 30 | #define _FIO_PORT_ARCH_PPC_ATOMIC_H 31 | 32 | typedef struct fusion_atomic { 33 | volatile int value; 34 | } fusion_atomic_t; 35 | 36 | // Use the sync builtins, see x86_atomic.h for more info 37 | 38 | static inline void fusion_atomic_set(fusion_atomic_t *atomp, int32_t val) 39 | { 40 | atomp->value = val; 41 | } 42 | 43 | static inline int32_t fusion_atomic_read(fusion_atomic_t *atomp) 44 | { 45 | return atomp->value; 46 | } 47 | 48 | static inline void fusion_atomic_add(int32_t val, fusion_atomic_t *atomp) 49 | { 50 | (void)__sync_add_and_fetch(&atomp->value, val); 51 | } 52 | 53 | static inline void fusion_atomic_inc(fusion_atomic_t *atomp) 54 | { 55 | (void)__sync_add_and_fetch(&atomp->value, 1); 56 | } 57 | 58 | static inline int32_t fusion_atomic_incr(fusion_atomic_t *atomp) 59 | { 60 | return __sync_add_and_fetch(&atomp->value, 1); 61 | } 62 | 63 | static inline int32_t fusion_atomic_add_return(int32_t val, fusion_atomic_t *atomp) 64 | { 65 | return __sync_add_and_fetch(&atomp->value, val); 66 | } 67 | 68 | static inline void fusion_atomic_dec(fusion_atomic_t *atomp) 69 | { 70 | (void)__sync_sub_and_fetch(&atomp->value, 1); 71 | } 72 | 73 | static inline int32_t fusion_atomic_decr(fusion_atomic_t *atomp) 74 | { 75 | return __sync_sub_and_fetch(&atomp->value, 1); 76 | } 77 | 78 | static inline void fusion_atomic_sub(int32_t val, fusion_atomic_t *atomp) 79 | { 80 | (void)__sync_sub_and_fetch(&atomp->value, val); 81 | } 82 | 83 | static inline int32_t fusion_atomic_sub_return(int32_t val, fusion_atomic_t *atomp) 84 | { 85 | return __sync_sub_and_fetch(&atomp->value, val); 86 | } 87 | 88 | /* 89 | Taken from http://gcc.gnu.org/onlinedocs/gcc-4.1.0/gcc/Atomic-Builtins.html 90 | 91 | This builtin (__sync_lock_test_and_set), as described by Intel, is not a 92 | traditional test-and-set operation, but rather an atomic exchange operation. 93 | It writes value into *ptr, and returns the previous contents of *ptr. 94 | 95 | Many targets have only minimal support for such locks, and do not support a full 96 | exchange operation. In this case, a target may support reduced functionality here 97 | by which the only valid value to store is the immediate constant 1. The exact value 98 | actually stored in *ptr is implementation defined. 99 | 100 | This builtin is not a full barrier, but rather an acquire barrier. This means that 101 | references after the builtin cannot move to (or be speculated to) before the builtin, 102 | but previous memory stores may not be globally visible yet, and previous memory loads 103 | may not yet be satisfied. 104 | */ 105 | static inline int32_t fusion_atomic_exchange(fusion_atomic_t *atomp, int32_t val) 106 | { 107 | return __sync_lock_test_and_set(&atomp->value, val); 108 | } 109 | 110 | #endif /* _FIO_PORT_ARCH_PPC_ATOMIC_H */ 111 | -------------------------------------------------------------------------------- /root/usr/src/iomemory-vsl-3.2.16/include/fio/port/arch/ppc_cache.h: -------------------------------------------------------------------------------- 1 | 2 | //----------------------------------------------------------------------------- 3 | // Copyright (c) 2006-2014, Fusion-io, Inc.(acquired by SanDisk Corp. 2014) 4 | // Copyright (c) 2014 SanDisk Corp. and/or all its affiliates. All rights reserved. 5 | // 6 | // Redistribution and use in source and binary forms, with or without 7 | // modification, are permitted provided that the following conditions are met: 8 | // * Redistributions of source code must retain the above copyright notice, 9 | // this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above copyright notice, 11 | // this list of conditions and the following disclaimer in the documentation 12 | // and/or other materials provided with the distribution. 13 | // * Neither the name of the SanDisk Corp. nor the names of its contributors 14 | // may be used to endorse or promote products derived from this software 15 | // without specific prior written permission. 16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 18 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 19 | // A PARTICULAR PURPOSE ARE DISCLAIMED. 20 | // IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 21 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 22 | // OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 23 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 24 | // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 25 | // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | //----------------------------------------------------------------------------- 29 | 30 | #ifndef __FIO_PORT_PPC_CACHE__ 31 | #define __FIO_PORT_PPC_CACHE__ 32 | 33 | #define FUSION_CACHE_LINE_SIZE 64 34 | #define FUSION_HAS_PREFETCH 0 35 | 36 | static inline void fusion_prefetch_t0(char *addr) 37 | { 38 | } 39 | 40 | static inline void fusion_prefetch_nta(char *addr) 41 | { 42 | } 43 | 44 | static inline void fusion_prefetch_page(void *addr) 45 | { 46 | } 47 | 48 | #endif /* __FIO_PORT_PPC_CACHE__ */ 49 | -------------------------------------------------------------------------------- /root/usr/src/iomemory-vsl-3.2.16/include/fio/port/arch/x86_64/bits.h: -------------------------------------------------------------------------------- 1 | 2 | //----------------------------------------------------------------------------- 3 | // Copyright (c) 2006-2014, Fusion-io, Inc.(acquired by SanDisk Corp. 2014) 4 | // Copyright (c) 2014 SanDisk Corp. and/or all its affiliates. All rights reserved. 5 | // 6 | // Redistribution and use in source and binary forms, with or without 7 | // modification, are permitted provided that the following conditions are met: 8 | // * Redistributions of source code must retain the above copyright notice, 9 | // this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above copyright notice, 11 | // this list of conditions and the following disclaimer in the documentation 12 | // and/or other materials provided with the distribution. 13 | // * Neither the name of the SanDisk Corp. nor the names of its contributors 14 | // may be used to endorse or promote products derived from this software 15 | // without specific prior written permission. 16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 18 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 19 | // A PARTICULAR PURPOSE ARE DISCLAIMED. 20 | // IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 21 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 22 | // OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 23 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 24 | // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 25 | // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | //----------------------------------------------------------------------------- 29 | 30 | #ifndef __FUSION_ARCH_BITS_64__ 31 | #define __FUSION_ARCH_BITS_64__ 32 | 33 | /** 34 | * @brief atomic clear of bit # v of *p. 35 | */ 36 | static inline void fio_clear_bit_64(int v, volatile uint64_t *p) 37 | { 38 | __asm__ __volatile__("\n\tlock; btrl %1, %0" 39 | :"=m"(*p) 40 | :"Jr"(v), "m"(*p) 41 | : "cc", "memory" ); 42 | 43 | } 44 | 45 | #endif //__FUSION_ARCH_BITS_64__ 46 | -------------------------------------------------------------------------------- /root/usr/src/iomemory-vsl-3.2.16/include/fio/port/arch/x86_cache.h: -------------------------------------------------------------------------------- 1 | 2 | //----------------------------------------------------------------------------- 3 | // Copyright (c) 2006-2014, Fusion-io, Inc.(acquired by SanDisk Corp. 2014) 4 | // Copyright (c) 2014 SanDisk Corp. and/or all its affiliates. All rights reserved. 5 | // 6 | // Redistribution and use in source and binary forms, with or without 7 | // modification, are permitted provided that the following conditions are met: 8 | // * Redistributions of source code must retain the above copyright notice, 9 | // this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above copyright notice, 11 | // this list of conditions and the following disclaimer in the documentation 12 | // and/or other materials provided with the distribution. 13 | // * Neither the name of the SanDisk Corp. nor the names of its contributors 14 | // may be used to endorse or promote products derived from this software 15 | // without specific prior written permission. 16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 18 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 19 | // A PARTICULAR PURPOSE ARE DISCLAIMED. 20 | // IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 21 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 22 | // OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 23 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 24 | // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 25 | // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | //----------------------------------------------------------------------------- 29 | 30 | #ifndef __FIO_PORT_X86_CACHE__ 31 | #define __FIO_PORT_X86_CACHE__ 32 | 33 | #define FUSION_CACHE_LINE_SIZE 64 34 | #define FUSION_HAS_PREFETCH 1 35 | 36 | #ifdef __GNUC__ 37 | 38 | static inline void fusion_prefetch_t0(void *addr){ 39 | __asm__ __volatile__("\n\tprefetcht0 %0" 40 | : 41 | : "m" (addr)); 42 | } 43 | 44 | static inline void fusion_prefetch_nta(void *addr){ 45 | __asm__ __volatile__("\n\tprefetchnta %0" 46 | : 47 | : "m" (addr)); 48 | } 49 | 50 | 51 | static inline void fusion_prefetch_page(void *addr) 52 | { 53 | __asm__ __volatile__( 54 | " prefetcht0 0*64(%0)\n" 55 | : 56 | : "r" (addr)); 57 | } 58 | 59 | #else /* __GNUC__ */ 60 | 61 | /* 62 | The following functions should be provided for different compilers 63 | WINNT in particular. Until then, they are going to do nothing. 64 | */ 65 | 66 | static inline void fusion_prefetch_t0(void *addr) 67 | { 68 | } 69 | 70 | static inline void fusion_prefetch_nta(void *addr) 71 | { 72 | } 73 | 74 | static inline void fusion_prefetch_page(void *addr) 75 | { 76 | } 77 | 78 | #endif /* __GNUC__ */ 79 | 80 | #endif /* __FIO_PORT_X86_CACHE__ */ 81 | -------------------------------------------------------------------------------- /root/usr/src/iomemory-vsl-3.2.16/include/fio/port/atomic_list.h: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------------------- 2 | // Copyright (c) 2011-2014, Fusion-io, Inc.(acquired by SanDisk Corp. 2014) 3 | // Copyright (c) 2014 SanDisk Corp. and/or all its affiliates. All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // * Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // * Neither the name of the SanDisk Corp. nor the names of its contributors 13 | // may be used to endorse or promote products derived from this software 14 | // without specific prior written permission. 15 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 17 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 18 | // A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | // IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 20 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 21 | // OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | //----------------------------------------------------------------------------- 28 | 29 | #ifndef __FUSION_ATOMIC_LIST_H__ 30 | #define __FUSION_ATOMIC_LIST_H__ 31 | 32 | #include 33 | 34 | /* 35 | * Below is an implementation of a singly linked compare-and-exchange (or 36 | * load and swap) list. It is safe to add to this list without protection 37 | * of locks. 38 | */ 39 | struct fio_atomic_list 40 | { 41 | struct fio_atomic_list *next; 42 | }; 43 | 44 | #define fusion_atomic_list_init(head) ((head)->next = NULL) 45 | 46 | static inline int fusion_atomic_list_empty(struct fio_atomic_list *list) 47 | { 48 | return list->next == NULL; 49 | } 50 | 51 | static inline void fusion_atomic_list_add(struct fio_atomic_list *entry, 52 | struct fio_atomic_list *head) 53 | { 54 | struct fio_atomic_list *cur; 55 | 56 | do 57 | { 58 | cur = head->next; 59 | entry->next = cur; 60 | } while (kfio_cmpxchg(&head->next, cur, entry) != cur); 61 | } 62 | 63 | static inline void fusion_atomic_list_splice(struct fio_atomic_list *list, 64 | struct fio_atomic_list *head) 65 | { 66 | head->next = kfio_xchg(&list->next, NULL); 67 | } 68 | 69 | #define fusion_atomic_list_for_each(pos, n, head) \ 70 | for (pos = (head)->next, (n = pos ? pos->next : NULL); pos; \ 71 | pos = n, n = pos ? pos->next : NULL) 72 | 73 | #endif 74 | -------------------------------------------------------------------------------- /root/usr/src/iomemory-vsl-3.2.16/include/fio/port/cdev.h: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------------------- 2 | // Copyright (c) 2006-2014, Fusion-io, Inc.(acquired by SanDisk Corp. 2014) 3 | // Copyright (c) 2014 SanDisk Corp. and/or all its affiliates. All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // * Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // * Neither the name of the SanDisk Corp. nor the names of its contributors 13 | // may be used to endorse or promote products derived from this software 14 | // without specific prior written permission. 15 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 17 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 18 | // A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | // IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 20 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 21 | // OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | //----------------------------------------------------------------------------- 28 | 29 | /** @file 30 | * NO OS-SPECIFIC REFERENCES ARE TO BE IN THIS FILE 31 | * 32 | */ 33 | /******************************************************************************* 34 | * Supported platforms / OS: 35 | * x86_64 Linux, Solaris, FreeBSD 36 | * PPC_64 Linux 37 | * SPARC_64 Solaris 38 | * Apple OS X v 10.6+ 39 | * (MS Windows 2003 64 bit) 40 | ******************************************************************************/ 41 | #ifndef __FIO_PORT_KTYPES_H__ 42 | #error Please include rather than this file directly. 43 | #endif 44 | #ifndef __FIO_PORT_CDEV_H__ 45 | #define __FIO_PORT_CDEV_H__ 46 | 47 | struct fusion_nand_device; 48 | 49 | /** 50 | * @struct fusion_misc_device 51 | * @brief placeholder struct that is large enough for the @e real OS-specific 52 | * variant 53 | */ 54 | struct fusion_misc_device { 55 | char foo[120]; 56 | }; 57 | typedef struct fusion_misc_device kfio_misc_device_t; 58 | 59 | typedef struct __fusion_poll_struct kfio_poll_struct; 60 | 61 | extern void kfio_poll_init(kfio_poll_struct *p); 62 | 63 | /** 64 | * @brief Returns the first fusion_nand_device in the system 65 | */ 66 | struct fusion_nand_device *fusion_nand_get_first(void); 67 | 68 | /** 69 | * @brief Return the next fusion_nand_device in the system 70 | */ 71 | struct fusion_nand_device *fusion_nand_get_next(struct fusion_nand_device *last); 72 | 73 | /** 74 | * @brief Gets the kernels miscdevice structure located inside the 75 | * fusion_nand_device 76 | */ 77 | kfio_misc_device_t *fusion_nand_get_miscdev(struct fusion_nand_device *entry); 78 | 79 | /** 80 | * @brief Get the device number of the nand device 81 | */ 82 | uint32_t fusion_nand_get_devnum(struct fusion_nand_device *entry); 83 | 84 | /** 85 | * @brief Get the PCI bus name of the device 86 | */ 87 | const char *fusion_nand_get_bus_name(struct fusion_nand_device *entry); 88 | 89 | /** 90 | * @brief Get the device name of the fusion_nand_device 91 | */ 92 | char *fusion_nand_get_dev_name(struct fusion_nand_device *entry); 93 | 94 | /** 95 | * @brief get kfio_pci_dev_t * given fusion_nand_device 96 | */ 97 | void *fusion_nand_get_pci_dev(const struct fusion_nand_device *entry); 98 | 99 | /** 100 | * @brief The wrapper will call this function to get ioctl information to the 101 | * kernel. 102 | */ 103 | int fusion_control_ioctl(void *nand, unsigned int cmd, fio_uintptr_t arg); 104 | /** 105 | * Returns 1 if event set, else 0 106 | */ 107 | int is_nand_device_event_set(struct fusion_nand_device *entry); 108 | 109 | /** 110 | * @brief get kfio_poll_struct * given fusion_nand_device 111 | */ 112 | kfio_poll_struct *nand_device_get_poll_struct(struct fusion_nand_device *entry); 113 | 114 | /** 115 | * @brief wakes anyone waiting on poll() 116 | */ 117 | void kfio_poll_wake(kfio_poll_struct *p); 118 | 119 | /** 120 | * @brief returns 1 iff the first argument refers to an ioctl that must 121 | * be called on a block device. 122 | */ 123 | int fusion_is_block_ioctl(unsigned cmd); 124 | 125 | #endif // __FIO_PORT_CDEV_H__ 126 | -------------------------------------------------------------------------------- /root/usr/src/iomemory-vsl-3.2.16/include/fio/port/common-linux/commontypes.h: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------------------- 2 | // Copyright (c) 2006-2014, Fusion-io, Inc.(acquired by SanDisk Corp. 2014) 3 | // Copyright (c) 2014 SanDisk Corp. and/or all its affiliates. All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // * Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // * Neither the name of the SanDisk Corp. nor the names of its contributors 13 | // may be used to endorse or promote products derived from this software 14 | // without specific prior written permission. 15 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 17 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 18 | // A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | // IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 20 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 21 | // OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | //----------------------------------------------------------------------------- 28 | 29 | // 30 | // This file is shared between kernel and user source files. All items shared 31 | // between the two environments are included in here... 32 | // 33 | 34 | #ifndef __FUSION_LINUX_COMMONTYPES_H__ 35 | #define __FUSION_LINUX_COMMONTYPES_H__ 36 | 37 | #include 38 | 39 | #define ATTRIBUTE_ALIGNED(x) \ 40 | __attribute__((aligned(x))) 41 | 42 | #ifdef __cplusplus 43 | // c/c++ linkage errors eliminated 44 | #define C_ASSERT(x) extern "C" int __CPP_ASSERT__ [(x)?1:-1] 45 | #else 46 | # if !defined(GCC_VERSION) 47 | #define GCC_VERSION (__GNUC__ * 10000 \ 48 | + __GNUC_MINOR__ * 100 \ 49 | + __GNUC_PATCHLEVEL__) 50 | # endif 51 | # if GCC_VERSION > 70300 52 | #define C_ASSERT(x) extern int __C_ASSERT__ [(x)?1:1] 53 | # else 54 | #define C_ASSERT(x) extern int __C_ASSERT__ [(x)?1:-1] 55 | # endif 56 | #endif 57 | 58 | #define UFIO_CONTROL_DEVICE_PATH "/dev/" 59 | #define UFIO_CONTROL_DEVICE_COMMON_PATH UFIO_CONTROL_DEVICE_PATH 60 | #define UFIO_CONTROL_DEVICE_PREFIX "fct" 61 | #if (KFIO_SCSI_DEVICE==1) 62 | #define UFIO_BLOCK_DEVICE_PREFIX "scsi" 63 | #else 64 | #define UFIO_BLOCK_DEVICE_PREFIX "fio" 65 | #endif 66 | #define UFIO_CONTROL_DEVICE_BASE UFIO_CONTROL_DEVICE_PATH UFIO_CONTROL_DEVICE_PREFIX 67 | 68 | // Add 10 to ensure that we have sufficient padding in the device name 69 | // which will either be "fct" or "fio" plus the identifier. 70 | #define UFIO_DEVICE_FILE_MAX_LEN sizeof(UFIO_CONTROL_DEVICE_PATH) + 10 71 | 72 | #endif // __FUSION_LINUX_COMMONTYPES_H__ 73 | 74 | -------------------------------------------------------------------------------- /root/usr/src/iomemory-vsl-3.2.16/include/fio/port/common-linux/div64.h: -------------------------------------------------------------------------------- 1 | 2 | //----------------------------------------------------------------------------- 3 | // Copyright (c) 2006-2014, Fusion-io, Inc.(acquired by SanDisk Corp. 2014) 4 | // Copyright (c) 2014 SanDisk Corp. and/or all its affiliates. All rights reserved. 5 | // 6 | // Redistribution and use in source and binary forms, with or without 7 | // modification, are permitted provided that the following conditions are met: 8 | // * Redistributions of source code must retain the above copyright notice, 9 | // this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above copyright notice, 11 | // this list of conditions and the following disclaimer in the documentation 12 | // and/or other materials provided with the distribution. 13 | // * Neither the name of the SanDisk Corp. nor the names of its contributors 14 | // may be used to endorse or promote products derived from this software 15 | // without specific prior written permission. 16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 18 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 19 | // A PARTICULAR PURPOSE ARE DISCLAIMED. 20 | // IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 21 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 22 | // OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 23 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 24 | // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 25 | // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | //----------------------------------------------------------------------------- 29 | 30 | #ifndef _KFIO_LINUX_DIV64_H 31 | #define _KFIO_LINUX_DIV64_H 32 | 33 | /** 34 | * @ingroup PORT_COMMON_LINUX 35 | * @{ 36 | */ 37 | 38 | #if FIO_BITS_PER_LONG == 64 39 | 40 | static inline uint64_t kfio_div64_64(uint64_t dividend, uint64_t divisor) 41 | { 42 | return dividend / divisor; // For 64-bit, can directly return the quotient. 43 | } 44 | 45 | static inline uint64_t kfio_mod64_64(uint64_t dividend, uint64_t divisor) 46 | { 47 | return dividend % divisor; 48 | } 49 | 50 | #else 51 | 52 | uint64_t kfio_div64_64(uint64_t dividend, uint64_t divisor); 53 | uint64_t kfio_mod64_64(uint64_t divident, uint64_t divisor); 54 | 55 | #endif 56 | /** 57 | * @} 58 | */ 59 | 60 | #endif /* _KFIO_LINUX_DIV64_H */ 61 | -------------------------------------------------------------------------------- /root/usr/src/iomemory-vsl-3.2.16/include/fio/port/common-linux/errno.h: -------------------------------------------------------------------------------- 1 | 2 | //----------------------------------------------------------------------------- 3 | // Copyright (c) 2006-2014, Fusion-io, Inc.(acquired by SanDisk Corp. 2014) 4 | // Copyright (c) 2014 SanDisk Corp. and/or all its affiliates. All rights reserved. 5 | // 6 | // Redistribution and use in source and binary forms, with or without 7 | // modification, are permitted provided that the following conditions are met: 8 | // * Redistributions of source code must retain the above copyright notice, 9 | // this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above copyright notice, 11 | // this list of conditions and the following disclaimer in the documentation 12 | // and/or other materials provided with the distribution. 13 | // * Neither the name of the SanDisk Corp. nor the names of its contributors 14 | // may be used to endorse or promote products derived from this software 15 | // without specific prior written permission. 16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 18 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 19 | // A PARTICULAR PURPOSE ARE DISCLAIMED. 20 | // IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 21 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 22 | // OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 23 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 24 | // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 25 | // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | //----------------------------------------------------------------------------- 29 | 30 | #ifndef __FIO_PORT_LINUX_ERRNO_H__ 31 | #define __FIO_PORT_LINUX_ERRNO_H__ 32 | 33 | #if !defined(__FIO_PORT_ERRNO_H__) 34 | #error Dont include directly - instead include 35 | #endif 36 | 37 | #if !defined(__KERNEL__) 38 | # include 39 | #endif 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /root/usr/src/iomemory-vsl-3.2.16/include/fio/port/common-linux/kblock.h: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------------------- 2 | // Copyright (c) 2006-2014, Fusion-io, Inc.(acquired by SanDisk Corp. 2014) 3 | // Copyright (c) 2014-2015 SanDisk Corp. and/or all its affiliates. All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // * Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // * Neither the name of the SanDisk Corp. nor the names of its contributors 13 | // may be used to endorse or promote products derived from this software 14 | // without specific prior written permission. 15 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 17 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 18 | // A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | // IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 20 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 21 | // OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | //----------------------------------------------------------------------------- 28 | /** @file 29 | * NO OS-SPECIFIC REFERENCES ARE TO BE IN THIS FILE 30 | * 31 | */ 32 | #ifndef __FIO_PORT_LINUX_KBLOCK_H__ 33 | #define __FIO_PORT_LINUX_KBLOCK_H__ 34 | 35 | #define FIO_NUM_MINORS 16 36 | 37 | typedef enum 38 | { 39 | destroy_type_normal, 40 | destroy_type_force 41 | } destroy_type_t; 42 | 43 | extern int kfio_init_storage_interface(void); 44 | extern int kfio_teardown_storage_interface(void); 45 | 46 | extern int kfio_create_disk(struct fio_device *dev, kfio_pci_dev_t *pci_dev, 47 | uint32_t sector_size, 48 | uint32_t max_sectors_per_request, 49 | uint32_t max_sg_elements_per_request, 50 | fusion_spinlock_t *queue_lock, kfio_disk_t **diskp, 51 | kfio_numa_node_t node); 52 | extern int kfio_expose_disk(kfio_disk_t *dp, char *name, int major, int disk_index, 53 | uint64_t reported_capacity, uint32_t sector_size, 54 | uint32_t max_sg_elements_per_request); 55 | extern void kfio_destroy_disk(kfio_disk_t *disk, destroy_type_t dt); 56 | 57 | extern void fio_bio_posted(struct fio_device *dev); 58 | 59 | #define FIO_ATOMIC_WRITE_USER_IOV 0x01 60 | #define FIO_ATOMIC_WRITE_USER_PAGES 0x02 61 | 62 | extern int kfio_handle_atomic(struct fio_device *dev, const struct kfio_iovec *iov, uint32_t iovcnt, uint32_t *bytes_written, uint32_t flags); 63 | extern int fio_count_sectors_inuse(struct fio_device *dev, uint64_t base, uint64_t length, uint64_t *count); 64 | 65 | #endif // __FIO_PORT_LINUX_KBLOCK_H__ 66 | -------------------------------------------------------------------------------- /root/usr/src/iomemory-vsl-3.2.16/include/fio/port/common-linux/kcondvar.h: -------------------------------------------------------------------------------- 1 | 2 | //----------------------------------------------------------------------------- 3 | // Copyright (c) 2006-2014, Fusion-io, Inc.(acquired by SanDisk Corp. 2014) 4 | // Copyright (c) 2014 SanDisk Corp. and/or all its affiliates. All rights reserved. 5 | // 6 | // Redistribution and use in source and binary forms, with or without 7 | // modification, are permitted provided that the following conditions are met: 8 | // * Redistributions of source code must retain the above copyright notice, 9 | // this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above copyright notice, 11 | // this list of conditions and the following disclaimer in the documentation 12 | // and/or other materials provided with the distribution. 13 | // * Neither the name of the SanDisk Corp. nor the names of its contributors 14 | // may be used to endorse or promote products derived from this software 15 | // without specific prior written permission. 16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 18 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 19 | // A PARTICULAR PURPOSE ARE DISCLAIMED. 20 | // IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 21 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 22 | // OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 23 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 24 | // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 25 | // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | //----------------------------------------------------------------------------- 29 | 30 | #ifndef __FIO_PORT_KCONDVAR_H__ 31 | #error Please include rather than this file directly. 32 | #endif 33 | #ifndef __FIO_PORT_LINUX_KCONDVAR_H__ 34 | #define __FIO_PORT_LINUX_KCONDVAR_H__ 35 | 36 | #if !defined(__linux__) 37 | #error This file supports only Linux 38 | #endif 39 | 40 | typedef fusion_spinlock_t fusion_cv_lock_t; 41 | 42 | #define fusion_cv_lock_init(lk, n) fusion_init_spin(lk, n) 43 | #define fusion_cv_lock_destroy(lk) fusion_destroy_spin(lk) 44 | #define fusion_cv_lock(lk) fusion_spin_lock(lk) 45 | #define fusion_cv_trylock(lk) fusion_spin_trylock(lk) 46 | #define fusion_cv_unlock(lk) fusion_spin_unlock(lk) 47 | #define fusion_cv_lock_irq(lk) fusion_spin_lock_irqsave(lk) 48 | #define fusion_cv_trylock_irq(lk) fusion_spin_trylock_irqsave(lk) 49 | #define fusion_cv_unlock_irq(lk) fusion_spin_unlock_irqrestore(lk) 50 | #define fusion_cv_lock_is_irqsaved(lk) fusion_spin_is_irqsaved(lk) 51 | 52 | #endif 53 | 54 | -------------------------------------------------------------------------------- /root/usr/src/iomemory-vsl-3.2.16/include/fio/port/common-linux/kpci.h: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------------------- 2 | // Copyright (c) 2006-2014, Fusion-io, Inc.(acquired by SanDisk Corp. 2014) 3 | // Copyright (c) 2014-2015 SanDisk Corp. and/or all its affiliates. All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // * Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // * Neither the name of the SanDisk Corp. nor the names of its contributors 13 | // may be used to endorse or promote products derived from this software 14 | // without specific prior written permission. 15 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 17 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 18 | // A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | // IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 20 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 21 | // OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | //----------------------------------------------------------------------------- 28 | 29 | #ifndef __FIO_PORT_LINUX_KPCI_H__ 30 | #define __FIO_PORT_LINUX_KPCI_H__ 31 | 32 | /** 33 | * @ingroup PORT_COMMON_LINUX 34 | * @{ 35 | */ 36 | 37 | /** 38 | * @} 39 | */ 40 | #endif /* __FIO_PORT_LINUX__KPCI_H__ */ 41 | 42 | 43 | -------------------------------------------------------------------------------- /root/usr/src/iomemory-vsl-3.2.16/include/fio/port/common-linux/kscsi_config.h: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------- 2 | // Copyright (c) 2013-2014, Fusion-io, Inc.(acquired by SanDisk Corp. 2014) 3 | // Copyright (c) 2014 SanDisk Corp. and/or all its affiliates. All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // * Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // * Neither the name of the SanDisk Corp. nor the names of its contributors 13 | // may be used to endorse or promote products derived from this software 14 | // without specific prior written permission. 15 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 17 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 18 | // A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | // IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 20 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 21 | // OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | // -------------------------------------------------------------------------- 28 | 29 | // This file provides working or nonworking definitions for distros that are missing 30 | // some midlayer stuff. 31 | 32 | #ifndef _FIO_PORT_COMMON_LINUX_KSCSI_CONFIG 33 | #define _FIO_PORT_COMMON_LINUX_KSCSI_CONFIG 34 | 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | 41 | /** 42 | * @ingroup PORT_COMMON_LINUX 43 | * @{ 44 | */ 45 | 46 | // Set to 0 to cause an error if SCSI is enabled and distro does not support SCSI. 47 | // Set to 1 to allow compiling all distros with SCSI enabled 48 | // (even if they might not function until the missing interfaces are created). 49 | #define FIO_PORT_SCSI_ALLOW_COMPILE_BAD_DISTRO 1 50 | 51 | struct scsi_cmnd; 52 | struct Scsi_Host; 53 | struct scatterlist; 54 | struct page; 55 | 56 | // Some linux variants don't define these macros 57 | #ifndef set_driver_byte 58 | #define set_driver_byte(cmnd, hsts) ((cmnd)->result |= (hsts) << 24) 59 | #endif 60 | #ifndef set_host_byte 61 | #define set_host_byte(cmnd, dsts) ((cmnd)->result |= (dsts) << 16) 62 | #endif 63 | 64 | #if KFIOC_HAS_SCSI_SG_FNS && KFIOC_HAS_SCSI_RESID_FNS 65 | #define KFIOC_PORT_SUPPORTS_SCSI 1 66 | #else 67 | #define KFIOC_PORT_SUPPORTS_SCSI 0 68 | #endif 69 | 70 | static inline void fio_port_scsi_unsupported_distro(void) 71 | { 72 | #if FIO_PORT_SCSI_ALLOW_COMPILE_BAD_DISTRO 73 | kassert_msg(false, "This distro does not support SCSI"); 74 | #else 75 | #error ERROR: This distro does not support SCSI 76 | #endif 77 | } 78 | 79 | #define UNSUP { fio_port_scsi_unsupported_distro(); } 80 | #define UNSUPR(r) { fio_port_scsi_unsupported_distro(); return r; } 81 | 82 | // Distros that do not define for_each_sg don't have sg iteration. 83 | // The only user is kfio_sgl_map_scatter(). 84 | // Define what is needed here in a way that avoids unused variables. 85 | #ifndef for_each_sg 86 | static inline struct page *sg_page(struct scatterlist *sg) UNSUPR(NULL) 87 | #define for_each_sg(sglist, sg, nr, __i) \ 88 | for (__i = 0, sg = (sglist); __i < (nr); ) 89 | #endif 90 | 91 | #if KFIOC_HAS_SCSI_SG_FNS==0 92 | static inline unsigned scsi_sg_count(struct scsi_cmnd *scmd) UNSUPR(0) 93 | static inline struct scatterlist *scsi_sglist(struct scsi_cmnd *scmd) UNSUPR(NULL) 94 | static inline unsigned scsi_bufflen(struct scsi_cmnd *scmd) UNSUPR(0) 95 | static inline void *shost_priv(struct Scsi_Host *shost) UNSUPR(NULL) 96 | #endif 97 | 98 | #if KFIOC_HAS_SCSI_SG_COPY_FNS==0 99 | // implementation for 2.6.18 100 | static inline int scsi_sg_copy_from_buffer(struct scsi_cmnd *cmd, void *buf, int buflen) 101 | { 102 | memcpy(cmd->request_buffer, buf, buflen); 103 | return 0; 104 | } 105 | 106 | static inline int scsi_sg_copy_to_buffer(struct scsi_cmnd *cmd, void *buf, int buflen) 107 | { 108 | memcpy(buf, cmd->request_buffer, buflen); 109 | return 0; 110 | } 111 | #endif 112 | 113 | #if KFIOC_HAS_SCSI_RESID_FNS==0 114 | static inline void scsi_set_resid(struct scsi_cmnd *scmd, int resid) UNSUP 115 | static inline int scsi_get_resid(struct scsi_cmnd *scmd) UNSUPR(0) 116 | #endif 117 | 118 | /** 119 | * @} 120 | */ 121 | 122 | #endif // _FIO_PORT_COMMON_LINUX_KSCSI_CONFIG 123 | -------------------------------------------------------------------------------- /root/usr/src/iomemory-vsl-3.2.16/include/fio/port/common-linux/kscsi_host.h: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------- 2 | // Copyright (c) 2013-2014, Fusion-io, Inc.(acquired by SanDisk Corp. 2014) 3 | // Copyright (c) 2014 SanDisk Corp. and/or all its affiliates. All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // * Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // * Neither the name of the SanDisk Corp. nor the names of its contributors 13 | // may be used to endorse or promote products derived from this software 14 | // without specific prior written permission. 15 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 17 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 18 | // A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | // IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 20 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 21 | // OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | // -------------------------------------------------------------------------- 28 | 29 | // This file contains SCSI driver interfaces between the common-linux and linux-specific porting layers. 30 | // It provides initialization and teardown interfaces for the linux-specific ports. 31 | // It supports slight differences in linux variant mid-layer semantics. 32 | 33 | #ifndef _FIO_PORT_COMMON_LINUX_KSCSI_HOST 34 | #define _FIO_PORT_COMMON_LINUX_KSCSI_HOST 35 | 36 | #include 37 | 38 | // linux-specific => "wherever the storage interface is" interfaces. 39 | // -For block devices, the storage interface is in specific-linux. 40 | // -For SCSI devices, the storage interface is in fio-scsi. 41 | 42 | extern int kfio_init_storage_interface(void); 43 | extern int kfio_teardown_storage_interface(void); 44 | 45 | // common-linux => linux-specific interfaces. 46 | 47 | struct Scsi_Host; 48 | struct pci_dev; 49 | 50 | extern int fio_port_scsi_host_register_host(struct Scsi_Host *sh, struct pci_dev *pdev); 51 | extern void fio_port_scsi_host_unregister_host(struct Scsi_Host *sh); 52 | 53 | #endif // _FIO_PORT_COMMON_LINUX_KSCSI_HOST 54 | -------------------------------------------------------------------------------- /root/usr/src/iomemory-vsl-3.2.16/include/fio/port/common-linux/stdint.h: -------------------------------------------------------------------------------- 1 | 2 | //----------------------------------------------------------------------------- 3 | // Copyright (c) 2006-2014, Fusion-io, Inc.(acquired by SanDisk Corp. 2014) 4 | // Copyright (c) 2014 SanDisk Corp. and/or all its affiliates. All rights reserved. 5 | // 6 | // Redistribution and use in source and binary forms, with or without 7 | // modification, are permitted provided that the following conditions are met: 8 | // * Redistributions of source code must retain the above copyright notice, 9 | // this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above copyright notice, 11 | // this list of conditions and the following disclaimer in the documentation 12 | // and/or other materials provided with the distribution. 13 | // * Neither the name of the SanDisk Corp. nor the names of its contributors 14 | // may be used to endorse or promote products derived from this software 15 | // without specific prior written permission. 16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 18 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 19 | // A PARTICULAR PURPOSE ARE DISCLAIMED. 20 | // IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 21 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 22 | // OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 23 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 24 | // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 25 | // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | //----------------------------------------------------------------------------- 29 | 30 | #ifndef __FIO_PORT_LINUX_STDINT_H__ 31 | #define __FIO_PORT_LINUX_STDINT_H__ 32 | 33 | /** 34 | * @ingroup PORT_COMMON_LINUX 35 | * @{ 36 | */ 37 | #ifndef _LINUX_TYPES_H 38 | 39 | /* Exact integral types. */ 40 | 41 | /* Signed. */ 42 | 43 | typedef signed char int8_t; 44 | typedef short int int16_t; 45 | typedef int int32_t; 46 | # if defined(__x86_64__) || defined(__PPC64__) || defined(__mips64) 47 | typedef long int int64_t; 48 | 49 | # else 50 | __extension__ 51 | typedef long long int int64_t; 52 | 53 | # endif 54 | 55 | /* Unsigned. */ 56 | typedef unsigned char uint8_t; 57 | typedef unsigned short int uint16_t; 58 | #ifndef __uint32_t_defined 59 | typedef unsigned int uint32_t; 60 | # define __uint32_t_defined 61 | #endif 62 | 63 | #if defined(__x86_64__) || defined(__PPC64__) || defined(__mips64) 64 | typedef unsigned long int uint64_t; 65 | 66 | #else 67 | __extension__ 68 | typedef unsigned long long int uint64_t; 69 | 70 | #endif 71 | 72 | #endif // _LINUX_TYPES_H 73 | 74 | #if defined(__x86_64__) || defined(__PPC64__) || defined(__mips64) 75 | #if !defined PRIi64 76 | #define PRIi64 "ld" 77 | #endif 78 | #if !defined PRIu64 79 | #define PRIu64 "lu" 80 | #endif 81 | #if !defined PRIx64 82 | #define PRIx64 "lx" 83 | #endif 84 | 85 | #else 86 | #if !defined PRIi64 87 | #define PRIi64 "lld" 88 | #endif 89 | #if !defined PRIu64 90 | #define PRIu64 "llu" 91 | #endif 92 | #if !defined PRIx64 93 | #define PRIx64 "llx" 94 | #endif 95 | 96 | #endif 97 | 98 | /** 99 | * @} 100 | */ 101 | 102 | #endif 103 | -------------------------------------------------------------------------------- /root/usr/src/iomemory-vsl-3.2.16/include/fio/port/common-linux/ufio.h: -------------------------------------------------------------------------------- 1 | 2 | //----------------------------------------------------------------------------- 3 | // Copyright (c) 2006-2014, Fusion-io, Inc.(acquired by SanDisk Corp. 2014) 4 | // Copyright (c) 2014 SanDisk Corp. and/or all its affiliates. All rights reserved. 5 | // 6 | // Redistribution and use in source and binary forms, with or without 7 | // modification, are permitted provided that the following conditions are met: 8 | // * Redistributions of source code must retain the above copyright notice, 9 | // this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above copyright notice, 11 | // this list of conditions and the following disclaimer in the documentation 12 | // and/or other materials provided with the distribution. 13 | // * Neither the name of the SanDisk Corp. nor the names of its contributors 14 | // may be used to endorse or promote products derived from this software 15 | // without specific prior written permission. 16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 18 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 19 | // A PARTICULAR PURPOSE ARE DISCLAIMED. 20 | // IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 21 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 22 | // OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 23 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 24 | // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 25 | // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | //----------------------------------------------------------------------------- 29 | 30 | #ifndef _FIO_PORT_LINUX_UFIO_H_ 31 | # define _FIO_PORT_LINUX_UFIO_H_ 32 | 33 | # ifndef _FIO_PORT_UFIO_H_ 34 | # error Do not include this file directly - instead include 35 | # endif 36 | 37 | # define UFIO_CONTROL_DEVICE_PATH "/dev/" 38 | 39 | # define UFIO_KINFO_ROOT "fusion" 40 | 41 | # define UFIO_MODPARAMS_DIR "/sys/module/" FIO_DRIVER_NAME "/parameters" 42 | 43 | # define _FILE_OFFSET_BITS 64 44 | 45 | # if !defined(__KERNEL__) 46 | # include 47 | # include 48 | 49 | # if FUSION_DEBUG 50 | 51 | #if defined(__x86_64__) || defined(__i386__) 52 | # define kassert(x) do { if(!(x)) { fprintf(stderr, "ASSERT FAILED: %s:%d %s\n", __FILE__, __LINE__, #x); asm("int3"); } } while(0) 53 | #else 54 | # define kassert(x) do { if(!(x)) { fprintf(stderr, "ASSERT FAILED: %s:%d %s\n", __FILE__, __LINE__, #x); exit(-1); } } while(0) 55 | #endif 56 | # define kdebug(x) x 57 | 58 | # else 59 | 60 | # define kassert(x) do { } while(0) 61 | # define kdebug(x) do { } while(0) 62 | 63 | # endif 64 | 65 | # endif /* !defined(__KERNEL__) */ 66 | 67 | #endif /* _FIO_PORT_LINUX_UFIO_H_ */ 68 | -------------------------------------------------------------------------------- /root/usr/src/iomemory-vsl-3.2.16/include/fio/port/commontypes.h: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------------------- 2 | // Copyright (c) 2006-2014, Fusion-io, Inc.(acquired by SanDisk Corp. 2014) 3 | // Copyright (c) 2014 SanDisk Corp. and/or all its affiliates. All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // * Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // * Neither the name of the SanDisk Corp. nor the names of its contributors 13 | // may be used to endorse or promote products derived from this software 14 | // without specific prior written permission. 15 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 17 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 18 | // A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | // IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 20 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 21 | // OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | //----------------------------------------------------------------------------- 28 | 29 | #ifndef _FIO_PORT_COMMONTYPES_H_ 30 | #define _FIO_PORT_COMMONTYPES_H_ 31 | 32 | #include 33 | 34 | #if defined(USERSPACE_KERNEL) 35 | #include 36 | #elif defined(__linux__) || defined(__VMKLNX__) 37 | #include 38 | #elif defined(__SVR4) && defined(__sun) 39 | #include 40 | #elif defined(__hpux__) 41 | #include 42 | #elif defined(__FreeBSD__) 43 | #include 44 | #elif defined(__OSX__) 45 | #include 46 | #elif defined(_AIX) 47 | #include 48 | #elif defined(WINNT) || defined(WIN32) 49 | #include 50 | #elif defined(UEFI) 51 | #include 52 | #else 53 | #error Unsupported OS - if you are porting, try starting with a copy of stubs 54 | #endif 55 | 56 | #endif /* _FIO_PORT_COMMONTYPES_H_ */ 57 | -------------------------------------------------------------------------------- /root/usr/src/iomemory-vsl-3.2.16/include/fio/port/compiler.h: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------------------- 2 | // Copyright (c) 2006-2014, Fusion-io, Inc.(acquired by SanDisk Corp. 2014) 3 | // Copyright (c) 2014-2016 SanDisk Corp. and/or all its affiliates. All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // * Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // * Neither the name of the SanDisk Corp. nor the names of its contributors 13 | // may be used to endorse or promote products derived from this software 14 | // without specific prior written permission. 15 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 17 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 18 | // A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | // IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 20 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 21 | // OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | //----------------------------------------------------------------------------- 28 | 29 | /* FIXME - this should be added to some general include so these are globally available 30 | * without specifically including this file. 31 | */ 32 | 33 | #ifndef __FIO_PORT_COMPILER_H__ 34 | #define __FIO_PORT_COMPILER_H__ 35 | 36 | #if defined(USERSPACE_KERNEL) 37 | # include 38 | #elif defined(__linux__) || defined(__VMKLNX__) 39 | # include 40 | #elif defined(__SVR4) && defined(__sun) 41 | # include 42 | #elif defined(__FreeBSD__) 43 | # include 44 | #elif defined(__OSX__) 45 | # include 46 | #elif defined(WIN32) || defined(WINNT) 47 | # include 48 | #elif defined(UEFI) 49 | # include 50 | #else 51 | # error Unsupported OS - please define a fio/port//compiler.h and include it in fio/port/compiler.h 52 | #endif 53 | 54 | #ifndef __has_attribute 55 | #define __has_attribute(x) 0 56 | #endif 57 | 58 | #if (__GNUC__ == 4 && __GNUC_MINOR__ >= 9) || (__GNUC__ > 4) || \ 59 | (defined(__clang__) && __has_attribute(returns_nonnull)) 60 | #define FIO_RETURNS_NONNULL __attribute__((returns_nonnull)) 61 | #else 62 | #define FIO_RETURNS_NONNULL 63 | #endif 64 | 65 | #if (defined __GNUC__) || (defined(__clang__) && __has_attribute(nonnull)) 66 | #define FIO_NONNULL_PARAMS __attribute__((nonnull)) 67 | #else 68 | #define FIO_NONNULL_PARAMS 69 | #endif 70 | 71 | #endif 72 | -------------------------------------------------------------------------------- /root/usr/src/iomemory-vsl-3.2.16/include/fio/port/csr_simulator.h: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------------------- 2 | // Copyright (c) 2006-2014, Fusion-io, Inc.(acquired by SanDisk Corp. 2014) 3 | // Copyright (c) 2014 SanDisk Corp. and/or all its affiliates. All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // * Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // * Neither the name of the SanDisk Corp. nor the names of its contributors 13 | // may be used to endorse or promote products derived from this software 14 | // without specific prior written permission. 15 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 17 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 18 | // A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | // IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 20 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 21 | // OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | //----------------------------------------------------------------------------- 28 | 29 | /// @file 30 | /// userspace PCI CSR access emulation. 31 | 32 | #ifndef CSR_SIMULATOR_H_ 33 | # define CSR_SIMULATOR_H_ 34 | 35 | # ifndef _GNU_SOURCE 36 | # define _GNU_SOURCE 37 | # endif 38 | # include 39 | 40 | # include 41 | 42 | struct userspace_fake_pci_dev; 43 | typedef void (* simulated_register_write)(uint32_t val, uint32_t reg_addr, struct userspace_fake_pci_dev *context); 44 | typedef uint32_t (* simulated_register_read)(uint32_t reg_addr, struct userspace_fake_pci_dev *context); 45 | typedef void (* simulated_config_write8)(uint8_t val, uint32_t reg_addr, struct userspace_fake_pci_dev *context); 46 | typedef uint8_t (* simulated_config_read8)(uint32_t reg_addr, struct userspace_fake_pci_dev *context); 47 | typedef void (* simulated_config_write16)(uint16_t val, uint32_t reg_addr, struct userspace_fake_pci_dev *context); 48 | typedef uint16_t (* simulated_config_read16)(uint32_t reg_addr, struct userspace_fake_pci_dev *context); 49 | typedef void (* simulated_config_write32)(uint32_t val, uint32_t reg_addr, struct userspace_fake_pci_dev *context); 50 | typedef uint32_t (* simulated_config_read32)(uint32_t reg_addr, struct userspace_fake_pci_dev *context); 51 | typedef void (* simulated_interrupt)(void); 52 | 53 | typedef void (*userspace_fake_pci_dump_state)(struct userspace_fake_pci_dev *pci_dev); 54 | typedef void (*bitbang_readid)(struct userspace_fake_pci_dev *pci_dev, uint32_t bar_offset, uint8_t ce, uint32_t pads, uint32_t bufwidth, uint8_t idlen, uint8_t *buffer); 55 | typedef void (*bitbang_readstat)(struct userspace_fake_pci_dev *pci_dev, uint32_t bar_offset, uint8_t ce, uint32_t pads, uint8_t *buffer); 56 | 57 | struct fake_pci_mmio_access 58 | { 59 | simulated_register_read read; 60 | simulated_register_write write; 61 | }; 62 | 63 | typedef struct userspace_fake_pci_dev 64 | { 65 | char name[32]; 66 | uint16_t vendor_id; 67 | uint16_t device_id; 68 | uint16_t subsystem_vendor_id; 69 | uint16_t subsystem_device_id; 70 | uint8_t slotnum; 71 | uint8_t bus; 72 | uint8_t devicenum; 73 | uint8_t function; 74 | 75 | struct fake_pci_mmio_access bar[6]; 76 | struct fake_pci_mmio_access expansion_rom; 77 | simulated_config_read8 config_read8; 78 | simulated_config_write8 config_write8; 79 | simulated_config_read16 config_read16; 80 | simulated_config_write16 config_write16; 81 | simulated_config_read32 config_read32; 82 | simulated_config_write32 config_write32; 83 | simulated_interrupt interrupt; 84 | void *isr_arg; 85 | 86 | userspace_fake_pci_dump_state dump_state; // Debug hook 87 | 88 | void *private_data; // private storage for the structure owner 89 | void *drvdata; // storage for pci_get_drvdata/pci_set_drvdata 90 | 91 | unsigned refcount; 92 | pthread_t interrupt_thread; 93 | uint32_t terminate_interrupt_thread; 94 | 95 | // Ugly NANDSIM specific hooks since bitbang registers are not directly supported 96 | bitbang_readid bitbang_readid; 97 | bitbang_readstat bitbang_readstat; 98 | } userspace_fake_pci_dev_t; 99 | 100 | #endif 101 | -------------------------------------------------------------------------------- /root/usr/src/iomemory-vsl-3.2.16/include/fio/port/fio-poppack.h: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------------------- 2 | // Copyright (c) 2006-2014, Fusion-io, Inc.(acquired by SanDisk Corp. 2014) 3 | // Copyright (c) 2014 SanDisk Corp. and/or all its affiliates. All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // * Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // * Neither the name of the SanDisk Corp. nor the names of its contributors 13 | // may be used to endorse or promote products derived from this software 14 | // without specific prior written permission. 15 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 17 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 18 | // A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | // IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 20 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 21 | // OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | //----------------------------------------------------------------------------- 28 | 29 | // NOTE: There is a similar error trap define in include/fio/dev/types.h. 30 | 31 | #if defined(_MSC_VER) 32 | #include 33 | #endif 34 | 35 | #undef ATTRIBUTE_PACKED_ALIGNED 36 | #define ATTRIBUTE_PACKED_ALIGNED(x) ERROR You_must_include_fio_pshpack1_h_before_and_fio_poppack_h_after_any_use_of_ATTRIBUTE_PACKED_ALIGNED_or_UNALIGNED 37 | -------------------------------------------------------------------------------- /root/usr/src/iomemory-vsl-3.2.16/include/fio/port/fio-port.h: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------------------- 2 | // Copyright (c) 2006-2014, Fusion-io, Inc.(acquired by SanDisk Corp. 2014) 3 | // Copyright (c) 2014 SanDisk Corp. and/or all its affiliates. All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // * Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // * Neither the name of the SanDisk Corp. nor the names of its contributors 13 | // may be used to endorse or promote products derived from this software 14 | // without specific prior written permission. 15 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 17 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 18 | // A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | // IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 20 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 21 | // OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | //----------------------------------------------------------------------------- 28 | 29 | #include 30 | 31 | #if defined(__KERNEL__) 32 | # include 33 | #endif 34 | 35 | #include 36 | 37 | #include 38 | 39 | #include 40 | 41 | 42 | -------------------------------------------------------------------------------- /root/usr/src/iomemory-vsl-3.2.16/include/fio/port/fio-pshpack1.h: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------------------- 2 | // Copyright (c) 2006-2014, Fusion-io, Inc.(acquired by SanDisk Corp. 2014) 3 | // Copyright (c) 2014 SanDisk Corp. and/or all its affiliates. All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // * Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // * Neither the name of the SanDisk Corp. nor the names of its contributors 13 | // may be used to endorse or promote products derived from this software 14 | // without specific prior written permission. 15 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 17 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 18 | // A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | // IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 20 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 21 | // OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | //----------------------------------------------------------------------------- 28 | 29 | #if defined(_MSC_VER) 30 | #include 31 | #undef ATTRIBUTE_PACKED_ALIGNED 32 | #define ATTRIBUTE_PACKED_ALIGNED(x) ATTRIBUTE_ALIGNED(x) 33 | 34 | #else 35 | 36 | #undef ATTRIBUTE_PACKED_ALIGNED 37 | #define ATTRIBUTE_PACKED_ALIGNED(x) __attribute__((packed)) __attribute__((aligned(x))) 38 | #endif 39 | 40 | #ifndef ATTRIBUTE_PACKED_UNALIGNED 41 | #define ATTRIBUTE_PACKED_UNALIGNED ATTRIBUTE_PACKED_ALIGNED(1) 42 | #endif 43 | -------------------------------------------------------------------------------- /root/usr/src/iomemory-vsl-3.2.16/include/fio/port/fio-stat.h: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------------------- 2 | // Copyright (c) 2011-2014, Fusion-io, Inc.(acquired by SanDisk Corp. 2014) 3 | // Copyright (c) 2014 SanDisk Corp. and/or all its affiliates. All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // * Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // * Neither the name of the SanDisk Corp. nor the names of its contributors 13 | // may be used to endorse or promote products derived from this software 14 | // without specific prior written permission. 15 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 17 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 18 | // A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | // IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 20 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 21 | // OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | //----------------------------------------------------------------------------- 28 | 29 | #ifndef __FIO_PORT_STAT_H__ 30 | #define __FIO_PORT_STAT_H__ 31 | 32 | // This file creates portability between OS's for the sys/stat.h functions. 33 | 34 | #include 35 | #include 36 | 37 | #if defined(WIN32) || defined(WINNT) 38 | #define stat _stat64 39 | 40 | #define S_IFBLK _S_IFBLK 41 | #define S_IFCHR _S_IFCHR 42 | #define S_IFIFO _S_IFIFO 43 | #define S_IFREG _S_IFREG 44 | #define S_IFLNK _S_IFLNK 45 | #define S_IFSOCK _S_IFSOCK 46 | 47 | #define S_ISBLK(m) (((m) & _S_IFMT) == (_S_IFCHR | _S_IFDIR)) // Maybe this is same as linux? 48 | #define S_ISCHR(m) (((m) & _S_IFMT) == _S_IFCHR) 49 | #endif 50 | 51 | #endif // WIN32 || WINNT 52 | -------------------------------------------------------------------------------- /root/usr/src/iomemory-vsl-3.2.16/include/fio/port/fiostring.h: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------------------- 2 | // Copyright (c) 2010-2014, Fusion-io, Inc.(acquired by SanDisk Corp. 2014) 3 | // Copyright (c) 2014 SanDisk Corp. and/or all its affiliates. All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // * Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // * Neither the name of the SanDisk Corp. nor the names of its contributors 13 | // may be used to endorse or promote products derived from this software 14 | // without specific prior written permission. 15 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 17 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 18 | // A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | // IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 20 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 21 | // OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | //----------------------------------------------------------------------------- 28 | 29 | #ifndef __FIO_STRINGS_H__ 30 | #define __FIO_STRINGS_H__ 31 | 32 | #include 33 | 34 | #if defined(WINNT) || defined(WIN32) 35 | #define strcasecmp _stricmp 36 | #define strncasecmp _strnicmp 37 | #endif 38 | 39 | 40 | #endif // __FIO_STRINGS_H__ 41 | -------------------------------------------------------------------------------- /root/usr/src/iomemory-vsl-3.2.16/include/fio/port/gcc/align.h: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------------------- 2 | // Copyright (c) 2011-2014, Fusion-io, Inc.(acquired by SanDisk Corp. 2014) 3 | // Copyright (c) 2014 SanDisk Corp. and/or all its affiliates. All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // * Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // * Neither the name of the SanDisk Corp. nor the names of its contributors 13 | // may be used to endorse or promote products derived from this software 14 | // without specific prior written permission. 15 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 17 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 18 | // A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | // IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 20 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 21 | // OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | //---------------------------------------------------------------------------------------------------------------------------------------------------------- 28 | 29 | #ifndef __FIO_PORT_GCC_ALIGN_H__ 30 | #define __FIO_PORT_GCC_ALIGN_H__ 31 | 32 | #define FUSION_STRUCT_ALIGN(alignment_byte) __attribute__((aligned(alignment_byte))) 33 | 34 | /* 35 | * Since some incorrect uses of FUSION_STRUCT_ALIGN don't produce a compile 36 | * error nor do they align, all common code uses of FUSION_STRUCT_ALIGN 37 | * should verify proper alignment by calling FUSION_STRUCT_ALIGN_VERIFY. 38 | */ 39 | #define FUSION_STRUCT_ALIGN_VERIFY(align_bytes,structure) \ 40 | C_ASSERT(__alignof__(structure) == (align_bytes)) 41 | 42 | #define DECLARE_RESERVE(x) char foo[x] __attribute__ ((aligned(8))) 43 | 44 | #define FUSION_DMA_ALIGN(x) x __attribute__((aligned(32))) 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /root/usr/src/iomemory-vsl-3.2.16/include/fio/port/gcc/compiler.h: -------------------------------------------------------------------------------- 1 | 2 | //----------------------------------------------------------------------------- 3 | // Copyright (c) 2006-2014, Fusion-io, Inc.(acquired by SanDisk Corp. 2014) 4 | // Copyright (c) 2014-2015 SanDisk Corp. and/or all its affiliates. All rights reserved. 5 | // 6 | // Redistribution and use in source and binary forms, with or without 7 | // modification, are permitted provided that the following conditions are met: 8 | // * Redistributions of source code must retain the above copyright notice, 9 | // this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above copyright notice, 11 | // this list of conditions and the following disclaimer in the documentation 12 | // and/or other materials provided with the distribution. 13 | // * Neither the name of the SanDisk Corp. nor the names of its contributors 14 | // may be used to endorse or promote products derived from this software 15 | // without specific prior written permission. 16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 18 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 19 | // A PARTICULAR PURPOSE ARE DISCLAIMED. 20 | // IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 21 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 22 | // OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 23 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 24 | // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 25 | // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | //----------------------------------------------------------------------------- 29 | 30 | /* FIXME - this should be more selective about which gcc version is covered */ 31 | 32 | #ifndef __FIO_PORT_COMPILER_LINUX_H__ 33 | #define __FIO_PORT_COMPILER_LINUX_H__ 34 | 35 | #ifndef __FIO_PORT_COMPILER_H__ 36 | # error Do not include this file directly - instead inclued 37 | #endif 38 | 39 | #define __must_use_result __attribute__((warn_unused_result)) 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /root/usr/src/iomemory-vsl-3.2.16/include/fio/port/ifio.h: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------------------- 2 | // Copyright (c) 2006-2014, Fusion-io, Inc.(acquired by SanDisk Corp. 2014) 3 | // Copyright (c) 2014 SanDisk Corp. and/or all its affiliates. All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // * Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // * Neither the name of the SanDisk Corp. nor the names of its contributors 13 | // may be used to endorse or promote products derived from this software 14 | // without specific prior written permission. 15 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 17 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 18 | // A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | // IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 20 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 21 | // OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | //----------------------------------------------------------------------------- 28 | 29 | #ifndef _FIO_PORT_IFIO_H_ 30 | #define _FIO_PORT_IFIO_H_ 31 | 32 | const char *ifio_strerror(int errnum); 33 | const char *ifio_strerror_sym(int errnum); 34 | 35 | #endif /* _FIO_PORT_IFIO_H_ */ 36 | -------------------------------------------------------------------------------- /root/usr/src/iomemory-vsl-3.2.16/include/fio/port/ioctl.h: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------------------- 2 | // Copyright (c) 2006-2014, Fusion-io, Inc.(acquired by SanDisk Corp. 2014) 3 | // Copyright (c) 2014-2016 SanDisk Corp. and/or all its affiliates. All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // * Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // * Neither the name of the SanDisk Corp. nor the names of its contributors 13 | // may be used to endorse or promote products derived from this software 14 | // without specific prior written permission. 15 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 17 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 18 | // A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | // IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 20 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 21 | // OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | //----------------------------------------------------------------------------- 28 | 29 | #ifndef _FIO_GENERIC_IOCTL_H_ 30 | #define _FIO_GENERIC_IOCTL_H_ 31 | 32 | #if defined(__FreeBSD__) 33 | #include 34 | #elif defined(WINNT) || defined(WIN32) 35 | #include 36 | #elif defined(__OSX__) 37 | #include 38 | #elif defined(__VMKAPI__) 39 | #include 40 | #endif 41 | 42 | /* If needed these can be overriden in the platform_ioctl.h file */ 43 | #ifndef FIO_IOC_SIZEBITS 44 | #define FIO_IOC_SIZEBITS 14 45 | #endif 46 | #ifndef FIO_IOC_DIRBITS 47 | #define FIO_IOC_DIRBITS 2 48 | #endif 49 | 50 | #ifndef FIO_IOC_NONE 51 | #define FIO_IOC_NONE 0U 52 | #endif 53 | #ifndef FIO_IOC_WRITE 54 | #define FIO_IOC_WRITE 1U /* copyout parameters */ 55 | #endif 56 | #ifndef FIO_IOC_READ 57 | #define FIO_IOC_READ 2U /* copyin parameters */ 58 | #endif 59 | 60 | #define FIO_IOC_NRBITS 8 61 | #define FIO_IOC_TYPEBITS 8 62 | 63 | #define FIO_IOC_NRMASK ((1 << FIO_IOC_NRBITS)-1) 64 | #define FIO_IOC_TYPEMASK ((1 << FIO_IOC_TYPEBITS)-1) 65 | #define FIO_IOC_SIZEMASK ((1 << FIO_IOC_SIZEBITS)-1) 66 | #define FIO_IOC_DIRMASK ((1 << FIO_IOC_DIRBITS)-1) 67 | 68 | #define FIO_IOC_NRSHIFT 0 69 | #define FIO_IOC_TYPESHIFT (FIO_IOC_NRSHIFT+FIO_IOC_NRBITS) // 8 70 | #define FIO_IOC_SIZESHIFT (FIO_IOC_TYPESHIFT+FIO_IOC_TYPEBITS) // 16 71 | #define FIO_IOC_DIRSHIFT (FIO_IOC_SIZESHIFT+FIO_IOC_SIZEBITS) // 30, FreeBSD:29 72 | 73 | #ifdef FIO_PLATFORM_IOC 74 | # define FIO_IOC(dir, type, nr, size) FIO_PLATFORM_IOC(dir, type, nr, size) 75 | #else 76 | # define FIO_IOC(dir, type, nr, size) \ 77 | (((dir) << FIO_IOC_DIRSHIFT) | \ 78 | ((type) << FIO_IOC_TYPESHIFT) | \ 79 | ((nr) << FIO_IOC_NRSHIFT) | \ 80 | ((size) << FIO_IOC_SIZESHIFT)) 81 | #endif 82 | 83 | /* provoke compile error for invalid uses of size argument */ 84 | #if 0 85 | extern unsigned int __invalid_size_argument_for_IOC; 86 | #define FIO_IOC_TYPECHECK(t) \ 87 | ((sizeof(t) == sizeof(t[1]) && \ 88 | sizeof(t) < (1 << FIO_IOC_SIZEBITS)) ? \ 89 | sizeof(t) : __invalid_size_argument_for_IOC) 90 | #endif 91 | #define FIO_IOC_TYPECHECK(t) (sizeof(t)) 92 | 93 | /* used to create numbers */ 94 | #define FIO_IO(type,nr) FIO_IOC(FIO_IOC_NONE,(type),(nr),0) 95 | #define FIO_IOR(type,nr,size) FIO_IOC(FIO_IOC_READ,(type),(nr),(FIO_IOC_TYPECHECK(size))) 96 | #define FIO_IOW(type,nr,size) FIO_IOC(FIO_IOC_WRITE,(type),(nr),(FIO_IOC_TYPECHECK(size))) 97 | #define FIO_IOWR(type,nr,size) FIO_IOC(FIO_IOC_READ|FIO_IOC_WRITE,(type),(nr),(FIO_IOC_TYPECHECK(size))) 98 | #define FIO_IOR_BAD(type,nr,size) FIO_IOC(FIO_IOC_READ,(type),(nr),sizeof(size)) 99 | #define FIO_IOW_BAD(type,nr,size) FIO_IOC(FIO_IOC_WRITE,(type),(nr),sizeof(size)) 100 | #define FIO_IOWR_BAD(type,nr,size) FIO_IOC(FIO_IOC_READ|FIO_IOC_WRITE,(type),(nr),sizeof(size)) 101 | 102 | /* used to decode ioctl numbers.. */ 103 | #define FIO_IOC_DIR(nr) (((nr) >> FIO_IOC_DIRSHIFT) & FIO_IOC_DIRMASK) 104 | #define FIO_IOC_TYPE(nr) (((nr) >> FIO_IOC_TYPESHIFT) & FIO_IOC_TYPEMASK) 105 | #define FIO_IOC_NR(nr) (((nr) >> FIO_IOC_NRSHIFT) & FIO_IOC_NRMASK) 106 | #define FIO_IOC_SIZE(nr) (((nr) >> FIO_IOC_SIZESHIFT) & FIO_IOC_SIZEMASK) 107 | 108 | #endif // _FIO_GENERIC_IOCTL_H_ 109 | 110 | -------------------------------------------------------------------------------- /root/usr/src/iomemory-vsl-3.2.16/include/fio/port/kblock.h: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------------------- 2 | // Copyright (c) 2006-2014, Fusion-io, Inc.(acquired by SanDisk Corp. 2014) 3 | // Copyright (c) 2014-2015 SanDisk Corp. and/or all its affiliates. All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // * Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // * Neither the name of the SanDisk Corp. nor the names of its contributors 13 | // may be used to endorse or promote products derived from this software 14 | // without specific prior written permission. 15 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 17 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 18 | // A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | // IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 20 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 21 | // OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | //----------------------------------------------------------------------------- 28 | /** @file 29 | * NO OS-SPECIFIC REFERENCES ARE TO BE IN THIS FILE 30 | * 31 | */ 32 | #ifndef __FIO_PORT_KBLOCK_H__ 33 | #define __FIO_PORT_KBLOCK_H__ 34 | 35 | #include 36 | #include 37 | #include 38 | 39 | struct kfio_bio; 40 | struct fio_device; 41 | struct kfio_disk; 42 | 43 | #if defined( __linux__) 44 | extern int kfio_register_blkdev_pre_init(kfio_pci_dev_t *pdev); 45 | extern void kfio_disk_stat_read_update(struct kfio_disk *gd, uint64_t totalsize, uint64_t duration); 46 | extern void kfio_disk_stat_write_update(struct kfio_disk *gd, uint64_t totalsize, uint64_t duration); 47 | extern int kfio_get_gd_in_flight(struct kfio_disk *gd, int rw); 48 | extern void kfio_set_gd_in_flight(struct kfio_disk *gd, int rw, int in_flight); 49 | extern void kfio_set_write_holdoff(struct kfio_disk *disk); 50 | extern void kfio_clear_write_holdoff(struct kfio_disk *disk); 51 | extern void kfio_mark_lock_pending(struct kfio_disk *disk); 52 | extern void kfio_unmark_lock_pending(struct kfio_disk *disk); 53 | #else 54 | // non-linux stubs 55 | static inline void kfio_disk_stat_write_update(void *gd, uint64_t totalsize, uint64_t duration) { } 56 | static inline int kfio_get_gd_in_flight(void *gd, int rw) { return 0; } 57 | static inline void kfio_set_gd_in_flight(void *gd, int rw, int in_flight) { } 58 | static inline void kfio_mark_lock_pending(void *disk) { } 59 | static inline void kfio_unmark_lock_pending(void *disk) { } 60 | #endif 61 | 62 | /* 63 | * Functions implemented in OS-specific kblock code and called from 64 | * parts of the core that are not OS-aware. 65 | */ 66 | extern int fio_create_blockdev(struct fio_device *dev); 67 | extern void fio_teardown_blockdev(struct fio_device *dev); 68 | extern void fio_start_submit_thread(struct fio_device *dev); 69 | extern void fio_stop_submit_thread(struct fio_device *dev); 70 | 71 | /* 72 | * Generic kblock-related services provided by core and available 73 | * to OS-specific block code. 74 | */ 75 | extern int fio_open(struct fio_device *dev); 76 | extern int fio_release(struct fio_device *dev); 77 | extern int fio_ioctl(struct fio_device *dev, unsigned cmd, fio_uintptr_t arg); 78 | 79 | extern int fio_handle_read_bio(struct fio_device *dev, struct kfio_bio *bio); 80 | extern int fio_handle_write_bio(struct fio_device *dev, struct kfio_bio *bio); 81 | extern int fio_handle_discard_bio(struct fio_device *dev, struct kfio_bio *bio); 82 | extern int fio_handle_flush_bio(struct fio_device *dev, struct kfio_bio *bio); 83 | 84 | extern void fio_restart_read_bio(struct kfio_bio *bio, int error); 85 | 86 | extern uint32_t fio_device_ptrim_available(struct fio_device *dev); 87 | 88 | #endif // __FIO_PORT_KBLOCK_H__ 89 | -------------------------------------------------------------------------------- /root/usr/src/iomemory-vsl-3.2.16/include/fio/port/kcpu.h: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------------------- 2 | // Copyright (c) 2011-2014, Fusion-io, Inc.(acquired by SanDisk Corp. 2014) 3 | // Copyright (c) 2014-2016 SanDisk Corp. and/or all its affiliates. All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // * Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // * Neither the name of the SanDisk Corp. nor the names of its contributors 13 | // may be used to endorse or promote products derived from this software 14 | // without specific prior written permission. 15 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 17 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 18 | // A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | // IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 20 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 21 | // OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | //----------------------------------------------------------------------------- 28 | 29 | #ifndef __FIO_PORT_KTYPES_H__ 30 | #error "Please include before this file." 31 | #endif 32 | 33 | #ifndef __FIO_PORT_KCPU_H__ 34 | #define __FIO_PORT_KCPU_H__ 35 | 36 | #include 37 | #include 38 | 39 | #if PORT_SUPPORTS_PER_CPU 40 | 41 | extern kfio_cpu_t kfio_current_cpu(void); 42 | extern kfio_cpu_t kfio_get_cpu(kfio_get_cpu_t *flags); 43 | extern void kfio_put_cpu(kfio_get_cpu_t *flags); 44 | extern unsigned int kfio_max_cpus(void); 45 | extern int kfio_cpu_online(kfio_cpu_t cpu); 46 | 47 | void kfio_create_kthread_on_cpu(fusion_kthread_func_t func, void *data, 48 | void *fusion_nand_device, kfio_cpu_t cpu, 49 | const char *fmt, ...); 50 | 51 | typedef void (kfio_cpu_notify_fn)(int new_cpu_flag, kfio_cpu_t cpu); 52 | extern void kfio_unregister_cpu_notifier(kfio_cpu_notify_fn *func); 53 | extern int kfio_register_cpu_notifier(kfio_cpu_notify_fn *func); 54 | #endif 55 | 56 | #if defined(PORT_SUPPORTS_PCI_NUMA_INFO) && PORT_SUPPORTS_PCI_NUMA_INFO 57 | extern kfio_numa_node_t kfio_pci_get_node(kfio_pci_dev_t *pdev); 58 | void kfio_bind_kthread_to_node(kfio_numa_node_t node); 59 | #else 60 | static inline kfio_numa_node_t kfio_pci_get_node(kfio_pci_dev_t *pdev) 61 | { 62 | return 0; 63 | } 64 | static inline void kfio_bind_kthread_to_node(kfio_numa_node_t node) 65 | { 66 | } 67 | #endif 68 | 69 | #if defined(PORT_SUPPORTS_NUMA_NODE_OVERRIDE) && PORT_SUPPORTS_NUMA_NODE_OVERRIDE 70 | extern int kfio_get_numa_node_override(kfio_pci_dev_t *pdev, const char *name, 71 | kfio_numa_node_t *nodep); 72 | #else 73 | static inline int kfio_get_numa_node_override(kfio_pci_dev_t *pdev, const char *name, 74 | kfio_numa_node_t *nodep) 75 | { 76 | return -ENOENT; 77 | } 78 | #endif 79 | 80 | extern int numa_node_forced_local; 81 | extern kfio_cpu_t kfio_next_cpu_in_node(kfio_cpu_t last_cpu, kfio_numa_node_t node); 82 | 83 | #endif 84 | -------------------------------------------------------------------------------- /root/usr/src/iomemory-vsl-3.2.16/include/fio/port/kcsr.h: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------------------- 2 | // Copyright (c) 2006-2014, Fusion-io, Inc.(acquired by SanDisk Corp. 2014) 3 | // Copyright (c) 2014 SanDisk Corp. and/or all its affiliates. All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // * Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // * Neither the name of the SanDisk Corp. nor the names of its contributors 13 | // may be used to endorse or promote products derived from this software 14 | // without specific prior written permission. 15 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 17 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 18 | // A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | // IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 20 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 21 | // OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | //----------------------------------------------------------------------------- 28 | 29 | #ifndef __FIO_PORT_KCSR_H__ 30 | #define __FIO_PORT_KCSR_H__ 31 | 32 | struct kfio_csr_handle 33 | { 34 | volatile void *bar_virt; 35 | volatile struct iodrive_CSR *csr_virt; 36 | volatile struct iodrive_nwlogic_s2c_registers *dma_s2c_virt; 37 | volatile struct iodrive_nwlogic_c2s_registers *dma_c2s_virt; 38 | volatile struct iodrive_common_DMA_CSR *dma_common_virt; 39 | void *csr_hdl; 40 | uint8_t indirect_access; 41 | }; 42 | 43 | extern uint32_t kfio_csr_read_direct(volatile void *addr, void *hdl); 44 | extern uint64_t kfio_csr_read_direct_64(volatile void *addr, void *hdl); 45 | extern void kfio_csr_write_nobarrier(uint32_t val, volatile void *addr, void *hdl); 46 | extern void kfio_csr_write(uint32_t val, volatile void *addr, void *hdl); 47 | extern void kfio_csr_write_64(uint64_t val, volatile void *addr, void *hdl); 48 | 49 | #endif /* __FIO_PORT_KCSR_H__ */ 50 | -------------------------------------------------------------------------------- /root/usr/src/iomemory-vsl-3.2.16/include/fio/port/kfio_config.h: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------------------- 2 | // Copyright (c) 2006-2014, Fusion-io, Inc.(acquired by SanDisk Corp. 2014) 3 | // Copyright (c) 2014 SanDisk Corp. and/or all its affiliates. All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // * Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // * Neither the name of the SanDisk Corp. nor the names of its contributors 13 | // may be used to endorse or promote products derived from this software 14 | // without specific prior written permission. 15 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 17 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 18 | // A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | // IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 20 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 21 | // OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | //----------------------------------------------------------------------------- 28 | 29 | #ifndef _FIO_PORT_KFIO_CONFIG_H_ 30 | #define _FIO_PORT_KFIO_CONFIG_H_ 31 | 32 | 33 | #include 34 | 35 | #if defined(USERSPACE_KERNEL) 36 | # include 37 | #elif defined(__linux__) 38 | #include 39 | #elif defined(__FreeBSD__) 40 | #include 41 | #include 42 | #elif defined(__OSX__) 43 | #include 44 | #include 45 | #elif defined(WINNT) || defined(WIN32) 46 | #define kfio_kmalloc kmalloc 47 | #include 48 | #elif defined(UEFI) 49 | #else 50 | #error Unsupported OS 51 | #endif 52 | 53 | #endif /* _FIO_PORT_KFIO_CONFIG_H_ */ 54 | 55 | -------------------------------------------------------------------------------- /root/usr/src/iomemory-vsl-3.2.16/include/fio/port/ktypes_32.h: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------------------- 2 | // Copyright (c) 2006-2014, Fusion-io, Inc.(acquired by SanDisk Corp. 2014) 3 | // Copyright (c) 2014 SanDisk Corp. and/or all its affiliates. All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // * Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // * Neither the name of the SanDisk Corp. nor the names of its contributors 13 | // may be used to endorse or promote products derived from this software 14 | // without specific prior written permission. 15 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 17 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 18 | // A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | // IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 20 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 21 | // OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | //----------------------------------------------------------------------------- 28 | 29 | #ifndef _FIO_PORT_KTYPES_32_H 30 | #define _FIO_PORT_KTYPES_32_H 31 | 32 | 33 | #define ptr_to_u64(ptr) ((uint64_t)((fio_uintptr_t)(ptr))) 34 | 35 | #define u64_to_ptr(u64, type) ({ \ 36 | uint64_t _u64 = (u64); \ 37 | kassert(_u64 < 0xffffffffULL); \ 38 | (type)((fio_uintptr_t)_u64); \ 39 | }) 40 | 41 | #if !defined(INT64_C) 42 | #define INT64_C(c) c ## LL 43 | #endif 44 | #if !defined(UINT64_C) 45 | #define UINT64_C(c) c ## ULL 46 | #endif 47 | 48 | #if !defined(INTMAX_C) 49 | #define INTMAX_C(c) c ## LL 50 | #endif 51 | #if !defined(UINTMAX_C) 52 | #define UINTMAX_C(c) c ## ULL 53 | #endif 54 | 55 | #if defined(_MSC_VER) 56 | #define FUSION_ALIGN(x) __declspec(align(4)) x 57 | #else 58 | #define FUSION_ALIGN(x) x __attribute__((aligned(4))) 59 | #endif 60 | 61 | 62 | #endif /* _FIO_PORT_KTYPES_32_H */ 63 | -------------------------------------------------------------------------------- /root/usr/src/iomemory-vsl-3.2.16/include/fio/port/ktypes_64.h: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------------------- 2 | // Copyright (c) 2006-2014, Fusion-io, Inc.(acquired by SanDisk Corp. 2014) 3 | // Copyright (c) 2014 SanDisk Corp. and/or all its affiliates. All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // * Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // * Neither the name of the SanDisk Corp. nor the names of its contributors 13 | // may be used to endorse or promote products derived from this software 14 | // without specific prior written permission. 15 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 17 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 18 | // A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | // IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 20 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 21 | // OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | //----------------------------------------------------------------------------- 28 | 29 | #ifndef _FIO_PORT_KTYPES_64_H 30 | #define _FIO_PORT_KTYPES_64_H 31 | 32 | 33 | #define ptr_to_u64(ptr) ((uint64_t)(ptr)) 34 | #define u64_to_ptr(u64) ((void *)(u64)) 35 | 36 | #ifndef INT64_C 37 | #define INT64_C(c) c ## L 38 | #define UINT64_C(c) c ## UL 39 | #endif 40 | 41 | #ifndef INTMAX_C 42 | #define INTMAX_C(c) c ## L 43 | #define UINTMAX_C(c) c ## UL 44 | #endif 45 | 46 | #if defined(_MSC_VER) 47 | #define FUSION_ALIGN(x) __declspec(align(8)) x 48 | #else 49 | #define FUSION_ALIGN(x) x __attribute__((aligned(8))) 50 | #endif 51 | 52 | 53 | #endif /* _FIO_PORT_KTYPES_64_H */ 54 | -------------------------------------------------------------------------------- /root/usr/src/iomemory-vsl-3.2.16/include/fio/port/libgen.h: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------------------- 2 | // Copyright (c) 2006-2014, Fusion-io, Inc.(acquired by SanDisk Corp. 2014) 3 | // Copyright (c) 2014 SanDisk Corp. and/or all its affiliates. All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // * Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // * Neither the name of the SanDisk Corp. nor the names of its contributors 13 | // may be used to endorse or promote products derived from this software 14 | // without specific prior written permission. 15 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 17 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 18 | // A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | // IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 20 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 21 | // OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | //----------------------------------------------------------------------------- 28 | #if !defined( __PORT_LIBGEN_H__ ) 29 | #define __PORT_LIBGEN_H__ 30 | 31 | #if defined (WIN32) || defined(WINNT) 32 | #include 33 | #else 34 | #include 35 | #endif 36 | 37 | #endif // __PORT_LIBGEN_H__ 38 | 39 | -------------------------------------------------------------------------------- /root/usr/src/iomemory-vsl-3.2.16/include/fio/port/linux/utypes.h: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------------------- 2 | // Copyright (c) 2006-2014, Fusion-io, Inc.(acquired by SanDisk Corp. 2014) 3 | // Copyright (c) 2014 SanDisk Corp. and/or all its affiliates. All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // * Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // * Neither the name of the SanDisk Corp. nor the names of its contributors 13 | // may be used to endorse or promote products derived from this software 14 | // without specific prior written permission. 15 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 17 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 18 | // A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | // IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 20 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 21 | // OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | //----------------------------------------------------------------------------- 28 | 29 | #ifndef _FIO_PORT_LINUX_UTYPES_H_ 30 | #define _FIO_PORT_LINUX_UTYPES_H_ 31 | 32 | #ifndef _FIO_PORT_UTYPES_H_ 33 | #error Do not include this file directly - instead include 34 | #endif 35 | 36 | #include 37 | #include 38 | 39 | #endif // _FIO_PORT_LINUX_UTYPES_H_ 40 | -------------------------------------------------------------------------------- /root/usr/src/iomemory-vsl-3.2.16/include/fio/port/pci.h: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------------------- 2 | // Copyright (c) 2006-2014, Fusion-io, Inc.(acquired by SanDisk Corp. 2014) 3 | // Copyright (c) 2014 SanDisk Corp. and/or all its affiliates. All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // * Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // * Neither the name of the SanDisk Corp. nor the names of its contributors 13 | // may be used to endorse or promote products derived from this software 14 | // without specific prior written permission. 15 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 17 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 18 | // A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | // IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 20 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 21 | // OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | //----------------------------------------------------------------------------- 28 | 29 | #ifndef __FIO_PORT_PCI_H__ 30 | #define __FIO_PORT_PCI_H__ 31 | 32 | #define PCI_VENDOR_ID_NWLOGIC 0xFAFA 33 | #define PCI_VENDOR_ID_PLX 0x10b5 34 | #define PCI_VENDOR_ID_FUSION 0x1AED 35 | 36 | #define IODRIVE_OLD_PCI_VENDOR PCI_VENDOR_ID_NWLOGIC 37 | #define IODRIVE_OLD_PCI_DEVICE 0xE003 38 | 39 | #define IODRIVE_PCI_DEVICE 0x1000 ///< Old busted devices only 40 | #define IODRIVE1_PCI_DEVICE 0x1001 ///< All ioDimm1 firmware releases 41 | #define IODRIVE3_OLD_PCI_DEVICE 0x1003 ///< All ioDimm3 firmware released with drivers < 1.2.5 42 | #define IODRIVE3_BOOT_PCI_DEVICE 0x1004 ///< For future use (Boot 6 BAR design) 43 | #define IODRIVE3_PCI_DEVICE 0x1005 ///< All ioDimm3 firmware released with drivers >= 1.2.5 44 | #define IOXTREME_PCI_DEVICE 0x1006 ///< All ioXtreme firmware 45 | #define IOXTREMEPRO_PCI_DEVICE 0x1007 ///< All ioXtreme Pro firmware 46 | #define IOXTREME2_PCI_DEVICE 0x1008 ///< All ioXtreme 2 (180/360) 47 | 48 | #define IODRIVE4_PCI_DEVICE 0x2001 ///< Generation 2 Hardware 49 | 50 | #define GEN3_DEVICEID 0x3000 51 | 52 | #define FUSION_PCI_SUBSYSTEM_VENDOR_ID PCI_VENDOR_ID_FUSION 53 | #define FUSION_PCI_SUBSYSTEM_DEVICE_ID 0x1010 54 | 55 | #define HP_PCI_SUBSYSTEM_VENDOR_ID 0x103c 56 | #define HP_PCI_MEZZ_SUBSYSTEM_DEVICE_ID 0x324D 57 | #define HP_PCI_IODRIVE_SUBSYSTEM_DEVICE_ID 0x324E 58 | 59 | #define DELL_PCI_SUBSYSTEM_VENDOR_ID 0x1028 60 | #define IBM_PCI_SUBSYSTEM_VENDOR_ID 0x1014 61 | 62 | #define OLDEST_FW_MAJ_VER_OF_THIS_GEN 6 63 | 64 | #endif /* __FIO_PORT_PCI_H__ */ 65 | -------------------------------------------------------------------------------- /root/usr/src/iomemory-vsl-3.2.16/include/fio/port/port_config_macros_clear.h: -------------------------------------------------------------------------------- 1 | /* ----------------------------------------------------------------------------- 2 | * Copyright (c) 2017, Fusion-io, Inc. (acquired by SanDisk Corp. 2014) 3 | * Copyright (c) 2014 SanDisk Corp. and/or all its affiliates. 4 | * All rights reserved. 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright notice, 10 | * this list of conditions and the following disclaimer in the documentation 11 | * and/or other materials provided with the distribution. 12 | * * Neither the name of the SanDisk Corp. nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 17 | * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 18 | * A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 21 | * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * ---------------------------------------------------------------------------*/ 28 | 29 | /* Machine generated file - edits will be overwritten. */ 30 | 31 | #ifdef FIO_PORT_CONFIG_MACRO 32 | #undef FIO_PORT_CONFIG_MACRO 33 | #endif 34 | 35 | #ifdef FIO_PORT_CONFIG_SET_ALL 36 | #undef FIO_PORT_CONFIG_SET_ALL 37 | #endif 38 | 39 | #ifdef FIO_PORT_CONFIG_SET_BOOLEAN 40 | #undef FIO_PORT_CONFIG_SET_BOOLEAN 41 | #endif 42 | 43 | #ifdef FIO_PORT_CONFIG_SET_DBGFLAG 44 | #undef FIO_PORT_CONFIG_SET_DBGFLAG 45 | #endif 46 | 47 | #ifdef FIO_PORT_CONFIG_SET_INT 48 | #undef FIO_PORT_CONFIG_SET_INT 49 | #endif 50 | 51 | #ifdef FIO_PORT_CONFIG_SET_STRING 52 | #undef FIO_PORT_CONFIG_SET_STRING 53 | #endif 54 | -------------------------------------------------------------------------------- /root/usr/src/iomemory-vsl-3.2.16/include/fio/port/stdint.h: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------------------- 2 | // Copyright (c) 2006-2014, Fusion-io, Inc.(acquired by SanDisk Corp. 2014) 3 | // Copyright (c) 2014 SanDisk Corp. and/or all its affiliates. All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // * Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // * Neither the name of the SanDisk Corp. nor the names of its contributors 13 | // may be used to endorse or promote products derived from this software 14 | // without specific prior written permission. 15 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 17 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 18 | // A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | // IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 20 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 21 | // OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | //----------------------------------------------------------------------------- 28 | 29 | #ifndef __FIO_PORT_STDINT_H__ 30 | #define __FIO_PORT_STDINT_H__ 31 | 32 | #if defined(USERSPACE_KERNEL) 33 | # include 34 | #elif (defined(__linux__) && !defined(SICORTEX)) || defined(__VMKLNX__) 35 | # include 36 | #elif defined(__SVR4) && defined(__sun) 37 | # include 38 | # include 39 | #elif defined(__hpux__) 40 | # include 41 | #elif defined(__FreeBSD__) 42 | # include 43 | #elif defined(_AIX) 44 | # include 45 | #elif defined(__OSX__) 46 | # include 47 | #elif defined(WIN32) || defined(WINNT) 48 | # include 49 | #elif defined(UEFI) 50 | # include 51 | #endif 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /root/usr/src/iomemory-vsl-3.2.16/include/fio/port/trim_completion.h: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------------------- 2 | // Copyright (c) 2006-2014, Fusion-io, Inc.(acquired by SanDisk Corp. 2014) 3 | // Copyright (c) 2014 SanDisk Corp. and/or all its affiliates. All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // * Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // * Neither the name of the SanDisk Corp. nor the names of its contributors 13 | // may be used to endorse or promote products derived from this software 14 | // without specific prior written permission. 15 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 17 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 18 | // A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | // IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 20 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 21 | // OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | //----------------------------------------------------------------------------- 28 | 29 | #include 30 | 31 | struct fio_trimmon; 32 | 33 | #if defined(WINNT) || defined(WIN32) 34 | extern int fio_trimmon_update_bitmap(struct fio_trimmon*t, fio_block_range_t srange); // Addes in-flight completions to local bitmap base block and length 35 | extern int fio_trimmon_update_bitmap_req(struct fio_trimmon *t, struct fusion_request *req); 36 | #else 37 | #define fio_trimmon_update_bitmap(t,r) ((void)(t),(void)(r),0) 38 | #define fio_trimmon_update_bitmap_req(t,r) (void)((void)(t),(void)(r),0) 39 | #endif 40 | -------------------------------------------------------------------------------- /root/usr/src/iomemory-vsl-3.2.16/include/fio/port/trimmon_attach.h: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------------------- 2 | // Copyright (c) 2006-2014, Fusion-io, Inc.(acquired by SanDisk Corp. 2014) 3 | // Copyright (c) 2014 SanDisk Corp. and/or all its affiliates. All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // * Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // * Neither the name of the SanDisk Corp. nor the names of its contributors 13 | // may be used to endorse or promote products derived from this software 14 | // without specific prior written permission. 15 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 17 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 18 | // A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | // IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 20 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 21 | // OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | //----------------------------------------------------------------------------- 28 | 29 | struct fio_trimmon; 30 | 31 | #if defined(WINNT) || defined(WIN32) 32 | int fio_trimmon_init(struct fio_trimmon **tdata); 33 | void fio_trimmon_teardown(struct fio_trimmon **tdata); 34 | #else 35 | #define fio_trimmon_init(trimmon_pp) (*(trimmon_pp)=NULL,0) // "returns" no error 36 | #define fio_trimmon_teardown(a) ((void)(a)) 37 | #endif 38 | 39 | -------------------------------------------------------------------------------- /root/usr/src/iomemory-vsl-3.2.16/include/fio/port/ufio.h: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------------------- 2 | // Copyright (c) 2006-2014, Fusion-io, Inc.(acquired by SanDisk Corp. 2014) 3 | // Copyright (c) 2014 SanDisk Corp. and/or all its affiliates. All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // * Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // * Neither the name of the SanDisk Corp. nor the names of its contributors 13 | // may be used to endorse or promote products derived from this software 14 | // without specific prior written permission. 15 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 17 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 18 | // A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | // IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 20 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 21 | // OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | //----------------------------------------------------------------------------- 28 | 29 | /* 30 | * ufio.h contains interface information between kernel and user space. 31 | * Consequently information in ufio.h (or the platform-specific ufio.h) 32 | * must be cautious about anything that must only be in either the kernel 33 | * or user space. Handling such situations is done by checking whether the 34 | * '__KERNEL__' macro is defined (or not). 35 | */ 36 | 37 | #ifndef _FIO_PORT_UFIO_H_ 38 | #define _FIO_PORT_UFIO_H_ 39 | 40 | #include 41 | 42 | #if defined(USERSPACE_KERNEL) 43 | # include 44 | #elif defined(__linux__) || defined(__VMKLNX__) 45 | #include 46 | #elif defined(__SVR4) && defined(__sun) 47 | #include 48 | #elif defined(__hpux__) 49 | #include 50 | #elif defined(__FreeBSD__) 51 | #include 52 | #elif defined(_AIX) 53 | #include 54 | #elif defined(__OSX__) 55 | #include 56 | #elif defined(WINNT) || defined(WIN32) 57 | #include 58 | #elif defined(UEFI) 59 | #include 60 | #else 61 | #error Unsupported OS 62 | #endif 63 | 64 | /* Non-platform specific */ 65 | 66 | #if !defined(__KERNEL__) 67 | #include 68 | #include 69 | #include 70 | 71 | #include 72 | #include 73 | #include 74 | #include 75 | #include 76 | 77 | /* If you're gonna be dumb you gotta be tough... */ 78 | #define kfio_malloc(s) malloc(s) 79 | #define kfio_free(p, s) do { free(p); (void)s; } while(0) 80 | #define kfio_memcpy(x, y, z) memcpy(x, y, z) 81 | #define kfio_memset(x, y, z) memset(x, y, z) 82 | #define kfio_memcmp(x, y, z) memcmp(x, y, z) 83 | #define kfio_memmove(x, y, z) memmove(x, y, z) 84 | #define kfio_strncpy(x, y, z) strncpy(x, y, z) 85 | #define kfio_strtoul(x, y, z) strtoul(x, y, z) 86 | #define kfio_strlen(x) strlen(x) 87 | #define kfio_print(fmt, ...) printf(fmt, ##__VA_ARGS__) 88 | //#define infprint printf 89 | #define kfio_strchr(x, y) strchr(x, y) 90 | #define kfio_strncmp(x, y, z) strncmp(x, y, z) 91 | #define kfio_strcat(x, y) strcat(x, y) 92 | 93 | #define kfio_div64_64(num, den) ((num) / (den)) 94 | 95 | #endif 96 | 97 | #define _FIO_UNICODE(str) L##str 98 | #define FIO_UNICODE(str) _FIO_UNICODE(str) 99 | 100 | 101 | #endif /* _FIO_PORT_UFIO_H_ */ 102 | -------------------------------------------------------------------------------- /root/usr/src/iomemory-vsl-3.2.16/include/fio/port/utypes.h: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------------------- 2 | // Copyright (c) 2006-2014, Fusion-io, Inc.(acquired by SanDisk Corp. 2014) 3 | // Copyright (c) 2014 SanDisk Corp. and/or all its affiliates. All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // * Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // * Neither the name of the SanDisk Corp. nor the names of its contributors 13 | // may be used to endorse or promote products derived from this software 14 | // without specific prior written permission. 15 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 17 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 18 | // A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | // IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 20 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 21 | // OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | //----------------------------------------------------------------------------- 28 | 29 | #ifndef _FIO_PORT_UTYPES_H_ 30 | #define _FIO_PORT_UTYPES_H_ 31 | 32 | #include 33 | 34 | #if defined(__KERNEL__) 35 | #error You should only include utype.h in user code -- not kernel. 36 | #endif // __KERNEL__ 37 | #if defined(__ESXI5__) 38 | #include 39 | #elif defined(USERSPACE_KERNEL) 40 | # include 41 | #elif defined(__linux__) 42 | #include 43 | #elif defined(__SVR4) && defined (__sun) 44 | #include 45 | #elif defined(__FreeBSD__) 46 | #include 47 | #elif defined(__OSX__) 48 | #include 49 | #elif defined(WINNT) || defined(WIN32) 50 | #include 51 | #elif defined(UEFI) 52 | // There is no file here for UEFI 53 | #else 54 | #error Unsupported OS - if you are porting, try starting with a copy of stubs 55 | #endif 56 | 57 | #include 58 | 59 | #endif /* _FIO_PORT_UTYPES_H_ */ 60 | -------------------------------------------------------------------------------- /root/usr/src/iomemory-vsl-3.2.16/include/fio/port/vararg.h: -------------------------------------------------------------------------------- 1 | // ----------------------------------------------------------------------------- 2 | // Copyright (c) 2006-2014, Fusion-io, Inc.(acquired by SanDisk Corp. 2014) 3 | // Copyright (c) 2014 SanDisk Corp. and/or all its affiliates. All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // * Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // * Neither the name of the SanDisk Corp. nor the names of its contributors 13 | // may be used to endorse or promote products derived from this software 14 | // without specific prior written permission. 15 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 17 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 18 | // A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | // IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 20 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 21 | // OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | // ----------------------------------------------------------------------------- 28 | 29 | #ifndef __FIO_PORT_STDARG_H__ 30 | #define __FIO_PORT_STDARG_H__ 31 | 32 | #if defined(__FreeBSD__) 33 | #include 34 | #else 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | #ifdef UEFI 39 | // UDK does not provide a stdarg.h include file. 40 | #define va_list VA_LIST 41 | #define va_copy(save, ap) save = ap 42 | #define va_start(a,b) VA_START(a,b) 43 | #define va_end(a) VA_END(a) 44 | #define va_arg(a,b) VA_ARG(a,b) 45 | 46 | #else 47 | #include 48 | #if __has_include("linux/stdarg.h") 49 | #include 50 | #else 51 | #include "stdarg.h" 52 | #endif 53 | #endif //!UEFI 54 | #ifdef __cplusplus 55 | } 56 | #endif 57 | #endif 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /root/usr/src/iomemory-vsl-3.2.16/include/kblock_meta.h: -------------------------------------------------------------------------------- 1 | /* 2 | This "meta" file is supposed to abstract things that change in kblock.c 3 | and should provide simplified defines that are named after their function. 4 | Both aimed at making the code cleaner, more readable and perhaps more 5 | maintainable. Blocks should be isolated and only cover one item. 6 | */ 7 | #ifndef __FIO_KBLOCK_META_H__ 8 | #define __FIO_KBLOCK_META_H__ 9 | 10 | #include 11 | 12 | #if __has_include("linux/part_stat.h") 13 | #include 14 | #endif 15 | #include 16 | #if __has_include("linux/bio-integrity.h") /* added 6.11 */ 17 | #include 18 | #endif 19 | 20 | #if KFIOC_X_BLK_ALLOC_DISK_EXISTS 21 | #define BLK_ALLOC_QUEUE dp->gd->queue; 22 | #define BLK_ALLOC_DISK blk_alloc_disk(FIO_NUM_MINORS); 23 | #define BLK_MQ_ALLOC_QUEUE blk_mq_init_queue(&disk->tag_set); 24 | #elif KFIOC_X_BLK_ALLOC_DISK_HAS_QUEUE_LIMITS 25 | #define BLK_ALLOC_QUEUE dp->gd->queue; 26 | #define BLK_ALLOC_DISK blk_alloc_disk(NULL, FIO_NUM_MINORS); 27 | #define BLK_MQ_ALLOC_QUEUE blk_mq_alloc_queue(&disk->tag_set, NULL, NULL); 28 | #else /* KFIOC_X_BLK_ALLOC_DISK_EXISTS */ 29 | #if KFIOC_X_HAS_MAKE_REQUEST_FN != 1 30 | #define BLK_ALLOC_QUEUE blk_alloc_queue(node); 31 | #endif /* KFIOC_X_HAS_MAKE_REQUEST_FN */ 32 | #define BLK_ALLOC_DISK alloc_disk(FIO_NUM_MINORS); 33 | #define BLK_MQ_ALLOC_QUEUE blk_mq_init_queue(&disk->tag_set); 34 | #endif /* KFIOC_X_BLK_ALLOC_DISK_EXISTS */ 35 | 36 | 37 | #if KFIOC_X_BIO_HAS_BI_BDEV 38 | #define BIO_DISK bi_bdev->bd_disk 39 | #else /* KFIOC_X_BIO_HAS_BI_BDEV */ 40 | #define BIO_DISK bi_disk 41 | #endif /* KFIOC_X_BIO_HAS_BI_BDEV */ 42 | 43 | 44 | #if KFIOC_X_HAS_MAKE_REQUEST_FN 45 | static unsigned int kfio_make_request(struct request_queue *queue, struct bio *bio); 46 | #define KFIO_SUBMIT_BIO_RC return FIO_MFN_RET; 47 | #define BLK_QUEUE_SPLIT blk_queue_split(queue, &bio); 48 | 49 | #if KFIOC_X_BLK_ALLOC_QUEUE_NODE_EXISTS 50 | #define BLK_ALLOC_QUEUE blk_alloc_queue_node(GFP_NOIO, node); 51 | #elif KFIOC_X_BLK_ALLOC_QUEUE_EXISTS 52 | #define BLK_ALLOC_QUEUE blk_alloc_queue(GFP_NOIO); 53 | #else 54 | #define BLK_ALLOC_QUEUE blk_alloc_queue(kfio_make_request, node); 55 | #endif /* KFIOC_X_BLK_ALLOC_QUEUE_NODE_EXISTS */ 56 | 57 | #else /* KFIOC_X_HAS_MAKE_REQUEST_FN */ 58 | #if KFIOC_X_SUBMIT_BIO_RETURNS_BLK_QC_T 59 | #define KFIO_SUBMIT_BIO blk_qc_t kfio_submit_bio(struct bio *bio) 60 | #define KFIO_SUBMIT_BIO_RC return FIO_MFN_RET; 61 | #else 62 | #define KFIO_SUBMIT_BIO void kfio_submit_bio(struct bio *bio) 63 | #define KFIO_SUBMIT_BIO_RC 64 | #endif /*KFIOC_X_SUBMIT_BIO_RETURNS_BLK_QC_T */ 65 | KFIO_SUBMIT_BIO; 66 | 67 | #if KFIOC_X_BIO_SPLIT_TO_LIMITS 68 | #define BLK_QUEUE_SPLIT bio = bio_split_to_limits(bio); 69 | #else 70 | #define BLK_QUEUE_SPLIT blk_queue_split(&bio); 71 | #endif /* KFIOC_X_BIO_SPLIT_TO_LIMITS */ 72 | #endif /* KFIOC_X_HAS_MAKE_REQUEST_FN */ 73 | 74 | // should check for hd_struct vs gendisk 75 | #if KFIOC_X_GENHD_PART0_IS_A_POINTER 76 | #define GD_PART0 disk->gd->part0 77 | #define GET_BDEV disk->gd->part0 78 | #else /* KFIOC_X_GENHD_PART0_IS_A_POINTER */ 79 | #define GD_PART0 &disk->gd->part0 80 | #define GET_BDEV bdget_disk(disk->gd, 0); 81 | #endif /* KFIOC_X_GENHD_PART0_IS_A_POINTER */ 82 | 83 | 84 | #if KFIOC_X_VOID_ADD_DISK 85 | #define ADD_DISK add_disk(disk->gd); 86 | #else 87 | #define ADD_DISK if (add_disk(disk->gd)) { infprint("Error while adding disk!"); } 88 | #endif /* KFIOC_X_VOID_ADD_DISK */ 89 | 90 | #if KFIOC_X_DISK_HAS_OPEN_MUTEX 91 | #define SHUTDOWN_MUTEX &disk->gd->open_mutex 92 | #else 93 | #define SHUTDOWN_MUTEX &linux_bdev->bd_mutex 94 | #endif /* KFIOC_X_DISK_HAS_OPEN_MUTEX */ 95 | 96 | #if !defined(GENHD_FL_EXT_DEVT) 97 | // 5.17 moved GD to explicitly do this by default 98 | #define KFIO_DISABLE_GENHD_FL_EXT_DEVT 1 99 | #endif 100 | 101 | #if !defined(QUEUE_FLAG_DISCARD) 102 | #define BD_OPENERS atomic_read(&linux_bdev->bd_openers) 103 | #define SET_QUEUE_FLAG_DISCARD 104 | #else 105 | #define BD_OPENERS linux_bdev->bd_openers 106 | // https://lore.kernel.org/linux-btrfs/20220409045043.23593-25-hch@lst.de/ 107 | #define SET_QUEUE_FLAG_DISCARD blk_queue_flag_set(QUEUE_FLAG_DISCARD, rq); 108 | #endif /* ! QUEUE_FLAG_DISCARD */ 109 | 110 | 111 | #endif /* __FIO_KBLOCK_META_H__ */ 112 | -------------------------------------------------------------------------------- /root/usr/src/iomemory-vsl-3.2.16/include/kfile_meta.h: -------------------------------------------------------------------------------- 1 | /* 2 | This "meta" file is supposed to abstract things that change in kfile.c 3 | and should provide simplified defines that are named after their function. 4 | Both aimed at making the code cleaner, more readable and perhaps more 5 | maintainable. Blocks should be isolated and only cover one item. 6 | */ 7 | #ifndef __FIO_KFILE_META_H__ 8 | #define __FIO_KFILE_META_H__ 9 | 10 | #include 11 | 12 | #if KFIOC_X_CAPS_PDE_DATA 13 | #define KFIO_PDE_DATA PDE_DATA(ip) 14 | #else 15 | #define KFIO_PDE_DATA pde_data(ip) 16 | #endif /* PDE_DATA */ 17 | 18 | #endif /* __FIO_KFILE_META_H__ */ 19 | 20 | -------------------------------------------------------------------------------- /root/usr/src/iomemory-vsl-3.2.16/include/sysrq_meta.h: -------------------------------------------------------------------------------- 1 | /* 2 | This "meta" file is supposed to abstract things that change in sysrq.c 3 | and should provide simplified defines that are named after their function. 4 | Both aimed at making the code cleaner, more readable and perhaps more 5 | maintainable. Blocks should be isolated and only cover one item. 6 | */ 7 | #ifndef __FIO_SYSRQ_META_H__ 8 | #define __FIO_SYSRQ_META_H__ 9 | 10 | #if KFIOC_X_HANDLE_SYSRQ_IS_U8 11 | #define HANDLE_SYSRQ_TYPE u8 12 | #else 13 | #define HANDLE_SYSRQ_TYPE int 14 | #endif /* KFIOC_X_HANDLE_SYSRQ_IS_U8 */ 15 | 16 | #endif /* __FIO_SYSRQ_META_H__ */ 17 | -------------------------------------------------------------------------------- /root/usr/src/iomemory-vsl-3.2.16/kcache.c: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------------------- 2 | // Copyright (c) 2006-2014, Fusion-io, Inc.(acquired by SanDisk Corp. 2014) 3 | // Copyright (c) 2014-2015, SanDisk Corp. and/or all its affiliates. All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // * Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // * Neither the name of the SanDisk Corp. nor the names of its contributors 13 | // may be used to endorse or promote products derived from this software 14 | // without specific prior written permission. 15 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 17 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 18 | // A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | // IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 20 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 21 | // OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | //----------------------------------------------------------------------------- 28 | #if !defined (__linux__) 29 | #error This file supports linux only 30 | #endif 31 | 32 | #include "port-internal.h" 33 | #include 34 | #include 35 | #include // in_atomic() 36 | 37 | /** 38 | * @ingroup PORT_LINUX 39 | * @{ 40 | */ 41 | 42 | #define KCACHE_PTR (struct kmem_cache *) 43 | 44 | /** 45 | * 46 | */ 47 | int noinline __kfio_create_cache(fusion_mem_cache_t *pcache, char *name, uint32_t size, uint32_t align) 48 | { 49 | dbgprint(DBGS_GENERAL, "Creating cache %s size: %d align: %d\n", name, size, align); 50 | 51 | // kassert(pcache->name); 52 | // kassert(name); 53 | strncpy(pcache->name, name, 39); 54 | pcache->p = kmem_cache_create(pcache->name, size, align, 0, NULL); 55 | 56 | #if FUSION_DEBUG_CACHE 57 | fusion_atomic_set(&pcache->count, 0); 58 | #endif 59 | 60 | return pcache->p ? 0 : -ENOMEM; 61 | } 62 | 63 | /** 64 | * @brief allocate a chunk from the given cache, possibly sleeping 65 | * but never doing file IO. 66 | * 67 | * This function checks if it is in interrupt context and if so will never sleep. 68 | * In non-interrupt context it may sleep. 69 | */ 70 | void *kfio_cache_alloc(fusion_mem_cache_t *cache, int can_wait) 71 | { 72 | void *p; 73 | 74 | FUSION_ALLOCATION_TRIPWIRE_TEST(); 75 | 76 | p = kmem_cache_alloc(KCACHE_PTR (cache->p), 77 | (!can_wait || in_atomic() || irqs_disabled()) ? GFP_NOWAIT : GFP_NOIO); 78 | #if FUSION_DEBUG_CACHE 79 | if (p) 80 | fusion_atomic_incr(&cache->count); 81 | #endif 82 | return p; 83 | } 84 | 85 | void *kfio_cache_alloc_node(fusion_mem_cache_t *cache, int can_wait, 86 | kfio_numa_node_t node) 87 | { 88 | void *p; 89 | 90 | FUSION_ALLOCATION_TRIPWIRE_TEST(); 91 | 92 | p = kmem_cache_alloc_node(KCACHE_PTR(cache->p), 93 | (!can_wait || in_atomic() || irqs_disabled()) ? GFP_NOWAIT : GFP_NOIO, node); 94 | 95 | #if FUSION_DEBUG_CACHE 96 | if (p) 97 | fusion_atomic_incr(&cache->count); 98 | #endif 99 | return p; 100 | } 101 | 102 | /** 103 | * 104 | */ 105 | void kfio_cache_free(fusion_mem_cache_t *cache, void *p) 106 | { 107 | #if FUSION_DEBUG_MEMORY 108 | if(!kmem_ptr_validate(KCACHE_PTR (cache->p), p)) 109 | kfail(); 110 | #endif 111 | 112 | kmem_cache_free(KCACHE_PTR (cache->p), p); 113 | #if FUSION_DEBUG_CACHE 114 | { 115 | int count; 116 | 117 | count = fusion_atomic_decr(&cache->count); 118 | 119 | if (! count) 120 | infprint("cache %s count decremented to zero\n", cache->name); 121 | 122 | kassert(count >= 0); 123 | } 124 | #endif 125 | } 126 | 127 | /** 128 | * 129 | */ 130 | void kfio_cache_destroy(fusion_mem_cache_t *cache) 131 | { 132 | #if FUSION_DEBUG_CACHE 133 | infprint("%d objects remaining in cache %s.\n", 134 | fusion_atomic_read(&cache->count), cache->name); 135 | #endif 136 | kmem_cache_destroy(KCACHE_PTR (cache->p)); 137 | 138 | cache->p = NULL; 139 | } 140 | 141 | #undef KCACHE_PTR 142 | 143 | /** 144 | * @} 145 | */ 146 | -------------------------------------------------------------------------------- /root/usr/src/iomemory-vsl-3.2.16/kcpu.c: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------------------- 2 | // Copyright (c) 2006-2014, Fusion-io, Inc.(acquired by SanDisk Corp. 2014) 3 | // Copyright (c) 2014-2016 SanDisk Corp. and/or all its affiliates. (acquired by Western Digital Corp. 2016) 4 | // Copyright (c) 2016-2017 Western Digital Technologies, Inc. All rights reserved. 5 | // 6 | // Redistribution and use in source and binary forms, with or without 7 | // modification, are permitted provided that the following conditions are met: 8 | // * Redistributions of source code must retain the above copyright notice, 9 | // this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above copyright notice, 11 | // this list of conditions and the following disclaimer in the documentation 12 | // and/or other materials provided with the distribution. 13 | // * Neither the name of the SanDisk Corp. nor the names of its contributors 14 | // may be used to endorse or promote products derived from this software 15 | // without specific prior written permission. 16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 18 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 19 | // A PARTICULAR PURPOSE ARE DISCLAIMED. 20 | // IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 21 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 22 | // OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 23 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 24 | // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 25 | // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | //----------------------------------------------------------------------------- 29 | 30 | #if !defined (__linux__) 31 | #error This file supports linux only 32 | #endif 33 | 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | 43 | #include 44 | #include 45 | 46 | /** 47 | * @ingroup PORT_COMMON_LINUX 48 | * @{ 49 | */ 50 | 51 | /** 52 | * @brief returns current CPU. 53 | * @note Some core code assumes that returning a non-zero CPU number implies support for 54 | * per CPU completions. 55 | */ 56 | kfio_cpu_t kfio_current_cpu(void) 57 | { 58 | return raw_smp_processor_id(); 59 | } 60 | 61 | kfio_cpu_t kfio_get_cpu(kfio_get_cpu_t *flags) 62 | { 63 | local_irq_save(*flags); 64 | return smp_processor_id(); 65 | } 66 | 67 | void kfio_put_cpu(kfio_get_cpu_t *flags) 68 | { 69 | local_irq_restore(*flags); 70 | } 71 | 72 | /** 73 | * @brief returns maximum number of CPUs. 74 | * @note Some code assumes a return value greater than 1 implies support for per 75 | * CPU completions. 76 | */ 77 | unsigned int kfio_max_cpus(void) 78 | { 79 | return num_possible_cpus(); 80 | } 81 | 82 | /** 83 | * @brief returns nonzero if indicated CPU is online. 84 | */ 85 | int kfio_cpu_online(kfio_cpu_t cpu) 86 | { 87 | return cpu_online(cpu); 88 | } 89 | 90 | #if PORT_SUPPORTS_PER_CPU 91 | void kfio_create_kthread_on_cpu(fusion_kthread_func_t func, void *data, 92 | void *fusion_nand_device, kfio_cpu_t cpu, 93 | const char *fmt, ...) 94 | { 95 | struct task_struct *task; 96 | va_list ap; 97 | char buffer[40]; 98 | 99 | if (!cpu_online(cpu)) 100 | { 101 | return; 102 | } 103 | 104 | va_start(ap, fmt); 105 | vsnprintf(buffer, sizeof(buffer), fmt, ap); 106 | va_end(ap); 107 | 108 | task = kthread_create(func, data, "%s", buffer); 109 | if (IS_ERR(task)) 110 | { 111 | return; 112 | } 113 | 114 | kthread_bind(task, cpu); 115 | wake_up_process(task); 116 | } 117 | #endif 118 | 119 | static void __kfio_bind_task_to_cpumask(struct task_struct *tsk, cpumask_t *mask) 120 | { 121 | #if KFIOC_X_TASK_HAS_CPUS_MASK 122 | tsk->cpus_mask = *mask; 123 | #else 124 | tsk->cpus_allowed = *mask; 125 | #endif 126 | // TODO: This is added in vsl4... 127 | // tsk->nr_cpus_allowed = cpumask_weight(mask); 128 | } 129 | 130 | /* 131 | * Will take effect on next schedule event 132 | */ 133 | void kfio_bind_kthread_to_node(kfio_numa_node_t node) 134 | { 135 | if (node != FIO_NUMA_NODE_NONE) 136 | { 137 | cpumask_t *cpumask = (cpumask_t *) cpumask_of_node(node); 138 | 139 | if (cpumask && 140 | cpumask_weight(cpumask) 141 | ) 142 | __kfio_bind_task_to_cpumask(current, cpumask); 143 | } 144 | } 145 | 146 | /** 147 | * @} 148 | */ 149 | -------------------------------------------------------------------------------- /root/usr/src/iomemory-vsl-3.2.16/kcsr.c: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------------------- 2 | // Copyright (c) 2006-2014, Fusion-io, Inc.(acquired by SanDisk Corp. 2014) 3 | // Copyright (c) 2014-2015, SanDisk Corp. and/or all its affiliates. All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // * Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // * Neither the name of the SanDisk Corp. nor the names of its contributors 13 | // may be used to endorse or promote products derived from this software 14 | // without specific prior written permission. 15 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 17 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 18 | // A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | // IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 20 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 21 | // OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | //----------------------------------------------------------------------------- 28 | #if defined(__KERNEL__) 29 | #include "port-internal.h" 30 | #include 31 | 32 | uint32_t kfio_csr_read_direct(volatile void *addr, void *hdl); 33 | uint64_t kfio_csr_read_direct_64(volatile void *addr, void *hdl); 34 | void kfio_csr_write_nobarrier(uint32_t val, volatile void *addr, void *hdl); 35 | void kfio_csr_write(uint32_t val, volatile void *addr, void *hdl); 36 | void kfio_csr_write_64(uint64_t val, volatile void *addr, void *hdl); 37 | 38 | #else /* not defined __KERNEL */ 39 | #include 40 | #include 41 | 42 | /** 43 | * @ingroup PORT_COMMON_LINUX 44 | * @{ 45 | */ 46 | 47 | #define __raw_readl(addr) (*(volatile uint32_t *)(addr)) 48 | #define __raw_writel(val, addr) (*(volatile uint32_t *)(addr) = (val)) 49 | 50 | #define __raw_readq(addr) (*(volatile uint64_t *)(addr)) 51 | #define __raw_writeq(val, addr) (*(volatile uint64_t *)(addr) = (val)) 52 | 53 | #endif // __KERNEL__ 54 | 55 | /** @brief in kernel space, the hdl is the handle to access the 56 | * mapped PCI memory, (can be NULL in Linux). 57 | * In user space Linux allow direct access to mapped PCI memory and so 58 | * perfroms like in kernel space. For other OSes where such access is 59 | * not allowed, the hdl is a pointer to a file handle and the 60 | * kfio_csr_read / write() calls perform an ioctl to the required driver 61 | * (which may be in minimal mode). 62 | */ 63 | 64 | // We have these functions because htonl can repeatedly evaluate its argument, which is very, very bad 65 | uint32_t kfio_csr_read_direct(volatile void *addr, void *hdl) 66 | { 67 | uint32_t v = __raw_readl(addr); 68 | v = fusion_card_to_host32(v); 69 | 70 | return v; 71 | } 72 | uint64_t kfio_csr_read_direct_64(volatile void *addr, void *hdl) 73 | { 74 | uint64_t v = __raw_readq(addr); 75 | v = fusion_card_to_host64(v); 76 | 77 | return v; 78 | } 79 | 80 | void kfio_csr_write_nobarrier(uint32_t val, volatile void *addr, void *hdl) 81 | { 82 | val = host_to_fusion_card32(val); 83 | __raw_writel(val, addr); 84 | } 85 | 86 | void kfio_csr_write(uint32_t val, volatile void *addr, void *hdl) 87 | { 88 | kfio_csr_write_nobarrier(val, addr, hdl); 89 | #if defined(__KERNEL__) 90 | kfio_barrier(); 91 | #endif 92 | } 93 | 94 | void kfio_csr_write_64(uint64_t val, volatile void *addr, void *hdl) 95 | { 96 | val = host_to_fusion_card64(val); 97 | __raw_writeq(val, addr); 98 | 99 | #if defined(__KERNEL__) 100 | kfio_barrier(); 101 | #endif 102 | } 103 | 104 | /** 105 | * @} 106 | */ 107 | -------------------------------------------------------------------------------- /root/usr/src/iomemory-vsl-3.2.16/kfio/README.md: -------------------------------------------------------------------------------- 1 | # kfio object libs 2 | **!!! NON USER SERVICABLE PARTS INSIDE!!!** 3 | 4 | **If you don't know what this is you probably shouldn't poke around here.** 5 | 6 | This directory contains object libraries that are proprietary and fill the 7 | "gaps" in the open source part of the driver code that handles the NAND, 8 | LEB-MAP, FPGA, and other operations on the cards. 9 | 10 | # Goal 11 | The goal of de-mangling the object files is to make sure the driver can be 12 | supported longer term, and make troubleshooting issues with cards more simple 13 | and transparent, hopefully saving cards from the bin. 14 | 15 | ## orig vs latest vs numbers 16 | The `x86_64_cc##_libkfio.o_shipped` names are based on the `gcc` version used 17 | for linking on the host that compiles the driver, they originally accompanied 18 | the driver. Today we look at which cc version someone has, and copy 19 | the `x86_64_libkfio.o_shipped` object file over to that cc version prior to 20 | compiling the driver. The shipped version is/*should be* a copy from 21 | `x86_64_cc63_libkfio.o_shipped`. 22 | 23 | ## procedure 24 | The `function_hash.txt` file contains a hash to function mapping, this mapping 25 | is used to translate obscure function names in the object files to humanly 26 | understandable names, allowing for easier debugging and code de-mangling. 27 | `kfio_operations.sh` contains a function called `patch_objs` which gets called 28 | with `-O`. This function takes the `x86_64_libkfio.o_shipped` and copies 29 | it. After copying the file it will munge the contents of `function_hashes.txt` 30 | and rename the functions in the copied file. By default the output file is 31 | `x86_64_latest_libkfio.o_shipped`, which is used when `make`-`ing` the module. 32 | 33 | ## src 34 | The `src` directory contains a de-compiled version of the library in various 35 | stages. 36 | -------------------------------------------------------------------------------- /root/usr/src/iomemory-vsl-3.2.16/kfio/kfio_operations.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | # 3 | # Replaced 1379 objects in x86_64_latest_libkfio.o_shipped from 3531 4 | # 5 | # ERROR: modpost: "g_fusion_info_root" [/home/snuf/Documents/Sources/fusion/iomemory-vsl/root/usr/src/iomemory-vsl-3.2.16/iomemory-vsl.ko] undefined! 6 | # ERROR: modpost: "gv_lock_indirect_read" [/home/snuf/Documents/Sources/fusion/iomemory-vsl/root/usr/src/iomemory-vsl-3.2.16/iomemory-vsl.ko] undefined! 7 | # ERROR: modpost: "g_config_table_count" [/home/snuf/Documents/Sources/fusion/iomemory-vsl/root/usr/src/iomemory-vsl-3.2.16/iomemory-vsl.ko] undefined! 8 | # ERROR: modpost: "gv_init_pci_counter" [/home/snuf/Documents/Sources/fusion/iomemory-vsl/root/usr/src/iomemory-vsl-3.2.16/iomemory-vsl.ko] undefined! 9 | # ERROR: modpost: "g_config_table" [/home/snuf/Documents/Sources/fusion/iomemory-vsl/root/usr/src/iomemory-vsl-3.2.16/iomemory-vsl.ko] undefined! 10 | # ERROR: modpost: "iodrive_pci_attach_post" [/home/snuf/Documents/Sources/fusion/iomemory-vsl/root/usr/src/iomemory-vsl-3.2.16/iomemory-vsl.ko] undefined! 11 | # ERROR: modpost: "gv_fio_device_list" [/home/snuf/Documents/Sources/fusion/iomemory-vsl/root/usr/src/iomemory-vsl-3.2.16/iomemory-vsl.ko] undefined! 12 | # ERROR: modpost: "g_fusion_info_iodrive" [/home/snuf/Documents/Sources/fusion/iomemory-vsl/root/usr/src/iomemory-vsl-3.2.16/iomemory-vsl.ko] undefined! 13 | # ERROR: modpost: "iodrive_pci_attach_setup" [/home/snuf/Documents/Sources/fusion/iomemory-vsl/root/usr/src/iomemory-vsl-3.2.16/iomemory-vsl.ko] undefined! 14 | # ERROR: modpost: "gv_fusion_info_fio" [/home/snuf/Documents/Sources/fusion/iomemory-vsl/root/usr/src/iomemory-vsl-3.2.16/iomemory-vsl.ko] undefined! 15 | 16 | usage() { 17 | echo "${0##*/}: 18 | -s 19 | -d 20 | -O flag: Patch Obj file with hashes 21 | -h flag: this help 22 | -D flag: Debug, set -x 23 | " 24 | } 25 | 26 | DEBUG=0 27 | OBJ_PATCH=0 28 | SRC_KFIO_LIB=x86_64_libkfio.o_shipped 29 | DST_KFIO_LIB=x86_64_latest_libkfio.o_shipped 30 | while getopts ":s:d:hDO" opt; do 31 | case ${opt} in 32 | s ) 33 | SRC_KFIO_LIB=$OPTARG 34 | ;; 35 | d ) 36 | DST_KFIO_LIB=$OPTARG 37 | ;; 38 | O ) 39 | OBJ_PATCH=1 40 | ;; 41 | D ) 42 | DEBUG=1 43 | set -x 44 | ;; 45 | h ) 46 | usage 47 | exit 0 48 | ;; 49 | \? ) 50 | usage 51 | exit 0 52 | ;; 53 | esac 54 | done 55 | shift $((OPTIND -1)) 56 | 57 | ## 58 | # x86_64_cc63_libkfio.o_shipped is the last OG that came with the driver 59 | ## 60 | patch_objs() { 61 | local src_obj_file=$1; shift 62 | local dst_obj_file=$1 63 | local TR_COUNT=0 64 | if [ -f "$src_obj_file" -a "$src_obj_file" != "$dst_obj_file" ]; then 65 | cp $src_obj_file $dst_obj_file 66 | obj_file=$dst_obj_file 67 | else 68 | echo "Missing source or source same as destination?" 69 | exit 1 70 | fi 71 | function_hash_file=$(dirname $0)/function_hashes.txt 72 | functions_in_obj=$(objdump -trS $obj_file | perl -ne 'if (m/(ifio_.*.3.2.16.1731|ifio_.*.4.3.7.1205)/) { print $1."\n" }' | uniq) 73 | function_version=$(objdump -trS x86_64_libkfio.o_shipped | head -20 | grep ifio | head -1 | perl -ne 'if (m/ifio_.*.(3.2.16.1731|4.3.7.1205)/) { print $1."\n" }') 74 | # 00122a840b5d7efe1beb3dd8908ae37fe03eac74:lrbtree_externalize 75 | # hash should become: 76 | # ifio_00122_a840b5d7efe1beb3dd8908ae37fe03eac74_3_2_16_1731 77 | # objcopy --redefine-sym ifio_58422......fef60.3.2.16.1731=fio_device_get_write_retard_reason 78 | if [ -f "$function_hash_file" ]; then 79 | FH_COUNT=$(cat $function_hash_file | wc -l | awk '{ print $1 }') 80 | FH=$(cat $function_hash_file) 81 | for obj_line in $FH; do 82 | obj_hash=${obj_line//:*} 83 | obj_name=${obj_line//*:} 84 | front_hash=${obj_hash:0:5} 85 | rest_hash=${obj_hash:5} 86 | # Make ver dynamic later? 87 | obj_id="ifio_${front_hash}.${rest_hash}.${function_version}" 88 | set +e 89 | res=$(echo $functions_in_obj | grep $obj_id) 90 | set -e 91 | if [ "$res" != "" ]; then 92 | echo "Found $obj_id for $obj_line in $dst_obj_file" 93 | if [ "$DEBUG" == "0" ]; then 94 | objcopy --redefine-sym $obj_id=$obj_name $obj_file 95 | else 96 | echo objcopy --redefine-sym $obj_id=$obj_name $obj_file 97 | fi 98 | TR_COUNT=$((TR_COUNT + 1)) 99 | else 100 | echo "Skipping $obj_id for $obj_line not in $dst_obj_file" 101 | fi 102 | # x86_64_cc53_libkfio.o_converted 103 | done 104 | echo "Replaced $TR_COUNT objects in $dst_obj_file from $FH_COUNT" 105 | else 106 | echo "No function hash replacement file found: $function_hashes" 107 | exit 1 108 | fi 109 | } 110 | 111 | if [ "$OBJ_PATCH" == "0" ]; then 112 | usage 113 | exit 1 114 | elif [ "$OBJ_PATCH" == "1" ]; then 115 | echo "Patching functions from $SRC_KFIO_LIB to $DST_KFIO_LIB" 116 | patch_objs $SRC_KFIO_LIB $DST_KFIO_LIB 117 | fi 118 | -------------------------------------------------------------------------------- /root/usr/src/iomemory-vsl-3.2.16/kfio/x86_64_cc41_libkfio.o_shipped: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RemixVSL/iomemory-vsl/c0f364fe7eeccbbd605137a88613b3c8d02246a4/root/usr/src/iomemory-vsl-3.2.16/kfio/x86_64_cc41_libkfio.o_shipped -------------------------------------------------------------------------------- /root/usr/src/iomemory-vsl-3.2.16/kfio/x86_64_cc43_libkfio.o_shipped: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RemixVSL/iomemory-vsl/c0f364fe7eeccbbd605137a88613b3c8d02246a4/root/usr/src/iomemory-vsl-3.2.16/kfio/x86_64_cc43_libkfio.o_shipped -------------------------------------------------------------------------------- /root/usr/src/iomemory-vsl-3.2.16/kfio/x86_64_cc44_libkfio.o_shipped: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RemixVSL/iomemory-vsl/c0f364fe7eeccbbd605137a88613b3c8d02246a4/root/usr/src/iomemory-vsl-3.2.16/kfio/x86_64_cc44_libkfio.o_shipped -------------------------------------------------------------------------------- /root/usr/src/iomemory-vsl-3.2.16/kfio/x86_64_cc48_libkfio.o_shipped: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RemixVSL/iomemory-vsl/c0f364fe7eeccbbd605137a88613b3c8d02246a4/root/usr/src/iomemory-vsl-3.2.16/kfio/x86_64_cc48_libkfio.o_shipped -------------------------------------------------------------------------------- /root/usr/src/iomemory-vsl-3.2.16/kfio/x86_64_cc49_libkfio.o_shipped: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RemixVSL/iomemory-vsl/c0f364fe7eeccbbd605137a88613b3c8d02246a4/root/usr/src/iomemory-vsl-3.2.16/kfio/x86_64_cc49_libkfio.o_shipped -------------------------------------------------------------------------------- /root/usr/src/iomemory-vsl-3.2.16/kfio/x86_64_cc53_libkfio.o_shipped: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RemixVSL/iomemory-vsl/c0f364fe7eeccbbd605137a88613b3c8d02246a4/root/usr/src/iomemory-vsl-3.2.16/kfio/x86_64_cc53_libkfio.o_shipped -------------------------------------------------------------------------------- /root/usr/src/iomemory-vsl-3.2.16/kfio/x86_64_cc54_libkfio.o_shipped: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RemixVSL/iomemory-vsl/c0f364fe7eeccbbd605137a88613b3c8d02246a4/root/usr/src/iomemory-vsl-3.2.16/kfio/x86_64_cc54_libkfio.o_shipped -------------------------------------------------------------------------------- /root/usr/src/iomemory-vsl-3.2.16/kfio/x86_64_cc63_libkfio.o_shipped: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RemixVSL/iomemory-vsl/c0f364fe7eeccbbd605137a88613b3c8d02246a4/root/usr/src/iomemory-vsl-3.2.16/kfio/x86_64_cc63_libkfio.o_shipped -------------------------------------------------------------------------------- /root/usr/src/iomemory-vsl-3.2.16/kfio/x86_64_latest_libkfio.o_shipped: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RemixVSL/iomemory-vsl/c0f364fe7eeccbbd605137a88613b3c8d02246a4/root/usr/src/iomemory-vsl-3.2.16/kfio/x86_64_latest_libkfio.o_shipped -------------------------------------------------------------------------------- /root/usr/src/iomemory-vsl-3.2.16/kscsi.c: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------- 2 | // Copyright (c) 2013-2014, Fusion-io, Inc.(acquired by SanDisk Corp. 2014) 3 | // Copyright (c) 2014-2015, SanDisk Corp. and/or all its affiliates. All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // * Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // * Neither the name of the SanDisk Corp. nor the names of its contributors 13 | // may be used to endorse or promote products derived from this software 14 | // without specific prior written permission. 15 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 17 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 18 | // A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | // IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 20 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 21 | // OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | // -------------------------------------------------------------------------- 28 | 29 | // This file implements the functions which interact with the "regular" linux SCSI mid-layer. 30 | 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include // for fio_bdev 36 | #include 37 | #include 38 | #include 39 | 40 | /** 41 | * @ingroup PORT_LINUX 42 | * @{ 43 | */ 44 | 45 | /* 46 | * Register the host with the operating system 47 | */ 48 | int fio_port_scsi_host_register_host(struct Scsi_Host *shost, struct pci_dev *pdev) 49 | { 50 | return scsi_add_host(shost, NULL); 51 | } 52 | 53 | /* 54 | * Unregister the host with the operating system 55 | */ 56 | void fio_port_scsi_host_unregister_host(struct Scsi_Host *shost) 57 | { 58 | scsi_remove_host(shost); 59 | } 60 | 61 | int kfio_port_scsi_cmd_copy_to_sg(void *port_cmd, void *src_buffer, uint32_t len) 62 | { 63 | struct scsi_cmnd *scmd = (struct scsi_cmnd *)port_cmd; 64 | uint32_t n; 65 | 66 | n = scsi_sg_copy_from_buffer(scmd, src_buffer, len); 67 | 68 | dbgprint(DBGS_SCSI_IO2, "kfio_port_scsi_cmd_copy_to_sg copied %u bytes\n", n); 69 | 70 | return n == len ? 0 : -EIO; 71 | } 72 | 73 | int kfio_port_scsi_cmd_copy_from_sg(void *port_cmd, void *dst_buffer, uint32_t len) 74 | { 75 | struct scsi_cmnd *scmd = (struct scsi_cmnd *)port_cmd; 76 | uint32_t n; 77 | 78 | n = scsi_sg_copy_to_buffer(scmd, dst_buffer, len); 79 | 80 | dbgprint(DBGS_SCSI_IO2, "kfio_port_scsi_cmd_copy_from_sg copied %u bytes\n", n); 81 | 82 | return n == len ? 0 : -EIO; 83 | } 84 | 85 | int kfio_port_scsi_cmd_map_kfio_bio(void *port_cmd, struct kfio_bio *fbio, uint32_t alignment) 86 | { 87 | struct scsi_cmnd *scmd = (struct scsi_cmnd *)port_cmd; 88 | struct scatterlist *sg; 89 | unsigned i; 90 | 91 | for_each_sg(scsi_sglist(scmd), sg, scsi_sg_count(scmd), i) 92 | { 93 | int ret = kfio_sgl_map_page(fbio->fbio_sgl, (fusion_page_t)sg_page(sg), sg->offset, sg->length); 94 | if (ret != 0) 95 | { 96 | return ret; 97 | } 98 | } 99 | 100 | return 0; 101 | } 102 | 103 | // These block functions do not apply when we are using the SCSI driver. 104 | int kfio_register_blkdev_pre_init(kfio_pci_dev_t *pdev) { return 0; } 105 | void kfio_disk_stat_read_update(struct kfio_disk *gd, uint64_t totalsize, uint64_t duration) { } 106 | void kfio_disk_stat_write_update(struct kfio_disk *gd, uint64_t totalsize, uint64_t duration) { } 107 | int kfio_get_gd_in_flight(struct kfio_disk *gd, int rw) { return 0; } 108 | void kfio_set_gd_in_flight(struct kfio_disk *gd, int rw, int in_flight) { } 109 | void kfio_set_write_holdoff(struct kfio_disk *disk) { } 110 | void kfio_clear_write_holdoff(struct kfio_disk *disk) { } 111 | void kfio_mark_lock_pending(struct kfio_disk *disk) { } 112 | void kfio_unmark_lock_pending(struct kfio_disk *disk) { } 113 | 114 | /** 115 | * @} 116 | */ 117 | -------------------------------------------------------------------------------- /root/usr/src/iomemory-vsl-3.2.16/port-internal.h: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------------------- 2 | // Copyright (c) 2006-2014, Fusion-io, Inc.(acquired by SanDisk Corp. 2014) 3 | // Copyright (c) 2014-2015, SanDisk Corp. and/or all its affiliates. All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // * Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // * Neither the name of the SanDisk Corp. nor the names of its contributors 13 | // may be used to endorse or promote products derived from this software 14 | // without specific prior written permission. 15 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 17 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 18 | // A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | // IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 20 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 21 | // OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | // ----------------------------------------------------------------------------- 28 | /** @file 29 | * This file contains OS-specific includes and references for use in the 30 | * porting layer only. Do not include this file directly or indirectly in the 31 | * driver. 32 | * 33 | */ 34 | 35 | #ifdef FUSION_CORE 36 | #error Only include this file when building the porting layer to avoid kernel-specific contamination. 37 | #endif 38 | 39 | #if !defined (__linux__) 40 | #error This file supports linux only 41 | #endif 42 | 43 | /******************************************************************************* 44 | * The constraints include not requiring recompilation for different versions 45 | * (debug/release, linux kernel versions &c.) for our proprietary portion of the 46 | * code. Many internal Fusion-io structures include fusion_event_t stuctures as 47 | * a (non dynamically allocated) member. We can either create and require using 48 | * dynamic allocators/deallocators and internally use pointers to structures, or 49 | * define a character structure large enough to accommodate the platform-specific 50 | * structure of any supported platforms. The latter is ugly, but the one in use. 51 | * 52 | * A corollary to the above is that OS-specific header files should be included 53 | * in the porting layer's source files but _not_ in header files accessed by 54 | * non- porting layer include or source files. 55 | ******************************************************************************/ 56 | 57 | #include 58 | 59 | 60 | #include 61 | #include 62 | #include 63 | #include 64 | #include 65 | #include 66 | #include 67 | #include 68 | #include 69 | #include 70 | #include 71 | #include 72 | #include 73 | 74 | #include 75 | #include 76 | -------------------------------------------------------------------------------- /root/usr/src/iomemory-vsl-3.2.16/sched.c: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------------------- 2 | // Copyright (c) 2006-2014, Fusion-io, Inc.(acquired by SanDisk Corp. 2014) 3 | // Copyright (c) 2014-2015, SanDisk Corp. and/or all its affiliates. All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // * Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // * Neither the name of the SanDisk Corp. nor the names of its contributors 13 | // may be used to endorse or promote products derived from this software 14 | // without specific prior written permission. 15 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 17 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 18 | // A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | // IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 20 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 21 | // OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | //----------------------------------------------------------------------------- 28 | #include "port-internal.h" 29 | #include 30 | #include 31 | 32 | /** 33 | * @ingroup PORT_COMMON_LINUX 34 | * @{ 35 | */ 36 | 37 | #include 38 | 39 | void noinline fusion_setup_dpc(fusion_dpc_t *wq, fusion_work_func_t func) 40 | { 41 | INIT_WORK((struct work_struct *) wq, (work_func_t) func); 42 | } 43 | 44 | void noinline fusion_setup_delayed_dpc(fusion_delayed_dpc_t *wq, fusion_work_func_t func) 45 | { 46 | INIT_DELAYED_WORK((struct delayed_work *) wq, (work_func_t) func); 47 | } 48 | 49 | /** 50 | */ 51 | void noinline fusion_schedule_dpc(fusion_dpc_t *work) 52 | { 53 | fusion_schedule_work(work); 54 | } 55 | 56 | /** 57 | * @brief initialize work item 58 | */ 59 | void noinline fusion_init_work(fusion_work_struct_t *wq, fusion_work_func_t func) 60 | { 61 | INIT_WORK((struct work_struct *) wq, (work_func_t) func); 62 | } 63 | KFIO_EXPORT_SYMBOL(fusion_init_work); 64 | 65 | /** 66 | * @brief destroy work item 67 | */ 68 | void noinline fusion_destroy_work(fusion_work_struct_t *work) 69 | { 70 | return; 71 | } 72 | KFIO_EXPORT_SYMBOL(fusion_destroy_work); 73 | 74 | /** 75 | * @brief schedule some work 76 | */ 77 | void noinline fusion_schedule_work(fusion_work_struct_t *work ) 78 | { 79 | schedule_work((struct work_struct *) work); 80 | } 81 | KFIO_EXPORT_SYMBOL(fusion_schedule_work); 82 | 83 | /** 84 | * @brief initialize delayed work item 85 | */ 86 | void noinline fusion_init_delayed_work(fusion_work_struct_t *wq, fusion_work_func_t func) 87 | { 88 | INIT_DELAYED_WORK((struct delayed_work *) wq, (work_func_t) func); 89 | } 90 | KFIO_EXPORT_SYMBOL(fusion_init_delayed_work); 91 | 92 | /** 93 | * @brief destroy work item 94 | */ 95 | void noinline fusion_destroy_delayed_work(fusion_work_struct_t *work) 96 | { 97 | return; 98 | } 99 | KFIO_EXPORT_SYMBOL(fusion_destroy_delayed_work); 100 | 101 | /** 102 | * @brief schedule delayed work 103 | * @param wq 104 | * @param sleep_time - delay time in micro seconds. 105 | */ 106 | void noinline fusion_schedule_delayed_work(fusion_work_struct_t *wq, uint64_t sleep_time ) 107 | { 108 | schedule_delayed_work((struct delayed_work *) wq, fusion_usectohz(sleep_time)); 109 | } 110 | 111 | void noinline fusion_might_sleep(void) 112 | { 113 | might_sleep(); 114 | } 115 | KFIO_EXPORT_SYMBOL(fusion_might_sleep); 116 | 117 | /** 118 | * @} 119 | */ 120 | -------------------------------------------------------------------------------- /root/usr/src/iomemory-vsl-3.2.16/sysrq.c: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------------------- 2 | // Copyright (c) 2006-2014, Fusion-io, Inc.(acquired by SanDisk Corp. 2014) 3 | // Copyright (c) 2014-2015, SanDisk Corp. and/or all its affiliates. All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // * Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // * Neither the name of the SanDisk Corp. nor the names of its contributors 13 | // may be used to endorse or promote products derived from this software 14 | // without specific prior written permission. 15 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 17 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 18 | // A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | // IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 20 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 21 | // OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | //----------------------------------------------------------------------------- 28 | #include 29 | #include 30 | #include 31 | #include 32 | 33 | #include 34 | #include 35 | #include 36 | #include 37 | 38 | void iodrive_handle_sysrq(HANDLE_SYSRQ_TYPE key); 39 | void kfio_iodrive_sysrq_keys(void); 40 | void kfio_iodrive_unreg_sysrq_keys(void); 41 | 42 | /** 43 | * @ingroup PORT_COMMON_LINUX 44 | * @{ 45 | */ 46 | 47 | extern void fio_pcicheck_handle_sysrq(void); 48 | extern void iodrive_dump_all(void); 49 | extern void iodrive_dump_all_software_state(void); 50 | 51 | #define SYSRQ_SOFTWARE 'l' 52 | #define SYSRQ_CSR 'z' 53 | 54 | void iodrive_handle_sysrq(HANDLE_SYSRQ_TYPE key) 55 | { 56 | switch (key) 57 | { 58 | case SYSRQ_CSR: 59 | iodrive_dump_all(); 60 | break; 61 | case SYSRQ_SOFTWARE: 62 | iodrive_dump_all_software_state(); 63 | break; 64 | } 65 | } 66 | 67 | struct sysrq_key_op csr_key_op = { 68 | .handler = iodrive_handle_sysrq, 69 | .help_msg = "ioDrive CSR (z)", 70 | .action_msg = "ioDrive CSR status:", 71 | .enable_mask = 0, 72 | }; 73 | 74 | struct sysrq_key_op software_key_op = { 75 | .handler = iodrive_handle_sysrq, 76 | .help_msg = "ioDrive software (l)", 77 | .action_msg = "ioDrive Software status:", 78 | .enable_mask = 0, 79 | }; 80 | 81 | void kfio_iodrive_sysrq_keys(void) 82 | { 83 | register_sysrq_key(SYSRQ_CSR, &csr_key_op); 84 | register_sysrq_key(SYSRQ_SOFTWARE, &software_key_op); 85 | } 86 | 87 | void kfio_iodrive_unreg_sysrq_keys(void) 88 | { 89 | unregister_sysrq_key(SYSRQ_CSR, &csr_key_op); 90 | unregister_sysrq_key(SYSRQ_SOFTWARE, &software_key_op); 91 | } 92 | 93 | /** 94 | * @} 95 | */ 96 | -------------------------------------------------------------------------------- /tools/efi/README.md: -------------------------------------------------------------------------------- 1 | # EFI Boot 2 | * NOT ALL VSL DRIVES SUPPORT UEFI, VSL4 DRIVES DO, 3 | check your device documentation and firmware to make sure yours does. 4 | 5 | > snippet from lspci -nnnvvv 6 | > 7 | > 04:00.0 Mass storage controller [0180]: SanDisk ioDrive2 [1aed:2001] (rev 04)
8 | > Subsystem: SanDisk ioDrive2 [1aed:2001] 9 | 10 | Booting from a Fusion-IO device comes with its own challenges. Firstly 11 | making sure the device supports the EFI boot ROM, and secondly installing 12 | the module, and in the case of Linux making the module available to initramfs 13 | when installing the OS so it will actually boot. 14 | 15 | The script in this directory is meant to help achieve and document the 16 | EFI booting from a Fusion-IO device on a new install of Ubuntu. 17 | 18 | ## install-ubuntu.sh 19 | Support for Ubuntu Desktop installation to a Fusion-IO drive as a boot drive. 20 | 21 | 1) Make sure BIOS is set to UEFI boot mode 22 | 2) Make sure FIO device has UEFI enabled 23 | 3) Boot your Ubuntu Desktop install medium 24 | 4) Choose "Try Ubuntu" 25 | 5) Open a terminal 26 | 6) `wget https://raw.githubusercontent.com/RemixVSL/iomemory-vsl/main/tools/efi/install-ubuntu.sh && bash install-ubuntu.sh` 27 | 7) Follow the instructions from the terminal 28 | 8) Proceed to install Ubuntu to the Fusion-IO drive 29 | 9) DON'T REBOOT BEFORE THE SCRIPT FINISHES!!! 30 | -------------------------------------------------------------------------------- /tools/efi/install-ubuntu.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # 1) Make sure BIOS is set to UEFI boot mode 4 | # 2) Make sure FIO device has UEFI enabled 5 | # 3) Boot ubuntu install medium 6 | # 4) Choose "Try Ubuntu" 7 | # 5) Open a terminal 8 | # 6) wget https://192.168.122.1:8080/install.sh && bash install.sh 9 | # 7) Follow the instructions on screen. 10 | # 8) DON'T REBOOT BEFORE THE SCRIPT FINISHES!!! 11 | 12 | mod=vsl 13 | sp="/-\|" 14 | if [ ! -d "/sys/firmware/efi" ]; then 15 | echo "You have to be running EFI mode and not BIOS mode to do this." 16 | exit 1 17 | fi 18 | 19 | sudo apt-get update 20 | sudo apt-get install -y git build-essential 21 | 22 | git clone https://github.com/RemixVSL/iomemory-${mod}.git 23 | cd iomemory-${mod} 24 | make module 25 | module=$(find . -type f -name iomemory-${mod}.ko) 26 | echo "Inserting module, this may take some time." 27 | sudo insmod $module 28 | 29 | # should we add fio-tools for debugging? 30 | echo "Module loaded!!" 31 | echo "Install the OS to your fio device now. Don't reboot till we are Done." 32 | 33 | waitforit=true 34 | while $waitforit; do 35 | if [ -e "/target/etc/passwd" ]; then 36 | grep -q 1000 /target/etc/passwd && grep -q 1000 /target/etc/group 37 | if [ "$?" == "0" ]; then 38 | waitforit=false 39 | fi 40 | fi 41 | printf "\rwaiting for signs of life \b${sp:i++%${#sp}:1}" 42 | sleep .2 43 | done 44 | echo 45 | waitforit=true 46 | while $waitforit; do 47 | grep -q "finish-install:" /var/log/syslog 48 | if [ "$?" == "0" ]; then 49 | waitforit=false 50 | else 51 | printf "\rwaiting for installer to finish \b${sp:i++%${#sp}:1}" 52 | fi 53 | sleep .2 54 | done 55 | echo 56 | waitforit=true 57 | while $waitforit; do 58 | tail -100 /var/log/syslog | grep -q "Reverting lockdown of the desktop environment." 59 | if [ "$?" == "0" ]; then 60 | waitforit=false 61 | else 62 | printf "\rwaiting for lockdown to finish \b${sp:i++%${#sp}:1}" 63 | fi 64 | sleep .2 65 | done 66 | echo 67 | 68 | echo "" 69 | echo "Copy module to target env root." 70 | sudo cp -pr ~/iomemory-${mod} /target/root 71 | 72 | sudo cp /etc/resolv.conf /target/etc/resolv.conf 73 | for m in proc sys dev; do 74 | sudo mount -o bind /$m /target/$m 75 | done 76 | # use "EOT" to stomp interpration of stuff 77 | echo "Going into chroot to move things around." 78 | sudo chroot /target /bin/bash <<"EOT" 79 | apt-get install -y git build-essential dkms grub-efi-amd64 80 | echo iomemory_vsl >> /etc/initramfs-tools/modules 81 | cd /root/iomemory-vsl 82 | make dkms 83 | release=$(uname -r) 84 | nrelease=$(ls -1 /lib/modules | grep -v $release) 85 | dkms_ver=$(dkms status | grep ^iomemory-vsl | awk -F', ' '{ print $2 }') 86 | dkms build -m iomemory-vsl -v $dkms_ver -k $nrelease 87 | dkms install -m iomemory-vsl -v $dkms_ver -k $nrelease 88 | EOT 89 | 90 | ### NON LVM installs!!! 91 | ## until we fix udev do this... 92 | sudo cp /target/etc/fstab /target/etc/fstab.org 93 | UUIDs=$(cat /target/etc/fstab | perl -ne 'print $1."\n" if /UUID=([\w\d\-]+)/') 94 | for UUID in $UUIDs; do 95 | blkdev=$(blkid | grep $UUID | awk -F: '{print $1}') 96 | line=$(grep $UUID /target/etc/fstab) 97 | sudo perl -pi -e "s#UUID=$UUID#$blkdev#" /target/etc/fstab 98 | echo "# $line" | sudo tee -a /target/etc/fstab 99 | done 100 | echo "DONE!!!, you can restart now." 101 | echo exit 102 | -------------------------------------------------------------------------------- /tools/udev/rules.d/60-persistent-fio.rules: -------------------------------------------------------------------------------- 1 | # persistent storage links for iomemory-vsl devices. 2 | # requires fio-status in /usr/bin. 3 | 4 | ACTION=="remove", GOTO="persistent_fio_end" 5 | ENV{UDEV_DISABLE_PERSISTENT_STORAGE_RULES_FLAG}=="1", GOTO="persistent_fio_end" 6 | 7 | SUBSYSTEM!="block", GOTO="persistent_fio_end" 8 | KERNEL!="fio*", GOTO="persistent_fio_end" 9 | 10 | # this was copied over from 60-persistent-storage, I believe it tries to see 11 | # if /sys/block/fio*/whole_disk merely exists 12 | TEST=="whole_disk", GOTO="persistent_fio_end" 13 | 14 | # partition handling also originates there. 15 | ENV{DEVTYPE}=="partition", \ 16 | IMPORT{parent}="ID_[!F]*", IMPORT{parent}="ID_", \ 17 | IMPORT{parent}="ID_F[!S]*", IMPORT{parent}="ID_F", \ 18 | IMPORT{parent}="ID_FS[!_]*", IMPORT{parent}="ID_FS" 19 | 20 | # by-id 21 | KERNEL=="fio[a-z]", PROGRAM="/usr/bin/fio-status --field iom.format_uuid /dev/%k", SYMLINK+="disk/by-id/fio-%c" 22 | KERNEL=="fio[a-z][0-9]*", ENV{DEVTYPE}=="partition", PROGRAM="/usr/bin/fio-status --field iom.format_uuid /dev/%P", SYMLINK+="disk/by-id/fio-%c-part%n" 23 | 24 | # by-path 25 | KERNEL=="fio[a-z]", PROGRAM="/usr/bin/fio-status --field iom.pci_addr /dev/%k", SYMLINK+="disk/by-path/pci-0000:%c-%k" 26 | KERNEL=="fio[a-z][0-9]*", ENV{DEVTYPE}=="partition", PROGRAM="/usr/bin/fio-status --field iom.pci_addr /dev/%P", SYMLINK+="disk/by-path/pci-0000:%c-%P-part%n" 27 | 28 | # by-uuid 29 | # snuf@scipio:~/$ blkid /dev/fioa1 30 | # /dev/fioa1: LABEL="Marvin" UUID="cda7751a-6cc1-4c5e-ba93-b08b843a7788" TYPE="ext4" PARTLABEL="marvin" PARTUUID="55574487-7748-4a44-ae71-02dc16e68a9a" 31 | # 32 | KERNEL!="fio[a-z][0-9]*", ENV{DEVTYPE}=="partition", IMPORT{program}="/sbin/blkid -o udev -p /dev/%k%n" 33 | KERNEL=="fio[a-z][0-9]*", ENV{DEVTYPE}=="partition", PROGRAM="/sbin/blkid -s PARTLABEL -o value /dev/%P%n", SYMLINK+="disk/by-partlabel/%c" 34 | KERNEL=="fio[a-z][0-9]*", ENV{DEVTYPE}=="partition", PROGRAM="/sbin/blkid -s LABEL -o value /dev/%P%n", SYMLINK+="disk/by-label/%c" 35 | KERNEL=="fio[a-z][0-9]*", ENV{DEVTYPE}=="partition", PROGRAM="/sbin/blkid -s UUID -o value /dev/%P%n", SYMLINK+="disk/by-uuid/%c" 36 | KERNEL=="fio[a-z][0-9]*", ENV{DEVTYPE}=="partition", PROGRAM="/sbin/blkid -s UUID_SUB -o value /dev/%P%n", SYMLINK+="disk/by-uuid/%c" 37 | KERNEL=="fio[a-z][0-9]*", ENV{DEVTYPE}=="partition", PROGRAM="/sbin/blkid -s PARTUUID -o value /dev/%P%n", SYMLINK+="disk/by-partuuid/%c" 38 | 39 | LABEL="persistent_fio_end" 40 | --------------------------------------------------------------------------------