Linux_SDK_V0.9.5

This commit is contained in:
thead_admin
2022-09-13 10:33:44 +08:00
commit a82fcbc63c
186 changed files with 33455 additions and 0 deletions

13
.gitignore vendored Normal file
View File

@@ -0,0 +1,13 @@
*.o
*.a
*.o.d
*.o.cmd
*.a.cmd
*.ko.cmd
*.ko
*.mod
*.mod.c
*.mod.cmd
Module.symvers
*.so
*.Module.*

3
.gitmodules vendored Normal file
View File

@@ -0,0 +1,3 @@
[submodule "CSI_DSP_FW"]
path = CSI_DSP_FW
url = git@gitlab.alibaba-inc.com:thead-linux-private/csi_dsp_firmware.git

137
Makefile Normal file
View File

@@ -0,0 +1,137 @@
##
# Copyright (C) 2021 Alibaba Group Holding Limited
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
##
test = $(shell if [ -f "../.param" ]; then echo "exist"; else echo "noexist"; fi)
ifeq ("$(test)", "exist")
include ../.param
endif
CONFIG_DRIVER_BUILD_PARAMS=KERNEL=$(LINUX_DIR) CROSS=$(CROSS_COMPILE) ARCH=$(ARCH) BOARD_NAME=$(BOARD_NAME)
CONFIG_LIB_BUILD_PARAMS=CROSS=$(CROSS_COMPILE) ARCH=$(ARCH) BOARD_NAME=$(BOARD_NAME)
CONFIG_TEST_BUILD_PARAMS=CROSS=$(CROSS_COMPILE) ARCH=$(ARCH) BOARD_NAME=$(BOARD_NAME)
MODULE_NAME=xtensa_dsp
BUILD_LOG_START="\033[47;30m>>> $(MODULE_NAME) $@ begin\033[0m"
BUILD_LOG_END ="\033[47;30m<<< $(MODULE_NAME) $@ end\033[0m"
DIR_TARGET_BASE=bsp/xtensa_dsp
DIR_TARGET_LIB =bsp/xtensa_dsp/lib
DIR_TARGET_KO =bsp/xtensa_dsp/ko
DIR_TARGET_TEST=bsp/xtensa_dsp/test
#
# Do a parallel build with multiple jobs, based on the number of CPUs online
# in this system: 'make -j8' on a 8-CPU system, etc.
#
# (To override it, run 'make JOBS=1' and similar.)
#
ifeq ($(JOBS),)
JOBS := $(shell grep -c ^processor /proc/cpuinfo 2>/dev/null)
ifeq ($(JOBS),)
JOBS := 1
endif
endif
all: info lib driver test install_local_output install_rootfs
.PHONY: info driver lib test install_local_output install_rootfs \
clean_driver clean_lib clean_test clean_tools clean_output clean
info:
@echo $(BUILD_LOG_START)
@echo " ====== Build Info from repo project ======"
@echo " BUILDROOT_DIR="$(BUILDROOT_DIR)
@echo " CROSS_COMPILE="$(CROSS_COMPILE)
@echo " LINUX_DIR="$(LINUX_DIR)
@echo " ARCH="$(ARCH)
@echo " BOARD_NAME="$(BOARD_NAME)
@echo " KERNEL_ID="$(KERNELVERSION)
@echo " KERNEL_DIR="$(LINUX_DIR)
@echo " INSTALL_DIR_ROOTFS="$(INSTALL_DIR_ROOTFS)
@echo " INSTALL_DIR_SDK="$(INSTALL_DIR_SDK)
@echo " CONFIG_DRIVER_BUILD_PARAMS="$(CONFIG_DRIVER_BUILD_PARAMS)
@echo " CONFIG_LIB_BUILD_PARAMS="$(CONFIG_LIB_BUILD_PARAMS)
@echo " CONFIG_TEST_BUILD_PARAMS="$(CONFIG_TEST_BUILD_PARAMS)
@echo $(BUILD_LOG_END)
driver:
@echo $(BUILD_LOG_START)
make -C driver/xrp-kernel $(CONFIG_DRIVER_BUILD_PARAMS) BUILD_TYPE=DEBUG
@echo $(BUILD_LOG_END)
clean_driver:
@echo $(BUILD_LOG_START)
make -C driver/xrp-kernel $(CONFIG_DRIVER_BUILD_PARAMS) clean
@echo $(BUILD_LOG_END)
lib:
@echo $(BUILD_LOG_START)
# make -C driver/xrp-user/xrp-host $(CONFIG_LIB_BUILD_PARAMS)
# make -C driver/xrp-user/xrp-common $(CONFIG_LIB_BUILD_PARAMS)
make -C driver/xrp-user/ $(CONFIG_LIB_BUILD_PARAMS)
@echo $(BUILD_LOG_END)
clean_lib:
@echo $(BUILD_LOG_START)
make -C driver/xrp-user/xrp-host clean
make -C driver/xrp-user/xrp-common clean
make -C driver/xrp-user/ clean
@echo $(BUILD_LOG_END)
test: lib driver
@echo $(BUILD_LOG_START)
make -C test/vi_test $(CONFIG_TEST_BUILD_PARAMS)
make -C test/npu_test $(CONFIG_TEST_BUILD_PARAMS)
make -C test/ip_test $(CONFIG_TEST_BUILD_PARAMS)
make -C test/drv_test $(CONFIG_TEST_BUILD_PARAMS)
@echo $(BUILD_LOG_END)
clean_test:
@echo $(BUILD_LOG_START)
make -C test/vi_test clean
make -C test/npu_test clean
make -C test/ip_test clean
make -C test/drv_test clean
@echo $(BUILD_LOG_END)
install_local_output: driver lib test
@echo $(BUILD_LOG_START)
# driver files
mkdir -p ./output/rootfs/$(DIR_TARGET_KO)
cp -f ./driver/xrp-kernel/*.ko ./output/rootfs/$(DIR_TARGET_KO)
# lib files
mkdir -p ./output/rootfs/$(DIR_TARGET_LIB)
cp -f ./driver/xrp-user/*.so ./output/rootfs/$(DIR_TARGET_LIB)
# test files
mkdir -p ./output/rootfs/$(DIR_TARGET_TEST)
cp -rf ./test/vi_test/output/* ./output/rootfs/$(DIR_TARGET_TEST)
cp -rf ./test/npu_test/output/* ./output/rootfs/$(DIR_TARGET_TEST)
cp -rf ./test/ip_test/output/* ./output/rootfs/$(DIR_TARGET_TEST)
cp -rf ./test/drv_test/output/* ./output/rootfs/$(DIR_TARGET_TEST)
@if [ `command -v tree` != "" ]; then \
tree ./output/rootfs -I 'sdk' | grep -v "\.json"; \
echo "INFO: The files above, has filter out the sdk folder and .json files"; \
fi
@echo $(BUILD_LOG_END)
install_rootfs: install_local_output
@echo $(BUILD_LOG_START)
# cp -rf output/rootfs/* $(INSTALL_DIR_ROOTFS)
@echo $(BUILD_LOG_END)
clean_output:
@echo $(BUILD_LOG_START)
rm -rf ./output
rm -rf $(INSTALL_DIR_ROOTFS)/$(DIR_TARGET_BASE)
@echo $(BUILD_LOG_END)
clean: clean_output clean_driver clean_lib clean_test

14
README.md Normal file
View File

@@ -0,0 +1,14 @@
# How to get the code
- git clone git@gitlab.alibaba-inc.com:thead-linux-private/xtensa_dsp.git
# How to build
## Build within repo project
- XX
## Build out of repo project
- YY
# Description of each directories
- driver/: Linux kernel module Driver.
- lib/: User mode libs and header files.
- test/: Test cases and demo app.

File diff suppressed because it is too large Load Diff

View File

View File

@@ -0,0 +1,192 @@
../xrp-kernel/libxrp_host_standalone_a-xrp_alloc.o: \
../xrp-kernel/xrp_alloc.c \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/errno.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/yvals.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/c99/yvals.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/config/core-isa.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/lib/xcc/include/stdarg.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/sys/reent.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/stdio.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/c99/stdio.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/mbstatet.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/tie/xt_scmpr.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/wchar.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/xwcstod.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/xwstr.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/fenv.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/ymath.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/c99/ymath.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/stdbool.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/stddef.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/c99/stddef.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/stdlib.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/c99/stdlib.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/alloca.h \
../xrp-common/xrp_debug.h ../xrp-kernel/xrp_private_alloc.h \
../xrp-kernel/xrp_alloc.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/stdint.h \
xrp_atomic.h thread-xos/xrp_thread_impl.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_types.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/hal.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/config/core.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xtensa-versions.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xtensa-types.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/config/core-matmap.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/config/tie.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/hal-certified.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/hal-compat.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/core-macros.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/corebits.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/tie/xt_core.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/tie/xt_interrupt.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/tie/xt_timer.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/tie/xt_externalregisters.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/tie/xt_coprocessors.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/intctrl.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/core-macros-compat.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_common.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/config/system.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_params.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_errors.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_regaccess.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_log.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_thread.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_cond.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_event.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_mutex.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_msgq.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_semaphore.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_blockmem.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_barrier.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_timer.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_stopwatch.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_syslog.h
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/errno.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/yvals.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/c99/yvals.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/config/core-isa.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/lib/xcc/include/stdarg.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/sys/reent.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/stdio.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/c99/stdio.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/mbstatet.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/tie/xt_scmpr.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/wchar.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/xwcstod.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/xwstr.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/fenv.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/ymath.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/c99/ymath.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/stdbool.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/stddef.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/c99/stddef.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/stdlib.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/c99/stdlib.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/alloca.h:
../xrp-common/xrp_debug.h:
../xrp-kernel/xrp_private_alloc.h:
../xrp-kernel/xrp_alloc.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/stdint.h:
xrp_atomic.h:
thread-xos/xrp_thread_impl.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_types.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/hal.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/config/core.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xtensa-versions.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xtensa-types.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/config/core-matmap.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/config/tie.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/hal-certified.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/hal-compat.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/core-macros.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/corebits.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/tie/xt_core.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/tie/xt_interrupt.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/tie/xt_timer.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/tie/xt_externalregisters.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/tie/xt_coprocessors.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/intctrl.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/core-macros-compat.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_common.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/config/system.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_params.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_errors.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_regaccess.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_log.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_thread.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_cond.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_event.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_mutex.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_msgq.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_semaphore.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_blockmem.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_barrier.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_timer.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_stopwatch.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_syslog.h:

View File

49
driver/xrp-kernel/Kconfig Normal file
View File

@@ -0,0 +1,49 @@
#
# Xtensa Remote Processing kernel driver
#
config XRP
tristate "XRP driver"
help
This is the core of Cadence Xtensa Remote Processing driver.
It should be enabled to support applications communicating with
Xtensa DSPs through the XRP API.
If unsure, say N.
To compile this driver as a module, choose M here: the
module will be called xrp.
config XRP_DEBUG
bool "Debug XRP"
depends on XRP
help
This enables verbose debug output of the XRP driver.
If unsure, say N.
config XRP_HW_SIMPLE
tristate "XRP for simple hardware"
depends on XRP
help
This is hardware-specific XRP kernel driver for the simple
hardware. It should be enabled to support XRP on simple hardware
platforms.
If unsure, say N.
To compile this driver as a module, choose M here: the
module will be called xrp_hw_simple.
config XRP_HW_HIKEY960
tristate "XRP for HiKey960"
depends on XRP
help
This is hardware-specific XRP kernel driver for the HiKey960
hardware. It should be enabled to support XRP on HiKey960
platform.
If unsure, say N.
To compile this driver as a module, choose M here: the
module will be called xrp_hw_hikey960.

View File

@@ -0,0 +1,63 @@
#
# Copyright (c) 2017 Cadence Design Systems Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Alternatively you can use and distribute this file under the terms of
# the GNU General Public License version 2 or later.
#
ifdef VISYS_SYM_PATH
KBUILD_EXTRA_SYMBOLS += $(VISYS_SYM_PATH)/bm_visys/Module.symvers
else
KBUILD_EXTRA_SYMBOLS += $(shell pwd)/../../../baremetal-drivers/driver/visys/Module.symvers
endif
# export KBUILD_EXTRA_SYMBOLS
EXTRA_CFLAGS += -DWITH_VISYS_KO
xrp-y += xvp_main.o xrp_address_map.o xrp_alloc.o xrp_debug.o
xrp-$(CONFIG_OF) += xrp_firmware.o
xrp-$(CONFIG_CMA) += xrp_cma_alloc.o
obj-$(CONFIG_XRP) += xrp.o
obj-$(CONFIG_XRP_HW_SIMPLE) += xrp_hw_simple.o
obj-m += xrp_hw_comm.o
obj-$(CONFIG_XRP_HW_HIKEY960) += xrp_hw_hikey960.o
ifeq ($(BUILD_TYPE),DEBUG)
EXTRA_CFLAGS += -DDEBUG
endif
KBUILD_CFLAGS += -O2
ccflags-$(CONFIG_XRP_DEBUG) += -DDEBUG
ccflags-$(CONFIG_XRP_HW_HIKEY960) += -I$(srctree)/drivers/hisi/hifi_mailbox
# Remove this comment and all lines below it when integrating this Makefile
# into the linux kernel make system.
#
# sed -i % '/Remove this comment and all lines below it/,$d'
# make -C $(KERNEL) M=$(PWD) modules
# KSRC ?= /lib/modules/$(shell uname -r)/build
modules:
$(MAKE) -C $(KERNEL) M=`pwd` CONFIG_XRP=m CONFIG_XRP_HW_SIMPLE=m CONFIG_XRP_DEBUG=y modules
%:
$(MAKE) -C $(KERNEL) M=`pwd` CONFIG_XRP=m $@

25
driver/xrp-kernel/README Normal file
View File

@@ -0,0 +1,25 @@
Driver parameters:
- firmware_command_timeout, int: a number of seconds that the host waits for
the DSP to respond to a synchronization request or a command. Can be changed
at runtime through the following sysfs entry:
/sys/module/xrp/parameters/firmware_command_timeout
- firmware_reboot, 0/1: controls whether the driver reboots firmware on
command timeout. Enabled by default and can be changed at runtime through
the following sysfs entry: /sys/module/xrp/parameters/firmware_reboot
- loopback, 0/1/2/3: controls level of interaction between the driver and
the firmware.
0: normal operation. The driver loads firmware, controls DSP and interacts
with the firmware through shared memory;
1: no-communication loopback. The driver loads the firmware and controls
DSP, but does not communicate with firmware. Initial synchronization
is not performed and command submission is completed immediately after
all normal preparation steps related to buffer mapping. Communication
area is not touched by the driver.
2: no-control loopback. The driver loads the firmware, but does not control
DSP nor does it communicate with the firmware. Neither communication
area nor DSP MMIO area are touched by the driver.
3: no-firmware loopback. The driver doesn't load firmware, doesn't control
DSP and doesn't communicate with DSP.

View File

@@ -0,0 +1,59 @@
Bindings for the Cadence Xtensa Remote Processing driver, CMA mode.
In CMA mode DSP communication area and shared memory are allocated from the
CMA-managed reserved memory region assigned to the XRP device.
Required properties:
- compatible: shall be "cdns,xrp,cma".
- memory-region: phandle, refers to a child node inside reserved-memory node.
Optional properties:
- queue-priority: cells indicating priorities of DSP hardware queues. If
missing then single default queue is configured.
- firmware-name: string identifying firmware name. If missing the driver
doesn't load the firmware.
- #address-cells: number of cells DSP physical address takes in the ranges.
- #size-cells: number of cells each size takes in the ranges.
- ranges: standard ranges property. Provides mapping of DSP physical addresses
to host physical addresses. Arbitrary number of groups with the following
structure:
- cells with DSP physical address of the region;
- cells with the corresponding host physical address of the
region;
- cells with the size of the region.
Ranges must cover addresses of the reserved memory pointed to by the
memory-region property.
XRP node may have an optional subnode when there's non-identity mapping set
up in the ranges property. Both subnode and ranges property are required in
order for the address translation to work.
Example:
reserved-memory {
#address-cells = <1>;
#size-cells = <1>;
ranges;
xrp_reserved: xrp@08000000 {
compatible = "shared-dma-pool";
reg = <0x08000000 0x08000000>;
reusable;
};
};
xrp@0 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "cdns,xrp,cma";
memory-region = <&xrp_reserved>;
queue-priority = <0 1 2>;
firmware-name = "xrp0.elf";
ranges = <0x00000000 0x00000000 0x10000000
0x3ffc0000 0xc0000000 0x00020000
0x3ffe0000 0xc0020000 0x00020000
0x50000000 0x50000000 0x01000000
0x60000000 0x60000000 0x20000000
0xf0000000 0xf0000000 0x0d000000>;
dsp@0 {
};
};

View File

@@ -0,0 +1,43 @@
Bindings for the Cadence Xtensa Remote Processing driver, v.1.
Required properties:
- compatible: shall be "cdns,xrp,v1".
- reg: location of DSP shared memory area.
Optional properties:
- queue-priority: cells indicating priorities of DSP hardware queues. If
missing then single default queue is configured.
- firmware-name: string identifying firmware name. If missing the driver
doesn't load the firmware.
- #address-cells: number of cells DSP physical address takes in the ranges.
- #size-cells: number of cells each size takes in the ranges.
- ranges: standard ranges property. Provides mapping of DSP physical addresses
to host physical addresses. Arbitrary number of groups with the following
structure:
- cells with DSP physical address of the region;
- cells with the corresponding host physical address of the
region;
- cells with the size of the region.
XRP node may have an optional subnode when there's non-identity mapping set
up in the ranges property. Both subnode and ranges property are required in
order for the address translation to work.
Example:
xrp@0 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "cdns,xrp,v1";
reg = <0xf0000000 0x01000000>;
firmware-name = "xrp0.elf";
ranges = <0x00000000 0x00000000 0x10000000
0x3ffc0000 0xc0000000 0x00020000
0x3ffe0000 0xc0020000 0x00020000
0x50000000 0x50000000 0x01000000
0x60000000 0x60000000 0x20000000
0xf0000000 0xf0000000 0x0d000000>;
dsp@0 {
};
};

View File

@@ -0,0 +1,52 @@
Bindings for the Cadence Xtensa Remote Processing HW-specific driver for
HiKey960.
This binding is an extension of the cdns,xrp,cma binding. All properties of
that binding are in effect.
Required properties:
- compatible: shall be "cdns,xrp-hw-hikey960,cma".
Optional properties:
- reg: panic/log buffer location.
- device-irq: 1 32-bit cell: DSP IRQ number (normal core IRQ number, not
external IRQ number) assigned to the egress mailbox.
- host-irq: 1 32-bit cell, when present enables IRQ usage in DSP->host
direction.
Example:
reserved-memory {
#address-cells = <1>;
#size-cells = <1>;
ranges;
xrp_reserved: xrp@60000000 {
compatible = "shared-dma-pool";
reg = <0x0 0x60000000 0x0 0x10000000>;
reusable;
};
};
xrp@0 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "cdns,xrp-hw-simple,cma";
memory-region = <&xrp_reserved>;
reg = <
0x0 0x8b300000 0x0 0x00001000 /* Panic/log page */
>;
device-irq = <3>;
host-irq = <0>;
firmware-name = "xrp0.elf";
ranges = <
0x00000000 0x0 0x00000000 0x89200000
0x89cc0000 0x0 0x89cc0000 0x06340000
0x90000000 0x0 0x90000000 0x30000000
0xc0000000 0x0 0x89200000 0x00600000
0xe8000000 0x0 0x89800000 0x00030000
0xe8058000 0x0 0x89830000 0x00031000
>;
dsp@0 {
};
};

View File

@@ -0,0 +1,41 @@
Bindings for the Cadence Xtensa Remote Processing HW-specific driver for
HiKey960.
This binding is an extension of the cdns,xrp,v1 binding. All properties of
that binding are in effect.
Required properties:
- compatible: shall be "cdns,xrp-hw-hikey960,v1".
- reg: register locations of the DSP shared memory (first entry, same as in
cdns,xrp,v1) panic/log buffer location (second entry, optional).
Optional properties:
- device-irq: 1 32-bit cell: DSP IRQ number (normal core IRQ number, not
external IRQ number) assigned to the egress mailbox.
- host-irq: 1 32-bit cell, when present enables IRQ usage in DSP->host
direction.
Example:
xrp@0 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "cdns,xrp-hw-simple,v1";
reg = <
0x0 0x8b301000 0x0 0x0037f000 /* Shared memory */
0x0 0x8b300000 0x0 0x00001000 /* Panic/log page */
>;
device-irq = <3>;
host-irq = <0>;
firmware-name = "xrp0.elf";
ranges = <
0x00000000 0x0 0x00000000 0x89200000
0x89cc0000 0x0 0x89cc0000 0x06340000
0x90000000 0x0 0x90000000 0x30000000
0xc0000000 0x0 0x89200000 0x00600000
0xe8000000 0x0 0x89800000 0x00030000
0xe8058000 0x0 0x89830000 0x00031000
>;
dsp@0 {
};
};

View File

@@ -0,0 +1,65 @@
Bindings for the Cadence Xtensa Remote Processing Simple HW-specific driver.
This binding is an extension of the cdns,xrp,cma binding. All properties of
that binding are in effect.
Required properties:
- compatible: shall be "cdns,xrp-hw-simple,cma".
- reg: register location of the DSP MMIO block.
Optional properties:
- device-irq: 3 32-bit cells:
- first: offset of the 32-bit device IRQ MMIO register from the DSP MMIO
block start as seen by the device;
- second: register bit index that controls IRQ;
- third: DSP IRQ number (normal core IRQ number, not external IRQ number)
controlled by this register/bit.
- device-irq-host-offset: offset of the 32-bit device IRQ MMIO register from
the DSP MMIO block start as seen by the host. If omitted device-irq cell 0
is used;
- device-irq-mode: 0 for none (polling), 1 for level, 2 for edge, 3 for
software-assisted (by LUA script in the XTSC) edge.
- host-irq: 2 32-bit cells:
- first: offset of the 32-bit device IRQ MMIO register from the DSP MMIO
block start;
- second: register bit index that controls IRQ.
- host-irq-mode: 0 for none (polling), 1 for level, 2 for edge.
- interrupts: host IRQ number controlled by this register/bit.
Example:
reserved-memory {
#address-cells = <1>;
#size-cells = <1>;
ranges;
xrp_reserved: xrp@08000000 {
compatible = "shared-dma-pool";
reg = <0x08000000 0x08000000>;
reusable;
};
};
xrp@0 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "cdns,xrp-hw-simple,cma";
memory-region = <&xrp_reserved>;
reg = <0xfd001000 0x00000200>; /* DSP MMIO */
device-irq = <0 1 5>; /* offset, bit#, IRQ# */
device-irq-host-offset = <0>;
device-irq-mode = <1>;
host-irq = <0xfffff000 0>; /* offset, bit# */
host-irq-mode = <2>;
interrupts = <15 0>;
firmware-name = "xrp0.elf";
ranges = <0x00000000 0x00000000 0x10000000
0x3ffc0000 0xc0000000 0x00020000
0x3ffe0000 0xc0020000 0x00020000
0x50000000 0x50000000 0x01000000
0x60000000 0x60000000 0x20000000
0xf0000000 0xf0000000 0x0d000000>;
dsp@0 {
};
};

View File

@@ -0,0 +1,54 @@
Bindings for the Cadence Xtensa Remote Processing Simple HW-specific driver.
This binding is an extension of the cdns,xrp,v1 binding. All properties of
that binding are in effect.
Required properties:
- compatible: shall be "cdns,xrp-hw-simple,v1".
- reg: register locations of the DSP shared memory (first entry, same as in
cdns,xrp,v1) and DSP MMIO block (second entry).
Optional properties:
- device-irq: 3 32-bit cells:
- first: offset of the 32-bit device IRQ MMIO register from the DSP MMIO
block start as seen by the device;
- second: register bit index that controls IRQ;
- third: DSP IRQ number (normal core IRQ number, not external IRQ number)
controlled by this register/bit.
- device-irq-host-offset: offset of the 32-bit device IRQ MMIO register from
the DSP MMIO block start as seen by the host. If omitted device-irq cell 0
is used;
- device-irq-mode: 0 for none (polling), 1 for level, 2 for edge, 3 for
software-assisted (by LUA script in the XTSC) edge.
- host-irq: 2 32-bit cells:
- first: offset of the 32-bit device IRQ MMIO register from the DSP MMIO
block start;
- second: register bit index that controls IRQ.
- host-irq-mode: 0 for none (polling), 1 for level, 2 for edge.
- interrupts: host IRQ number controlled by this register/bit.
Example:
xrp@0 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "cdns,xrp-hw-simple,v1";
reg = <0xf0000000 0x01000000 /* DSP shared memory */
0xfd001000 0x00000200>; /* DSP MMIO */
device-irq = <0 1 5>; /* offset, bit#, IRQ# */
device-irq-host-offset = <0>;
device-irq-mode = <1>;
host-irq = <0xfffff000 0>; /* offset, bit# */
host-irq-mode = <2>;
interrupts = <15 0>;
firmware-name = "xrp0.elf";
ranges = <0x00000000 0x00000000 0x10000000
0x3ffc0000 0xc0000000 0x00020000
0x3ffe0000 0xc0020000 0x00020000
0x50000000 0x50000000 0x01000000
0x60000000 0x60000000 0x20000000
0xf0000000 0xf0000000 0x0d000000>;
dsp@0 {
};
};

View File

@@ -0,0 +1,55 @@
Bindings for the Cadence Xtensa Remote Processing Simple HW-specific driver.
This binding is an extension of the cdns,xrp binding. All properties of
that binding are in effect.
Required properties:
- compatible: shall be "cdns,xrp-hw-simple".
- reg: register locations of the DSP MMIO block, DSP communication area and
DSP shared memory area.
Optional properties:
- device-irq: 3 32-bit cells:
- first: offset of the 32-bit device IRQ MMIO register from the DSP MMIO
block start as seen by the device;
- second: register bit index that controls IRQ;
- third: DSP IRQ number (normal core IRQ number, not external IRQ number)
controlled by this register/bit.
- device-irq-host-offset: offset of the 32-bit device IRQ MMIO register from
the DSP MMIO block start as seen by the host. If omitted device-irq cell 0
is used;
- device-irq-mode: 0 for none (polling), 1 for level, 2 for edge, 3 for
software-assisted (by LUA script in the XTSC) edge.
- host-irq: 2 32-bit cells:
- first: offset of the 32-bit device IRQ MMIO register from the DSP MMIO
block start;
- second: register bit index that controls IRQ.
- host-irq-mode: 0 for none (polling), 1 for level, 2 for edge.
- interrupts: host IRQ number controlled by this register/bit.
Example:
xrp@0 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "cdns,xrp-hw-simple";
reg = <0xfd001000 0x00000200 /* DSP MMIO */
0xf0000000 0x00001000 /* DSP communication area */
0xf0001000 0x00fff000>; /* DSP shared memory */
device-irq = <0 1 5>; /* offset, bit#, IRQ# */
device-irq-host-offset = <0>;
device-irq-mode = <1>;
host-irq = <0xfffff000 0>; /* offset, bit# */
host-irq-mode = <2>;
interrupts = <15 0>;
firmware-name = "xrp0.elf";
ranges = <0x00000000 0x00000000 0x10000000
0x3ffc0000 0xc0000000 0x00020000
0x3ffe0000 0xc0020000 0x00020000
0x50000000 0x50000000 0x01000000
0x60000000 0x60000000 0x20000000
0xf0000000 0xf0000000 0x0d000000>;
dsp@0 {
};
};

View File

@@ -0,0 +1,46 @@
Bindings for the Cadence Xtensa Remote Processing driver.
Required properties:
- compatible: shall be "cdns,xrp".
- reg: register locations of the DSP MMIO block, DSP communication area and
DSP shared memory area.
Optional properties:
- queue-priority: cells indicating priorities of DSP hardware queues. If
missing then single default queue is configured.
- firmware-name: string identifying firmware name. If missing the driver
doesn't load the firmware.
- #address-cells: number of cells DSP physical address takes in the ranges.
- #size-cells: number of cells each size takes in the ranges.
- ranges: standard ranges property. Provides mapping of DSP physical addresses
to host physical addresses. Arbitrary number of groups with the following
structure:
- cells with DSP physical address of the region;
- cells with the corresponding host physical address of the
region;
- cells with the size of the region.
XRP node may have an optional subnode when there's non-identity mapping set
up in the ranges property. Both subnode and ranges property are required in
order for the address translation to work.
Example:
xrp@0 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "cdns,xrp";
reg = <0xfd001000 0x00000200 /* DSP MMIO */
0xf0000000 0x00001000 /* DSP communication area */
0xf0001000 0x00fff000>; /* DSP shared memory */
firmware-name = "xrp0.elf";
ranges = <0x00000000 0x00000000 0x10000000
0x3ffc0000 0xc0000000 0x00020000
0x3ffe0000 0xc0020000 0x00020000
0x50000000 0x50000000 0x01000000
0x60000000 0x60000000 0x20000000
0xf0000000 0xf0000000 0x0d000000>;
dsp@0 {
};
};

View File

@@ -0,0 +1,12 @@
#!/bin/bash
# mkdir /tmp/debugfs
# mount -t debugfs none /tmp/debugfs
# echo -n 'file xvp_main.c +p' > /tmp/debugfs/dynamic_debug/control
# echo -n 'file xrp_hw_simple.c +p' > /tmp/debugfs/dynamic_debug/control
# echo -n 'file xrp_firmware.c +p' > /tmp/debugfs/dynamic_debug/control
# echo 8 > /proc/sys/kernel/printk
modprobe xrp_hw_comm
modprobe xrp
# echo 1 > /sys/module/xrp/parameters/loopback
modprobe xrp_hw_simple

View File

@@ -0,0 +1,20 @@
#!/bin/bash
mkdir /tmp/debugfs
mount -t debugfs none /tmp/debugfs
echo -n 'file xvp_main.c +p' > /tmp/debugfs/dynamic_debug/control
echo -n 'file xrp_hw_simple.c +p' > /tmp/debugfs/dynamic_debug/control
echo -n 'file xrp_firmware.c +p' > /tmp/debugfs/dynamic_debug/control
echo 8 > /proc/sys/kernel/printk
modprobe xrp_hw_comm
modprobe xrp
# echo 1 > /sys/module/xrp/parameters/loopback
#increase the timeout time 2 min
echo 120 > /sys/module/xrp/parameters/firmware_command_timeout
echo 1 > /sys/module/xrp/parameters/load_mode
memtool mw 0xffe7f3c408 0x11000000
memtool mw 0xffe7f3c40c 0x111
memtool mw 0xffe7f3c410 0x11111
modprobe xrp_hw_simple

6
driver/xrp-kernel/rmmod.sh Executable file
View File

@@ -0,0 +1,6 @@
#!/bin/bash
# echo 1 > /sys/module/xrp/parameters/loopback
rmmod xrp_hw_simple.ko
rmmod xrp.ko
rmmod xrp_hw_comm.ko

View File

@@ -0,0 +1,173 @@
/*
* xrp_address_map: CPU->DSP physical address translator
*
* Copyright (c) 2017 Cadence Design Systems, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Alternatively you can use and distribute this file under the terms of
* the GNU General Public License version 2 or later.
*/
#include <linux/bsearch.h>
#include <linux/device.h>
#include <linux/of.h>
#include <linux/of_address.h>
#include <linux/slab.h>
#include <linux/sort.h>
#include "xrp_address_map.h"
#if IS_ENABLED(CONFIG_OF)
static int xrp_compare_address_sort(const void *a, const void *b)
{
const struct xrp_address_map_entry *pa = a;
const struct xrp_address_map_entry *pb = b;
if (pa->src_addr < pb->src_addr &&
pb->src_addr - pa->src_addr >= pa->size)
return -1;
if (pa->src_addr > pb->src_addr &&
pa->src_addr - pb->src_addr >= pb->size)
return 1;
return 0;
}
#endif
int xrp_init_address_map(struct device *dev,
struct xrp_address_map *map)
{
int ret = 0;
#if IS_ENABLED(CONFIG_OF)
struct device_node *pnode = dev->of_node;
struct device_node *node;
int rlen, off;
const __be32 *ranges = of_get_property(pnode, "ranges", &rlen);
int na, pna, ns;
int i;
if (!ranges) {
dev_dbg(dev, "%s: no 'ranges' property in the device tree, no translation at that level\n",
__func__);
goto empty;
}
node = of_get_next_child(pnode, NULL);
if (!node) {
dev_warn(dev, "%s: no child node found in the device tree, no translation at that level\n",
__func__);
goto empty;
}
na = of_n_addr_cells(node);
ns = of_n_size_cells(node);
pna = of_n_addr_cells(pnode);
rlen /= 4;
map->n = rlen / (na + pna + ns);
map->entry = kmalloc_array(map->n, sizeof(*map->entry), GFP_KERNEL);
if (!map->entry) {
ret = -ENOMEM;
goto err;
}
dev_dbg(dev,
"%s: na = %d, pna = %d, ns = %d, rlen = %d cells, n = %d\n",
__func__, na, pna, ns, rlen, map->n);
for (off = 0, i = 0; off < rlen; off += na + pna + ns, ++i) {
map->entry[i].src_addr = of_translate_address(node,
ranges + off);
map->entry[i].dst_addr = of_read_number(ranges + off, na);
map->entry[i].size = of_read_number(ranges + off + na + pna,
ns);
dev_dbg(dev,
" src_addr = 0x%llx, dst_addr = 0x%lx, size = 0x%lx\n",
(unsigned long long)map->entry[i].src_addr,
(unsigned long)map->entry[i].dst_addr,
(unsigned long)map->entry[i].size);
}
sort(map->entry, map->n, sizeof(*map->entry),
xrp_compare_address_sort, NULL);
err:
of_node_put(node);
return ret;
empty:
#endif
map->n = 1;
map->entry = kmalloc(sizeof(*map->entry), GFP_KERNEL);
map->entry->src_addr = 0;
map->entry->dst_addr = 0;
map->entry->size = ~0ul;
return ret;
}
void xrp_free_address_map(struct xrp_address_map *map)
{
if(!map->entry)
kfree(map->entry);
}
static int xrp_compare_address_search(const void *a, const void *b)
{
const phys_addr_t *pa = a;
return xrp_compare_address(*pa, b);
}
struct xrp_address_map_entry *
xrp_get_address_mapping(const struct xrp_address_map *map, phys_addr_t addr)
{
struct xrp_address_map_entry *entry =
bsearch(&addr, map->entry, map->n, sizeof(*map->entry),
xrp_compare_address_search);
return entry;
}
u32 xrp_translate_to_dsp(const struct xrp_address_map *map, phys_addr_t addr)
{
struct xrp_address_map_entry *entry = xrp_get_address_mapping(map, addr);
if (!entry)
return XRP_NO_TRANSLATION;
return entry->dst_addr + addr - entry->src_addr;
}
phys_addr_t xrp_translate_dsp_to_host(const struct xrp_address_map *map,u32 addr)
{
int loop;
struct xrp_address_map_entry *entry=NULL;
for(loop=0;loop<map->n;loop++)
{
if((map->entry[loop].dst_addr<=addr) &&
((map->entry[loop].dst_addr+map->entry[loop].size)>addr))
{
// pr_debug("%s\n",__func__);
entry= &map->entry[loop];
break;
}
}
if(entry == NULL)
{
return (phys_addr_t)OF_BAD_ADDR;
}
pr_debug("%s,entry(%d),device:(0x%08x,0x%08x),target:0x%08x\n",
__func__,loop,entry->dst_addr,entry->dst_addr+entry->size,addr);
return entry->src_addr+addr-entry->dst_addr;
}

View File

@@ -0,0 +1,78 @@
/*
* xrp_address_map: CPU->DSP physical address translator
*
* Copyright (c) 2017 Cadence Design Systems, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Alternatively you can use and distribute this file under the terms of
* the GNU General Public License version 2 or later.
*/
#ifndef XRP_ADDRESS_MAP_H
#define XRP_ADDRESS_MAP_H
#include <linux/types.h>
#define XRP_NO_TRANSLATION ((u32)~0ul)
struct xrp_address_map_entry {
phys_addr_t src_addr;
u32 dst_addr;
u32 size;
};
struct xrp_address_map {
unsigned n;
struct xrp_address_map_entry *entry;
};
int xrp_init_address_map(struct device *dev,
struct xrp_address_map *map);
void xrp_free_address_map(struct xrp_address_map *map);
struct xrp_address_map_entry *
xrp_get_address_mapping(const struct xrp_address_map *map, phys_addr_t addr);
u32 xrp_translate_to_dsp(const struct xrp_address_map *map, phys_addr_t addr);
phys_addr_t xrp_translate_dsp_to_host(const struct xrp_address_map *map,u32 addr);
static inline int xrp_compare_address(phys_addr_t addr,
const struct xrp_address_map_entry *entry)
{
if (addr < entry->src_addr)
return -1;
if (addr - entry->src_addr < entry->size)
return 0;
return 1;
}
static inline int xrp_compare_dev_address(phys_addr_t addr,
const struct xrp_address_map_entry *entry)
{
if (addr < entry->dst_addr)
return -1;
if (addr - entry->dst_addr < entry->size)
return 0;
return 1;
}
#endif

View File

@@ -0,0 +1,443 @@
/*
* Copyright (c) 2016 - 2017 Cadence Design Systems Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Alternatively you can use and distribute this file under the terms of
* the GNU General Public License version 2 or later.
*/
#ifdef __KERNEL__
#include <asm/atomic.h>
#include <linux/kernel.h>
#include <linux/mutex.h>
#include <linux/printk.h>
#include <linux/slab.h>
#include <linux/pagemap.h>
#else
#include <errno.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include "xrp_debug.h"
#define PAGE_SIZE 4096
#define GFP_KERNEL 0
#define ALIGN(v, a) (((v) + (a) - 1) & -(a))
#define GET_PAGE_NUM(size, offset) ((((size) + ((offset) & ~PAGE_MASK)) + PAGE_SIZE - 1) >> PAGE_SHIFT)
static void *kmalloc(size_t sz, int flags)
{
(void)flags;
return malloc(sz);
}
static void *kzalloc(size_t sz, int flags)
{
(void)flags;
return calloc(1, sz);
}
static void kfree(void *p)
{
free(p);
}
#endif
#include "xrp_private_alloc.h"
#ifndef __KERNEL__
static void mutex_init(struct mutex *mutex)
{
xrp_mutex_init(&mutex->o);
}
static void mutex_lock(struct mutex *mutex)
{
xrp_mutex_lock(&mutex->o);
}
static void mutex_unlock(struct mutex *mutex)
{
xrp_mutex_unlock(&mutex->o);
}
static void atomic_set(atomic_t *p, uint32_t v)
{
*((volatile atomic_t *)p) = v;
}
#define container_of(ptr, type, member) ({ \
void *__mptr = (void *)(ptr); \
((type *)(__mptr - offsetof(type, member))); })
#endif
struct xrp_private_pool {
struct xrp_allocation_pool pool;
struct mutex free_list_lock;
phys_addr_t start;
u32 size;
struct xrp_allocation *free_list;
};
static inline void xrp_pool_lock(struct xrp_private_pool *pool)
{
mutex_lock(&pool->free_list_lock);
}
static inline void xrp_pool_unlock(struct xrp_private_pool *pool)
{
mutex_unlock(&pool->free_list_lock);
}
static void xrp_private_free(struct xrp_allocation *xrp_allocation)
{
struct xrp_private_pool *pool = container_of(xrp_allocation->pool,
struct xrp_private_pool,
pool);
struct xrp_allocation **pcur;
pr_debug("%s: %pap x %d\n", __func__,
&xrp_allocation->start, xrp_allocation->size);
xrp_pool_lock(pool);
for (pcur = &pool->free_list; ; pcur = &(*pcur)->next) {
struct xrp_allocation *cur = *pcur;
if (cur && cur->start + cur->size == xrp_allocation->start) {
struct xrp_allocation *next = cur->next;
pr_debug("merging block tail: %pap x 0x%x ->\n",
&cur->start, cur->size);
cur->size += xrp_allocation->size;
pr_debug("... -> %pap x 0x%x\n",
&cur->start, cur->size);
kfree(xrp_allocation);
if (next && cur->start + cur->size == next->start) {
pr_debug("merging with next block: %pap x 0x%x ->\n",
&cur->start, cur->size);
cur->size += next->size;
cur->next = next->next;
pr_debug("... -> %pap x 0x%x\n",
&cur->start, cur->size);
kfree(next);
}
break;
}
if (!cur || xrp_allocation->start < cur->start) {
if (cur && xrp_allocation->start + xrp_allocation->size ==
cur->start) {
pr_debug("merging block head: %pap x 0x%x ->\n",
&cur->start, cur->size);
cur->size += xrp_allocation->size;
cur->start = xrp_allocation->start;
pr_debug("... -> %pap x 0x%x\n",
&cur->start, cur->size);
kfree(xrp_allocation);
} else {
pr_debug("inserting new free block\n");
xrp_allocation->next = cur;
*pcur = xrp_allocation;
}
break;
}
}
xrp_pool_unlock(pool);
}
static long xrp_alloc_gfp(u32 size, u32 align,struct xrp_allocation **alloc);
static long xrp_private_alloc(struct xrp_allocation_pool *pool,
u32 size, u32 align,
struct xrp_allocation **alloc)
{
struct xrp_private_pool *ppool = container_of(pool,
struct xrp_private_pool,
pool);
struct xrp_allocation **pcur;
struct xrp_allocation *cur = NULL;
struct xrp_allocation *new;
phys_addr_t aligned_start = 0;
bool found = false;
if (!size || (align & (align - 1)))
return -EINVAL;
if (!align)
align = 1;
new = kzalloc(sizeof(struct xrp_allocation), GFP_KERNEL);
if (!new)
return -ENOMEM;
align = ALIGN(align, PAGE_SIZE);
size = ALIGN(size, PAGE_SIZE);
xrp_pool_lock(ppool);
/* on exit free list is fixed */
for (pcur = &ppool->free_list; *pcur; pcur = &(*pcur)->next) {
cur = *pcur;
aligned_start = ALIGN(cur->start, align);
if (aligned_start >= cur->start &&
aligned_start - cur->start + size <= cur->size) {
if (aligned_start == cur->start) {
if (aligned_start + size == cur->start + cur->size) {
pr_debug("reusing complete block: %pap x %x\n",
&cur->start, cur->size);
*pcur = cur->next;
} else {
pr_debug("cutting block head: %pap x %x ->\n",
&cur->start, cur->size);
cur->size -= aligned_start + size - cur->start;
cur->start = aligned_start + size;
pr_debug("... -> %pap x %x\n",
&cur->start, cur->size);
cur = NULL;
}
} else {
if (aligned_start + size == cur->start + cur->size) {
pr_debug("cutting block tail: %pap x %x ->\n",
&cur->start, cur->size);
cur->size = aligned_start - cur->start;
pr_debug("... -> %pap x %x\n",
&cur->start, cur->size);
cur = NULL;
} else {
pr_debug("splitting block into two: %pap x %x ->\n",
&cur->start, cur->size);
new->start = aligned_start + size;
new->size = cur->start +
cur->size - new->start;
cur->size = aligned_start - cur->start;
new->next = cur->next;
cur->next = new;
pr_debug("... -> %pap x %x + %pap x %x\n",
&cur->start, cur->size,
&new->start, new->size);
cur = NULL;
new = NULL;
}
}
found = true;
break;
} else {
cur = NULL;
}
}
xrp_pool_unlock(ppool);
if (!found) {
kfree(cur);
kfree(new);
if(!xrp_alloc_gfp(size,align,alloc))
{
return 0;
}
return -ENOMEM;
}
if (!cur) {
cur = new;
new = NULL;
}
if (!cur) {
cur = kzalloc(sizeof(struct xrp_allocation), GFP_KERNEL);
if (!cur)
return -ENOMEM;
}
if (new)
kfree(new);
pr_debug("returning: %pap x %x\n", &aligned_start, size);
cur->start = aligned_start;
cur->size = size;
cur->pool = pool;
atomic_set(&cur->ref, 0);
xrp_allocation_get(cur);
*alloc = cur;
return 0;
}
static void xrp_private_free_pool(struct xrp_allocation_pool *pool)
{
struct xrp_private_pool *ppool = container_of(pool,
struct xrp_private_pool,
pool);
kfree(ppool->free_list);
kfree(ppool);
}
static phys_addr_t xrp_private_offset(const struct xrp_allocation *allocation)
{
struct xrp_private_pool *ppool = container_of(allocation->pool,
struct xrp_private_pool,
pool);
return allocation->start ;//- ppool->start;
}
static const struct xrp_allocation_ops xrp_private_pool_ops = {
.alloc = xrp_private_alloc,
.free = xrp_private_free,
.free_pool = xrp_private_free_pool,
.offset = xrp_private_offset,
};
long xrp_init_private_pool(struct xrp_allocation_pool **ppool,
phys_addr_t start, u32 size)
{
struct xrp_private_pool *pool = kmalloc(sizeof(*pool), GFP_KERNEL);
struct xrp_allocation *allocation = kmalloc(sizeof(*allocation),
GFP_KERNEL);
if (!pool || !allocation) {
kfree(pool);
kfree(allocation);
return -ENOMEM;
}
*allocation = (struct xrp_allocation){
.pool = &pool->pool,
.start = start,
.size = size,
};
*pool = (struct xrp_private_pool){
.pool = {
.ops = &xrp_private_pool_ops,
},
.start = start,
.size = size,
.free_list = allocation,
};
mutex_init(&pool->free_list_lock);
*ppool = &pool->pool;
return 0;
}
static void xrp_free_gfp(struct xrp_allocation *alloc)
{
size_t numPages;
int i;
struct page *page;
phys_addr_t phys;
if(!alloc)
return;
if(alloc->size & (PAGE_SIZE-1) ||
alloc->start &(PAGE_SIZE-1))
{
pr_debug("alloc is not aligment addr: %llx,size: %d",alloc->start,alloc->size);
return ;
}
phys = alloc->start;
numPages = alloc->size>>PAGE_SHIFT;
for (i = 0; i < numPages; i++)
{
page = pfn_to_page(__phys_to_pfn(phys));
ClearPageReserved(page);
phys +=PAGE_SIZE;
}
__free_pages(pfn_to_page(__phys_to_pfn(alloc->start)), get_order(alloc->size));
kfree(alloc->pool);
kfree(alloc);
pr_debug("free gfp alloc on phy addr: %llx,size: %d",alloc->start,alloc->size);
return;
}
static const struct xrp_allocation_ops xrp_gfp_pool_ops = {
.free = xrp_free_gfp,
.offset = xrp_private_offset,
};
static long xrp_alloc_gfp(u32 size, u32 align,
struct xrp_allocation **alloc)
{
struct xrp_allocation *new;
size_t numPages;
struct page *contiguousPages;
struct xrp_allocation_pool *pool;
int i;
unsigned int gfp = GFP_KERNEL | GFP_DMA | __GFP_NOWARN;
if (!size || (align & (align - 1)))
return -EINVAL;
if (!align)
align = 1;
new = kzalloc(sizeof(struct xrp_allocation), GFP_KERNEL);
if(!new)
return -ENOMEM;
new->pool = kzalloc(sizeof(struct xrp_allocation_pool),GFP_KERNEL);
if(!new->pool)
goto OnError;
new->pool->ops = &xrp_gfp_pool_ops;
align = ALIGN(align, PAGE_SIZE);
size = ALIGN(size, PAGE_SIZE);
numPages = size >> PAGE_SHIFT;
int order = get_order(size);
if (order >= MAX_ORDER)
{
pr_debug("Too big buffer size requested. (order %d >= max %d)\n",
order, MAX_ORDER);
goto TwoError;
}
contiguousPages = alloc_pages(gfp, order);
for (i = 0; i < numPages; i++)
{
struct page *page;
page = nth_page(contiguousPages, i);
SetPageReserved(page);
}
new->start = page_to_phys(nth_page(contiguousPages, 0));
new->size = size;
atomic_set(&new->ref, 0);
xrp_allocation_get(new);
*alloc = new;
pr_debug("alloc by gfp with phy addr: %llx,size: %d",new->start,new->size);
return 0;
TwoError:
kfree(new->pool);
OnError:
kfree(new);
return -ENOMEM;
}

View File

@@ -0,0 +1,113 @@
/*
* Copyright (c) 2016 - 2017 Cadence Design Systems Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Alternatively you can use and distribute this file under the terms of
* the GNU General Public License version 2 or later.
*/
#ifndef XRP_ALLOC_H
#define XRP_ALLOC_H
#ifndef __KERNEL__
#include <stdint.h>
#include <xrp_atomic.h>
#include <xrp_thread_impl.h>
typedef uint32_t u32;
typedef uint32_t phys_addr_t;
typedef _Atomic uint32_t atomic_t;
struct mutex {
xrp_mutex o;
};
static inline void atomic_inc(atomic_t *v)
{
++*(volatile atomic_t *)v;
}
static inline int atomic_dec_and_test(atomic_t *v)
{
return --*(volatile atomic_t *)v == 0;
}
#endif
struct xrp_allocation_pool;
struct xrp_allocation;
struct xrp_allocation_ops {
long (*alloc)(struct xrp_allocation_pool *allocation_pool,
u32 size, u32 align, struct xrp_allocation **alloc);
void (*free)(struct xrp_allocation *allocation);
void (*free_pool)(struct xrp_allocation_pool *allocation_pool);
phys_addr_t (*offset)(const struct xrp_allocation *allocation);
};
struct xrp_allocation_pool {
const struct xrp_allocation_ops *ops;
};
struct xrp_allocation {
struct xrp_allocation_pool *pool;
struct xrp_allocation *next;
phys_addr_t start;
u32 size;
atomic_t ref;
};
static inline void xrp_free_pool(struct xrp_allocation_pool *allocation_pool)
{
allocation_pool->ops->free_pool(allocation_pool);
}
static inline void xrp_free(struct xrp_allocation *allocation)
{
return allocation->pool->ops->free(allocation);
}
static inline long xrp_allocate(struct xrp_allocation_pool *allocation_pool,
u32 size, u32 align,
struct xrp_allocation **alloc)
{
return allocation_pool->ops->alloc(allocation_pool,
size, align, alloc);
}
static inline void xrp_allocation_get(struct xrp_allocation *xrp_allocation)
{
atomic_inc(&xrp_allocation->ref);
}
static inline void xrp_allocation_put(struct xrp_allocation *xrp_allocation)
{
if (atomic_dec_and_test(&xrp_allocation->ref))
xrp_allocation->pool->ops->free(xrp_allocation);
}
static inline phys_addr_t xrp_allocation_offset(const struct xrp_allocation *allocation)
{
return allocation->pool->ops->offset(allocation);
}
#endif

View File

@@ -0,0 +1,147 @@
/*
* Copyright (c) 2017 Cadence Design Systems Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Alternatively you can use and distribute this file under the terms of
* the GNU General Public License version 2 or later.
*/
#include <linux/version.h>
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 16, 0)
#include <linux/dma-mapping.h>
#else
#include <linux/dma-direct.h>
#endif
#include <linux/kernel.h>
#include <linux/slab.h>
#include "xrp_cma_alloc.h"
struct xrp_cma_allocation {
struct xrp_allocation allocation;
void *kvaddr;
};
struct xrp_cma_pool {
struct xrp_allocation_pool pool;
struct device *dev;
};
static long xrp_cma_alloc(struct xrp_allocation_pool *allocation_pool,
u32 size, u32 align, struct xrp_allocation **alloc)
{
struct xrp_cma_pool *pool = container_of(allocation_pool,
struct xrp_cma_pool, pool);
struct xrp_cma_allocation *new_cma;
struct xrp_allocation *new;
dma_addr_t dma_addr;
void *kvaddr;
size = ALIGN(size, PAGE_SIZE);
new_cma = kzalloc(sizeof(struct xrp_cma_allocation), GFP_KERNEL);
if (!new_cma)
return -ENOMEM;
new = &new_cma->allocation;
#if LINUX_VERSION_CODE < KERNEL_VERSION(4,8,0)
{
DEFINE_DMA_ATTRS(attrs);
dma_set_attr(DMA_ATTR_NO_KERNEL_MAPPING, &attrs);
kvaddr = dma_alloc_attrs(pool->dev, size, &dma_addr,
GFP_KERNEL, &attrs);
}
#else
kvaddr = dma_alloc_attrs(pool->dev, size, &dma_addr, GFP_KERNEL,
DMA_ATTR_NO_KERNEL_MAPPING);
#endif
if (!kvaddr) {
kfree(new_cma);
return -ENOMEM;
}
new->pool = allocation_pool;
new->start = dma_to_phys(pool->dev, dma_addr);
new->size = size;
atomic_set(&new->ref, 0);
xrp_allocation_get(new);
new_cma->kvaddr = kvaddr;
*alloc = new;
return 0;
}
static void xrp_cma_free(struct xrp_allocation *xrp_allocation)
{
struct xrp_cma_pool *pool = container_of(xrp_allocation->pool,
struct xrp_cma_pool, pool);
struct xrp_cma_allocation *a = container_of(xrp_allocation,
struct xrp_cma_allocation,
allocation);
#if LINUX_VERSION_CODE < KERNEL_VERSION(4,8,0)
DEFINE_DMA_ATTRS(attrs);
dma_set_attr(DMA_ATTR_NO_KERNEL_MAPPING, &attrs);
dma_free_attrs(pool->dev, xrp_allocation->size,
a->kvaddr,
phys_to_dma(pool->dev, xrp_allocation->start),
&attrs);
#else
dma_free_attrs(pool->dev, xrp_allocation->size,
a->kvaddr,
phys_to_dma(pool->dev, xrp_allocation->start),
DMA_ATTR_NO_KERNEL_MAPPING);
#endif
kfree(a);
}
static void xrp_cma_free_pool(struct xrp_allocation_pool *allocation_pool)
{
struct xrp_cma_pool *pool = container_of(allocation_pool,
struct xrp_cma_pool, pool);
kfree(pool);
}
static phys_addr_t xrp_cma_offset(const struct xrp_allocation *allocation)
{
return allocation->start;
}
static const struct xrp_allocation_ops xrp_cma_pool_ops = {
.alloc = xrp_cma_alloc,
.free = xrp_cma_free,
.free_pool = xrp_cma_free_pool,
.offset = xrp_cma_offset,
};
long xrp_init_cma_pool(struct xrp_allocation_pool **ppool, struct device *dev)
{
struct xrp_cma_pool *pool = kmalloc(sizeof(*pool), GFP_KERNEL);
if (!pool)
return -ENOMEM;
pool->pool.ops = &xrp_cma_pool_ops;
pool->dev = dev;
*ppool = &pool->pool;
return 0;
}

View File

@@ -0,0 +1,44 @@
/*
* Copyright (c) 2017 Cadence Design Systems Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Alternatively you can use and distribute this file under the terms of
* the GNU General Public License version 2 or later.
*/
#ifndef XRP_CMA_ALLOC_H
#define XRP_CMA_ALLOC_H
#include "xrp_alloc.h"
struct device;
#ifdef CONFIG_CMA
long xrp_init_cma_pool(struct xrp_allocation_pool **pool, struct device *dev);
#else
static inline long xrp_init_cma_pool(struct xrp_allocation_pool **pool,
struct device *dev)
{
return -ENXIO;
}
#endif
#endif

View File

@@ -0,0 +1,275 @@
/*
* xrp_debug:
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Alternatively you can use and distribute this file under the terms of
* the GNU General Public License version 2 or later.
*/
#include <linux/delay.h>
// #include <linux/dma-noncoherent.h>
#include <linux/interrupt.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_address.h>
#include <linux/of_device.h>
#include <linux/platform_device.h>
#include <linux/proc_fs.h>
#include <linux/seq_file.h>
#include <linux/slab.h>
#include <linux/io.h>
#include <asm/cacheflush.h>
#include "xrp_kernel_defs.h"
#include "xrp_hw.h"
#include "xrp_hw_simple_dsp_interface.h"
#define GET_PAGE_NUM(size, offset) ((((size) + ((offset) & ~PAGE_MASK)) + PAGE_SIZE - 1) >> PAGE_SHIFT)
struct xrp_panic_log{
struct xrp_hw_panic __iomem *panic;
phys_addr_t panic_phys;
u32 last_read;
struct proc_dir_entry *log_proc_file;
};
static void memset_hw(void __iomem *dst, int c, size_t sz)
{
int i;
volatile u32 * d_ptr=dst;
for(i=0;i<sz/4;i++)
{
__raw_writel(c, d_ptr++);
}
}
static void dump_regs(const char *fn, void *hw_arg)
{
struct xrp_panic_log *panic_log = hw_arg;
if (!panic_log->panic)
return;
pr_debug("%s: panic = 0x%08x, ccount = 0x%08x\n",
fn,
__raw_readl(&panic_log->panic->panic),
__raw_readl(&panic_log->panic->ccount));
pr_debug("%s: read = 0x%08x, write = 0x%08x, size = 0x%08x\n",
fn,
__raw_readl(&panic_log->panic->rb.read),
__raw_readl(&panic_log->panic->rb.write),
__raw_readl(&panic_log->panic->rb.size));
}
static void dump_log_page(struct xrp_panic_log *hw)
{
char *buf;
size_t i;
if (!hw->panic)
return;
dump_regs(__func__, hw);
buf = kmalloc(PAGE_SIZE, GFP_KERNEL);
if (buf) {
memcpy_fromio(buf, hw->panic, hw->panic->rb.size);
buf+=sizeof(struct xrp_hw_panic);
for (i = 0; i < hw->panic->rb.size; i += 64)
pr_debug(" %*pEhp\n", 64, buf + i);
kfree(buf);
} else {
pr_debug("(couldn't allocate copy buffer)\n");
}
}
static int log_proc_show(struct seq_file *file, void *v)
{
struct xrp_panic_log *hw = file->private;
char *buf;
size_t i;
int page_num = GET_PAGE_NUM(hw->panic->rb.size,0);
dump_regs(__func__, hw);
buf = kmalloc(PAGE_SIZE*page_num, GFP_KERNEL);
if (buf) {
memcpy_fromio(buf, hw->panic->rb.data, hw->panic->rb.size);
seq_printf(file,"****************** device log >>>>>>>>>>>>>>>>>\n");
for (i = 0; i < hw->panic->rb.size; i += 64)
seq_printf(file," %*pEp", 64,buf+i);
// pr_debug(" %*pEhp\n", 64, buf + i);
// seq_printf(file," %*pEp\n",buf);
kfree(buf);
uint32_t write = __raw_readl(&hw->panic->rb.write);
__raw_writel(write, &hw->panic->rb.read);
return 0;
}
else
{
pr_debug("Fail to alloc buf\n");
return -1;
}
return 0;
}
static int log_proc_open(struct inode *inode, struct file *file)
{
return single_open(file, log_proc_show, NULL);
}
static const struct file_operations log_proc_fops = {
.open = log_proc_open,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release,
};
static bool xrp_panic_init(struct xrp_hw_panic* panic,size_t size)
{
if(size < sizeof(struct xrp_hw_panic))
{
return false;
}
memset_hw(panic,0x0,size);
panic->panic = 0;
panic->ccount = 0;
panic->rb.read = 0;
panic->rb.write = 0;
panic->rb.size = size - sizeof(struct xrp_hw_panic);
sprintf(panic->rb.data,"Inition dsp log\n");
return true;
}
void* xrp_create_panic_log_proc(void* dir,void * panic_addr,size_t size)
{
struct xrp_panic_log *panic_log = kmalloc(sizeof(struct xrp_panic_log),GFP_KERNEL);
if(panic_log == NULL)
return NULL;
panic_log->last_read = 0;
panic_log->panic = panic_addr;
xrp_panic_init(panic_log->panic,size);
panic_log->log_proc_file=proc_create_single_data("dsp_log",0644,dir,&log_proc_show,panic_log);
if(panic_log->log_proc_file == NULL) {
pr_debug("Error: Could not initialize %s\n","dsp_log");
kfree(panic_log);
panic_log =NULL;
} else {
pr_debug("%s create Success!\n","dsp_log");
}
return panic_log;
}
void xrp_remove_panic_log_proc(void *arg)
{
// char file_name[32];
struct xrp_panic_log *panic_log = arg;
// remove_proc_entry(panic_log->log_proc_file,NULL);
proc_remove(panic_log->log_proc_file);
kfree(arg);
pr_debug("dsp proc removed\n");
}
bool panic_check(void *arg)
{
struct xrp_panic_log *panic_log = arg;
uint32_t panic;
uint32_t ccount;
uint32_t read;
uint32_t write;
uint32_t size;
if (!panic_log || !panic_log->panic)
return true;
panic = __raw_readl(&panic_log->panic->panic);
ccount = __raw_readl(&panic_log->panic->ccount);
read = __raw_readl(&panic_log->panic->rb.read);
write = __raw_readl(&panic_log->panic->rb.write);
size = __raw_readl(&panic_log->panic->rb.size);
if (read == 0 && read != panic_log->last_read) {
pr_debug( "****************** device restarted >>>>>>>>>>>>>>>>>\n");
dump_log_page(panic_log);
pr_debug ("<<<<<<<<<<<<<<<<<< device restarted *****************\n");
}
if (write < size && read < size && size < PAGE_SIZE) {
uint32_t tail;
uint32_t total;
char *buf = NULL;
panic_log->last_read = read;
if (read < write) {
tail = write - read;
total = tail;
} else if (read == write) {
tail = 0;
total = 0;
} else {
tail = size - read;
total = write + tail;
}
if (total)
buf = kmalloc(total, GFP_KERNEL);
if (buf) {
uint32_t off = 0;
pr_debug("panic = 0x%08x, ccount = 0x%08x read = %d, write = %d, size = %d, total = %d",
panic, ccount, read, write, size, total);
while (off != total) {
memcpy_fromio(buf + off,
panic_log->panic->rb.data + read,
tail);
read = 0;
off += tail;
tail = total - tail;
}
__raw_writel(write, &panic_log->panic->rb.read);
panic_log->last_read = write;
pr_debug("<<<\n%.*s\n>>>\n",
total, buf);
kfree(buf);
} else if (total) {
pr_debug(
"%s: couldn't allocate memory (%d) to read the dump\n",
__func__, total);
}
} else {
if (read != panic_log->last_read) {
pr_debug(
"nonsense in the log buffer: read = %d, write = %d, size = %d\n",
read, write, size);
panic_log->last_read = read;
}
}
if (panic == 0xdeadbabe) {
pr_debug("%s: panic detected, log dump:\n", __func__);
dump_log_page(panic_log);
}
return panic == 0xdeadbabe;
}

View File

@@ -0,0 +1,34 @@
/*
* xrp_debug:
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Alternatively you can use and distribute this file under the terms of
* the GNU General Public License version 2 or later.
*/
#ifndef XRP_DEBUG_H
#define XRP_DEBUG_H
void* xrp_create_panic_log_proc(void* dir,void * panic_addr,size_t size);
void xrp_remove_panic_log_proc(void *arg);
bool panic_check(void *arg);
#endif

View File

@@ -0,0 +1,406 @@
/*
* xrp_firmware: firmware manipulation for the XRP
*
* Copyright (c) 2015 - 2017 Cadence Design Systems, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Alternatively you can use and distribute this file under the terms of
* the GNU General Public License version 2 or later.
*/
#include "xrp_firmware.h"
#include "xrp_address_map.h"
#include "xrp_hw.h"
#include "xrp_internal.h"
#include "xrp_kernel_dsp_interface.h"
#include <linux/dma-mapping.h>
#include <linux/elf.h>
#include <linux/firmware.h>
#include <linux/highmem.h>
#include <linux/io.h>
#include <linux/of.h>
#include <linux/of_address.h>
static phys_addr_t xrp_translate_to_cpu(struct xvp *xvp, Elf32_Phdr *phdr) {
phys_addr_t res;
__be32 addr = cpu_to_be32((u32)phdr->p_paddr);
struct device_node *node = of_get_next_child(xvp->dev->of_node, NULL);
if (!node)
node = xvp->dev->of_node;
res = of_translate_address(node, &addr);
if (node != xvp->dev->of_node)
of_node_put(node);
return res;
}
static int xrp_load_segment_to_sysmem(struct xvp *xvp, Elf32_Phdr *phdr) {
// phys_addr_t pa = xrp_translate_to_cpu(xvp, phdr);
phys_addr_t pa = xrp_translate_dsp_to_host(&xvp->address_map,phdr->p_paddr);
struct page *page = pfn_to_page(__phys_to_pfn(pa));
size_t page_offs = pa & ~PAGE_MASK;
size_t offs;
for (offs = 0; offs < phdr->p_memsz; ++page) {
void *p = kmap(page);
size_t sz;
if (!p)
return -ENOMEM;
page_offs &= ~PAGE_MASK;
sz = PAGE_SIZE - page_offs;
dev_dbg(xvp->dev, "loading segment to host addr 0x%d by host visiul %p,size:%d\n",
page_offs,p,sz);
if (offs < phdr->p_filesz) {
size_t copy_sz = sz;
if (phdr->p_filesz - offs < copy_sz)
copy_sz = phdr->p_filesz - offs;
copy_sz = ALIGN(copy_sz, 4);
memcpy(p + page_offs, (void *)xvp->firmware->data + phdr->p_offset + offs,
copy_sz);
page_offs += copy_sz;
offs += copy_sz;
sz -= copy_sz;
}
dev_dbg(xvp->dev, "loading segment to host addr 0x%d by host visiul %p,size:%d\n",
page_offs,p, sz);
if (offs < phdr->p_memsz && sz) {
if (phdr->p_memsz - offs < sz)
sz = phdr->p_memsz - offs;
sz = ALIGN(sz, 4);
memset(p + page_offs, 0, sz);
page_offs += sz;
offs += sz;
}
kunmap(page);
}
dma_sync_single_for_device(xvp->dev, pa, phdr->p_memsz, DMA_TO_DEVICE);
dev_dbg(xvp->dev, "xrp_load_segment_to_sysmem");
return 0;
}
static int xrp_load_segment_to_iomem(struct xvp *xvp, Elf32_Phdr *phdr) {
// phys_addr_t pa = xrp_translate_to_cpu(xvp, phdr);
phys_addr_t pa = xrp_translate_dsp_to_host(&xvp->address_map,phdr->p_paddr);
if(pa==OF_BAD_ADDR)
{
dev_err(xvp->dev, "couldn't translate DSP addr 0x%x\n", phdr->p_paddr);
return -EINVAL;
}
void __iomem *p = ioremap(pa, phdr->p_memsz);
if (!p) {
dev_err(xvp->dev, "couldn't ioremap %pap x 0x%08x\n", &pa,
(u32)phdr->p_memsz);
return -EINVAL;
}
dev_dbg(xvp->dev, "loading segment to host addr 0x%pap by host virtual 0x%llx,size:%d,total size:%d,fw dataptr:0x%llx,offset:0x%x\n",
&pa,p, phdr->p_filesz,(u32)phdr->p_memsz,xvp->firmware->data,phdr->p_offset);
if(phdr->p_filesz)
{
if (xvp->hw_ops->memcpy_tohw)
xvp->hw_ops->memcpy_tohw(p, (void *)xvp->firmware->data + phdr->p_offset,
ALIGN(phdr->p_filesz, 4));
else
memcpy_toio(p, (void *)xvp->firmware->data + phdr->p_offset,
ALIGN(phdr->p_filesz, 4));
dev_dbg(xvp->dev, "copy size:%d\n",ALIGN(phdr->p_filesz, 4));
}
if(phdr->p_memsz - phdr->p_filesz)
{
if (xvp->hw_ops->memset_hw)
xvp->hw_ops->memset_hw(p + phdr->p_filesz, 0,
phdr->p_memsz - phdr->p_filesz);
else
memset_io(p + ALIGN(phdr->p_filesz, 4), 0,
ALIGN(phdr->p_memsz - ALIGN(phdr->p_filesz, 4), 4));
dev_dbg(xvp->dev, "set size:%d\n",ALIGN(phdr->p_memsz - ALIGN(phdr->p_filesz, 4),4));
}
iounmap(p);
dev_dbg(xvp->dev, "xrp_load_segment_to_iomem done\n");
return 0;
}
static inline bool xrp_section_bad(struct xvp *xvp, const Elf32_Shdr *shdr) {
return shdr->sh_offset > xvp->firmware->size ||
shdr->sh_size > xvp->firmware->size - shdr->sh_offset;
}
static int xrp_firmware_find_symbol(struct xvp *xvp, const char *name,
void **paddr, size_t *psize) {
const Elf32_Ehdr *ehdr = (Elf32_Ehdr *)xvp->firmware->data;
const void *shdr_data = xvp->firmware->data + ehdr->e_shoff;
const Elf32_Shdr *sh_symtab = NULL;
const Elf32_Shdr *sh_strtab = NULL;
const void *sym_data;
const void *str_data;
const Elf32_Sym *esym;
void *addr = NULL;
unsigned i;
if (ehdr->e_shoff == 0) {
dev_dbg(xvp->dev, "%s: no section header in the firmware image", __func__);
return -ENOENT;
}
if (ehdr->e_shoff > xvp->firmware->size ||
ehdr->e_shnum * ehdr->e_shentsize > xvp->firmware->size - ehdr->e_shoff) {
dev_err(xvp->dev, "%s: bad firmware SHDR information", __func__);
return -EINVAL;
}
/* find symbols and string sections */
for (i = 0; i < ehdr->e_shnum; ++i) {
const Elf32_Shdr *shdr = shdr_data + i * ehdr->e_shentsize;
switch (shdr->sh_type) {
case SHT_SYMTAB:
sh_symtab = shdr;
break;
case SHT_STRTAB:
sh_strtab = shdr;
break;
default:
break;
}
}
if (!sh_symtab || !sh_strtab) {
dev_dbg(xvp->dev, "%s: no symtab or strtab in the firmware image",
__func__);
return -ENOENT;
}
if (xrp_section_bad(xvp, sh_symtab)) {
dev_err(xvp->dev, "%s: bad firmware SYMTAB section information", __func__);
return -EINVAL;
}
if (xrp_section_bad(xvp, sh_strtab)) {
dev_err(xvp->dev, "%s: bad firmware STRTAB section information", __func__);
return -EINVAL;
}
/* iterate through all symbols, searching for the name */
sym_data = xvp->firmware->data + sh_symtab->sh_offset;
str_data = xvp->firmware->data + sh_strtab->sh_offset;
for (i = 0; i < sh_symtab->sh_size; i += sh_symtab->sh_entsize) {
esym = sym_data + i;
if (!(ELF_ST_TYPE(esym->st_info) == STT_OBJECT &&
esym->st_name < sh_strtab->sh_size &&
strncmp(str_data + esym->st_name, name,
sh_strtab->sh_size - esym->st_name) == 0))
continue;
if (esym->st_shndx > 0 && esym->st_shndx < ehdr->e_shnum) {
const Elf32_Shdr *shdr = shdr_data + esym->st_shndx * ehdr->e_shentsize;
Elf32_Off in_section_off = esym->st_value - shdr->sh_addr;
if (xrp_section_bad(xvp, shdr)) {
dev_err(xvp->dev, "%s: bad firmware section #%d information", __func__,
esym->st_shndx);
return -EINVAL;
}
if (esym->st_value < shdr->sh_addr || in_section_off > shdr->sh_size ||
esym->st_size > shdr->sh_size - in_section_off) {
dev_err(xvp->dev, "%s: bad symbol information", __func__);
return -EINVAL;
}
addr = (void *)xvp->firmware->data + shdr->sh_offset + in_section_off;
dev_dbg(xvp->dev,
"%s: found symbol, st_shndx = %d, "
"sh_offset = 0x%08x, sh_addr = 0x%08x, "
"st_value = 0x%08x, address = %p",
__func__, esym->st_shndx, shdr->sh_offset, shdr->sh_addr,
esym->st_value, addr);
} else {
dev_dbg(xvp->dev, "%s: unsupported section index in found symbol: 0x%x",
__func__, esym->st_shndx);
return -EINVAL;
}
break;
}
if (!addr)
return -ENOENT;
*paddr = addr;
*psize = esym->st_size;
return 0;
}
static int xrp_firmware_fixup_symbol(struct xvp *xvp, const char *name,
phys_addr_t v) {
u32 v32 = XRP_DSP_COMM_BASE_MAGIC;
void *addr;
size_t sz;
int rc;
if(v == XRP_NO_TRANSLATION)
{
dev_err(xvp->dev, "%s: invalid dsp address %llx", __func__, name);
return -EINVAL;
}
rc = xrp_firmware_find_symbol(xvp, name, &addr, &sz);
if (rc < 0) {
dev_err(xvp->dev, "%s: symbol \"%s\" is not found", __func__, name);
return rc;
}
if (sz != sizeof(u32)) {
dev_err(xvp->dev, "%s: symbol \"%s\" has wrong size: %zu", __func__, name,
sz);
return -EINVAL;
}
/* update data associated with symbol */
if (memcmp(addr, &v32, sz) != 0) {
dev_dbg(xvp->dev, "%s: value pointed to by symbol is incorrect: %*ph",
__func__, (int)sz, addr);
}
v32 = v;
memcpy(addr, &v32, sz);
return 0;
}
static int xrp_load_firmware(struct xvp *xvp) {
Elf32_Ehdr *ehdr = (Elf32_Ehdr *)xvp->firmware->data;
int i;
if (memcmp(ehdr->e_ident, ELFMAG, SELFMAG)) {
dev_err(xvp->dev, "bad firmware ELF magic\n");
return -EINVAL;
}
if (ehdr->e_type != ET_EXEC) {
dev_err(xvp->dev, "bad firmware ELF type\n");
return -EINVAL;
}
if (ehdr->e_machine != 94 /*EM_XTENSA*/) {
dev_err(xvp->dev, "bad firmware ELF machine\n");
return -EINVAL;
}
if (ehdr->e_phoff >= xvp->firmware->size ||
ehdr->e_phoff + ehdr->e_phentsize * ehdr->e_phnum > xvp->firmware->size) {
dev_err(xvp->dev, "bad firmware ELF PHDR information\n");
return -EINVAL;
}
xrp_firmware_fixup_symbol(
xvp, "xrp_dsp_comm_base",
xrp_translate_to_dsp(&xvp->address_map, xvp->comm_phys));
for (i = 0; i < ehdr->e_phnum; ++i) {
Elf32_Phdr *phdr =
(void *)xvp->firmware->data + ehdr->e_phoff + i * ehdr->e_phentsize;
phys_addr_t pa;
int rc;
/* Only load non-empty loadable segments, R/W/X */
if (!(phdr->p_type == PT_LOAD && (phdr->p_flags & (PF_X | PF_R | PF_W)) &&
phdr->p_memsz > 0))
continue;
if (phdr->p_offset >= xvp->firmware->size ||
phdr->p_offset + phdr->p_filesz > xvp->firmware->size) {
dev_err(xvp->dev, "bad firmware ELF program header entry %d\n", i);
return -EINVAL;
}
// pa = xrp_translate_to_cpu(xvp, phdr);
pa=phdr->p_paddr;
if (pa == (phys_addr_t)OF_BAD_ADDR) {
dev_err(
xvp->dev,
"device address 0x%08x could not be mapped to host physical address",
(u32)phdr->p_paddr);
return -EINVAL;
}
dev_dbg(xvp->dev, "loading segment %d (device 0x%08x) to physical %pap\n",
i, (u32)phdr->p_paddr, &pa);
// if (pfn_valid(__phys_to_pfn(pa)))
// rc = xrp_load_segment_to_sysmem(xvp, phdr);
// else
rc = xrp_load_segment_to_iomem(xvp, phdr);
if (rc < 0)
return rc;
}
dev_dbg(xvp->dev, "loading firmware sucessful\n");
return 0;
}
int xrp_request_firmware(struct xvp *xvp,Elf32_Addr *boot_addr) {
int ret = request_firmware(&xvp->firmware, xvp->firmware_name, xvp->dev);
if (ret < 0 || boot_addr == NULL)
return ret;
ret = xrp_load_firmware(xvp);
*boot_addr = xrp_get_firmware_entry_addr(xvp);
release_firmware(xvp->firmware);
return ret;
}
Elf32_Addr xrp_get_firmware_entry_addr(struct xvp *xvp)
{
Elf32_Ehdr *ehdr = (Elf32_Ehdr *)xvp->firmware->data;
int i;
if (memcmp(ehdr->e_ident, ELFMAG, SELFMAG)) {
dev_err(xvp->dev, "bad firmware ELF magic\n");
return 0;
}
if (ehdr->e_type != ET_EXEC) {
dev_err(xvp->dev, "bad firmware ELF type\n");
return 0;
}
if (ehdr->e_machine != 94 /*EM_XTENSA*/) {
dev_err(xvp->dev, "bad firmware ELF machine\n");
return 0;
}
return ehdr->e_entry;
}

View File

@@ -0,0 +1,50 @@
/*
* xrp_firmware: firmware manipulation for the XRP
*
* Copyright (c) 2015 - 2017 Cadence Design Systems, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Alternatively you can use and distribute this file under the terms of
* the GNU General Public License version 2 or later.
*/
#ifndef XRP_FIRMWARE_H
#define XRP_FIRMWARE_H
#include <linux/elf.h>
struct xvp;
#if IS_ENABLED(CONFIG_OF)
int xrp_request_firmware(struct xvp *xvp,Elf32_Addr *boot_addr);
Elf32_Addr xrp_get_firmware_entry_addr(struct xvp *xvp);
#else
int xrp_request_firmware(struct xvp *xvp,Elf32_Addr *boot_addr)
{
(void)xvp;
return -EINVAL;
}
Elf32_Addr xrp_get_firmware_entry_addr(struct xvp *xvp)
{
(void)xvp;
return 0;
}
#endif
#endif

251
driver/xrp-kernel/xrp_hw.h Normal file
View File

@@ -0,0 +1,251 @@
/*
* Copyright (c) 2017 Cadence Design Systems, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Alternatively you can use and distribute this file under the terms of
* the GNU General Public License version 2 or later.
*/
/*!
* \file xrp_hw.h
* \brief Interface between generic and HW-specific kernel drivers.
*/
#ifndef _XRP_HW
#define _XRP_HW
#include <linux/irqreturn.h>
#include <linux/platform_device.h>
#include <linux/types.h>
struct xvp;
/*!
* Hardware-specific operation entry points.
* Hardware-specific driver passes a pointer to this structure to xrp_init
* at initialization time.
*/
struct xrp_hw_ops {
/*!
* Enable power/clock, but keep the core stalled.
* \param hw_arg: opaque parameter passed to xrp_init at initialization
* time
*/
int (*enable)(void *hw_arg);
/*!
* Diable power/clock.
*
* \param hw_arg: opaque parameter passed to xrp_init at initialization
* time
*/
void (*disable)(void *hw_arg);
/*!
* Reset the core.
*
* \param hw_arg: opaque parameter passed to xrp_init at initialization
* time
*/
void (*reset)(void *hw_arg);
/*!
* Unstall the core.
*
* \param hw_arg: opaque parameter passed to xrp_init at initialization
* time
*/
void (*release)(void *hw_arg);
/*!
* Stall the core.
*
* \param hw_arg: opaque parameter passed to xrp_init at initialization
* time
*/
void (*halt)(void *hw_arg);
/*! Get HW-specific data to pass to the DSP on synchronization
*
* \param hw_arg: opaque parameter passed to xrp_init at initialization
* time
* \param sz: return size of sync data here
* \return a buffer allocated with kmalloc that the caller will free
*/
void *(*get_hw_sync_data)(void *hw_arg, size_t *sz);
/*!
* Send IRQ to the core.
*
* \param hw_arg: opaque parameter passed to xrp_init at initialization
* time
*/
void (*send_irq)(void *hw_arg);
/*!
* Check whether region of physical memory may be handled by
* dma_sync_* operations
*
* \param hw_arg: opaque parameter passed to xrp_init at initialization
* time
*/
bool (*cacheable)(void *hw_arg, unsigned long pfn, unsigned long n_pages);
/*!
* Synchronize region of memory for DSP access.
*
* \param hw_arg: opaque parameter passed to xrp_init at initialization
* time
* \param flags: XRP_FLAG_{READ,WRITE,READWRITE}
*/
void (*dma_sync_for_device)(void *hw_arg,
void *vaddr, phys_addr_t paddr,
unsigned long sz, unsigned flags);
/*!
* Synchronize region of memory for host access.
*
* \param hw_arg: opaque parameter passed to xrp_init at initialization
* time
* \param flags: XRP_FLAG_{READ,WRITE,READWRITE}
*/
void (*dma_sync_for_cpu)(void *hw_arg,
void *vaddr, phys_addr_t paddr,
unsigned long sz, unsigned flags);
/*!
* memcpy data/code to device-specific memory.
*/
void (*memcpy_tohw)(volatile void __iomem *dst, const void *src, size_t sz);
/*!
* memset device-specific memory.
*/
void (*memset_hw)(volatile void __iomem *dst, int c, size_t sz);
/*!
* Check DSP status.
*
* \param hw_arg: opaque parameter passed to xrp_init at initialization
* time
* \return whether the core has crashed and needs to be restarted
*/
bool (*panic_check)(void *hw_arg);
phys_addr_t (*get_base_mimo)(void *hw_arg);
void (*update_device_base)(void *hw_arg,phys_addr_t addr);
void (*set_reset_vector)(void *hw_arg,u32 addr);
void (*clear_hw)(void *hw_arg);
};
enum xrp_init_flags {
/*! Use interrupts in DSP->host communication */
XRP_INIT_USE_HOST_IRQ = 0x1,
};
/*!
* Initialize generic XRP kernel driver from cdns,xrp-compatible device
* tree node.
*
* \param pdev: pointer to platform device associated with the XRP device
* instance
* \param flags: initialization flags
* \param hw: pointer to xrp_hw_ops structeure for this device
* \param hw_arg: opaque pointer passed back to hw-specific functions
* \return error code or pointer to struct xvp, use IS_ERR_VALUE and ERR_PTR
*/
long xrp_init(struct platform_device *pdev, enum xrp_init_flags flags,
const struct xrp_hw_ops *hw, void *hw_arg,int mem_idx);
/*!
* Initialize generic XRP kernel driver from cdns,xrp,v1-compatible device
* tree node.
*
* \param pdev: pointer to platform device associated with the XRP device
* instance
* \param flags: initialization flags
* \param hw: pointer to xrp_hw_ops structeure for this device
* \param hw_arg: opaque pointer passed back to hw-specific functions
* \return error code or pointer to struct xvp, use IS_ERR_VALUE and ERR_PTR
*/
long xrp_init_v1(struct platform_device *pdev, enum xrp_init_flags flags,
const struct xrp_hw_ops *hw, void *hw_arg,int mem_idx);
/*!
* Initialize generic XRP kernel driver from cdns,xrp,cma-compatible device
* tree node.
*
* \param pdev: pointer to platform device associated with the XRP device
* instance
* \param flags: initialization flags
* \param hw: pointer to xrp_hw_ops structeure for this device
* \param hw_arg: opaque pointer passed back to hw-specific functions
* \return error code or pointer to struct xvp, use IS_ERR_VALUE and ERR_PTR
*/
long xrp_init_cma(struct platform_device *pdev, enum xrp_init_flags flags,
const struct xrp_hw_ops *hw, void *hw_arg,int mem_idx);
/*!
* Deinitialize generic XRP kernel driver.
*
* \param pdev: pointer to platform device associated with the XRP device
* instance
* \return 0 on success, negative error code otherwise
*/
int xrp_deinit(struct platform_device *pdev);
/*!
* Deinitialize generic XRP kernel driver.
*
* \param pdev: pointer to platform device associated with the XRP device
* instance
* \param hw_arg: optional pointer to opaque pointer where generic XRP driver
* returns hw_arg that was associated with the pdev at xrp_init
* time
* \return 0 on success, negative error code otherwise
*/
int xrp_deinit_hw(struct platform_device *pdev, void **hw_arg);
/*!
* Notify generic XRP driver of possible IRQ from the DSP.
*
* \param irq: IRQ number
* \param xvp: pointer to struct xvp returned from xrp_init* call
* \return whether IRQ was recognized and handled
*/
irqreturn_t xrp_irq_handler(int irq, struct xvp *xvp);
/*!
* Resume generic XRP operation of the device dev.
*
* \param dev: device which operation shall be resumed
* \return 0 on success, negative error code otherwise
*/
int xrp_runtime_resume(struct device *dev);
/*!
* Suspend generic XRP operation of the device dev.
*
* \param dev: device which operation shall be suspended
* \return 0 on success, negative error code otherwise
*/
int xrp_runtime_suspend(struct device *dev);
int xrp_set_reset_reg(int dsp_id);
#endif

View File

@@ -0,0 +1,157 @@
/*
* XRP: Linux device driver for Xtensa Remote Processing
*
* Copyright (c) 2015 - 2017 Cadence Design Systems, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Alternatively you can use and distribute this file under the terms of
* the GNU General Public License version 2 or later.
*/
#include <linux/version.h>
#include <linux/atomic.h>
#include <linux/acpi.h>
#include <linux/completion.h>
#include <linux/delay.h>
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 16, 0)
#include <linux/dma-mapping.h>
#else
#include <linux/dma-direct.h>
#endif
#include <linux/firmware.h>
#include <linux/fs.h>
#include <linux/hashtable.h>
#include <linux/highmem.h>
#include <linux/idr.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_address.h>
#include <linux/of_device.h>
#include <linux/of_reserved_mem.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <linux/property.h>
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/sort.h>
#include <asm/mman.h>
#include <linux/mman.h>
#include <asm/uaccess.h>
#include "xrp_cma_alloc.h"
#include "xrp_firmware.h"
#include "xrp_hw.h"
#include "xrp_internal.h"
#include "xrp_kernel_defs.h"
#include "xrp_kernel_dsp_interface.h"
#include "xrp_private_alloc.h"
#define DRIVER_NAME "xrp_hw_com"
struct xrp_hw_common_drvdata {
phys_addr_t sys_reg_phys;
void __iomem *sys_regs;
size_t sys_reg_size;
struct mutex lock;
};
static struct xrp_hw_common_drvdata *hw_drvdata = NULL;
#define XRP_REG_RESET (0x28)
#define DSP0_RESET_BIT_MASK (0x1<<8)
#define DSP1_RESET_BIT_MASK (0x1<<12)
int xrp_set_reset_reg(int dsp_id)
{
uint32_t bit_mask = dsp_id==0?DSP0_RESET_BIT_MASK
:DSP1_RESET_BIT_MASK;
pr_debug("%s,reset\n", __func__);
if(!hw_drvdata)
{
pr_debug("%s hw_drvdata is NULL \n",__func__);
return -1;
}
mutex_lock(&hw_drvdata->lock);
uint32_t old_value = __raw_readl(hw_drvdata->sys_regs+XRP_REG_RESET);
pr_debug("%s,reset reg:%x\n",__func__,old_value);
__raw_writel(old_value^bit_mask,hw_drvdata->sys_regs+XRP_REG_RESET);
udelay(10000);
__raw_writel(old_value,hw_drvdata->sys_regs+XRP_REG_RESET);
mutex_unlock(&hw_drvdata->lock);
return 0;
}
EXPORT_SYMBOL(xrp_set_reset_reg);
static const struct of_device_id xrp_hw_common_of_match[] = {
{
.compatible = "thead,dsp-hw-common",
}, {},
};
// MODULE_DEVICE_TABLE(of, xrp_hw_common_of_match);
static int xrp_hw_common_probe(struct platform_device *pdev)
{
long ret = -EINVAL;
struct resource *mem;
hw_drvdata =
devm_kzalloc(&pdev->dev, sizeof(*hw_drvdata), GFP_KERNEL);
if (!hw_drvdata)
return -ENOMEM;
mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!mem) {
return -ENODEV;
}
hw_drvdata->sys_reg_phys = mem->start;
hw_drvdata->sys_reg_size =mem->end-mem->start;
hw_drvdata->sys_regs = devm_ioremap_resource(&pdev->dev, mem);
pr_debug("%s,sys_reg_phys:%lx,sys_regs:%lx,size:%x\n", __func__,
hw_drvdata->sys_reg_phys,hw_drvdata->sys_regs,hw_drvdata->sys_reg_size);
mutex_init(&hw_drvdata->lock);
return 0;
}
static int xrp_hw_common_remove(struct platform_device *pdev)
{
return 0;
}
static struct platform_driver xrp_hw_common_driver = {
.probe = xrp_hw_common_probe,
.remove = xrp_hw_common_remove,
.driver = {
.name = DRIVER_NAME,
.of_match_table = of_match_ptr( xrp_hw_common_of_match),
},
};
module_platform_driver(xrp_hw_common_driver);
MODULE_AUTHOR("T-HEAD");
MODULE_DESCRIPTION("XRP: Linux device driver for Xtensa Remote Processing");
MODULE_LICENSE("Dual MIT/GPL");

View File

@@ -0,0 +1,480 @@
/*
* xrp_hw_hikey: Simple xtensa/arm low-level XRP driver
*
* Copyright (c) 2018 Cadence Design Systems, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Alternatively you can use and distribute this file under the terms of
* the GNU General Public License version 2 or later.
*/
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_address.h>
#include <linux/of_device.h>
#include <linux/platform_device.h>
#include <linux/slab.h>
#include "xrp_hw.h"
#include "xrp_hw_hikey960_dsp_interface.h"
#include "xrp_ring_buffer.h"
#include <linux/hisi/hisi_rproc.h>
#include <ipcm/bsp_drv_ipc.h>
#include <mailbox/drv_mailbox_msg.h>
#define DRIVER_NAME "xrp-hw-hikey960"
enum xrp_irq_mode {
XRP_IRQ_NONE,
XRP_IRQ_LEVEL,
XRP_IRQ_EDGE,
XRP_IRQ_MAX,
};
struct xrp_hw_hikey {
struct xvp *xrp;
struct device *dev;
struct xrp_hw_hikey960_panic __iomem *panic;
uint32_t last_read;
/* how IRQ is used to notify the device of incoming data */
enum xrp_irq_mode device_irq_mode;
/* device IRQ# */
u32 device_irq;
/* how IRQ is used to notify the host of incoming data */
enum xrp_irq_mode host_irq_mode;
/* dummy host IRQ */
u32 host_irq;
};
static void *get_hw_sync_data(void *hw_arg, size_t *sz)
{
struct xrp_hw_hikey *hw = hw_arg;
struct xrp_hw_hikey960_sync_data *hw_sync_data =
kmalloc(sizeof(*hw_sync_data), GFP_KERNEL);
if (!hw_sync_data)
return NULL;
*hw_sync_data = (struct xrp_hw_hikey960_sync_data){
.host_irq_mode = hw->host_irq_mode,
.device_irq_mode = hw->device_irq_mode,
.device_irq = hw->device_irq,
};
*sz = sizeof(*hw_sync_data);
return hw_sync_data;
}
static int send_cmd_async(struct xrp_hw_hikey *hw, uint32_t mbx, uint32_t cmd)
{
int ret = RPROC_ASYNC_SEND(mbx, &cmd, 1);
if (ret != 0) {
dev_err(hw->dev, "%s: RPROC_ASYNC_SEND ret = %d\n",
__func__, ret);
}
return ret;
}
static int send_cmd_sync(struct xrp_hw_hikey *hw, uint32_t mbx, uint32_t cmd)
{
int ret = hisi_rproc_xfer_sync_auto(mbx, &cmd, 1, NULL, 0);
if (ret != 0) {
dev_err(hw->dev, "%s: RPROC_SYNC_SEND ret = %d\n",
__func__, ret);
}
return ret;
}
static int enable(void *hw_arg)
{
return 0;
}
static void disable(void *hw_arg)
{
}
static void reset(void *hw_arg)
{
}
static void dump_regs(const char *fn, void *hw_arg)
{
struct xrp_hw_hikey *hw = hw_arg;
if (!hw->panic)
return;
dev_info(hw->dev, "%s: panic = 0x%08x, ccount = 0x%08x\n",
fn,
__raw_readl(&hw->panic->panic),
__raw_readl(&hw->panic->ccount));
dev_info(hw->dev, "%s: read = 0x%08x, write = 0x%08x, size = 0x%08x\n",
fn,
__raw_readl(&hw->panic->rb.read),
__raw_readl(&hw->panic->rb.write),
__raw_readl(&hw->panic->rb.size));
}
static void dump_log_page(struct xrp_hw_hikey *hw)
{
char *buf;
size_t i;
if (!hw->panic)
return;
dump_regs(__func__, hw);
buf = kmalloc(PAGE_SIZE, GFP_KERNEL);
if (buf) {
memcpy_fromio(buf, hw->panic, PAGE_SIZE);
for (i = 0; i < PAGE_SIZE; i += 64)
dev_info(hw->dev, " %*pEhp\n", 64, buf + i);
kfree(buf);
} else {
dev_err(hw->dev, " (couldn't allocate copy buffer)\n");
}
}
static void halt(void *hw_arg)
{
struct xrp_hw_hikey *hw = hw_arg;
int i;
dev_dbg(hw->dev, "%s\n", __func__);
dump_regs(__func__, hw);
dump_log_page(hw);
send_cmd_sync(hw_arg, HISI_RPROC_LPM3_MBX17,
(16 << 16) | (3 << 8) | (1 << 0));
for (i = 0; i < 10; ++i) {
schedule();
mdelay(1);
dump_regs(__func__, hw);
}
dev_dbg(hw->dev, "%s done\n", __func__);
}
static void release(void *hw_arg)
{
struct xrp_hw_hikey *hw = hw_arg;
int i;
dev_dbg(hw->dev, "%s\n", __func__);
dump_regs(__func__, hw);
send_cmd_async(hw_arg, HISI_RPROC_HIFI_MBX18, 0xb007);
for (i = 0; i < 10; ++i) {
schedule();
mdelay(1);
dump_regs(__func__, hw);
}
dev_dbg(hw->dev, "%s done\n", __func__);
}
static void send_irq(void *hw_arg)
{
struct xrp_hw_hikey *hw = hw_arg;
switch (hw->device_irq_mode) {
case XRP_IRQ_EDGE:
case XRP_IRQ_LEVEL:
send_cmd_async(hw_arg, HISI_RPROC_HIFI_MBX18, 0);
break;
default:
break;
}
}
static void irq_handler(void *dev_id)
{
struct xrp_hw_hikey *hw = dev_id;
dev_dbg(hw->dev, "%s\n", __func__);
xrp_irq_handler(0, hw->xrp);
DRV_k3IpcIntHandler_Autoack();
}
static void *irq_handler_context;
static void irq1_handler(unsigned int dummy)
{
irq_handler(irq_handler_context);
}
static bool panic_check(void *hw_arg)
{
struct xrp_hw_hikey *hw = hw_arg;
uint32_t panic;
uint32_t ccount;
uint32_t read;
uint32_t write;
uint32_t size;
if (!hw->panic)
return false;
panic = __raw_readl(&hw->panic->panic);
ccount = __raw_readl(&hw->panic->ccount);
read = __raw_readl(&hw->panic->rb.read);
write = __raw_readl(&hw->panic->rb.write);
size = __raw_readl(&hw->panic->rb.size);
if (read == 0 && read != hw->last_read) {
dev_warn(hw->dev, "****************** device restarted >>>>>>>>>>>>>>>>>\n");
dump_log_page(hw);
dev_warn(hw->dev, "<<<<<<<<<<<<<<<<<< device restarted *****************\n");
}
if (write < size && read < size && size < PAGE_SIZE) {
uint32_t tail;
uint32_t total;
char *buf = NULL;
hw->last_read = read;
if (read < write) {
tail = write - read;
total = tail;
} else if (read == write) {
tail = 0;
total = 0;
} else {
tail = size - read;
total = write + tail;
}
if (total)
buf = kmalloc(total, GFP_KERNEL);
if (buf) {
uint32_t off = 0;
dev_dbg(hw->dev, "panic = 0x%08x, ccount = 0x%08x read = %d, write = %d, size = %d, total = %d",
panic, ccount, read, write, size, total);
while (off != total) {
memcpy_fromio(buf + off,
hw->panic->rb.data + read,
tail);
read = 0;
off += tail;
tail = total - tail;
}
__raw_writel(write, &hw->panic->rb.read);
hw->last_read = write;
dev_info(hw->dev, "<<<\n%.*s\n>>>\n",
total, buf);
kfree(buf);
} else if (total) {
dev_err(hw->dev,
"%s: couldn't allocate memory (%d) to read the dump\n",
__func__, total);
}
} else {
if (read != hw->last_read) {
dev_warn(hw->dev,
"nonsense in the log buffer: read = %d, write = %d, size = %d\n",
read, write, size);
hw->last_read = read;
}
}
if (panic == 0xdeadbabe) {
dev_info(hw->dev, "%s: panic detected, log dump:\n", __func__);
dump_log_page(hw);
}
return panic == 0xdeadbabe;
}
static const struct xrp_hw_ops hw_ops = {
.enable = enable,
.disable = disable,
.halt = halt,
.release = release,
.reset = reset,
.get_hw_sync_data = get_hw_sync_data,
.send_irq = send_irq,
.panic_check = panic_check,
};
static long init_hw(struct platform_device *pdev, struct xrp_hw_hikey *hw,
int mem_idx, enum xrp_init_flags *init_flags)
{
struct resource *mem;
long ret;
mem = platform_get_resource(pdev, IORESOURCE_MEM, mem_idx);
if (mem) {
hw->panic = devm_ioremap_resource(&pdev->dev, mem);
if (IS_ERR(hw->panic)) {
dev_dbg(&pdev->dev,
"%s: couldn't ioremap abort/log region: %ld\n",
__func__, PTR_ERR(hw->panic));
hw->panic = NULL;
} else {
dev_dbg(&pdev->dev,
"%s: log ring buffer = %pap, mapped at %p\n",
__func__, &mem->start, hw->panic);
}
}
ret = of_property_read_u32(pdev->dev.of_node,
"device-irq",
&hw->device_irq);
if (ret == 0) {
hw->device_irq_mode = XRP_IRQ_LEVEL;
dev_dbg(&pdev->dev,
"%s: device IRQ = %d\n",
__func__, hw->device_irq);
} else {
dev_info(&pdev->dev,
"using polling mode on the device side\n");
}
ret = of_property_read_u32(pdev->dev.of_node,
"host-irq",
&hw->host_irq);
if (ret == 0) {
hw->host_irq_mode = XRP_IRQ_LEVEL;
dev_dbg(&pdev->dev, "%s: using host IRQ\n", __func__);
irq_handler_context = hw;
DRV_IPCIntInit();
IPC_IntConnect(IPC_ACPU_INT_SRC_HIFI_MSG,
irq1_handler, 0);
IPC_IntEnable(IPC_ACPU_INT_SRC_HIFI_MSG);
*init_flags |= XRP_INIT_USE_HOST_IRQ;
} else {
dev_info(&pdev->dev, "using polling mode on the host side\n");
}
return 0;
}
typedef long init_function(struct platform_device *pdev,
struct xrp_hw_hikey *hw);
static init_function init_v1;
static long init_v1(struct platform_device *pdev, struct xrp_hw_hikey *hw)
{
long ret;
enum xrp_init_flags init_flags = 0;
ret = init_hw(pdev, hw, 1, &init_flags);
if (ret < 0)
return ret;
return xrp_init_v1(pdev, init_flags, &hw_ops, hw);
}
static init_function init_cma;
static long init_cma(struct platform_device *pdev, struct xrp_hw_hikey *hw)
{
long ret;
enum xrp_init_flags init_flags = 0;
ret = init_hw(pdev, hw, 0, &init_flags);
if (ret < 0)
return ret;
return xrp_init_cma(pdev, init_flags, &hw_ops, hw);
}
#ifdef CONFIG_OF
static const struct of_device_id xrp_hw_hikey_match[] = {
{
.compatible = "cdns,xrp-hw-hikey960,v1",
.data = init_v1,
}, {
.compatible = "cdns,xrp-hw-hikey960,cma",
.data = init_cma,
}, {},
};
MODULE_DEVICE_TABLE(of, xrp_hw_hikey_match);
#endif
static int xrp_hw_hikey_probe(struct platform_device *pdev)
{
struct xrp_hw_hikey *hw =
devm_kzalloc(&pdev->dev, sizeof(*hw), GFP_KERNEL);
const struct of_device_id *match;
init_function *init;
long ret;
if (!hw)
return -ENOMEM;
match = of_match_device(of_match_ptr(xrp_hw_hikey_match),
&pdev->dev);
if (!match)
return -ENODEV;
hw->dev = &pdev->dev;
init = match->data;
ret = init(pdev, hw);
if (IS_ERR_VALUE(ret)) {
xrp_deinit(pdev);
return ret;
} else {
hw->xrp = ERR_PTR(ret);
return 0;
}
}
static int xrp_hw_hikey_remove(struct platform_device *pdev)
{
/*
* There's no way to disconnect from IPC or disable IPC IRQ.
* Do it here when it's available.
*/
return xrp_deinit(pdev);
}
static int xrp_hw_hikey_idle(struct device *dev)
{
/* Power management is flaky, don't do it now. */
return 1;
}
static const struct dev_pm_ops xrp_hw_hikey_pm_ops = {
SET_RUNTIME_PM_OPS(xrp_runtime_suspend,
xrp_runtime_resume,
xrp_hw_hikey_idle)
};
static struct platform_driver xrp_hw_hikey_driver = {
.probe = xrp_hw_hikey_probe,
.remove = xrp_hw_hikey_remove,
.driver = {
.name = DRIVER_NAME,
.of_match_table = of_match_ptr(xrp_hw_hikey_match),
.pm = &xrp_hw_hikey_pm_ops,
},
};
module_platform_driver(xrp_hw_hikey_driver);
MODULE_AUTHOR("Max Filippov");
MODULE_DESCRIPTION("XRP HiKey960: low level device driver for Xtensa Remote Processing");
MODULE_LICENSE("Dual MIT/GPL");

View File

@@ -0,0 +1,53 @@
/*
* XRP interface between hardware-specific linux and DSP parts of HiKey960
*
* Copyright (c) 2018 Cadence Design Systems, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Alternatively you can use and distribute this file under the terms of
* the GNU General Public License version 2 or later.
*/
#ifndef _XRP_KERNEL_HIKEY960_DSP_INTERFACE
#define _XRP_KERNEL_HIKEY960_DSP_INTERFACE
#include "xrp_ring_buffer.h"
enum {
XRP_DSP_SYNC_IRQ_MODE_NONE = 0x0,
XRP_DSP_SYNC_IRQ_MODE_LEVEL = 0x1,
XRP_DSP_SYNC_IRQ_MODE_EDGE = 0x2,
};
struct xrp_hw_hikey960_sync_data {
__u32 host_irq_mode;
__u32 device_irq_mode;
__u32 device_irq;
};
struct xrp_hw_hikey960_panic {
__u32 panic;
__u32 ccount;
__u32 reserved[2];
struct xrp_ring_buffer rb;
};
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,66 @@
/*
* @Author: your name
* @Date: 2022-03-25 12:36:07
* @LastEditTime: 2022-03-25 12:36:08
* @LastEditors: your name
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: /workspace/thead-build/light-fm/tmp-glibc/work/riscv64-oe-linux/xtensa-dsp/1.0-r0/git/driver/xrp-kernel/xrp_hw_simple_dsp_interface.h
*/
/*
* XRP interface between hardware-specific linux and DSP parts of example
* hardware
*
* Copyright (c) 2017 Cadence Design Systems, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Alternatively you can use and distribute this file under the terms of
* the GNU General Public License version 2 or later.
*/
#ifndef _XRP_KERNEL_SIMPLE_HW_DSP_INTERFACE
#define _XRP_KERNEL_SIMPLE_HW_DSP_INTERFACE
#include "xrp_ring_buffer.h"
enum {
XRP_DSP_SYNC_IRQ_MODE_NONE = 0x0,
XRP_DSP_SYNC_IRQ_MODE_LEVEL = 0x1,
XRP_DSP_SYNC_IRQ_MODE_EDGE = 0x2,
};
struct xrp_hw_simple_sync_data {
__u32 device_mmio_base;
__u32 host_irq_mode;
__u32 host_irq_offset;
__u32 host_irq_bit;
__u32 device_irq_mode;
__u32 device_irq_offset;
__u32 device_irq_bit;
__u32 device_irq;
};
struct xrp_hw_panic {
__u32 panic;
__u32 ccount;
__u32 reserved[2];
struct xrp_ring_buffer rb;
};
#endif

View File

@@ -0,0 +1,92 @@
/*
* Internal XRP structures definition.
*
* Copyright (c) 2015 - 2017 Cadence Design Systems, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Alternatively you can use and distribute this file under the terms of
* the GNU General Public License version 2 or later.
*/
#ifndef XRP_INTERNAL_H
#define XRP_INTERNAL_H
#include <linux/completion.h>
#include <linux/proc_fs.h>
#include <linux/miscdevice.h>
#include <linux/mutex.h>
#include <linux/types.h>
#include "xrp_address_map.h"
#include "xrp_kernel_report.h"
struct device;
struct firmware;
struct xrp_hw_ops;
struct xrp_allocation_pool;
struct xrp_dma_buf_list;
struct xrp_panic_log ;
struct xrp_comm {
struct mutex lock;
void __iomem *comm;
struct completion completion;
u32 priority;
};
struct xvp {
struct device *dev;
const char *firmware_name;
const struct firmware *firmware;
struct miscdevice miscdev;
const struct xrp_hw_ops *hw_ops;
void *hw_arg;
unsigned n_queues;
u32 *queue_priority;
struct xrp_comm *queue;
struct xrp_comm **queue_ordered;
void __iomem *comm;
phys_addr_t pmem;
phys_addr_t comm_phys;
phys_addr_t shared_size;
atomic_t reboot_cycle;
atomic_t reboot_cycle_complete;
struct xrp_address_map address_map;
bool host_irq_mode;
struct xrp_allocation_pool *pool;
bool off;
int nodeid;
struct xrp_reporter *reporter;
struct list_head dma_buf_list;
struct proc_dir_entry *proc_dir;
void __iomem *panic;
phys_addr_t panic_phy;
phys_addr_t panic_size;
struct xrp_panic_log *panic_log;
// struct xrp_dsp_debug_info debug_info;
};
#endif

View File

@@ -0,0 +1,107 @@
/*
* XRP driver IOCTL codes and data structures
*
* Copyright (c) 2015 - 2017 Cadence Design Systems, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Alternatively you can use and distribute this file under the terms of
* the GNU General Public License version 2 or later.
*/
#ifndef _XRP_KERNEL_DEFS_H
#define _XRP_KERNEL_DEFS_H
#define XRP_IOCTL_MAGIC 'r'
#define XRP_IOCTL_ALLOC _IO(XRP_IOCTL_MAGIC, 1)
#define XRP_IOCTL_FREE _IO(XRP_IOCTL_MAGIC, 2)
#define XRP_IOCTL_QUEUE _IO(XRP_IOCTL_MAGIC, 3)
#define XRP_IOCTL_QUEUE_NS _IO(XRP_IOCTL_MAGIC, 4)
#define XRP_IOCTL_REPORT_CREATE _IO(XRP_IOCTL_MAGIC, 5)
#define XRP_IOCTL_REPORT_RELEASE _IO(XRP_IOCTL_MAGIC, 6)
#define XRP_IOCTL_DMABUF_IMPORT _IO(XRP_IOCTL_MAGIC, 7)
#define XRP_IOCTL_DMABUF_EXPORT _IO(XRP_IOCTL_MAGIC, 8)
#define XRP_IOCTL_DMABUF_RELEASE _IO(XRP_IOCTL_MAGIC, 9)
#define XRP_IOCTL_DMABUF_SYNC _IO(XRP_IOCTL_MAGIC, 10)
struct xrp_ioctl_alloc {
__u32 size;
__u32 align;
__u64 addr;
__u64 paddr;
};
enum {
XRP_FLAG_READ = 0x1,
XRP_FLAG_WRITE = 0x2,
XRP_FLAG_READ_WRITE = 0x3,
};
struct xrp_ioctl_buffer {
__u32 flags;
__u32 size;
__u64 addr;
};
enum {
XRP_QUEUE_FLAG_NSID = 0x4,
XRP_QUEUE_FLAG_PRIO = 0xff00,
XRP_QUEUE_FLAG_PRIO_SHIFT = 8,
XRP_QUEUE_VALID_FLAGS =
XRP_QUEUE_FLAG_NSID |
XRP_QUEUE_FLAG_PRIO,
};
struct xrp_ioctl_queue {
__u32 flags;
__u32 in_data_size;
__u32 out_data_size;
__u32 buffer_size;
__u64 in_data_addr;
__u64 out_data_addr;
__u64 buffer_addr;
__u64 nsid_addr;
};
struct xrp_report_buffer
{
__u32 report_id;
__u32 data[1];
};
struct xrp_dma_buf{
int fd;
__u32 flags;
__u32 size;
__u64 addr;
__u64 paddr;
} ;
// struct xrp_ioctl_report {
// __u32 size;
// struct xrp_report_buffer *addr;
// };
#endif

View File

@@ -0,0 +1,150 @@
/*
* Data structures and constants for generic XRP interface between
* linux and DSP
*
* Copyright (c) 2015 - 2019 Cadence Design Systems, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Alternatively you can use and distribute this file under the terms of
* the GNU General Public License version 2 or later.
*/
#ifndef _XRP_KERNEL_DSP_INTERFACE_H
#define _XRP_KERNEL_DSP_INTERFACE_H
#ifndef XRP_DSP_COMM_BASE_MAGIC
#define XRP_DSP_COMM_BASE_MAGIC 0x20161006
#endif
enum {
XRP_DSP_SYNC_IDLE = 0,
XRP_DSP_SYNC_HOST_TO_DSP = 0x1,
XRP_DSP_SYNC_DSP_TO_HOST = 0x3,
XRP_DSP_SYNC_START = 0x101,
XRP_DSP_SYNC_DSP_READY_V1 = 0x203,
XRP_DSP_SYNC_DSP_READY_V2 = 0x303,
};
enum {
XRP_DSP_SYNC_TYPE_ACCEPT = 0x80000000,
XRP_DSP_SYNC_TYPE_MASK = 0x00ffffff,
XRP_DSP_SYNC_TYPE_LAST = 0,
XRP_DSP_SYNC_TYPE_HW_SPEC_DATA = 1,
XRP_DSP_SYNC_TYPE_HW_QUEUES = 2,
XRP_DSP_SYNC_TYPE_HW_DEBUG_INFO =3,
};
struct xrp_dsp_tlv {
__u32 type;
__u32 length;
__u32 value[0];
};
struct xrp_dsp_sync_v1 {
__u32 sync;
__u32 hw_sync_data[0];
};
struct xrp_dsp_sync_v2 {
__u32 sync;
__u32 reserved[3];
struct xrp_dsp_tlv hw_sync_data[0];
};
enum log_level{
FW_DEBUG_LOG_MODE_QUIET, /* disabel FW log printf */
FW_DEBUG_LOG_MODE_ERR, /* enable FW log printf with error level */
FW_DEBUG_LOG_MODE_WRN, /* enable FW log printf with warning level */
FW_DEBUG_LOG_MODE_INF, /* enable FW log printf with info level*/
FW_DEBUG_LOG_MODE_DBG, /* enable FW log printf with debug level*/
FW_DEBUG_LOG_MODE_TRACE, /* enable FW log printf with trace level*/
};
struct xrp_dsp_debug_info{
__u32 panic_addr;
__u32 log_level;
__u32 profile_addr;
};
enum {
XRP_DSP_BUFFER_FLAG_READ = 0x1,
XRP_DSP_BUFFER_FLAG_WRITE = 0x2,
};
struct xrp_dsp_buffer {
/*
* When submitted to DSP: types of access allowed
* When returned to host: actual access performed
*/
__u32 flags;
__u32 size;
__u32 addr;
};
enum {
XRP_DSP_CMD_FLAG_REQUEST_VALID = 0x00000001,
XRP_DSP_CMD_FLAG_RESPONSE_VALID = 0x00000002,
XRP_DSP_CMD_FLAG_REQUEST_NSID = 0x00000004,
XRP_DSP_CMD_FLAG_RESPONSE_DELIVERY_FAIL = 0x00000008,
};
enum {
XRP_DSP_REPORT_INVALID = 0,
XRP_DSP_REPORT_WORKING = 0x1,
XRP_DSP_REPORT_OVERWIRTE = 0x3,
};
#define XRP_DSP_REPORT_TO_HOST_FLAG (0x10000000)
#define XRP_DSP_CMD_INLINE_DATA_SIZE 16
#define XRP_DSP_CMD_INLINE_BUFFER_COUNT 1
#define XRP_DSP_CMD_NAMESPACE_ID_SIZE 16
#define XRP_DSP_CMD_STRIDE 128
struct xrp_dsp_cmd {
__u32 flags;
__u32 in_data_size;
__u32 out_data_size;
__u32 buffer_size;
union {
__u32 in_data_addr;
__u8 in_data[XRP_DSP_CMD_INLINE_DATA_SIZE];
};
union {
__u32 out_data_addr;
__u8 out_data[XRP_DSP_CMD_INLINE_DATA_SIZE];
};
union {
__u32 buffer_addr;
struct xrp_dsp_buffer buffer_data[XRP_DSP_CMD_INLINE_BUFFER_COUNT];
__u8 buffer_alignment[XRP_DSP_CMD_INLINE_DATA_SIZE];
};
__u8 nsid[XRP_DSP_CMD_NAMESPACE_ID_SIZE];
/*************DSP report channel***************************************/
__u32 report_id;
__u32 report_paylad_size;
__u32 report_buffer_size;
__u32 report_status;
union {
__u32 report_addr;
__u8 report_data[XRP_DSP_CMD_INLINE_DATA_SIZE];
};
__u32 cmd_flag;
};
#endif

View File

@@ -0,0 +1,43 @@
/*
* Copyright (c) 2017 Cadence Design Systems Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Alternatively you can use and distribute this file under the terms of
* the GNU General Public License version 2 or later.
*/
#ifndef XRP_KERNEL_REPORT_H
#define XRP_KERNEL_REPORT_H
// #include "xrp_alloc.h"
#include <linux/interrupt.h>
struct xrp_reporter {
struct fasync_struct *fasync;
struct tasklet_struct report_task;
__u64 buffer_virt;
phys_addr_t buffer_phys;
size_t buffer_size;
};
#endif

View File

@@ -0,0 +1,35 @@
/*
* Copyright (c) 2017 Cadence Design Systems Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Alternatively you can use and distribute this file under the terms of
* the GNU General Public License version 2 or later.
*/
#ifndef XRP_PRIVATE_ALLOC_H
#define XRP_PRIVATE_ALLOC_H
#include "xrp_alloc.h"
long xrp_init_private_pool(struct xrp_allocation_pool **pool,
phys_addr_t start, u32 size);
#endif

View File

@@ -0,0 +1,40 @@
/*
* XRP ring buffer structure
*
* Copyright (c) 2018 Cadence Design Systems, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Alternatively you can use and distribute this file under the terms of
* the GNU General Public License version 2 or later.
*/
#ifndef XRP_RING_BUFFER_H
#define XRP_RING_BUFFER_H
struct xrp_ring_buffer {
__u32 read;
__u32 write;
__u32 size;
__u32 reserved[1];
__u8 data[0];
};
#endif

3287
driver/xrp-kernel/xvp_main.c Normal file

File diff suppressed because it is too large Load Diff

68
driver/xrp-user/Makefile Normal file
View File

@@ -0,0 +1,68 @@
##
# Copyright (C) 2021 Alibaba Group Holding Limited
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
##
# INCLUDES = -I../../driver/isp -I../../common
TARGET = libdsp.so
CFLAGS = -O2 -Wall -g -lm -lpthread
CFLAGS:=-fPIC
LDFLAGS:=-shared -fpic
LDFLAGS+=--whole-archive
LDFLAGS += -Lxrp-host -lxrp_linux
LDFLAGS += -Lxrp-common -lxrp-common
LDFLAGS+=--no-whole-archive
# LDFLAGS += -Lxrp-host -lxrp_linux
# LDFLAGS += -Lxrp-common -lxrp-common
# LIB_PATH += -Lxrp-host
# LIB_PATH += -Lxrp-common
# LIBS += -lpthread
# LIBS += -lxrp_linux
# LIBS += -lxrp-common
# USE_THREADS =
xrp_SRCS += dsp-ps/csi_dsp_core.c
# xrp_SRCS += dsp-ps/dsp_ps_core.c
xrp_SRCS += dsp-ps/csi_dsp_helper.c
xrp_SRCS += dsp-ps/dsp_common.c
INCLUDES = -I$(CURDIR) -Ihosted -Iinclude -Ithread-pthread -I../xrp-common -I../../xrp-kernel
# object files will be generated from .c sourcefiles
xrp_OBJS = $(notdir $(xrp_SRCS:.c=.o))
all: $(TARGET)
XRP_COMMON := xrp-common
$(XRP_COMMON): DUMMY
make -C $(XRP_COMMON)
XRP_LINUX:=xrp-host
$(XRP_LINUX): DUMMY
make -C $(XRP_LINUX)
DUMMY:
$(xrp_OBJS): $(xrp_SRCS)
$(CC) -c $(CFLAGS) $(INCLUDES) $(xrp_SRCS)
$(TARGET): $(xrp_OBJS) $(XRP_COMMON) $(XRP_LINUX)
$(LD) $(LDFLAGS) -o $(TARGET) $(xrp_OBJS) $(LIB_PATH) $(LIBS)
clean:
rm -f *.o
rm -f *.so
rm -rf output
install:
.PHONY: clean all prepare common

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,127 @@
/*
* Copyright (c) 2021 Alibaba Group. All rights reserved.
* License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
/*!
* \file
* \brief This section defines CSI DSP API.
*
*/
#ifndef _CSI_DSP_CORE_H
#define _CSI_DSP_CORE_H
#include <string.h>
#include "xrp_api.h"
#include "csi_dsp_task_defs.h"
#include "csi_dsp_post_process_defs.h"
#include "dsp_ps_ns.h"
#include "list.h"
#include <pthread.h>
#ifdef __cplusplus
extern "C" {
#endif
struct csi_dsp_logger{
struct xrp_queue *comm_queue;
struct log_ops{
int (*create)(int mode);
int(*enable)();
int (*disable)();
};
};
struct csi_dsp_monitor{
struct xrp_queue *comm_queue;
struct mon_ops{
int(*enable)();
int (*disable)();
};
};
typedef struct dsp_handler_item{
struct list_head head;
void* handler;
}dsp_handler_item_t;
struct csi_dsp_instance{
int id;
struct xrp_device *device;
struct xrp_queue *comm_queue;
struct csi_dsp_logger *logger_impl;
struct csi_dsp_monitor *monitor_impl;
struct xrp_report *report_impl;
struct list_head task_list;
};
struct csi_dsp_task_handler{
int task_id;
char task_ns[TASK_NAME_LINE];
csi_dsp_task_mode_e mode;
struct csi_dsp_instance *instance;
struct xrp_queue *queue;
struct csi_dsp_task_fe_para fe;
struct csi_dsp_task_be_para be;
struct csi_dsp_algo_config_par algo;
struct xrp_buffer_group *buffers; //store task level buf info
int priority;
int report_id;
uint32_t report_size;
int (*cb)(void*context,void*data);
void *context;
void *private;
};
typedef struct task_event_item{
struct list_head head;
struct xrp_event * event;
struct csi_sw_task_req* req;
csi_dsp_status_e req_status;
}task_event_item_t;
typedef struct csi_dsp_sw_task_manager{
struct list_head event_list;
int event_num;
pthread_mutex_t mutex;
}csi_dsp_sw_task_manager_t;
int csi_dsp_test_config(void* dsp ,struct csi_dsp_ip_test_par* config_para,void* buf);
int csi_dsp_cmd_send(const struct xrp_queue *queue,int cmd_type,void * cmd_payload,
size_t payload_size,void *resp, size_t resp_size,struct xrp_buffer_group *buffer_group);
int csi_dsp_enable_heartbeat_check(struct csi_dsp_instance *dsp ,int secs);
int csi_dsp_disable_heartbeat_check();
int csi_dsp_buf_flush( struct xrp_device *device,struct csi_dsp_buffer *buffers);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -0,0 +1,159 @@
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <signal.h>
#include <time.h>
#include <sys/time.h>
#include "../include/xrp_api.h"
#include "../include/dsp_ps_ns.h"
#include "../include/csi_dsp_api.h"
#include "csi_dsp_core.h"
#include "csi_dsp_task_defs.h"
#include "dsp_common.h"
// #include "../xrp-host/xrp_host_common.h"
struct csi_dsp_instance *instance = NULL;
void csi_dsp_heartbeak_polling()
{
dsp_handler_item_t *task_item =NULL;
struct itimerval val,oval;
struct csi_dsp_task_handler *task;
// static counter =0;
DSP_PRINT(INFO,"heartbeat checking\n");
if(instance == NULL)
{
DSP_PRINT(WARNING,"dsp instance is NULL\n");
return;
}
// counter++;
/*close timer*/
val.it_value.tv_sec = 0;
val.it_value.tv_usec =0;
val.it_interval.tv_sec = 0;
val.it_interval.tv_usec =0;
setitimer(ITIMER_REAL,&val,&oval);
if(csi_dsp_cmd_send(instance->comm_queue,PS_CMD_HEART_BEAT_REQ,NULL,0,NULL,0,NULL))
{
DSP_PRINT(WARNING,"PS_CMD_TASK_ALLOC fail\n");
s_cmd_t cmd =
{
.cmd=CSI_DSP_REPORT_HEARTBEAT_ERR,
};
list_for_each_entry(task_item,&instance->task_list,head)
{
task = task_item->handler;
if(task->mode & CSI_DSP_TASK_HW)
{
if(task->cb)
task->cb(task->context,&cmd);
}
}
}
/*restore timer*/
setitimer(ITIMER_REAL,&oval,NULL);
return;
}
int csi_dsp_enable_heartbeat_check(struct csi_dsp_instance *dsp ,int secs)
{
struct itimerval val,oval;
signal(SIGALRM,csi_dsp_heartbeak_polling);
val.it_value.tv_sec = secs;
val.it_value.tv_usec =0;
val.it_interval.tv_sec = secs;
val.it_interval.tv_usec =0;
instance = dsp;
DSP_PRINT(DEBUG,"period:%d sec hearbeat working\n",secs);
return setitimer(ITIMER_REAL,&val,&oval);
}
int csi_dsp_disable_heartbeat_check()
{
struct itimerval val;
val.it_value.tv_sec = 0;
val.it_value.tv_usec =0;
val.it_interval.tv_sec = 0;
val.it_interval.tv_usec =0;
instance = NULL;
DSP_PRINT(INFO,"sec hearbeat disable\n");
return setitimer(ITIMER_REAL,&val,NULL);
}
void isp_algo_result_handler(void *context,void *data)
{
s_cmd_t *msg=(s_cmd_t *)data;
printf("report recived:%x\n",msg->cmd);
switch(msg->cmd)
{
case CSI_DSP_REPORT_ISP_ERR:
printf("ISP error:%d\n",msg->data[0]);
break;
case CSI_DSP_REPORT_RY_ERR:
printf("Post ISP error\n",msg->data[0]);
break;
case CSI_DSP_REPORT_ALGO_ERR:
printf("algo err\n");
break;
case CSI_DSP_REPORT_VI_PRE_ERR:
break;
case CSI_DSP_REPORT_RESULT:
break;
case CSI_DSP_REPORT_HEARTBEAT_ERR:
printf("heartbeat not detect\n");
break;
default:
break;
}
}
int csi_dsp_buf_flush( struct xrp_device *device,struct csi_dsp_buffer *buffers)
{
int loop;
enum xrp_status status;
int flag = buffers->dir == CSI_DSP_BUFFER_IN ?XRP_READ:XRP_WRITE;
if(buffers->type == CSI_DSP_BUF_TYPE_DMA_BUF_IMPORT ||
buffers->type == CSI_DSP_BUF_TYPE_DMA_BUF_IMPORT )
{
for(loop=0;loop<buffers->plane_count;loop++)
{
xrp_flush_dma_buf(device, buffers->planes[loop].fd,flag,&status);
}
}
}
// void hw_task_result_handler(void *context,void *data)
// {
// s_cmd_t *msg=(s_cmd_t *)data;
// struct csi_dsp_task_handler * task = (struct csi_dsp_task_handler *)context;
// printf("report recived:%x\n",msg->cmd);
// switch(msg->cmd)
// {
// case VI_SYS_REPORT_ISP_ERR:
// printf("ISP error:%d\n",msg->data[0]);
// break;
// case VI_SYS_REPORT_RY_ERR:
// printf("Post ISP error\n",msg->data[0]);
// break;
// case VI_SYS_REPORT_ALGO_ERR:
// printf("algo err\n");
// break;
// case VI_SYS_REPORT_RESULT:
// if(task->cb)
// {
// task->cb(task->context,)
// }
// break;
// default:
// break;
// }
// }

View File

@@ -0,0 +1,46 @@
/*
* Copyright (c) 2022 Alibaba Group. All rights reserved.
* License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#include "dsp_common.h"
int log_level = CSI_DSP_LOG_INFO;
int pid = 0;
static int getLogLevel()
{
pid = getpid();
char *env = getenv("LIGHT_DSP_LOG_LEVEL");
if (env == NULL)
return CSI_DSP_LOG_ERROR;
else
{
int level = atoi(env);
if (level >= CSI_DSP_LOG_MAX || level < CSI_DSP_LOG_QUIET)
return CSI_DSP_LOG_ERROR;
else
return level;
}
}
void dsp_InitEnv()
{
log_level = getLogLevel();
}

View File

@@ -0,0 +1,353 @@
/*
* Copyright © 2010 Intel Corporation
* Copyright © 2010 Francisco Jerez <currojerez@riseup.net>
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*
*/
/* Modified by Ben Skeggs <bskeggs@redhat.com> to match kernel list APIs */
#ifndef _XORG_LIST_H_
#define _XORG_LIST_H_
/**
* @file Classic doubly-link circular list implementation.
* For real usage examples of the linked list, see the file test/list.c
*
* Example:
* We need to keep a list of struct foo in the parent struct bar, i.e. what
* we want is something like this.
*
* struct bar {
* ...
* struct foo *list_of_foos; -----> struct foo {}, struct foo {}, struct foo{}
* ...
* }
*
* We need one list head in bar and a list element in all list_of_foos (both are of
* data type 'struct list_head').
*
* struct bar {
* ...
* struct list_head list_of_foos;
* ...
* }
*
* struct foo {
* ...
* struct list_head entry;
* ...
* }
*
* Now we initialize the list head:
*
* struct bar bar;
* ...
* INIT_LIST_HEAD(&bar.list_of_foos);
*
* Then we create the first element and add it to this list:
*
* struct foo *foo = malloc(...);
* ....
* list_add(&foo->entry, &bar.list_of_foos);
*
* Repeat the above for each element you want to add to the list. Deleting
* works with the element itself.
* list_del(&foo->entry);
* free(foo);
*
* Note: calling list_del(&bar.list_of_foos) will set bar.list_of_foos to an empty
* list again.
*
* Looping through the list requires a 'struct foo' as iterator and the
* name of the field the subnodes use.
*
* struct foo *iterator;
* list_for_each_entry(iterator, &bar.list_of_foos, entry) {
* if (iterator->something == ...)
* ...
* }
*
* Note: You must not call list_del() on the iterator if you continue the
* loop. You need to run the safe for-each loop instead:
*
* struct foo *iterator, *next;
* list_for_each_entry_safe(iterator, next, &bar.list_of_foos, entry) {
* if (...)
* list_del(&iterator->entry);
* }
*
*/
/**
* The linkage struct for list nodes. This struct must be part of your
* to-be-linked struct. struct list_head is required for both the head of the
* list and for each list node.
*
* Position and name of the struct list_head field is irrelevant.
* There are no requirements that elements of a list are of the same type.
* There are no requirements for a list head, any struct list_head can be a list
* head.
*/
struct list_head {
struct list_head *next, *prev;
};
/**
* Initialize the list as an empty list.
*
* Example:
* INIT_LIST_HEAD(&bar->list_of_foos);
*
* @param The list to initialized.
*/
#define LIST_HEAD_INIT(name) { &(name), &(name) }
#define LIST_HEAD(name) \
struct list_head name = LIST_HEAD_INIT(name)
static inline void
INIT_LIST_HEAD(struct list_head *list)
{
list->next = list->prev = list;
}
static inline void
__list_add(struct list_head *entry,
struct list_head *prev, struct list_head *next)
{
next->prev = entry;
entry->next = next;
entry->prev = prev;
prev->next = entry;
}
/**
* Insert a new element after the given list head. The new element does not
* need to be initialised as empty list.
* The list changes from:
* head → some element → ...
* to
* head → new element → older element → ...
*
* Example:
* struct foo *newfoo = malloc(...);
* list_add(&newfoo->entry, &bar->list_of_foos);
*
* @param entry The new element to prepend to the list.
* @param head The existing list.
*/
static inline void
list_add(struct list_head *entry, struct list_head *head)
{
__list_add(entry, head, head->next);
}
/**
* Append a new element to the end of the list given with this list head.
*
* The list changes from:
* head → some element → ... → lastelement
* to
* head → some element → ... → lastelement → new element
*
* Example:
* struct foo *newfoo = malloc(...);
* list_add_tail(&newfoo->entry, &bar->list_of_foos);
*
* @param entry The new element to prepend to the list.
* @param head The existing list.
*/
static inline void
list_add_tail(struct list_head *entry, struct list_head *head)
{
__list_add(entry, head->prev, head);
}
static inline void
__list_del(struct list_head *prev, struct list_head *next)
{
next->prev = prev;
prev->next = next;
}
/**
* Remove the element from the list it is in. Using this function will reset
* the pointers to/from this element so it is removed from the list. It does
* NOT free the element itself or manipulate it otherwise.
*
* Using list_del on a pure list head (like in the example at the top of
* this file) will NOT remove the first element from
* the list but rather reset the list as empty list.
*
* Example:
* list_del(&foo->entry);
*
* @param entry The element to remove.
*/
static inline void
list_del(struct list_head *entry)
{
__list_del(entry->prev, entry->next);
}
static inline void
list_del_init(struct list_head *entry)
{
__list_del(entry->prev, entry->next);
INIT_LIST_HEAD(entry);
}
static inline void list_move_tail(struct list_head *list,
struct list_head *head)
{
__list_del(list->prev, list->next);
list_add_tail(list, head);
}
/**
* Check if the list is empty.
*
* Example:
* list_empty(&bar->list_of_foos);
*
* @return True if the list contains one or more elements or False otherwise.
*/
static inline int
list_empty(struct list_head *head)
{
return head->next == head;
}
/**
* Returns a pointer to the container of this list element.
*
* Example:
* struct foo* f;
* f = container_of(&foo->entry, struct foo, entry);
* assert(f == foo);
*
* @param ptr Pointer to the struct list_head.
* @param type Data type of the list element.
* @param member Member name of the struct list_head field in the list element.
* @return A pointer to the data struct containing the list head.
*/
#ifndef container_of
#define container_of(ptr, type, member) \
(type *)((char *)(ptr) - (char *) &((type *)0)->member)
#endif
/**
* Alias of container_of
*/
#define list_entry(ptr, type, member) \
container_of(ptr, type, member)
/**
* Retrieve the first list entry for the given list pointer.
*
* Example:
* struct foo *first;
* first = list_first_entry(&bar->list_of_foos, struct foo, list_of_foos);
*
* @param ptr The list head
* @param type Data type of the list element to retrieve
* @param member Member name of the struct list_head field in the list element.
* @return A pointer to the first list element.
*/
#define list_first_entry(ptr, type, member) \
list_entry((ptr)->next, type, member)
/**
* Retrieve the last list entry for the given listpointer.
*
* Example:
* struct foo *first;
* first = list_last_entry(&bar->list_of_foos, struct foo, list_of_foos);
*
* @param ptr The list head
* @param type Data type of the list element to retrieve
* @param member Member name of the struct list_head field in the list element.
* @return A pointer to the last list element.
*/
#define list_last_entry(ptr, type, member) \
list_entry((ptr)->prev, type, member)
#define __container_of(ptr, sample, member) \
(void *)container_of((ptr), typeof(*(sample)), member)
/**
* Loop through the list given by head and set pos to struct in the list.
*
* Example:
* struct foo *iterator;
* list_for_each_entry(iterator, &bar->list_of_foos, entry) {
* [modify iterator]
* }
*
* This macro is not safe for node deletion. Use list_for_each_entry_safe
* instead.
*
* @param pos Iterator variable of the type of the list elements.
* @param head List head
* @param member Member name of the struct list_head in the list elements.
*
*/
#define list_for_each_entry(pos, head, member) \
for (pos = __container_of((head)->next, pos, member); \
&pos->member != (head); \
pos = __container_of(pos->member.next, pos, member))
/**
* Loop through the list, keeping a backup pointer to the element. This
* macro allows for the deletion of a list element while looping through the
* list.
*
* See list_for_each_entry for more details.
*/
#define list_for_each_entry_safe(pos, tmp, head, member) \
for (pos = __container_of((head)->next, pos, member), \
tmp = __container_of(pos->member.next, pos, member); \
&pos->member != (head); \
pos = tmp, tmp = __container_of(pos->member.next, tmp, member))
#define list_for_each_entry_reverse(pos, head, member) \
for (pos = __container_of((head)->prev, pos, member); \
&pos->member != (head); \
pos = __container_of(pos->member.prev, pos, member))
#define list_for_each_entry_continue(pos, head, member) \
for (pos = __container_of(pos->member.next, pos, member); \
&pos->member != (head); \
pos = __container_of(pos->member.next, pos, member))
#define list_for_each_entry_continue_reverse(pos, head, member) \
for (pos = __container_of(pos->member.prev, pos, member); \
&pos->member != (head); \
pos = __container_of(pos->member.prev, pos, member))
#define list_for_each_entry_from(pos, head, member) \
for (; \
&pos->member != (head); \
pos = __container_of(pos->member.next, pos, member))
#endif

View File

@@ -0,0 +1,232 @@
/*
* Copyright (c) 2021 Alibaba Group. All rights reserved.
* License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
/*!
* \file
* \brief This section defines CSI DSP API.
*
* General properties:
* 1. API Handler DSP TASK CREATE
* 2. API Handler DSP ALGO config
* 3. API
*/
#ifndef _CSI_DSP_API_H
#define _CSI_DSP_API_H
#include <string.h>
#include <stdint.h>
#include "csi_dsp_task_defs.h"
#ifdef __cplusplus
extern "C" {
#endif
/************* CPU interafce*********************************/
/**
* @description: * Open DSP device by index.
* @param {int} dsp_id dsp index to create
* @return {*} pointer to the opened device or NULL in case of error
*/
void *csi_dsp_create_instance(int dsp_id);
/**
* @description: Close DSP device by index.
* @param {void} *dsp ,dsp index to close
* @return {int} return 0 when delete success, not 0 in case of error
*/
int csi_dsp_delete_instance(void *dsp);
/**
* @description: create an task on an instance
* Task have a dependece Algo
* for CSI_DSP_TASK_HW (CSI_DSP_TASK_SW_TO_HW|CSI_DSP_TASK_SW_TO_SW)
* both csi_dsp_task_config_frontend and csi_dsp_task_config_backend are needed to call
* for CSI_DSP_TASK_SW_TO_SW use task req to handle seperate process req on this task
* @param {void *} point to an dsp instance
* @param {csi_dsp_task_mode_e} task_type
* @return {*}pointer to the createrf task or NULL in case of error
*/
void *csi_dsp_create_task(void * instance,csi_dsp_task_mode_e task_type);
/**
* @description: create a report handler on an instance
* @param {void*} point to an dsp instance
* @return {int} return 0 when create success, not 0 in case of error
*/
int csi_dsp_create_reporter(void* dsp);
/**
* @description: destroy a report handler on an instance
* @param {void} point to an dsp instance
* @return {int} return 0 when create success, not 0 in case of error
*/
int csi_dsp_destroy_reporter(void *dsp);
/**
* @description: destroy a task handler
* @param {void} *task, point to an task handler
* @return {int} return 0 when credestroy success, not 0 in case of error
*/
void csi_dsp_destroy_task(void *task);
/**
* @description: config a task's frontend ,for SW Task
* @param {void} *task
* @param {csi_dsp_task_fe_para} *config_para
* @return {*}
*/
int csi_dsp_task_config_frontend(void *task,struct csi_dsp_task_fe_para *config_para);
/**
* @description:
* @param {void} *task
* @param {csi_dsp_task_fe_para} *config_para
* @return {*}
*/
int csi_dsp_task_get_frontend(void *task,struct csi_dsp_task_fe_para *config_para);
/**
* @description:
* @param {void} *task
* @param {csi_dsp_task_be_para} *config_para
* @return {*}
*/
int csi_dsp_task_config_backend(void *task,struct csi_dsp_task_be_para *config_para);
/**
* @description:
* @param {void} *task
* @param {csi_dsp_task_be_para} *config_para
* @return {*}
*/
int csi_dsp_task_get_backend(void *task,struct csi_dsp_task_be_para *config_para);
/**
* @description:
* @param {void} *task
* @param {csi_dsp_algo_config_par} *config_para
* @return {*}
*/
int csi_dsp_task_config_algo(void *task,struct csi_dsp_algo_config_par *config_para);
/**
* @description:
* @param {void} *task_ctx
* @param {csi_dsp_algo_load_req_t*} config_para
* @return {*}
*/
int csi_dsp_task_load_algo(void *task_ctx, csi_dsp_algo_load_req_t* config_para);
/**
* @description:
* @param {void} *task_ctx
* @return {*}
*/
int csi_dsp_task_acquire_algo(void *task_ctx,char*name);
/**
* @description:
* @param {void} *task
* @return {*}
*/
int csi_dsp_task_start(void *task);
/**
* @description:
* @param {void} *task
* @return {*}
*/
int csi_dsp_task_stop(void *task);
/**
* @description:
* @param {void} *task
* @param { } int
* @param {void*} context
* @param {size_t} data_size
* @return {*}
*/
int csi_dsp_task_register_cb(void *task,
int (*cb)(void*context,void*data),
void* context,
size_t data_size);
/**
* @description:
* @param {void} *task
* @return {*}
*/
int csi_dsp_ps_task_unregister_cb(void *task);
/**
* @description:
* @param {void} *task
* @return {*}
*/
struct csi_sw_task_req* csi_dsp_task_create_request(void *task);
/**
* @description:
* @param {void *} task_ctx
* @param {csi_dsp_buffer *} buffer
* @return {*}
*/
int csi_dsp_task_create_buffer(void * task_ctx,struct csi_dsp_buffer * buffer);
/**
* @description:
* @param {void *} task_ctx
* @param {csi_dsp_buffer *} buffer
* @return {*}
*/
int csi_dsp_task_free_buffer(void * task_ctx,struct csi_dsp_buffer * buffer);
/**
* @description:
* @param {csi_sw_task_req*} req
* @param {csi_dsp_buffer *} buffer
* @return {*}
*/
int csi_dsp_request_add_buffer(struct csi_sw_task_req* req,struct csi_dsp_buffer * buffer);
/**
* @description:
* @param {csi_sw_task_req*} req
* @param {void*} property
* @param {size_t} sz
* @return {*}
*/
int csi_dsp_request_set_property(struct csi_sw_task_req* req,void* property,size_t sz);
/**
* @description:
* @param {csi_sw_task_req*} req
* @return {*}
*/
int csi_dsp_request_enqueue(struct csi_sw_task_req* req);
/**
* @description:
* @param {void} *task
* @return {*}
*/
struct csi_sw_task_req* csi_dsp_request_dequeue(void *task);
/**
* @description:
* @param {csi_sw_task_req*} req
* @return {*}
*/
int csi_dsp_task_release_request(struct csi_sw_task_req* req);
int csi_dsp_task_update_backend_buf(void *task_ctx,struct csi_dsp_task_be_para* config_para);
int csi_dsp_test_config(void* dsp ,struct csi_dsp_ip_test_par* config_para,void* buf);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -0,0 +1,144 @@
/*
* Copyright (c) 2021 Alibaba Group. All rights reserved.
* License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
/*!
* \file
* \brief This section defines DSP shared strcut for CPU&DSP&APP.
*
* General properties:
* 1. Post porcess define data and strcut, visiable for APP
* 2. user define data shared bedtween DSP ans host
*/
#ifndef _CSI_DSP_POST_DEFS_H
#define _CSI_DSP_POST_DEFS_H
#include <string.h>
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
#define CSI_DSP_MAX_BUFFER 8
typedef uint8_t dsp_id_t;
typedef enum csi_dsp_img_fmt{
CSI_DSP_IMG_FMT_RAW8 =0,
CSI_DSP_IMG_FMT_RAW10_UNALGIN,
CSI_DSP_IMG_FMT_RAW10_ALGIN,
CSI_DSP_IMG_FMT_RAW12_UNALGIN,
CSI_DSP_IMG_FMT_RAW12_ALGIN,
CSI_DSP_IMG_FMT_RAW16_UNALGIN,
CSI_DSP_IMG_FMT_RAW16_ALGIN,
CSI_DSP_IMG_FMT_NV12,
CSI_DSP_IMG_FMT_NV21,
CSI_DSP_IMG_FMT_I420, /* 420 3P Y/U/V */
CSI_DSP_IMG_FMT_YV12, /* 420 3P Y/V/U */
CSI_DSP_IMG_FMT_YUY2, /* 422 1P YUYV */
CSI_DSP_IMG_FMT_YVYU, /* 422 1P YVYU */
CSI_DSP_IMG_FMT_YV16, /* 422 3P Y/V/U */
CSI_DSP_IMG_FMT_Y, /* Y only */
CSI_DSP_IMG_FMT_420_CHROME, /* u or v only */
CSI_DSP_IMG_FMT_422_CHROME, /* u or v only */
CSI_DSP_IMG_FMT_420_UV_IL, /* uv interleave*/
CSI_DSP_IMG_FMT_422_UV_IL, /* uv interleave*/
CSI_DSP_IMG_FMT_INVALID,
} csi_dsp_img_fmt_e;
enum buffer_property{
CSI_DSP_BUFFER_IN,
CSI_DSP_BUFFER_OUT,
CSI_DSP_BUFFER_IN_OUT,
};
struct csi_dsp_plane {
int fd;
uint32_t stride; /* if buffer type is image */
uint32_t size;
uint64_t buf_phy;
uint64_t buf_vir;
};
typedef enum csi_dsp_buf_type {
CSI_DSP_BUF_TYPE_DMA_BUF_IMPORT, // memory allocated via dma-buf from extern
CSI_DSP_BUF_TYPE_DMA_BUF_EXPORT, // memory allocated via dma-buf from internal
CSI_DSP_BUF_ALLOC_APP, // memory allocated via APP malloc
CSI_DSP_BUF_ALLOC_DRV, // memory allocated via DSP Drvier
CSI_DSP_BUF_ALLOC_FM, // memory will auto acquire by DSP FM
} csi_dsp_buf_type_e;
struct csi_dsp_buffer {
dsp_id_t buf_id;
enum buffer_property dir;
csi_dsp_buf_type_e type;
uint8_t format;
uint8_t plane_count;
uint32_t width;
uint32_t height;
struct csi_dsp_plane planes[3];
};
struct csi_dsp_algo_config_par{
int16_t algo_id;
int task_id;
uint64_t algo_ptr;
uint64_t sett_ptr;
uint32_t sett_length;
uint64_t bufs_ptr;
uint32_t buf_num;
uint32_t algo_size;
};
typedef enum csi_dsp_sw_req_status {
CSI_DSP_SW_REQ_IDLE,
CSI_DSP_SW_REQ_RUNNING,
CSI_DSP_SW_REQ_FAIL,
CSI_DSP_SW_REQ_DONE,
} csi_dsp_sw_req_status_e;
struct csi_sw_task_req{
uint16_t algo_id;
uint16_t request_id;
uint16_t buffer_num;
csi_dsp_sw_req_status_e status;
uint32_t sett_length;
uint64_t sett_ptr;
struct csi_dsp_buffer buffers[CSI_DSP_MAX_BUFFER];
void *task;
void* priv;
};
typedef enum csi_dsp_algo_lib_id{
CSI_DSP_ALGO_LIB_COPY,
CSI_DSP_ALGO_LIB_0,
CSI_DSP_ALGO_LIB_1,
}csi_dsp_algo_lib_id_e;
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -0,0 +1,229 @@
/*
* Copyright (c) 2021 Alibaba Group. All rights reserved.
* License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
/*!
* \file
* \brief This section defines DSP shared strcut for CPU&DSP&APP.
*
* General properties:
* 1. Post porcess define data and strcut, visiable for APP
* 2. user define data shared bedtween DSP ans host
*/
#ifndef _CSI_DSP_TASK_DEFS_H
#define _CSI_DSP_TASK_DEFS_H
#include <string.h>
#include <stdint.h>
#include "csi_dsp_post_process_defs.h"
#ifdef __cplusplus
extern "C" {
#endif
#define MAX_REPORT_SIZE 256
#define CSI_DSP_HW_TASK_EXTRA_BUF_START_INDEX 2
typedef struct {
uint16_t id;
uint16_t hor;
uint16_t ver;
uint16_t data_fmt;
uint16_t line_in_entry;
uint16_t line_stride;
uint32_t buffer_size;
uint64_t buffer_addr;
}sisp_config_par;
typedef sisp_config_par spost_isp_config_par;
// typedef sisp_config_par svipre_config_par;
typedef struct vipre_config_par{
uint8_t id;
uint8_t act_channel;
uint8_t data_fmt;
uint8_t buffer_num;
uint16_t line_num;
uint16_t hor;
uint16_t ver;
uint16_t line_stride;
uint32_t buffer_size;
uint64_t buffer_addr[12];
}vipre_config_par_t;
typedef struct {
uint16_t algo_id;
float gamma; // float鍙傛暟
float coef1;
float coef2;
float coef3;
float coef4;
short beta; // short鍨嬪弬鏁<E5BCAC>
short beta1;
short beta2;
short beta3;
short beta4;
}salgo_config_par;
typedef enum{
CSI_DSP_REPORT_NORMAL,
CSI_DSP_REPORT_RESULT,
CSI_DSP_REPORT_RESULT_WITH_EXRA_PARAM,
CSI_DSP_REPORT_ALGO_ERR,
CSI_DSP_REPORT_PS_ERR,
CSI_DSP_REPORT_ISP_ERR,
CSI_DSP_REPORT_RY_ERR,
CSI_DSP_REPORT_VI_PRE_ERR,
CSI_DSP_REPORT_NO_BUF,
CSI_DSP_REPORT_HEARTBEAT_ERR,
CSI_DSP_HW_FRAME_DROP,
CSI_DSP_REPORT_EXRA_PARAM,
}csi_dsp_report_e;
typedef struct dsp_frame{
uint64_t p_frame_buff[3];
uint32_t frame_buff_size[3];
int32_t frame_width;
int32_t frame_height;
int32_t frame_pitch;
uint8_t pixel_res;
uint8_t num_channels;
int8_t fmt;
}dsp_frame_t;
typedef enum csi_dsp_task_mode{
CSI_DSP_TASK_SW_TO_SW =0x1<<0, /*SW Queue to handle in / data/exception */
CSI_DSP_TASK_SW_TO_HW =0x1<<1, /*SW Queue to handle in and exception / Report handlere exception,HW handl out*/
CSI_DSP_TASK_HW_TO_SW =0x1<<2, /* HW send handle in, Report handler out and exception*/
CSI_DSP_TASK_HW_TO_HW =0x01<<3, /* Hw handler in&out Report handler exception*/
CSI_DSP_TASK_SW = (CSI_DSP_TASK_SW_TO_HW|CSI_DSP_TASK_SW_TO_SW),
CSI_DSP_TASK_HW = (CSI_DSP_TASK_HW_TO_SW|CSI_DSP_TASK_HW_TO_HW),
}csi_dsp_task_mode_e;
//#define CSI_DSP_TASK_SW (CSI_DSP_TASK_SW_TO_HW|CSI_DSP_TASK_SW_TO_SW)
//#define CSI_DSP_TASK_HW (CSI_DSP_TASK_HW_TO_SW|CSI_DSP_TASK_HW_TO_HW)
typedef enum csi_dsp_status{
CSI_DSP_ERR_ILLEGAL_PARAM = -100,
CSI_DSP_TASK_NOT_VALID,
CSI_DSP_TASK_ALLOC_FAIL,
CSI_DSP_TASK_ADD_TO_SCHEDULER_FAIL,
CSI_DSP_TASK_ALREADY_RUNNING,
CSI_DSP_TASK_START_FAIL,
CSI_DSP_REPORTER_NOT_INIT,
CSI_DSP_FE_NOT_VALID,
CSI_DSP_FE_CONFIG_FAIL,
CSI_DSP_BE_CONFIG_FAIL,
CSI_DSP_BE_NOT_VALID,
CSI_DSP_ALGO_INVALID,
CSI_DSP_ALGO_ERR,
CSI_DSP_FE_ERR,
CSI_DSP_BE_ERR,
CSI_DSP_BUF_TYPE_ERR,
CSI_DSP_ALGO_LOAD_FAIL,
CSI_DSP_MALLO_FAIL,
CSI_DSP_ALGO_BUF_FAIL,
CSI_DSP_FAIL,
CSI_DSP_OK = 0,
}csi_dsp_status_e;
struct csi_dsp_task_create_req{
csi_dsp_task_mode_e type;
int priority;
};
struct csi_dsp_task_comm_resp{
csi_dsp_status_e status;
};
enum csi_dsp_fe_type{
CSI_DSP_FE_TYPE_CPU,
CSI_DSP_FE_TYPE_ISP,
CSI_DSP_FE_TYPE_VIPRE,
CSI_DSP_FE_TYPE_INVALID,
};
enum csi_dsp_be_type{
CSI_DSP_BE_TYPE_HOST,
CSI_DSP_BE_TYPE_POST_ISP,
CSI_DSP_BE_TYPE_INVALID,
};
enum csi_dsp_task_cfg{
CSI_DSP_TASK_IDLE,
CSI_DSP_TASK_START,
CSI_DSP_TASK_STOP,
};
struct csi_dsp_task_fe_para{
enum csi_dsp_fe_type frontend_type;
int task_id;
union{
sisp_config_par isp_param;
vipre_config_par_t vipre_param;
};
};
typedef struct _sw_be_config_par{
int num_buf;
struct csi_dsp_buffer bufs[1];
}sw_be_config_par;
struct csi_dsp_task_be_para{
enum csi_dsp_be_type backend_type;
int task_id;
union{
sisp_config_par post_isp_param;
sw_be_config_par sw_param;
};
};
typedef struct csi_dsp_report_item{
csi_dsp_report_e type;
union{
char data[MAX_REPORT_SIZE];
struct csi_dsp_buffer buf;
};
}csi_dsp_report_item_t;
typedef struct csi_dsp_algo_load_req{
uint16_t algo_id;
int task_id;
uint64_t algo_ptr;
}csi_dsp_algo_load_req_t;
typedef struct csi_dsp_algo_load_resp{
csi_dsp_status_e status;
uint16_t algo_id;
uint16_t buf_desc_num;
uint16_t info_prop_des_num;
uint16_t set_prop_des_num;
}csi_dsp_algo_load_resp_t;
void isp_algo_result_handler(void *context,void *data);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -0,0 +1,91 @@
/*
* Copyright (c) 2022 Alibaba Group. All rights reserved.
* License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#ifndef _DSP_COMMON_H_
#define _DSP_COMMON_H_
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <memory.h>
#define DSP_MIN(a, b) ((a) < (b) ? (a) : (b))
#define DSP_MAX(a, b) ((a) > (b) ? (a) : (b))
#define DSP_ALIGN_UP(num, bits) (((num) + (1 << (bits)) - 1) & ~((1 << (bits)) - 1))
#define DSP_ZERO_MEMORY(data) \
{ \
memset(data, 0, sizeof(*(data))); \
}
#define DSP_MEMCPY(dst, src, size) \
{ \
memcpy(dst, src, size); \
}
#define DSP_SAFE_FREE(buf) \
{ \
if (buf != NULL) \
{ \
free(buf); \
buf = NULL; \
} \
}
#define DSP_PRINT(level, ...) \
{ \
if (log_level >= CSI_DSP_LOG_##level) \
{ \
printf("CSI_DSP[%d] %s,(%s,%d): ", pid, #level,__FUNCTION__,__LINE__); \
printf(__VA_ARGS__); \
} \
}
#define DSP_PRINT_RETURN(retcode, level, ...) \
{ \
DSP_PRINT(level, __VA_ARGS__) \
return retcode; \
}
#define DSP_CHECK_CONDITION(cond, retcode, ...) \
if (cond) \
{ \
DSP_PRINT(ERROR, __VA_ARGS__) \
return retcode; \
}
typedef enum log_level
{
CSI_DSP_LOG_QUIET = 0,
CSI_DSP_LOG_ERROR,
CSI_DSP_LOG_WARNING,
CSI_DSP_LOG_INFO,
CSI_DSP_LOG_DEBUG,
CSI_DSP_LOG_TRACE,
CSI_DSP_LOG_MAX
} csi_dsp_log_level;
extern int log_level;
extern int pid;
void dsp_InitEnv();
#endif

View File

@@ -0,0 +1,144 @@
/*
* Copyright (c) 2021 Alibaba Group. All rights reserved.
* License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
/*!
* \file
* \brief This section defines DSP and host shared data and strcut.
*
* General properties:
* 1. Define the common shared struct for both DSP and Host
* 2. The shared strcut only visible internal, for those open to APP shou be define in dsp_post_process_defs
*/
#ifndef _DSP_PS_NS_H
#define _DSP_PS_NS_H
#include <stdint.h>
#include "xrp_api.h"
#include "csi_dsp_task_defs.h"
#ifdef __cplusplus
extern "C" {
#endif
// enum {
// PS_CMD_IDLE = 0,
// PS_CMD_INLINE_START =PS_CMD_IDLE,
// PS_CMD_LOOPBACK_TEST,
// PS_CMD_ISP_CONFIG,
// PS_CMD_RY_CONFIG,
// PS_CMD_ISP_ALGO_CONFIG,
// PS_CMD_QUERY_DRAM_SIZE,
// PS_CMD_SET_IO_BUFFER,
// PS_CMD_WITH_BUFFER_START,
// };
#define TASK_NAME_LINE XRP_NAMESPACE_ID_SIZE
#define XRP_PS_NSID_COMMON_CMD \
{0xf9, 0x3c, 0x09, 0x61, 0x9d, 0x3f, 0x45, 0x29, \
0xbd, 0xe9, 0x7a, 0x4b, 0x18, 0x91, 0xdb, 0x15}
#define XRP_PS_NSID_ISP_ALGO \
{0xf9, 0x3c, 0x09, 0x61, 0x9d, 0x3f, 0x45, 0x29, \
0xbd, 0xe9, 0x7a, 0x4b, 0x18, 0x91, 0xdb, 0x14}
typedef struct {
uint32_t cmd;
uint32_t data[1];
}s_cmd_t;
typedef enum {
PS_CMD_IDLE = 0,
PS_CMD_INLINE_START =PS_CMD_IDLE,
PS_CMD_TASK_ALLOC,
PS_CMD_TASK_FREE,
PS_CMD_LOOPBACK_TEST,
PS_CMD_REPORT_CONFIG,
PS_CMD_LOG_CONFIG,
PS_CMD_HEART_BEAT_REQ,
PS_CMD_LOAD_MINITOR_REQ,
PS_CMD_FE_CONFIG,
PS_CMD_BE_CONFIG,
PS_CMD_ALGO_CONFIG,
PS_CMD_TASK_START,
PS_CMD_TASK_STOP,
PS_CMD_DATA_MOVE,
PS_CMD_DSP_IP_TEST,
PS_CMD_BE_ASSGIN_BUF,
PS_CMD_ALGO_LOAD,
}ECOMMON_CMD;
enum cmd_type{
CMD_SETUP,
CMD_RELEASE,
CMD_INVALID,
};
struct report_config_msg{
enum cmd_type flag;
int32_t report_id;
char task[TASK_NAME_LINE];
uint32_t size;
uint64_t addr;
};
struct data_move_msg{
uint64_t src_addr;
uint64_t dst_addr;
uint32_t size;
};
struct csi_dsp_task_start_req{
int task_id;
char task_ns[TASK_NAME_LINE];
};
struct csi_dsp_task_create_resp{
csi_dsp_status_e status;
char task_ns[TASK_NAME_LINE];
int task_id;
};
struct csi_dsp_task_free_req{
int task_id;
char task_ns[TASK_NAME_LINE];
};
struct csi_dsp_ip_test_par{
char case_name[32];
char case_goup[32];
int result_buf_size;
};
// struct csi_dsp_algo_config_par{
// uint16_t algo_id;
// char* algo;
// union
// {
// float gam_coef[4];
// short beta_coef[4];
// };
// };
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -0,0 +1,612 @@
/*
* Copyright (c) 2016 - 2017 Cadence Design Systems Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/*!
* \file xrp_api.h
* \brief This section defines XRP API.
*
* General API properties:
* - All status pointers can be NULL.
* - Reference counting is not meant to work across host/DSP boundary, i.e.
* DSP may not retain the host buffer.
* - A buffer allocated for one device can be passed as command parameter to
* a different device; implementation should do reasonable thing, e.g. use
* the original data if possible or transparently migrate it to suitable
* memory.
* - A group of API calls may be host side only, DSP side only, or usable on
* both sides. When it's usable on both sides there may be additional
* restrictions on the DSP side.
*/
#ifndef _XRP_API_H
#define _XRP_API_H
#include <stddef.h>
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* User API.
*/
struct xrp_device;
struct xrp_queue;
struct xrp_buffer;
struct xrp_buffer_group;
struct xrp_event;
struct xrp_report;
/*!
* Status codes of XRP calls.
*/
enum xrp_status {
/*! Call completed successfully. */
XRP_STATUS_SUCCESS,
/*! Call failed. */
XRP_STATUS_FAILURE,
/*! Call has not completed. */
XRP_STATUS_PENDING,
};
enum xrp_access_flags {
XRP_READ = 0x1,
XRP_WRITE = 0x2,
XRP_READ_WRITE = 0x3,
};
/*!
* Types of information that may be queried for a buffer object.
*/
enum xrp_buffer_info {
/*! Size of the buffer. */
XRP_BUFFER_SIZE_SIZE_T,
/*! Host pointer of the buffer. */
XRP_BUFFER_HOST_POINTER_PTR,
XRP_BUFFER_PHY_ADDR,
XRP_BUFFER_USER_ADDR,
};
/*!
* Types of information that may be queried for a buffer group object.
*/
enum xrp_buffer_group_info {
/*! Access flags associated with a buffer. Requires buffer index. */
XRP_BUFFER_GROUP_BUFFER_FLAGS_ENUM,
/*! Number of buffers in the buffer group. Buffer index is ignored. */
XRP_BUFFER_GROUP_SIZE_SIZE_T,
};
#define XRP_NAMESPACE_ID_SIZE 16
/*!
* \defgroup device_api Device API
* These calls are available on the host side and on the DSP side with the
* following restriction:
* - only device 0 may be opened.
* @{
*/
/*!
* Open device by index.
* A device is reference counted and is opened with reference count of 1.
* Devices are numbered sequentially starting at 0, they can be probed with
* simple loop.
* \param idx: device index to open
* \param[out] status: operation status
* \return pointer to the opened device or NULL in case of error
*/
struct xrp_device *xrp_open_device(int idx, enum xrp_status *status);
/*!
* Increment device reference count.
*/
void xrp_retain_device(struct xrp_device *device);
/*!
* Decrement device reference count (and free associated resources once the
* counter gets down to zero).
*/
void xrp_release_device(struct xrp_device *device);
/*!
* @}
*/
/*!
* \defgroup buffer_api Buffer API
* These calls are available on the host side and on the DSP side with the
* following restriction:
* - buffers may not be created on the DSP side.
* @{
*/
/*!
* Create memory buffer and allocate device-specific storage (host_ptr == NULL)
* or use host buffer (host_ptr != NULL, treated as virtual address in the
* current process).
* A buffer is reference counted and is created with reference count of 1.
* \param[out] status: operation status
*/
struct xrp_buffer *xrp_create_buffer(struct xrp_device *device,
size_t size, void *host_ptr,
enum xrp_status *status);
/*!
* Increment buffer reference count.
*/
void xrp_retain_buffer(struct xrp_buffer *buffer);
/*!
* Decrement buffer reference count (and free the storage if it was allocated
* once the counter gets down to zero).
*/
void xrp_release_buffer(struct xrp_buffer *buffer);
/*!
* Map subbuffer of the buffer. Buffer may be mapped multiple times.
*
* \param map_flags: access to the mapping requested by the mapper. Access
* to buffers on DSP side is subject to restrictions set by the host side.
* \param[out] status: operation status
*/
void *xrp_map_buffer(struct xrp_buffer *buffer, size_t offset, size_t size,
enum xrp_access_flags map_flags, enum xrp_status *status);
/*!
* Unmap previously mapped buffer.
* \param[out] status: operation status
*/
void xrp_unmap_buffer(struct xrp_buffer *buffer, void *p,
enum xrp_status *status);
/*!
* Get information about the buffer object.
*
* \param info: information type to retrieve.
* \param[out] out: pointer to return information to.
* \param out_sz: size of out buffer.
* \param[out] status: operation status
*/
void xrp_buffer_get_info(struct xrp_buffer *buffer, enum xrp_buffer_info info,
void *out, size_t out_sz, enum xrp_status *status);
/*!
* @}
*/
/*!
* \defgroup buffer_group_api Buffer Group API
* These calls are available on the host side and on the DSP side with the
* following restrictions:
* - buffer groups may not be created on the DSP side;
* - existing buffer groups may not be modified on the DSP side.
* @{
*/
/*!
* Create a group of shared buffers. Group is reference counted and is
* created with reference count of 1.
* \param[out] status: operation status
*/
struct xrp_buffer_group *xrp_create_buffer_group(enum xrp_status *status);
/*!
* Increment buffer group reference count.
*/
void xrp_retain_buffer_group(struct xrp_buffer_group *group);
/*!
* Decrement group reference count (and free it once the counter gets down
* to zero).
*/
void xrp_release_buffer_group(struct xrp_buffer_group *group);
/*!
* Add buffer to the group and get its index.
* This adds a reference to the buffer.
*
* \param access_flags: granted access. User of the buffer on the DSP side
* will be able to map it only for this type of access.
* \param[out] status: operation status
*/
size_t xrp_add_buffer_to_group(struct xrp_buffer_group *group,
struct xrp_buffer *buffer,
enum xrp_access_flags access_flags,
enum xrp_status *status);
/*!
* Put new buffer to the existing index in the group.
* When operation succeeds it releases the buffer previously contained at
* that index and adds a reference to the new buffer.
*
* \param access_flags: granted access. User of the buffer on the DSP side
* will be able to map it only for this type of access.
* \param[out] status: operation status
*/
void xrp_set_buffer_in_group(struct xrp_buffer_group *group,
size_t index,
struct xrp_buffer *buffer,
enum xrp_access_flags access_flags,
enum xrp_status *status);
/*!
* Get buffer from the group by its index.
* Buffer must be freed with release_buffer.
* \param[out] status: operation status
*/
struct xrp_buffer *xrp_get_buffer_from_group(struct xrp_buffer_group *group,
size_t idx,
enum xrp_status *status);
/*!
* Get information about the buffer group object.
*
* \param info: information type to retrieve.
* \param idx: buffer index (if applicable).
* \param[out] out: pointer to return information to.
* \param out_sz: size of out buffer.
* \param[out] status: operation status
*/
void xrp_buffer_group_get_info(struct xrp_buffer_group *group,
enum xrp_buffer_group_info info, size_t idx,
void *out, size_t out_sz,
enum xrp_status *status);
/*!
* @}
*/
/*!
* \defgroup queue_api Queue API
* These calls are available only on the host side.
* @{
*/
/*!
* Create queue to the default namespace of the device.
* Queue is an ordered device communication channel. Queue is reference
* counted and is created with reference count of 1.
* \param[out] status: operation status
*/
struct xrp_queue *xrp_create_queue(struct xrp_device *device,
enum xrp_status *status);
/*!
* Create queue to the specified namespace of the device.
* Queue is an ordered device communication channel. Queue is reference
* counted and is created with reference count of 1.
* \param[out] status: operation status
*/
struct xrp_queue *xrp_create_ns_queue(struct xrp_device *device,
const void *nsid,
enum xrp_status *status);
/*!
* Create queue to the specified namespace of the device with specific
* priority.
* Queue is an ordered device communication channel. Queue is reference
* counted and is created with reference count of 1.
* \param[out] status: operation status
*/
struct xrp_queue *xrp_create_nsp_queue(struct xrp_device *device,
const void *nsid,
int priority,
enum xrp_status *status);
/*!
* Increment queue reference count.
*/
void xrp_retain_queue(struct xrp_queue *queue);
/*!
* Decrement queue reference count (and free it once the counter gets down
* to zero).
*/
void xrp_release_queue(struct xrp_queue *queue);
/*!
* @}
*/
/*!
* \defgroup event_api Event API
* These calls are available only on the host side.
* @{
*/
/*!
* Increment event reference count.
*/
void xrp_retain_event(struct xrp_event *event);
/*!
* Decrement event reference count (and free it once the counter gets down
* to zero).
*/
void xrp_release_event(struct xrp_event *event);
/*!
* Get status of the event/associated command.
* The function may be called at any time, it sets *status to
* XRP_STATUS_PENDING if the command has not been executed yet, or to the
* command execution status. See status description of xrp_run_command_sync()
* for the description of command execution status.
* \param[out] status: operation status
*/
void xrp_event_status(struct xrp_event *event, enum xrp_status *status);
/*!
* @}
*/
/*!
* \defgroup communication_api Communication API
* These calls are available only on the host side.
* @{
*/
/*
* Even more internal API related to command passing between cores.
* These are tightly coupled to the host-DSP communication model and
* are likely to be changed/enhanced as the model evolves.
*/
/*!
* Synchronously send command from host to DSP.
*
* When this is invoked on the host it synchronously runs a command on DSP,
* passing a group of shared buffers and two additional (small) buffers
* with opaque command description (in_data) and results (out_data).
*
* in_data is used at the function call and is not referenced afterwards.
* out_data is updated with the value returned by DSP before the function
* returns.
*
* Optimal processing is guaranteed for in_data and out_data buffers not
* exceeding 16 bytes in size. Larger buffers may require additional data
* copying depending on the implementation.
*
* status is the result of command execution. Command execution is
* successful if the command was delivered to the DSP and the response was
* delivered back. Otherwise the command execution has failed. IOW execution
* success means that the out_data contains command-specific response received
* from the DSP, execution failure means that out_data does not contain useful
* information.
*
* \param[out] status: operation status
*/
void xrp_run_command_sync(struct xrp_queue *queue,
const void *in_data, size_t in_data_size,
void *out_data, size_t out_data_size,
struct xrp_buffer_group *buffer_group,
enum xrp_status *status);
/*!
* Asynchronously send command from host to DSP.
*
* When this is invoked on the host it queues a command to DSP,
* passing a group of shared buffers and two additional (small) buffers
* with opaque command description (in_data) and results (out_data).
*
* in_data is used at the function call and is not referenced afterwards.
* out_data must stay valid after this function call until command completion,
* at which point it is updated with the value returned by DSP.
*
* Optimal processing is guaranteed for in_data and out_data buffers not
* exceeding 16 bytes in size. Larger buffers may require additional data
* copying depending on the implementation.
*
* If event is non-NULL then a pointer to an event corresponding to the
* queued command is returned. This event can be waited for with xrp_wait,
* it is signaled when the command execution is complete.
* The returned event object is reference counted and is created with
* reference count of 1.
*
* status is the result of command enqueuing. Command enqueuing is
* successful if the command was enqueued on the host side and an associated
* event has been returned (if requested). Otherwise the command enqueuing has
* failed. IOW enqueuing success means that if event is non-NULL then *event
* contains valid event, enqueuing failure means that *event does not contain
* useful information.
*
* \param[out] status: operation status
*/
void xrp_enqueue_command(struct xrp_queue *queue,
const void *in_data, size_t in_data_size,
void *out_data, size_t out_data_size,
struct xrp_buffer_group *buffer_group,
struct xrp_event **event,
enum xrp_status *status);
/*!
* Wait for the event.
* Waiting for already signaled event completes immediately.
* Successful completion of this function does not alter the event state,
* i.e. the event remains signaled.
* status is the result of waiting, not the result of the command execution.
* Use xrp_event_status() to get the command execution status.
* \param[out] status: operation status
*/
void xrp_wait(struct xrp_event *event, enum xrp_status *status);
/*!
* Wait for any event in the group.
* Waiting for a group with already signaled event completes immediately.
* Successful completion of this function does not alter the event state,
* i.e. signaled events remain signaled.
* status is the result of waiting, not the result of the command execution.
* Use xrp_event_status() with individual events to get the corresponding
* command execution status.
*
* \param[in] event: an array of pointers to events to wait for
* \param[i] n_events: number of events in the events array
* \param[out] status: operation status
* \return index of a completed event in the event array
*/
size_t xrp_wait_any(struct xrp_event **event, size_t n_events,
enum xrp_status *status);
int xrp_add_report_item_with_id(struct xrp_report *report,
int (*cb)(void*context,void*data),
int report_id,
void* context,
size_t data_size);
int xrp_add_report_item(struct xrp_report *report,
int (*cb)(void*context,void*data),
void* context,
size_t data_size);
void xrp_remove_report_item(struct xrp_report *report,int report_id);
struct xrp_report *xrp_create_reporter(struct xrp_device *device,size_t size);
int xrp_release_reporter(struct xrp_device *device,struct xrp_report *report);
void xrp_import_dma_buf(struct xrp_device *device, int fd,enum xrp_access_flags flag ,uint64_t *phy_addr,
uint64_t *user_addr,size_t* size,enum xrp_status *status);
void xrp_release_dma_buf(struct xrp_device *device, int fd,enum xrp_status *status);
void xrp_flush_dma_buf(struct xrp_device *device, int fd,enum xrp_access_flags flag ,enum xrp_status *status);
/*!
* @}
*/
/*!
* \defgroup dsp_specific_api DSP-specific Interface (Library-Style)
* These calls are available only on the DSP side.
* @{
*/
/*!
* Check if there's a command from the host in the hardware queue.
* Returns XRP_STATUS_PENDING if the queue is empty or XRP_STATUS_SUCCESS
* if there is a command ready for processing.
*
* The check is quick and may be issued in any context.
*/
enum xrp_status xrp_device_poll(struct xrp_device *device);
/*!
* Check if there's a command from the host in the hardware queue and invoke
* command handler if there's one.
* Returns XRP_STATUS_PENDING if the queue is empty, or the status returned by
* the command handler.
*/
enum xrp_status xrp_device_dispatch(struct xrp_device *device);
/*!
* Function type for command handler.
*
* This callback is called on the DSP side to process queued command.
* in_data, out_data and buffer_group correspond to the same parameters of the
* host side API calls.
*
* On return from this function buffer group and individual buffer reference
* counters shall be restored to their entry values. out_data buffer shall be
* updated with command return value.
* Neither in_data nor out_data may be referenced after this function returns.
*
* Return value shall describe whether xrp_command_handler itself was
* successful or not, not the command it was requested to run.
* I.e. if the command was not recognized or its handler could not be called
* due to insufficient memory, that's XRP_STATUS_FAILURE returned in status.
* The host will also receive XRP_STATUS_FAILURE as a completion status.
* If the command was run that's XRP_STATUS_SUCCESS regardless of the
* command-specific status, which should be returned in out_data.
*
* \param handler_context: context that was passed to the
* xrp_device_register_namespace
*/
typedef enum xrp_status
(xrp_command_handler)(void *handler_context,
const void *in_data, size_t in_data_size,
void *out_data, size_t out_data_size,
struct xrp_buffer_group *buffer_group);
/*!
* Register namespace handler.
*
* There may be only one handler for a namespace, second attempt to register
* a handler for the same namespace will fail.
*
* \param device: device for which namespace handler is registered
* \param nsid: namespace identifier, XRP_NAMESPACE_ID_SIZE bytes long
* \param handler: pointer to the handler function
* \param handler_context: first argument that will be passed to the handler
* function
* \param[out] status: operation status
*/
void xrp_device_register_namespace(struct xrp_device *device,
const void *nsid,
xrp_command_handler *handler,
void *handler_context,
enum xrp_status *status);
/*!
* Unregister namespace handler.
*
* Only registered namespace handler may be unregistered.
*
* \param device: device for which namespace handler is registered
* \param nsid: namespace identifier, XRP_NAMESPACE_ID_SIZE bytes long
* \param[out] status: operation status
*/
void xrp_device_unregister_namespace(struct xrp_device *device,
const void *nsid,
enum xrp_status *status);
/*!
* Enable or disable shared memory cache management.
* Note that this call does not change memory caching attributes, it only
* enables flushing and invalidating used regions of shared memory in the
* XRP code.
*
* \param device: device for which shared memory cache management state is
* changed
* \param enable: whether cache management shall be enabled (non-zero) or
* disabled (0)
*/
void xrp_device_enable_cache(struct xrp_device *device, int enable);
/*!
* @}
*/
/*!
* Helper function that terminates fast simulation.
*/
void xrp_exit(void);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -0,0 +1,50 @@
../xrp-common/libxrp_host_single_a-xrp_ns.o: ../xrp-common/xrp_ns.c \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/inttypes.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/stdint.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/yvals.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/c99/yvals.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/config/core-isa.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/lib/xcc/include/stdarg.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/stdlib.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/c99/stdlib.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/alloca.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/string.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/c99/string.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/tie/xt_scmpr.h \
../xrp-common/xrp_debug.h ../xrp-common/xrp_ns.h ../xrp_api.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/stddef.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/c99/stddef.h
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/inttypes.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/stdint.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/yvals.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/c99/yvals.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/config/core-isa.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/lib/xcc/include/stdarg.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/stdlib.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/c99/stdlib.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/alloca.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/string.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/c99/string.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/tie/xt_scmpr.h:
../xrp-common/xrp_debug.h:
../xrp-common/xrp_ns.h:
../xrp_api.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/stddef.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/c99/stddef.h:

View File

@@ -0,0 +1,50 @@
xrp_ns.o: xrp_ns.c \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/inttypes.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/stdint.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/yvals.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/c99/yvals.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/config/core-isa.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/lib/xcc/include/stdarg.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/stdlib.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/c99/stdlib.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/alloca.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/string.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/c99/string.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/tie/xt_scmpr.h \
xrp_debug.h xrp_ns.h ../xrp_api.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/stddef.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/c99/stddef.h
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/inttypes.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/stdint.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/yvals.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/c99/yvals.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/config/core-isa.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/lib/xcc/include/stdarg.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/stdlib.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/c99/stdlib.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/alloca.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/string.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/c99/string.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/tie/xt_scmpr.h:
xrp_debug.h:
xrp_ns.h:
../xrp_api.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/stddef.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/c99/stddef.h:

View File

@@ -0,0 +1,37 @@
xrp_rb_file.o: xrp_rb_file.c \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/string.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/c99/string.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/c99/yvals.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/config/core-isa.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/lib/xcc/include/stdarg.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/tie/xt_scmpr.h \
xrp_rb_file.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/stddef.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/c99/stddef.h \
xrp_types.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/stdint.h \
../xrp-kernel/xrp_ring_buffer.h
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/string.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/c99/string.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/c99/yvals.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/config/core-isa.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/lib/xcc/include/stdarg.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/tie/xt_scmpr.h:
xrp_rb_file.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/stddef.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/c99/stddef.h:
xrp_types.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/stdint.h:
../xrp-kernel/xrp_ring_buffer.h:

View File

View File

@@ -0,0 +1,39 @@
##
# Copyright (C) 2021 Alibaba Group Holding Limited
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
##
TARGET = libxrp-common.a
CFLAGS = -O0 -Wall -g -lm
CFLAGS += -fPIC
xrp_SRCS += xrp_rb_file.c
xrp_SRCS += xrp_ns.c
INCLUDES = -I$(CURDIR) -I../include -I../../xrp-kernel
# object files will be generated from .c sourcefiles
xrp_OBJS = $(notdir $(xrp_SRCS:.c=.o))
all: $(TARGET)
$(xrp_OBJS): $(xrp_SRCS)
$(CC) -c $(CFLAGS) $(INCLUDES) $(xrp_SRCS)
$(TARGET): $(xrp_OBJS)
$(AR) -rc $(TARGET) $(xrp_OBJS)
clean:
rm -f *.o *.a
rm -rf output
install:
.PHONY: clean all prepare common

View File

@@ -0,0 +1,31 @@
#
# Copyright (c) 2018 Cadence Design Systems Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
AM_CPPFLAGS = -I$(srcdir)/.. \
-I$(srcdir)/../xrp-kernel
AM_CFLAGS = -W -Wall
lib_LIBRARIES = libxrp-common.a
libxrp_common_a_SOURCES = xrp_rb_file.c \
xrp_ns.c

View File

@@ -0,0 +1,657 @@
# Makefile.in generated by automake 1.16.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2018 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
#
# Copyright (c) 2018 Cadence Design Systems Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
VPATH = @srcdir@
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = xrp-common
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
am__install_max = 40
am__nobase_strip_setup = \
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
am__nobase_strip = \
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
am__nobase_list = $(am__nobase_strip_setup); \
for p in $$list; do echo "$$p $$p"; done | \
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
if (++n[$$2] == $(am__install_max)) \
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
END { for (dir in files) print dir, files[dir] }'
am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
am__uninstall_files_from_dir = { \
test -z "$$files" \
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
$(am__cd) "$$dir" && rm -f $$files; }; \
}
am__installdirs = "$(DESTDIR)$(libdir)"
LIBRARIES = $(lib_LIBRARIES)
ARFLAGS = cru
AM_V_AR = $(am__v_AR_@AM_V@)
am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@)
am__v_AR_0 = @echo " AR " $@;
am__v_AR_1 =
libxrp_common_a_AR = $(AR) $(ARFLAGS)
libxrp_common_a_LIBADD =
am_libxrp_common_a_OBJECTS = xrp_rb_file.$(OBJEXT) xrp_ns.$(OBJEXT)
libxrp_common_a_OBJECTS = $(am_libxrp_common_a_OBJECTS)
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@
depcomp = $(SHELL) $(top_srcdir)/autoconf/depcomp
am__maybe_remake_depfiles = depfiles
am__depfiles_remade = ./$(DEPDIR)/xrp_ns.Po ./$(DEPDIR)/xrp_rb_file.Po
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
AM_V_CC = $(am__v_CC_@AM_V@)
am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
am__v_CC_0 = @echo " CC " $@;
am__v_CC_1 =
CCLD = $(CC)
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
AM_V_CCLD = $(am__v_CCLD_@AM_V@)
am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
am__v_CCLD_0 = @echo " CCLD " $@;
am__v_CCLD_1 =
SOURCES = $(libxrp_common_a_SOURCES)
DIST_SOURCES = $(libxrp_common_a_SOURCES)
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
# *not* preserved.
am__uniquify_input = $(AWK) '\
BEGIN { nonempty = 0; } \
{ items[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in items) print i; }; } \
'
# Make sure the list of sources is unique. This is necessary because,
# e.g., the same source file might be shared among _SOURCES variables
# for different programs/libraries.
am__define_uniq_tagged_files = \
list='$(am__tagged_files)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/autoconf/depcomp
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCAS = @CCAS@
CCASDEPMODE = @CCASDEPMODE@
CCASFLAGS = @CCASFLAGS@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DSP_CACHEATTR = @DSP_CACHEATTR@
DSP_COMM_BASE = @DSP_COMM_BASE@
DSP_LSP = @DSP_LSP@
DTC = @DTC@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
GREP = @GREP@
HOST_CACHEATTR = @HOST_CACHEATTR@
HOST_LSP = @HOST_LSP@
HOST_OS = @HOST_OS@
HW_PORT = @HW_PORT@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBFDT_CPPFLAGS = @LIBFDT_CPPFLAGS@
LIBFDT_LDFLAGS = @LIBFDT_LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
THREADS_CFLAGS = @THREADS_CFLAGS@
THREADS_IMPL = @THREADS_IMPL@
THREADS_LDFLAGS = @THREADS_LDFLAGS@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
AM_CPPFLAGS = -I$(srcdir)/.. \
-I$(srcdir)/../xrp-kernel
AM_CFLAGS = -W -Wall
lib_LIBRARIES = libxrp-common.a
libxrp_common_a_SOURCES = xrp_rb_file.c \
xrp_ns.c
all: all-am
.SUFFIXES:
.SUFFIXES: .c .o .obj
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign xrp-common/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign xrp-common/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
install-libLIBRARIES: $(lib_LIBRARIES)
@$(NORMAL_INSTALL)
@list='$(lib_LIBRARIES)'; test -n "$(libdir)" || list=; \
list2=; for p in $$list; do \
if test -f $$p; then \
list2="$$list2 $$p"; \
else :; fi; \
done; \
test -z "$$list2" || { \
echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \
$(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \
echo " $(INSTALL_DATA) $$list2 '$(DESTDIR)$(libdir)'"; \
$(INSTALL_DATA) $$list2 "$(DESTDIR)$(libdir)" || exit $$?; }
@$(POST_INSTALL)
@list='$(lib_LIBRARIES)'; test -n "$(libdir)" || list=; \
for p in $$list; do \
if test -f $$p; then \
$(am__strip_dir) \
echo " ( cd '$(DESTDIR)$(libdir)' && $(RANLIB) $$f )"; \
( cd "$(DESTDIR)$(libdir)" && $(RANLIB) $$f ) || exit $$?; \
else :; fi; \
done
uninstall-libLIBRARIES:
@$(NORMAL_UNINSTALL)
@list='$(lib_LIBRARIES)'; test -n "$(libdir)" || list=; \
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
dir='$(DESTDIR)$(libdir)'; $(am__uninstall_files_from_dir)
clean-libLIBRARIES:
-test -z "$(lib_LIBRARIES)" || rm -f $(lib_LIBRARIES)
libxrp-common.a: $(libxrp_common_a_OBJECTS) $(libxrp_common_a_DEPENDENCIES) $(EXTRA_libxrp_common_a_DEPENDENCIES)
$(AM_V_at)-rm -f libxrp-common.a
$(AM_V_AR)$(libxrp_common_a_AR) libxrp-common.a $(libxrp_common_a_OBJECTS) $(libxrp_common_a_LIBADD)
$(AM_V_at)$(RANLIB) libxrp-common.a
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xrp_ns.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xrp_rb_file.Po@am__quote@ # am--include-marker
$(am__depfiles_remade):
@$(MKDIR_P) $(@D)
@echo '# dummy' >$@-t && $(am__mv) $@-t $@
am--depfiles: $(am__depfiles_remade)
.c.o:
@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
.c.obj:
@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
ID: $(am__tagged_files)
$(am__define_uniq_tagged_files); mkid -fID $$unique
tags: tags-am
TAGS: tags
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
set x; \
here=`pwd`; \
$(am__define_uniq_tagged_files); \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: ctags-am
CTAGS: ctags
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
$(am__define_uniq_tagged_files); \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
cscopelist: cscopelist-am
cscopelist-am: $(am__tagged_files)
list='$(am__tagged_files)'; \
case "$(srcdir)" in \
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
*) sdir=$(subdir)/$(srcdir) ;; \
esac; \
for i in $$list; do \
if test -f "$$i"; then \
echo "$(subdir)/$$i"; \
else \
echo "$$sdir/$$i"; \
fi; \
done >> $(top_builddir)/cscope.files
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(LIBRARIES)
installdirs:
for dir in "$(DESTDIR)$(libdir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic clean-libLIBRARIES mostlyclean-am
distclean: distclean-am
-rm -f ./$(DEPDIR)/xrp_ns.Po
-rm -f ./$(DEPDIR)/xrp_rb_file.Po
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am:
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am: install-libLIBRARIES
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man:
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f ./$(DEPDIR)/xrp_ns.Po
-rm -f ./$(DEPDIR)/xrp_rb_file.Po
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-libLIBRARIES
.MAKE: install-am install-strip
.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
clean-generic clean-libLIBRARIES cscopelist-am ctags ctags-am \
distclean distclean-compile distclean-generic distclean-tags \
distdir dvi dvi-am html html-am info info-am install \
install-am install-data install-data-am install-dvi \
install-dvi-am install-exec install-exec-am install-html \
install-html-am install-info install-info-am \
install-libLIBRARIES install-man install-pdf install-pdf-am \
install-ps install-ps-am install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \
uninstall-am uninstall-libLIBRARIES
.PRECIOUS: Makefile
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

View File

@@ -0,0 +1,38 @@
/*
* Copyright (c) 2016 - 2018 Cadence Design Systems Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef _XRP_DEBUG_H
#define _XRP_DEBUG_H
#ifdef DEBUG
#include <stdio.h>
#define pr_debug printf
#else
static inline int pr_debug(const char *p, ...)
{
(void)p;
return 0;
}
#endif
#endif

View File

@@ -0,0 +1,201 @@
/*
* Copyright (c) 2016 - 2018 Cadence Design Systems Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <inttypes.h>
#include <stdlib.h>
#include <string.h>
#include "xrp_debug.h"
#include "xrp_ns.h"
static int compare_cmd_ns(const void *nsid, struct xrp_cmd_ns *cmd_ns)
{
return memcmp(nsid, cmd_ns->id, sizeof(cmd_ns->id));
}
int xrp_cmd_ns_match(const void *nsid, struct xrp_cmd_ns *cmd_ns)
{
return cmd_ns && compare_cmd_ns(nsid, cmd_ns) == 0;
}
#ifdef DEBUG
static void dump_nsid(const void *p)
{
const uint8_t *id = p;
printf("%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x",
id[0], id[1], id[2], id[3],
id[4], id[5],
id[6], id[7],
id[8], id[9],
id[10], id[11], id[12], id[13], id[14], id[15]);
}
static void dump_cmd_ns(const struct xrp_cmd_ns *cmd_ns)
{
if (cmd_ns) {
dump_nsid(cmd_ns->id);
printf(" -> %p(%p)", cmd_ns->handler, cmd_ns->handler_context);
} else {
printf("NULL");
}
}
static void dump_cmd_ns_map(const struct xrp_cmd_ns_map *ns_map)
{
size_t i;
printf("n_cmd_ns: %zu, size_cmd_ns: %zu\n",
ns_map->n_cmd_ns, ns_map->size_cmd_ns);
for (i = 0; i < ns_map->n_cmd_ns; ++i) {
printf(" ");
dump_cmd_ns(ns_map->cmd_ns + i);
printf("\n");
}
}
#else
static void dump_nsid(const void *p)
{
(void)p;
}
static void dump_cmd_ns(const struct xrp_cmd_ns *cmd_ns)
{
(void)cmd_ns;
}
static void dump_cmd_ns_map(const struct xrp_cmd_ns_map *ns_map)
{
(void)ns_map;
}
#endif
static int cmd_ns_present(struct xrp_cmd_ns_map *ns_map,
struct xrp_cmd_ns *cmd_ns)
{
return cmd_ns >= ns_map->cmd_ns &&
cmd_ns < ns_map->cmd_ns + ns_map->n_cmd_ns;
}
struct xrp_cmd_ns *xrp_find_cmd_ns(struct xrp_cmd_ns_map *ns_map,
const void *id)
{
size_t a = 0;
size_t b = ns_map->n_cmd_ns;
struct xrp_cmd_ns *p;
pr_debug("%s: ", __func__);
dump_nsid(id);
pr_debug("\n");
while (b - a > 1) {
size_t c = (a + b) / 2;
pr_debug("a: %zu, b:%zu, c: %zu\n", a, b, c);
p = ns_map->cmd_ns + c;
if (compare_cmd_ns(id, p) < 0)
b = c;
else
a = c;
pr_debug("...a: %zu, b:%zu\n", a, b);
}
p = ns_map->cmd_ns + a;
if (a < b && compare_cmd_ns(id, p) > 0)
++p;
if (cmd_ns_present(ns_map, p)) {
pr_debug("%s: found: ", __func__);
dump_cmd_ns(p);
pr_debug("\n");
} else {
pr_debug("%s: not found\n", __func__);
}
return p;
}
static struct xrp_cmd_ns *insert_cmd_ns(struct xrp_cmd_ns_map *ns_map,
struct xrp_cmd_ns *cmd_ns)
{
size_t i = cmd_ns - ns_map->cmd_ns;
if (ns_map->n_cmd_ns == ns_map->size_cmd_ns) {
size_t new_size = (ns_map->size_cmd_ns + 1) * 2;
void *new_cmd_ns = realloc(ns_map->cmd_ns,
new_size * sizeof(*ns_map->cmd_ns));
if (!new_cmd_ns)
return NULL;
ns_map->cmd_ns = new_cmd_ns;
ns_map->size_cmd_ns = new_size;
cmd_ns = ns_map->cmd_ns + i;
}
memmove(cmd_ns + 1, cmd_ns,
sizeof(*cmd_ns) * (ns_map->n_cmd_ns - i));
++ns_map->n_cmd_ns;
return cmd_ns;
}
static void remove_cmd_ns(struct xrp_cmd_ns_map *ns_map,
struct xrp_cmd_ns *cmd_ns)
{
size_t i = cmd_ns - ns_map->cmd_ns;
memmove(cmd_ns, cmd_ns + 1,
sizeof(*cmd_ns) * (ns_map->n_cmd_ns - i - 1));
--ns_map->n_cmd_ns;
}
int xrp_register_namespace(struct xrp_cmd_ns_map *ns_map,
const void *nsid,
xrp_command_handler *handler,
void *handler_context)
{
struct xrp_cmd_ns *cmd_ns = xrp_find_cmd_ns(ns_map, nsid);
if (cmd_ns_present(ns_map, cmd_ns) && xrp_cmd_ns_match(nsid, cmd_ns)) {
return 0;
} else {
cmd_ns = insert_cmd_ns(ns_map, cmd_ns);
if (cmd_ns) {
memcpy(cmd_ns->id, nsid, sizeof(cmd_ns->id));
cmd_ns->handler = handler;
cmd_ns->handler_context = handler_context;
dump_cmd_ns_map(ns_map);
return 1;
} else {
return 0;
}
}
}
int xrp_unregister_namespace(struct xrp_cmd_ns_map *ns_map,
const void *nsid)
{
struct xrp_cmd_ns *cmd_ns = xrp_find_cmd_ns(ns_map, nsid);
if (cmd_ns_present(ns_map, cmd_ns) && xrp_cmd_ns_match(nsid, cmd_ns)) {
remove_cmd_ns(ns_map, cmd_ns);
dump_cmd_ns_map(ns_map);
return 1;
} else {
return 0;
}
}

View File

@@ -0,0 +1,52 @@
/*
* Copyright (c) 2016 - 2018 Cadence Design Systems Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef _XRP_NS_H
#define _XRP_NS_H
#include <xrp_api.h>
struct xrp_cmd_ns {
char id[XRP_NAMESPACE_ID_SIZE];
xrp_command_handler *handler;
void *handler_context;
};
struct xrp_cmd_ns_map {
size_t n_cmd_ns;
size_t size_cmd_ns;
struct xrp_cmd_ns *cmd_ns;
};
int xrp_register_namespace(struct xrp_cmd_ns_map *ns_map,
const void *nsid,
xrp_command_handler *handler,
void *handler_context);
int xrp_unregister_namespace(struct xrp_cmd_ns_map *ns_map,
const void *nsid);
int xrp_cmd_ns_match(const void *nsid, struct xrp_cmd_ns *cmd_ns);
struct xrp_cmd_ns *xrp_find_cmd_ns(struct xrp_cmd_ns_map *ns_map,
const void *id);
#endif

View File

@@ -0,0 +1,71 @@
/*
* Copyright (c) 2018 Cadence Design Systems Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <string.h>
#include "xrp_rb_file.h"
static size_t xrp_rb_write_some(void *cookie, const void *buf, size_t size)
{
volatile struct xrp_ring_buffer *rb = cookie;
uint32_t read = rb->read;
uint32_t write = rb->write;
size_t tail;
if (read > write) {
tail = read - 1 - write;
} else if (read) {
tail = rb->size - write;
} else {
tail = rb->size - 1 - write;
}
if (size < tail)
tail = size;
memcpy((char *)rb->data + write, buf, tail);
write += tail;
if (write == rb->size)
write = 0;
rb->write = write;
return tail;
}
size_t xrp_rb_write(void *cookie, const void *buf, size_t size)
{
size_t write_total = 0;
const char *p = buf;
while (size) {
size_t write = xrp_rb_write_some(cookie, p, size);
if (write == 0)
break;
p += write;
size -= write;
write_total += write;
}
return write_total;
}

View File

@@ -0,0 +1,33 @@
/*
* Copyright (c) 2018 Cadence Design Systems Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef XRP_RB_FILE_H
#define XRP_RB_FILE_H
#include <stddef.h>
#include <xrp_types.h>
#include <xrp_ring_buffer.h>
size_t xrp_rb_write(void *cookie, const void *buf, size_t size);
#endif

View File

@@ -0,0 +1,39 @@
/*
* Copyright (c) 2018 Cadence Design Systems Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef XRP_TYPES_H
#define XRP_TYPES_H
#include <stdint.h>
#ifndef HAVE___U8
typedef uint8_t __u8;
#endif
#ifndef HAVE___U32
typedef uint32_t __u32;
#endif
#ifndef HAVE___U64
typedef uint64_t __u64;
#endif
#endif

View File

@@ -0,0 +1,228 @@
libxrp_host_hosted_a-xrp_host_common.o: xrp_host_common.c \
/usr/include/stdc-predef.h \
/usr/lib/gcc/x86_64-linux-gnu/7/include/stdint.h /usr/include/stdint.h \
/usr/include/x86_64-linux-gnu/bits/libc-header-start.h \
/usr/include/features.h /usr/include/x86_64-linux-gnu/sys/cdefs.h \
/usr/include/x86_64-linux-gnu/bits/wordsize.h \
/usr/include/x86_64-linux-gnu/bits/long-double.h \
/usr/include/x86_64-linux-gnu/gnu/stubs.h \
/usr/include/x86_64-linux-gnu/gnu/stubs-64.h \
/usr/include/x86_64-linux-gnu/bits/types.h \
/usr/include/x86_64-linux-gnu/bits/typesizes.h \
/usr/include/x86_64-linux-gnu/bits/wchar.h \
/usr/include/x86_64-linux-gnu/bits/stdint-intn.h \
/usr/include/x86_64-linux-gnu/bits/stdint-uintn.h /usr/include/stdio.h \
/usr/lib/gcc/x86_64-linux-gnu/7/include/stddef.h \
/usr/include/x86_64-linux-gnu/bits/types/__FILE.h \
/usr/include/x86_64-linux-gnu/bits/types/FILE.h \
/usr/include/x86_64-linux-gnu/bits/libio.h \
/usr/include/x86_64-linux-gnu/bits/_G_config.h \
/usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h \
/usr/lib/gcc/x86_64-linux-gnu/7/include/stdarg.h \
/usr/include/x86_64-linux-gnu/bits/stdio_lim.h \
/usr/include/x86_64-linux-gnu/bits/sys_errlist.h \
/usr/include/x86_64-linux-gnu/bits/stdio.h \
/usr/include/x86_64-linux-gnu/bits/stdio2.h /usr/include/string.h \
/usr/include/x86_64-linux-gnu/bits/types/locale_t.h \
/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h \
/usr/include/strings.h \
/usr/include/x86_64-linux-gnu/bits/strings_fortified.h \
/usr/include/x86_64-linux-gnu/bits/string_fortified.h ../xrp_api.h \
xrp_host_common.h /usr/include/stdlib.h \
/usr/include/x86_64-linux-gnu/bits/waitflags.h \
/usr/include/x86_64-linux-gnu/bits/waitstatus.h \
/usr/include/x86_64-linux-gnu/bits/floatn.h \
/usr/include/x86_64-linux-gnu/bits/floatn-common.h \
/usr/include/x86_64-linux-gnu/sys/types.h \
/usr/include/x86_64-linux-gnu/bits/types/clock_t.h \
/usr/include/x86_64-linux-gnu/bits/types/clockid_t.h \
/usr/include/x86_64-linux-gnu/bits/types/time_t.h \
/usr/include/x86_64-linux-gnu/bits/types/timer_t.h /usr/include/endian.h \
/usr/include/x86_64-linux-gnu/bits/endian.h \
/usr/include/x86_64-linux-gnu/bits/byteswap.h \
/usr/include/x86_64-linux-gnu/bits/byteswap-16.h \
/usr/include/x86_64-linux-gnu/bits/uintn-identity.h \
/usr/include/x86_64-linux-gnu/sys/select.h \
/usr/include/x86_64-linux-gnu/bits/select.h \
/usr/include/x86_64-linux-gnu/bits/types/sigset_t.h \
/usr/include/x86_64-linux-gnu/bits/types/__sigset_t.h \
/usr/include/x86_64-linux-gnu/bits/types/struct_timeval.h \
/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h \
/usr/include/x86_64-linux-gnu/bits/select2.h \
/usr/include/x86_64-linux-gnu/sys/sysmacros.h \
/usr/include/x86_64-linux-gnu/bits/sysmacros.h \
/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h \
/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h \
/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h \
/usr/include/alloca.h \
/usr/include/x86_64-linux-gnu/bits/stdlib-bsearch.h \
/usr/include/x86_64-linux-gnu/bits/stdlib-float.h \
/usr/include/x86_64-linux-gnu/bits/stdlib.h xrp_atomic.h \
thread-pthread/xrp_thread_impl.h /usr/include/pthread.h \
/usr/include/sched.h /usr/include/x86_64-linux-gnu/bits/sched.h \
/usr/include/x86_64-linux-gnu/bits/cpu-set.h /usr/include/time.h \
/usr/include/x86_64-linux-gnu/bits/time.h \
/usr/include/x86_64-linux-gnu/bits/types/struct_tm.h \
/usr/include/x86_64-linux-gnu/bits/types/struct_itimerspec.h \
/usr/include/x86_64-linux-gnu/bits/setjmp.h hosted/xrp_host_impl.h \
thread-pthread/xrp_queue_impl.h xrp_threaded_queue.h
/usr/include/stdc-predef.h:
/usr/lib/gcc/x86_64-linux-gnu/7/include/stdint.h:
/usr/include/stdint.h:
/usr/include/x86_64-linux-gnu/bits/libc-header-start.h:
/usr/include/features.h:
/usr/include/x86_64-linux-gnu/sys/cdefs.h:
/usr/include/x86_64-linux-gnu/bits/wordsize.h:
/usr/include/x86_64-linux-gnu/bits/long-double.h:
/usr/include/x86_64-linux-gnu/gnu/stubs.h:
/usr/include/x86_64-linux-gnu/gnu/stubs-64.h:
/usr/include/x86_64-linux-gnu/bits/types.h:
/usr/include/x86_64-linux-gnu/bits/typesizes.h:
/usr/include/x86_64-linux-gnu/bits/wchar.h:
/usr/include/x86_64-linux-gnu/bits/stdint-intn.h:
/usr/include/x86_64-linux-gnu/bits/stdint-uintn.h:
/usr/include/stdio.h:
/usr/lib/gcc/x86_64-linux-gnu/7/include/stddef.h:
/usr/include/x86_64-linux-gnu/bits/types/__FILE.h:
/usr/include/x86_64-linux-gnu/bits/types/FILE.h:
/usr/include/x86_64-linux-gnu/bits/libio.h:
/usr/include/x86_64-linux-gnu/bits/_G_config.h:
/usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h:
/usr/lib/gcc/x86_64-linux-gnu/7/include/stdarg.h:
/usr/include/x86_64-linux-gnu/bits/stdio_lim.h:
/usr/include/x86_64-linux-gnu/bits/sys_errlist.h:
/usr/include/x86_64-linux-gnu/bits/stdio.h:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:
/usr/include/string.h:
/usr/include/x86_64-linux-gnu/bits/types/locale_t.h:
/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h:
/usr/include/strings.h:
/usr/include/x86_64-linux-gnu/bits/strings_fortified.h:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:
../xrp_api.h:
xrp_host_common.h:
/usr/include/stdlib.h:
/usr/include/x86_64-linux-gnu/bits/waitflags.h:
/usr/include/x86_64-linux-gnu/bits/waitstatus.h:
/usr/include/x86_64-linux-gnu/bits/floatn.h:
/usr/include/x86_64-linux-gnu/bits/floatn-common.h:
/usr/include/x86_64-linux-gnu/sys/types.h:
/usr/include/x86_64-linux-gnu/bits/types/clock_t.h:
/usr/include/x86_64-linux-gnu/bits/types/clockid_t.h:
/usr/include/x86_64-linux-gnu/bits/types/time_t.h:
/usr/include/x86_64-linux-gnu/bits/types/timer_t.h:
/usr/include/endian.h:
/usr/include/x86_64-linux-gnu/bits/endian.h:
/usr/include/x86_64-linux-gnu/bits/byteswap.h:
/usr/include/x86_64-linux-gnu/bits/byteswap-16.h:
/usr/include/x86_64-linux-gnu/bits/uintn-identity.h:
/usr/include/x86_64-linux-gnu/sys/select.h:
/usr/include/x86_64-linux-gnu/bits/select.h:
/usr/include/x86_64-linux-gnu/bits/types/sigset_t.h:
/usr/include/x86_64-linux-gnu/bits/types/__sigset_t.h:
/usr/include/x86_64-linux-gnu/bits/types/struct_timeval.h:
/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h:
/usr/include/x86_64-linux-gnu/bits/select2.h:
/usr/include/x86_64-linux-gnu/sys/sysmacros.h:
/usr/include/x86_64-linux-gnu/bits/sysmacros.h:
/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h:
/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h:
/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h:
/usr/include/alloca.h:
/usr/include/x86_64-linux-gnu/bits/stdlib-bsearch.h:
/usr/include/x86_64-linux-gnu/bits/stdlib-float.h:
/usr/include/x86_64-linux-gnu/bits/stdlib.h:
xrp_atomic.h:
thread-pthread/xrp_thread_impl.h:
/usr/include/pthread.h:
/usr/include/sched.h:
/usr/include/x86_64-linux-gnu/bits/sched.h:
/usr/include/x86_64-linux-gnu/bits/cpu-set.h:
/usr/include/time.h:
/usr/include/x86_64-linux-gnu/bits/time.h:
/usr/include/x86_64-linux-gnu/bits/types/struct_tm.h:
/usr/include/x86_64-linux-gnu/bits/types/struct_itimerspec.h:
/usr/include/x86_64-linux-gnu/bits/setjmp.h:
hosted/xrp_host_impl.h:
thread-pthread/xrp_queue_impl.h:
xrp_threaded_queue.h:

View File

@@ -0,0 +1 @@
# dummy

View File

@@ -0,0 +1,211 @@
libxrp_host_hosted_a-xrp_threaded_queue.o: xrp_threaded_queue.c \
/usr/include/stdc-predef.h /usr/include/stdio.h \
/usr/include/x86_64-linux-gnu/bits/libc-header-start.h \
/usr/include/features.h /usr/include/x86_64-linux-gnu/sys/cdefs.h \
/usr/include/x86_64-linux-gnu/bits/wordsize.h \
/usr/include/x86_64-linux-gnu/bits/long-double.h \
/usr/include/x86_64-linux-gnu/gnu/stubs.h \
/usr/include/x86_64-linux-gnu/gnu/stubs-64.h \
/usr/lib/gcc/x86_64-linux-gnu/7/include/stddef.h \
/usr/include/x86_64-linux-gnu/bits/types.h \
/usr/include/x86_64-linux-gnu/bits/typesizes.h \
/usr/include/x86_64-linux-gnu/bits/types/__FILE.h \
/usr/include/x86_64-linux-gnu/bits/types/FILE.h \
/usr/include/x86_64-linux-gnu/bits/libio.h \
/usr/include/x86_64-linux-gnu/bits/_G_config.h \
/usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h \
/usr/lib/gcc/x86_64-linux-gnu/7/include/stdarg.h \
/usr/include/x86_64-linux-gnu/bits/stdio_lim.h \
/usr/include/x86_64-linux-gnu/bits/sys_errlist.h \
/usr/include/x86_64-linux-gnu/bits/stdio.h \
/usr/include/x86_64-linux-gnu/bits/stdio2.h ../xrp-common/xrp_debug.h \
xrp_host_common.h /usr/include/stdlib.h \
/usr/include/x86_64-linux-gnu/bits/waitflags.h \
/usr/include/x86_64-linux-gnu/bits/waitstatus.h \
/usr/include/x86_64-linux-gnu/bits/floatn.h \
/usr/include/x86_64-linux-gnu/bits/floatn-common.h \
/usr/include/x86_64-linux-gnu/sys/types.h \
/usr/include/x86_64-linux-gnu/bits/types/clock_t.h \
/usr/include/x86_64-linux-gnu/bits/types/clockid_t.h \
/usr/include/x86_64-linux-gnu/bits/types/time_t.h \
/usr/include/x86_64-linux-gnu/bits/types/timer_t.h \
/usr/include/x86_64-linux-gnu/bits/stdint-intn.h /usr/include/endian.h \
/usr/include/x86_64-linux-gnu/bits/endian.h \
/usr/include/x86_64-linux-gnu/bits/byteswap.h \
/usr/include/x86_64-linux-gnu/bits/byteswap-16.h \
/usr/include/x86_64-linux-gnu/bits/uintn-identity.h \
/usr/include/x86_64-linux-gnu/sys/select.h \
/usr/include/x86_64-linux-gnu/bits/select.h \
/usr/include/x86_64-linux-gnu/bits/types/sigset_t.h \
/usr/include/x86_64-linux-gnu/bits/types/__sigset_t.h \
/usr/include/x86_64-linux-gnu/bits/types/struct_timeval.h \
/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h \
/usr/include/x86_64-linux-gnu/bits/select2.h \
/usr/include/x86_64-linux-gnu/sys/sysmacros.h \
/usr/include/x86_64-linux-gnu/bits/sysmacros.h \
/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h \
/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h \
/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h \
/usr/include/alloca.h \
/usr/include/x86_64-linux-gnu/bits/stdlib-bsearch.h \
/usr/include/x86_64-linux-gnu/bits/stdlib-float.h \
/usr/include/x86_64-linux-gnu/bits/stdlib.h xrp_atomic.h \
thread-pthread/xrp_thread_impl.h /usr/include/pthread.h \
/usr/include/sched.h /usr/include/x86_64-linux-gnu/bits/sched.h \
/usr/include/x86_64-linux-gnu/bits/cpu-set.h /usr/include/time.h \
/usr/include/x86_64-linux-gnu/bits/time.h \
/usr/include/x86_64-linux-gnu/bits/types/struct_tm.h \
/usr/include/x86_64-linux-gnu/bits/types/struct_itimerspec.h \
/usr/include/x86_64-linux-gnu/bits/types/locale_t.h \
/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h \
/usr/include/x86_64-linux-gnu/bits/setjmp.h hosted/xrp_host_impl.h \
../xrp_api.h thread-pthread/xrp_queue_impl.h xrp_threaded_queue.h \
xrp_threaded_queue.h
/usr/include/stdc-predef.h:
/usr/include/stdio.h:
/usr/include/x86_64-linux-gnu/bits/libc-header-start.h:
/usr/include/features.h:
/usr/include/x86_64-linux-gnu/sys/cdefs.h:
/usr/include/x86_64-linux-gnu/bits/wordsize.h:
/usr/include/x86_64-linux-gnu/bits/long-double.h:
/usr/include/x86_64-linux-gnu/gnu/stubs.h:
/usr/include/x86_64-linux-gnu/gnu/stubs-64.h:
/usr/lib/gcc/x86_64-linux-gnu/7/include/stddef.h:
/usr/include/x86_64-linux-gnu/bits/types.h:
/usr/include/x86_64-linux-gnu/bits/typesizes.h:
/usr/include/x86_64-linux-gnu/bits/types/__FILE.h:
/usr/include/x86_64-linux-gnu/bits/types/FILE.h:
/usr/include/x86_64-linux-gnu/bits/libio.h:
/usr/include/x86_64-linux-gnu/bits/_G_config.h:
/usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h:
/usr/lib/gcc/x86_64-linux-gnu/7/include/stdarg.h:
/usr/include/x86_64-linux-gnu/bits/stdio_lim.h:
/usr/include/x86_64-linux-gnu/bits/sys_errlist.h:
/usr/include/x86_64-linux-gnu/bits/stdio.h:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:
../xrp-common/xrp_debug.h:
xrp_host_common.h:
/usr/include/stdlib.h:
/usr/include/x86_64-linux-gnu/bits/waitflags.h:
/usr/include/x86_64-linux-gnu/bits/waitstatus.h:
/usr/include/x86_64-linux-gnu/bits/floatn.h:
/usr/include/x86_64-linux-gnu/bits/floatn-common.h:
/usr/include/x86_64-linux-gnu/sys/types.h:
/usr/include/x86_64-linux-gnu/bits/types/clock_t.h:
/usr/include/x86_64-linux-gnu/bits/types/clockid_t.h:
/usr/include/x86_64-linux-gnu/bits/types/time_t.h:
/usr/include/x86_64-linux-gnu/bits/types/timer_t.h:
/usr/include/x86_64-linux-gnu/bits/stdint-intn.h:
/usr/include/endian.h:
/usr/include/x86_64-linux-gnu/bits/endian.h:
/usr/include/x86_64-linux-gnu/bits/byteswap.h:
/usr/include/x86_64-linux-gnu/bits/byteswap-16.h:
/usr/include/x86_64-linux-gnu/bits/uintn-identity.h:
/usr/include/x86_64-linux-gnu/sys/select.h:
/usr/include/x86_64-linux-gnu/bits/select.h:
/usr/include/x86_64-linux-gnu/bits/types/sigset_t.h:
/usr/include/x86_64-linux-gnu/bits/types/__sigset_t.h:
/usr/include/x86_64-linux-gnu/bits/types/struct_timeval.h:
/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h:
/usr/include/x86_64-linux-gnu/bits/select2.h:
/usr/include/x86_64-linux-gnu/sys/sysmacros.h:
/usr/include/x86_64-linux-gnu/bits/sysmacros.h:
/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h:
/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h:
/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h:
/usr/include/alloca.h:
/usr/include/x86_64-linux-gnu/bits/stdlib-bsearch.h:
/usr/include/x86_64-linux-gnu/bits/stdlib-float.h:
/usr/include/x86_64-linux-gnu/bits/stdlib.h:
xrp_atomic.h:
thread-pthread/xrp_thread_impl.h:
/usr/include/pthread.h:
/usr/include/sched.h:
/usr/include/x86_64-linux-gnu/bits/sched.h:
/usr/include/x86_64-linux-gnu/bits/cpu-set.h:
/usr/include/time.h:
/usr/include/x86_64-linux-gnu/bits/time.h:
/usr/include/x86_64-linux-gnu/bits/types/struct_tm.h:
/usr/include/x86_64-linux-gnu/bits/types/struct_itimerspec.h:
/usr/include/x86_64-linux-gnu/bits/types/locale_t.h:
/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h:
/usr/include/x86_64-linux-gnu/bits/setjmp.h:
hosted/xrp_host_impl.h:
../xrp_api.h:
thread-pthread/xrp_queue_impl.h:
xrp_threaded_queue.h:
xrp_threaded_queue.h:

View File

@@ -0,0 +1,204 @@
libxrp_host_single_a-xrp_host_common.o: xrp_host_common.c \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/stdint.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/yvals.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/c99/yvals.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/config/core-isa.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/lib/xcc/include/stdarg.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/stdio.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/c99/stdio.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/mbstatet.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/tie/xt_scmpr.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/string.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/c99/string.h \
../xrp_api.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/stddef.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/c99/stddef.h \
xrp_host_common.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/stdlib.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/c99/stdlib.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/alloca.h \
xrp_atomic.h thread-xos/xrp_thread_impl.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_types.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/hal.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/config/core.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xtensa-versions.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xtensa-types.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/config/core-matmap.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/config/tie.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/hal-certified.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/hal-compat.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/core-macros.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/corebits.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/tie/xt_core.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/tie/xt_interrupt.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/tie/xt_timer.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/tie/xt_externalregisters.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/tie/xt_coprocessors.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/intctrl.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/core-macros-compat.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_common.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/config/system.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_params.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/sys/reent.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/wchar.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/xwcstod.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/xwstr.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/fenv.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/ymath.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/c99/ymath.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_errors.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_regaccess.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_log.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_thread.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_cond.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_event.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_mutex.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_msgq.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_semaphore.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_blockmem.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_barrier.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_timer.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_stopwatch.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_syslog.h \
single/xrp_host_impl.h ../xrp_api.h thread-xos/xrp_thread_impl.h \
thread-xos/xrp_queue_impl.h xrp_threaded_queue.h \
thread-xos/xrp_thread_impl.h
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/stdint.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/yvals.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/c99/yvals.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/config/core-isa.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/lib/xcc/include/stdarg.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/stdio.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/c99/stdio.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/mbstatet.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/tie/xt_scmpr.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/string.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/c99/string.h:
../xrp_api.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/stddef.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/c99/stddef.h:
xrp_host_common.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/stdlib.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/c99/stdlib.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/alloca.h:
xrp_atomic.h:
thread-xos/xrp_thread_impl.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_types.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/hal.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/config/core.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xtensa-versions.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xtensa-types.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/config/core-matmap.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/config/tie.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/hal-certified.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/hal-compat.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/core-macros.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/corebits.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/tie/xt_core.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/tie/xt_interrupt.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/tie/xt_timer.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/tie/xt_externalregisters.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/tie/xt_coprocessors.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/intctrl.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/core-macros-compat.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_common.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/config/system.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_params.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/sys/reent.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/wchar.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/xwcstod.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/xwstr.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/fenv.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/ymath.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/c99/ymath.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_errors.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_regaccess.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_log.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_thread.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_cond.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_event.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_mutex.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_msgq.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_semaphore.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_blockmem.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_barrier.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_timer.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_stopwatch.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_syslog.h:
single/xrp_host_impl.h:
../xrp_api.h:
thread-xos/xrp_thread_impl.h:
thread-xos/xrp_queue_impl.h:
xrp_threaded_queue.h:
thread-xos/xrp_thread_impl.h:

View File

@@ -0,0 +1 @@
# dummy

View File

@@ -0,0 +1,196 @@
libxrp_host_single_a-xrp_threaded_queue.o: xrp_threaded_queue.c \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/stdio.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/c99/stdio.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/c99/yvals.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/config/core-isa.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/lib/xcc/include/stdarg.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/mbstatet.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/tie/xt_scmpr.h \
../xrp-common/xrp_debug.h xrp_host_common.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/stdlib.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/c99/stdlib.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/alloca.h \
xrp_atomic.h thread-xos/xrp_thread_impl.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_types.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/stdint.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/hal.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/config/core.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xtensa-versions.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xtensa-types.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/config/core-matmap.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/config/tie.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/hal-certified.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/stddef.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/c99/stddef.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/hal-compat.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/core-macros.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/corebits.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/tie/xt_core.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/tie/xt_interrupt.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/tie/xt_timer.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/tie/xt_externalregisters.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/tie/xt_coprocessors.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/intctrl.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/core-macros-compat.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_common.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/config/system.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_params.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/sys/reent.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/wchar.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/xwcstod.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/xwstr.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/fenv.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/ymath.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/c99/ymath.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_errors.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_regaccess.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_log.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_thread.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_cond.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_event.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_mutex.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_msgq.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_semaphore.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_blockmem.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_barrier.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_timer.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_stopwatch.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_syslog.h \
single/xrp_host_impl.h ../xrp_api.h thread-xos/xrp_thread_impl.h \
thread-xos/xrp_queue_impl.h xrp_threaded_queue.h \
thread-xos/xrp_thread_impl.h xrp_threaded_queue.h
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/stdio.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/c99/stdio.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/c99/yvals.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/config/core-isa.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/lib/xcc/include/stdarg.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/mbstatet.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/tie/xt_scmpr.h:
../xrp-common/xrp_debug.h:
xrp_host_common.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/stdlib.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/c99/stdlib.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/alloca.h:
xrp_atomic.h:
thread-xos/xrp_thread_impl.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_types.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/stdint.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/hal.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/config/core.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xtensa-versions.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xtensa-types.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/config/core-matmap.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/config/tie.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/hal-certified.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/stddef.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/c99/stddef.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/hal-compat.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/core-macros.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/corebits.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/tie/xt_core.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/tie/xt_interrupt.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/tie/xt_timer.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/tie/xt_externalregisters.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/tie/xt_coprocessors.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/intctrl.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/core-macros-compat.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_common.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/config/system.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_params.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/sys/reent.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/wchar.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/xwcstod.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/xwstr.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/fenv.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/ymath.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/c99/ymath.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_errors.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_regaccess.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_log.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_thread.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_cond.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_event.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_mutex.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_msgq.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_semaphore.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_blockmem.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_barrier.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_timer.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_stopwatch.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_syslog.h:
single/xrp_host_impl.h:
../xrp_api.h:
thread-xos/xrp_thread_impl.h:
thread-xos/xrp_queue_impl.h:
xrp_threaded_queue.h:
thread-xos/xrp_thread_impl.h:
xrp_threaded_queue.h:

View File

@@ -0,0 +1,204 @@
libxrp_host_standalone_a-xrp_host_common.o: xrp_host_common.c \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/stdint.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/yvals.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/c99/yvals.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/config/core-isa.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/lib/xcc/include/stdarg.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/stdio.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/c99/stdio.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/mbstatet.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/tie/xt_scmpr.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/string.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/c99/string.h \
../xrp_api.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/stddef.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/c99/stddef.h \
xrp_host_common.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/stdlib.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/c99/stdlib.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/alloca.h \
xrp_atomic.h thread-xos/xrp_thread_impl.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_types.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/hal.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/config/core.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xtensa-versions.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xtensa-types.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/config/core-matmap.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/config/tie.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/hal-certified.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/hal-compat.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/core-macros.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/corebits.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/tie/xt_core.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/tie/xt_interrupt.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/tie/xt_timer.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/tie/xt_externalregisters.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/tie/xt_coprocessors.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/intctrl.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/core-macros-compat.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_common.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/config/system.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_params.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/sys/reent.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/wchar.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/xwcstod.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/xwstr.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/fenv.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/ymath.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/c99/ymath.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_errors.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_regaccess.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_log.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_thread.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_cond.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_event.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_mutex.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_msgq.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_semaphore.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_blockmem.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_barrier.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_timer.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_stopwatch.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_syslog.h \
standalone/xrp_host_impl.h ../xrp_api.h thread-xos/xrp_thread_impl.h \
thread-xos/xrp_queue_impl.h xrp_threaded_queue.h \
thread-xos/xrp_thread_impl.h
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/stdint.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/yvals.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/c99/yvals.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/config/core-isa.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/lib/xcc/include/stdarg.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/stdio.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/c99/stdio.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/mbstatet.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/tie/xt_scmpr.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/string.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/c99/string.h:
../xrp_api.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/stddef.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/c99/stddef.h:
xrp_host_common.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/stdlib.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/c99/stdlib.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/alloca.h:
xrp_atomic.h:
thread-xos/xrp_thread_impl.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_types.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/hal.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/config/core.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xtensa-versions.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xtensa-types.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/config/core-matmap.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/config/tie.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/hal-certified.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/hal-compat.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/core-macros.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/corebits.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/tie/xt_core.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/tie/xt_interrupt.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/tie/xt_timer.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/tie/xt_externalregisters.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/tie/xt_coprocessors.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/intctrl.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/core-macros-compat.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_common.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/config/system.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_params.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/sys/reent.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/wchar.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/xwcstod.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/xwstr.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/fenv.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/ymath.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/c99/ymath.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_errors.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_regaccess.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_log.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_thread.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_cond.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_event.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_mutex.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_msgq.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_semaphore.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_blockmem.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_barrier.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_timer.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_stopwatch.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_syslog.h:
standalone/xrp_host_impl.h:
../xrp_api.h:
thread-xos/xrp_thread_impl.h:
thread-xos/xrp_queue_impl.h:
xrp_threaded_queue.h:
thread-xos/xrp_thread_impl.h:

View File

@@ -0,0 +1 @@
# dummy

View File

@@ -0,0 +1,196 @@
libxrp_host_standalone_a-xrp_threaded_queue.o: xrp_threaded_queue.c \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/stdio.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/c99/stdio.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/c99/yvals.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/config/core-isa.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/lib/xcc/include/stdarg.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/mbstatet.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/tie/xt_scmpr.h \
../xrp-common/xrp_debug.h xrp_host_common.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/stdlib.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/c99/stdlib.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/alloca.h \
xrp_atomic.h thread-xos/xrp_thread_impl.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_types.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/stdint.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/hal.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/config/core.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xtensa-versions.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xtensa-types.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/config/core-matmap.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/config/tie.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/hal-certified.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/stddef.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/c99/stddef.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/hal-compat.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/core-macros.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/corebits.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/tie/xt_core.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/tie/xt_interrupt.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/tie/xt_timer.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/tie/xt_externalregisters.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/tie/xt_coprocessors.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/intctrl.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/core-macros-compat.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_common.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/config/system.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_params.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/sys/reent.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/wchar.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/xwcstod.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/xwstr.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/fenv.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/ymath.h \
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/c99/ymath.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_errors.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_regaccess.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_log.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_thread.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_cond.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_event.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_mutex.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_msgq.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_semaphore.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_blockmem.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_barrier.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_timer.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_stopwatch.h \
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_syslog.h \
standalone/xrp_host_impl.h ../xrp_api.h thread-xos/xrp_thread_impl.h \
thread-xos/xrp_queue_impl.h xrp_threaded_queue.h \
thread-xos/xrp_thread_impl.h xrp_threaded_queue.h
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/stdio.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/c99/stdio.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/c99/yvals.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/config/core-isa.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/lib/xcc/include/stdarg.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/mbstatet.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/tie/xt_scmpr.h:
../xrp-common/xrp_debug.h:
xrp_host_common.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/stdlib.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/c99/stdlib.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/alloca.h:
xrp_atomic.h:
thread-xos/xrp_thread_impl.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_types.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/stdint.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/hal.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/config/core.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xtensa-versions.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xtensa-types.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/config/core-matmap.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/config/tie.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/hal-certified.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/stddef.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/c99/stddef.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/hal-compat.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/core-macros.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/corebits.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/tie/xt_core.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/tie/xt_interrupt.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/tie/xt_timer.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/tie/xt_externalregisters.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/tie/xt_coprocessors.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/intctrl.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/core-macros-compat.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_common.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/arch/include/xtensa/config/system.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_params.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/sys/reent.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/wchar.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/xwcstod.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/xwstr.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/fenv.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/ymath.h:
/home/jianghm/xtensa/XtDevTools/install/builds/RI-2020.4-linux/q7_check/xtensa-elf/include/c99/ymath.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_errors.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_regaccess.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_log.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_thread.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_cond.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_event.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_mutex.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_msgq.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_semaphore.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_blockmem.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_barrier.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_timer.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_stopwatch.h:
/home/jianghm/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/xtensa-elf/include/xtensa/xos_syslog.h:
standalone/xrp_host_impl.h:
../xrp_api.h:
thread-xos/xrp_thread_impl.h:
thread-xos/xrp_queue_impl.h:
xrp_threaded_queue.h:
thread-xos/xrp_thread_impl.h:
xrp_threaded_queue.h:

View File

@@ -0,0 +1,52 @@
##
# Copyright (C) 2021 Alibaba Group Holding Limited
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
##
# INCLUDES = -I../../driver/isp -I../../common
TARGET = libxrp_linux.a
CFLAGS = -O0 -Wall -g -lm -lpthread
CFLAGS += -fPIC
# USE_THREADS =
# ifdef USE_THREADS
queue_sources = xrp_threaded_queue.c
INCLUDE +=-Ithread-pthread
# else
# queue_sources = xrp_sync_queue.c
# endif
xrp_SRCS += $(queue_sources)
xrp_SRCS += xrp_host_common.c
xrp_SRCS += hosted/xrp_linux.c
xrp_SRCS += xrp_report.c
INCLUDES = -I$(CURDIR) -Ihosted -I../include -Ithread-pthread -I../xrp-common -I../../xrp-kernel
# object files will be generated from .c sourcefiles
xrp_OBJS = $(notdir $(xrp_SRCS:.c=.o))
all: $(TARGET)
$(xrp_OBJS): $(xrp_SRCS)
$(CC) -c $(CFLAGS) $(INCLUDES) $(xrp_SRCS)
$(TARGET): $(xrp_OBJS)
$(AR) -rc $(TARGET) $(xrp_OBJS)
clean:
rm -f *.o *.a
rm -rf output
install:
.PHONY: clean all prepare common

View File

@@ -0,0 +1,69 @@
#
# Copyright (c) 2017 - 2018 Cadence Design Systems Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
AM_CPPFLAGS = -I$(srcdir)/.. -I$(srcdir) -I$(srcdir)/../xrp-common \
-I$(srcdir)/thread-@THREADS_IMPL@
AM_CFLAGS = -W -Wall $(THREADS_CFLAGS)
include_HEADERS = ../xrp_api.h
lib_LIBRARIES =
if BUILD_STANDALONE
lib_LIBRARIES += libxrp-host-standalone.a
endif
if BUILD_HOSTED
lib_LIBRARIES += libxrp-host-hosted.a
endif
if BUILD_SINGLE
lib_LIBRARIES += libxrp-host-single.a
endif
if USE_THREADS
queue_sources = xrp_threaded_queue.c
else
queue_sources = xrp_sync_queue.c
endif
libxrp_host_standalone_a_CPPFLAGS = $(AM_CPPFLAGS) \
$(LIBFDT_CPPFLAGS) \
-I$(srcdir)/standalone \
-I$(srcdir)/../xrp-kernel
libxrp_host_standalone_a_SOURCES = xrp_host_common.c \
$(queue_sources) \
standalone/xrp_host.c \
standalone/xrp_@HOST_OS@.c \
../xrp-kernel/xrp_alloc.c
libxrp_host_hosted_a_CPPFLAGS = $(AM_CPPFLAGS) \
-I$(srcdir)/hosted \
-I$(srcdir)/../xrp-kernel
libxrp_host_hosted_a_SOURCES = xrp_host_common.c \
$(queue_sources) \
hosted/xrp_@HOST_OS@.c
libxrp_host_single_a_CPPFLAGS = $(AM_CPPFLAGS) \
-I$(srcdir)/single
libxrp_host_single_a_SOURCES = xrp_host_common.c \
$(queue_sources) \
single/xrp_single.c \
../xrp-common/xrp_ns.c

View File

@@ -0,0 +1 @@
# dummy

View File

@@ -0,0 +1,298 @@
hosted/libxrp_host_hosted_a-xrp_linux.o: hosted/xrp_linux.c \
/usr/include/stdc-predef.h /usr/include/fcntl.h /usr/include/features.h \
/usr/include/x86_64-linux-gnu/sys/cdefs.h \
/usr/include/x86_64-linux-gnu/bits/wordsize.h \
/usr/include/x86_64-linux-gnu/bits/long-double.h \
/usr/include/x86_64-linux-gnu/gnu/stubs.h \
/usr/include/x86_64-linux-gnu/gnu/stubs-64.h \
/usr/include/x86_64-linux-gnu/bits/types.h \
/usr/include/x86_64-linux-gnu/bits/typesizes.h \
/usr/include/x86_64-linux-gnu/bits/fcntl.h \
/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h \
/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h \
/usr/include/x86_64-linux-gnu/bits/stat.h \
/usr/include/x86_64-linux-gnu/bits/fcntl2.h \
/usr/lib/gcc/x86_64-linux-gnu/7/include/stdint.h /usr/include/stdint.h \
/usr/include/x86_64-linux-gnu/bits/libc-header-start.h \
/usr/include/x86_64-linux-gnu/bits/wchar.h \
/usr/include/x86_64-linux-gnu/bits/stdint-intn.h \
/usr/include/x86_64-linux-gnu/bits/stdint-uintn.h /usr/include/stdio.h \
/usr/lib/gcc/x86_64-linux-gnu/7/include/stddef.h \
/usr/include/x86_64-linux-gnu/bits/types/__FILE.h \
/usr/include/x86_64-linux-gnu/bits/types/FILE.h \
/usr/include/x86_64-linux-gnu/bits/libio.h \
/usr/include/x86_64-linux-gnu/bits/_G_config.h \
/usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h \
/usr/lib/gcc/x86_64-linux-gnu/7/include/stdarg.h \
/usr/include/x86_64-linux-gnu/bits/stdio_lim.h \
/usr/include/x86_64-linux-gnu/bits/sys_errlist.h \
/usr/include/x86_64-linux-gnu/bits/stdio.h \
/usr/include/x86_64-linux-gnu/bits/stdio2.h /usr/include/stdlib.h \
/usr/include/x86_64-linux-gnu/bits/waitflags.h \
/usr/include/x86_64-linux-gnu/bits/waitstatus.h \
/usr/include/x86_64-linux-gnu/bits/floatn.h \
/usr/include/x86_64-linux-gnu/bits/floatn-common.h \
/usr/include/x86_64-linux-gnu/sys/types.h \
/usr/include/x86_64-linux-gnu/bits/types/clock_t.h \
/usr/include/x86_64-linux-gnu/bits/types/clockid_t.h \
/usr/include/x86_64-linux-gnu/bits/types/time_t.h \
/usr/include/x86_64-linux-gnu/bits/types/timer_t.h /usr/include/endian.h \
/usr/include/x86_64-linux-gnu/bits/endian.h \
/usr/include/x86_64-linux-gnu/bits/byteswap.h \
/usr/include/x86_64-linux-gnu/bits/byteswap-16.h \
/usr/include/x86_64-linux-gnu/bits/uintn-identity.h \
/usr/include/x86_64-linux-gnu/sys/select.h \
/usr/include/x86_64-linux-gnu/bits/select.h \
/usr/include/x86_64-linux-gnu/bits/types/sigset_t.h \
/usr/include/x86_64-linux-gnu/bits/types/__sigset_t.h \
/usr/include/x86_64-linux-gnu/bits/types/struct_timeval.h \
/usr/include/x86_64-linux-gnu/bits/select2.h \
/usr/include/x86_64-linux-gnu/sys/sysmacros.h \
/usr/include/x86_64-linux-gnu/bits/sysmacros.h \
/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h \
/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h \
/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h \
/usr/include/alloca.h \
/usr/include/x86_64-linux-gnu/bits/stdlib-bsearch.h \
/usr/include/x86_64-linux-gnu/bits/stdlib-float.h \
/usr/include/x86_64-linux-gnu/bits/stdlib.h /usr/include/string.h \
/usr/include/x86_64-linux-gnu/bits/types/locale_t.h \
/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h \
/usr/include/strings.h \
/usr/include/x86_64-linux-gnu/bits/strings_fortified.h \
/usr/include/x86_64-linux-gnu/bits/string_fortified.h \
/usr/include/x86_64-linux-gnu/sys/ioctl.h \
/usr/include/x86_64-linux-gnu/bits/ioctls.h \
/usr/include/x86_64-linux-gnu/asm/ioctls.h \
/usr/include/asm-generic/ioctls.h /usr/include/linux/ioctl.h \
/usr/include/x86_64-linux-gnu/asm/ioctl.h \
/usr/include/asm-generic/ioctl.h \
/usr/include/x86_64-linux-gnu/bits/ioctl-types.h \
/usr/include/x86_64-linux-gnu/sys/ttydefaults.h \
/usr/include/x86_64-linux-gnu/sys/stat.h /usr/include/unistd.h \
/usr/include/x86_64-linux-gnu/bits/posix_opt.h \
/usr/include/x86_64-linux-gnu/bits/environments.h \
/usr/include/x86_64-linux-gnu/bits/confname.h \
/usr/include/x86_64-linux-gnu/bits/getopt_posix.h \
/usr/include/x86_64-linux-gnu/bits/getopt_core.h \
/usr/include/x86_64-linux-gnu/bits/unistd.h ../xrp-common/xrp_types.h \
xrp_host_common.h xrp_atomic.h thread-pthread/xrp_thread_impl.h \
/usr/include/pthread.h /usr/include/sched.h \
/usr/include/x86_64-linux-gnu/bits/sched.h \
/usr/include/x86_64-linux-gnu/bits/cpu-set.h /usr/include/time.h \
/usr/include/x86_64-linux-gnu/bits/time.h \
/usr/include/x86_64-linux-gnu/bits/types/struct_tm.h \
/usr/include/x86_64-linux-gnu/bits/types/struct_itimerspec.h \
/usr/include/x86_64-linux-gnu/bits/setjmp.h hosted/xrp_host_impl.h \
../xrp_api.h thread-pthread/xrp_queue_impl.h xrp_threaded_queue.h \
hosted/xrp_host_impl.h ../xrp-kernel/xrp_kernel_defs.h
/usr/include/stdc-predef.h:
/usr/include/fcntl.h:
/usr/include/features.h:
/usr/include/x86_64-linux-gnu/sys/cdefs.h:
/usr/include/x86_64-linux-gnu/bits/wordsize.h:
/usr/include/x86_64-linux-gnu/bits/long-double.h:
/usr/include/x86_64-linux-gnu/gnu/stubs.h:
/usr/include/x86_64-linux-gnu/gnu/stubs-64.h:
/usr/include/x86_64-linux-gnu/bits/types.h:
/usr/include/x86_64-linux-gnu/bits/typesizes.h:
/usr/include/x86_64-linux-gnu/bits/fcntl.h:
/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h:
/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h:
/usr/include/x86_64-linux-gnu/bits/stat.h:
/usr/include/x86_64-linux-gnu/bits/fcntl2.h:
/usr/lib/gcc/x86_64-linux-gnu/7/include/stdint.h:
/usr/include/stdint.h:
/usr/include/x86_64-linux-gnu/bits/libc-header-start.h:
/usr/include/x86_64-linux-gnu/bits/wchar.h:
/usr/include/x86_64-linux-gnu/bits/stdint-intn.h:
/usr/include/x86_64-linux-gnu/bits/stdint-uintn.h:
/usr/include/stdio.h:
/usr/lib/gcc/x86_64-linux-gnu/7/include/stddef.h:
/usr/include/x86_64-linux-gnu/bits/types/__FILE.h:
/usr/include/x86_64-linux-gnu/bits/types/FILE.h:
/usr/include/x86_64-linux-gnu/bits/libio.h:
/usr/include/x86_64-linux-gnu/bits/_G_config.h:
/usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h:
/usr/lib/gcc/x86_64-linux-gnu/7/include/stdarg.h:
/usr/include/x86_64-linux-gnu/bits/stdio_lim.h:
/usr/include/x86_64-linux-gnu/bits/sys_errlist.h:
/usr/include/x86_64-linux-gnu/bits/stdio.h:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:
/usr/include/stdlib.h:
/usr/include/x86_64-linux-gnu/bits/waitflags.h:
/usr/include/x86_64-linux-gnu/bits/waitstatus.h:
/usr/include/x86_64-linux-gnu/bits/floatn.h:
/usr/include/x86_64-linux-gnu/bits/floatn-common.h:
/usr/include/x86_64-linux-gnu/sys/types.h:
/usr/include/x86_64-linux-gnu/bits/types/clock_t.h:
/usr/include/x86_64-linux-gnu/bits/types/clockid_t.h:
/usr/include/x86_64-linux-gnu/bits/types/time_t.h:
/usr/include/x86_64-linux-gnu/bits/types/timer_t.h:
/usr/include/endian.h:
/usr/include/x86_64-linux-gnu/bits/endian.h:
/usr/include/x86_64-linux-gnu/bits/byteswap.h:
/usr/include/x86_64-linux-gnu/bits/byteswap-16.h:
/usr/include/x86_64-linux-gnu/bits/uintn-identity.h:
/usr/include/x86_64-linux-gnu/sys/select.h:
/usr/include/x86_64-linux-gnu/bits/select.h:
/usr/include/x86_64-linux-gnu/bits/types/sigset_t.h:
/usr/include/x86_64-linux-gnu/bits/types/__sigset_t.h:
/usr/include/x86_64-linux-gnu/bits/types/struct_timeval.h:
/usr/include/x86_64-linux-gnu/bits/select2.h:
/usr/include/x86_64-linux-gnu/sys/sysmacros.h:
/usr/include/x86_64-linux-gnu/bits/sysmacros.h:
/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h:
/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h:
/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h:
/usr/include/alloca.h:
/usr/include/x86_64-linux-gnu/bits/stdlib-bsearch.h:
/usr/include/x86_64-linux-gnu/bits/stdlib-float.h:
/usr/include/x86_64-linux-gnu/bits/stdlib.h:
/usr/include/string.h:
/usr/include/x86_64-linux-gnu/bits/types/locale_t.h:
/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h:
/usr/include/strings.h:
/usr/include/x86_64-linux-gnu/bits/strings_fortified.h:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:
/usr/include/x86_64-linux-gnu/sys/ioctl.h:
/usr/include/x86_64-linux-gnu/bits/ioctls.h:
/usr/include/x86_64-linux-gnu/asm/ioctls.h:
/usr/include/asm-generic/ioctls.h:
/usr/include/linux/ioctl.h:
/usr/include/x86_64-linux-gnu/asm/ioctl.h:
/usr/include/asm-generic/ioctl.h:
/usr/include/x86_64-linux-gnu/bits/ioctl-types.h:
/usr/include/x86_64-linux-gnu/sys/ttydefaults.h:
/usr/include/x86_64-linux-gnu/sys/stat.h:
/usr/include/unistd.h:
/usr/include/x86_64-linux-gnu/bits/posix_opt.h:
/usr/include/x86_64-linux-gnu/bits/environments.h:
/usr/include/x86_64-linux-gnu/bits/confname.h:
/usr/include/x86_64-linux-gnu/bits/getopt_posix.h:
/usr/include/x86_64-linux-gnu/bits/getopt_core.h:
/usr/include/x86_64-linux-gnu/bits/unistd.h:
../xrp-common/xrp_types.h:
xrp_host_common.h:
xrp_atomic.h:
thread-pthread/xrp_thread_impl.h:
/usr/include/pthread.h:
/usr/include/sched.h:
/usr/include/x86_64-linux-gnu/bits/sched.h:
/usr/include/x86_64-linux-gnu/bits/cpu-set.h:
/usr/include/time.h:
/usr/include/x86_64-linux-gnu/bits/time.h:
/usr/include/x86_64-linux-gnu/bits/types/struct_tm.h:
/usr/include/x86_64-linux-gnu/bits/types/struct_itimerspec.h:
/usr/include/x86_64-linux-gnu/bits/setjmp.h:
hosted/xrp_host_impl.h:
../xrp_api.h:
thread-pthread/xrp_queue_impl.h:
xrp_threaded_queue.h:
hosted/xrp_host_impl.h:
../xrp-kernel/xrp_kernel_defs.h:

View File

@@ -0,0 +1,76 @@
/*
* Copyright (c) 2016 - 2018 Cadence Design Systems Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef _XRP_LINUX_NATIVE_H
#define _XRP_LINUX_NATIVE_H
#include <xrp_api.h>
#include "xrp_thread_impl.h"
#include "xrp_queue_impl.h"
struct xrp_device_impl {
int fd;
};
struct xrp_buffer_impl {
};
struct xrp_queue_impl {
struct xrp_request_queue queue;
};
void xrp_impl_release_device(struct xrp_device *device);
void xrp_impl_create_device_buffer(struct xrp_device *device,
struct xrp_buffer *buffer,
size_t size,
enum xrp_status *status);
void xrp_impl_release_device_buffer(struct xrp_buffer *buffer);
void xrp_impl_create_queue(struct xrp_queue *queue,
enum xrp_status *status);
void xrp_impl_release_queue(struct xrp_queue *queue);
void xrp_impl_create_report(struct xrp_device *device,
struct xrp_report *report,
size_t size,
enum xrp_status *status);
void xrp_impl_release_report(struct xrp_device *device,
struct xrp_report *report,enum xrp_status *status);
int xrp_impl_add_report_item(struct xrp_report *report,
int (*cb)(void*context,void*data),
void* context,
size_t data_size);
int xrp_impl_add_report_item_with_id(struct xrp_report *report,
int (*cb)(void*context,void*data),
int report_id,
void* context,
size_t data_size);
void xrp_impl_remove_report_item(struct xrp_report *report,int report_id);
void xrp_impl_import_dma_buf(struct xrp_device *device, int fd,enum xrp_access_flags,uint64_t *phy_addr,
uint64_t *user_addr,size_t* size,enum xrp_status *status);
void xrp_impl_release_dma_buf(struct xrp_device *device, int fd,enum xrp_status *status);
#endif

View File

@@ -0,0 +1,478 @@
/*
* Copyright (c) 2016 - 2018 Cadence Design Systems Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <fcntl.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <signal.h>
#include <unistd.h>
#include "xrp_types.h"
#include "xrp_host_common.h"
#include "xrp_host_impl.h"
#include "xrp_kernel_defs.h"
#include "xrp_report.h"
#include "dsp_common.h"
struct xrp_request {
struct xrp_queue_item q;
void *in_data;
void *out_data;
size_t in_data_size;
size_t out_data_size;
struct xrp_buffer_group *buffer_group;
struct xrp_event *event;
};
/* Device API. */
struct xrp_device *xrp_open_device(int idx, enum xrp_status *status)
{
struct xrp_device *device;
char name[sizeof("/dev/xvp") + sizeof(int) * 4];
int fd;
sprintf(name, "/dev/xvp%u", idx);
fd = open(name, O_RDWR);
if (fd == -1) {
set_status(status, XRP_STATUS_FAILURE);
return NULL;
}
device = alloc_refcounted(sizeof(*device));
if (!device) {
set_status(status, XRP_STATUS_FAILURE);
return NULL;
}
device->impl.fd = fd;
set_status(status, XRP_STATUS_SUCCESS);
return device;
}
void xrp_impl_release_device(struct xrp_device *device)
{
close(device->impl.fd);
}
/* Buffer API. */
void xrp_impl_create_device_buffer(struct xrp_device *device,
struct xrp_buffer *buffer,
size_t size,
enum xrp_status *status)
{
struct xrp_ioctl_alloc ioctl_alloc = {
.size = size,
};
int ret;
xrp_retain_device(device);
buffer->device = device;
ret = ioctl(buffer->device->impl.fd, XRP_IOCTL_ALLOC, &ioctl_alloc);
if (ret < 0) {
xrp_release_device(buffer->device);
set_status(status, XRP_STATUS_FAILURE);
return;
}
buffer->ptr = (void *)(uintptr_t)ioctl_alloc.addr;
buffer->size = size;
buffer->phy_addr = ioctl_alloc.paddr;
set_status(status, XRP_STATUS_SUCCESS);
}
void xrp_impl_release_device_buffer(struct xrp_buffer *buffer)
{
struct xrp_ioctl_alloc ioctl_alloc = {
.addr = (uintptr_t)buffer->ptr,
};
ioctl(buffer->device->impl.fd,
XRP_IOCTL_FREE, &ioctl_alloc);
xrp_release_device(buffer->device);
}
/* Queue API. */
static void _xrp_run_command(struct xrp_queue *queue,
const void *in_data, size_t in_data_size,
void *out_data, size_t out_data_size,
struct xrp_buffer_group *buffer_group,
enum xrp_status *status)
{
int ret;
if (buffer_group)
xrp_mutex_lock(&buffer_group->mutex);
{
size_t n_buffers = buffer_group ? buffer_group->n_buffers : 0;
struct xrp_ioctl_buffer ioctl_buffer[n_buffers];/* TODO */
struct xrp_ioctl_queue ioctl_queue = {
.flags = (queue->use_nsid ? XRP_QUEUE_FLAG_NSID : 0) |
((queue->priority << XRP_QUEUE_FLAG_PRIO_SHIFT) &
XRP_QUEUE_FLAG_PRIO),
.in_data_size = in_data_size,
.out_data_size = out_data_size,
.buffer_size = n_buffers *
sizeof(struct xrp_ioctl_buffer),
.in_data_addr = (uintptr_t)in_data,
.out_data_addr = (uintptr_t)out_data,
.buffer_addr = (uintptr_t)ioctl_buffer,
.nsid_addr = (uintptr_t)queue->nsid,
};
size_t i;
for (i = 0; i < n_buffers; ++i) {
ioctl_buffer[i] = (struct xrp_ioctl_buffer){
.flags = buffer_group->buffer[i].access_flags,
.size = buffer_group->buffer[i].buffer->size,
.addr = (uintptr_t)buffer_group->buffer[i].buffer->ptr,
};
}
if (buffer_group)
xrp_mutex_unlock(&buffer_group->mutex);
ret = ioctl(queue->device->impl.fd,
XRP_IOCTL_QUEUE, &ioctl_queue);
}
// printf("%s, user out data\n",__func__);
if (ret < 0)
set_status(status, XRP_STATUS_FAILURE);
else
set_status(status, XRP_STATUS_SUCCESS);
}
static void xrp_request_process(struct xrp_queue_item *q,
void *context)
{
enum xrp_status status;
struct xrp_request *rq = (struct xrp_request *)q;
_xrp_run_command(context,
rq->in_data, rq->in_data_size,
rq->out_data, rq->out_data_size,
rq->buffer_group,
&status);
if (rq->buffer_group)
xrp_release_buffer_group(rq->buffer_group);
if (rq->event) {
xrp_impl_broadcast_event(rq->event, status);
xrp_release_event(rq->event);
}
// printf("%s,get resp with event %p!\n",__func__,rq->event);
free(rq->in_data);
free(rq);
}
void xrp_impl_create_queue(struct xrp_queue *queue,
enum xrp_status *status)
{
xrp_queue_init(&queue->impl.queue, queue->priority,
queue, xrp_request_process);
set_status(status, XRP_STATUS_SUCCESS);
}
void xrp_impl_release_queue(struct xrp_queue *queue)
{
xrp_queue_destroy(&queue->impl.queue);
}
/* Communication API */
void xrp_enqueue_command(struct xrp_queue *queue,
const void *in_data, size_t in_data_size,
void *out_data, size_t out_data_size,
struct xrp_buffer_group *buffer_group,
struct xrp_event **evt,
enum xrp_status *status)
{
struct xrp_request *rq;
void *in_data_copy;
rq = malloc(sizeof(*rq));
in_data_copy = malloc(in_data_size);
if (!rq || (in_data_size && !in_data_copy)) {
free(in_data_copy);
free(rq);
set_status(status, XRP_STATUS_FAILURE);
return;
}
memcpy(in_data_copy, in_data, in_data_size);
rq->in_data = in_data_copy;
rq->in_data_size = in_data_size;
rq->out_data = out_data;
rq->out_data_size = out_data_size;
if (evt) {
struct xrp_event *event = xrp_event_create();
if (!event) {
free(rq->in_data);
free(rq);
set_status(status, XRP_STATUS_FAILURE);
return;
}
xrp_retain_queue(queue);
event->queue = queue;
*evt = event;
xrp_retain_event(event);
rq->event = event;
} else {
rq->event = NULL;
}
if (buffer_group)
xrp_retain_buffer_group(buffer_group);
rq->buffer_group = buffer_group;
set_status(status, XRP_STATUS_SUCCESS);
xrp_queue_push(&queue->impl.queue, &rq->q);
}
static struct xrp_report *reporter;
void xrp_reporter_sig_handler()
{
// printf("%s\n",__func__);
struct xrp_report_buffer *report_buffer;
if(!reporter || !reporter->report_buf)
{
return;
}
report_buffer = (struct xrp_report_buffer *)reporter->report_buf;
// printf("buffer:%lx,id:%d,data:%x,%x,%x,%x\n",report_buffer,report_buffer->report_id,report_buffer->data[0],report_buffer->data[1],report_buffer->data[2],report_buffer->data[3]);
xrp_process_report(&reporter->list,report_buffer->data,report_buffer->report_id);
}
int xrp_add_report_item_with_id(struct xrp_report *report,
int (*cb)(void*context,void*data),
int report_id,
void* context,
size_t data_size)
{
// int id;
// // set_status(status, XRP_STATUS_SUCCESS);
// id =xrp_alloc_report_id(&report->list);
if(report_id<0 || !report)
{
// set_status(status, XRP_STATUS_FAILURE);
return -1;
}
if(data_size>report->buf_size)
{
//realloc()
DSP_PRINT(WARNING,"report instance size %d is exceed limit %d\n",data_size,report->buf_size);
// set_status(status, XRP_STATUS_FAILURE);
return -1;
}
char *report_buf = malloc(data_size);
if(!report_buf)
{
// set_status(status, XRP_STATUS_FAILURE);
return -1;
}
struct xrp_report_item new_item={
.report_id = report_id,
.buf = report_buf,
.size = data_size,
.context = context,
.fn = cb,
};
DSP_PRINT(DEBUG,"add report id:%d\n", report_id);
if(xrp_add_report(&report->list,&new_item))
{
free(report_buf);
return -1;
}
DSP_PRINT(INFO,"the report item: %d is added sucessfully\n",report_id);
return report_id;
}
int xrp_add_report_item(struct xrp_report *report,
int (*cb)(void*context,void*data),
void* context,
size_t data_size)
{
int id;
id =xrp_alloc_report_id(&report->list);
if(id<0)
{
return -1;
}
return xrp_add_report_item_with_id(report,cb,id,context,data_size);
}
void xrp_remove_report_item(struct xrp_report *report,int report_id)
{
int id;
struct xrp_report_item* item=xrp_get_report_entry(&report->list,report_id);
free(item->buf);
xrp_remove_report(&report->list,report_id);
}
void xrp_impl_create_report(struct xrp_device *device,
struct xrp_report *report,
size_t size,
enum xrp_status *status)
{
// char *report_buf = malloc(size+4);
// if(!report_buf)
// {
// set_status(status, XRP_STATUS_FAILURE);
// return;
// }
struct xrp_ioctl_alloc ioctl_alloc = {
.addr = (uintptr_t)NULL,
.size = size,
};
int ret;
xrp_retain_device(device);
report->device = device;
ret = ioctl(report->device->impl.fd, XRP_IOCTL_REPORT_CREATE, &ioctl_alloc);
if (ret < 0) {
// free(report_buf);
set_status(status, XRP_STATUS_FAILURE);
return;
}
if(ioctl_alloc.addr ==NULL)
{
DSP_PRINT(INFO,"alloc report buffer fail\n");
set_status(status, XRP_STATUS_FAILURE);
return ;
}
report->report_buf = (void *)(uintptr_t)ioctl_alloc.addr;
// printf("buf:%lx,report:x\n",ioctl_alloc.addr,report);
report->buf_size = size;
report->list.queue.head=NULL;
reporter=report;
signal(SIGIO, xrp_reporter_sig_handler); /* sigaction() is better */
fcntl(report->device->impl.fd, F_SETOWN, getpid());
int oflags = fcntl(report->device->impl.fd, F_GETFL);
fcntl(report->device->impl.fd, F_SETFL, oflags | FASYNC);
set_status(status, XRP_STATUS_SUCCESS);
DSP_PRINT(INFO,"buf:%lx,user space report create\n",ioctl_alloc.addr);
}
void xrp_impl_release_report(struct xrp_device *device,
struct xrp_report *report,enum xrp_status *status)
{
struct xrp_ioctl_alloc ioctl_alloc = {
.addr = (uintptr_t)report->report_buf,
.size = report->buf_size,
};
int ret = ioctl(report->device->impl.fd, XRP_IOCTL_REPORT_RELEASE, &ioctl_alloc);
if (ret < 0) {
// free(report_buf);
set_status(status, XRP_STATUS_FAILURE);
return;
}
report->report_buf=NULL;
xrp_release_device(device);
set_status(status, XRP_STATUS_SUCCESS);
return;
}
void xrp_import_dma_buf(struct xrp_device *device, int fd,enum xrp_access_flags flag,uint64_t *phy_addr,
uint64_t *user_addr,size_t* size,enum xrp_status *status)
{
struct xrp_dma_buf dma_buf;
if(fd < 0 || !(flag&XRP_FLAG_READ_WRITE))
{
set_status(status, XRP_STATUS_FAILURE);
DSP_PRINT(DEBUG,"param check fail\n");
return;
}
dma_buf.fd = fd;
dma_buf.flags = flag;
int ret = ioctl(device->impl.fd, XRP_IOCTL_DMABUF_IMPORT,&dma_buf);
if (ret < 0) {
DSP_PRINT(DEBUG,"_DMABUF_IMPORT fail\n");
set_status(status, XRP_STATUS_FAILURE);
}
else
{
*phy_addr = dma_buf.paddr;
*user_addr = dma_buf.addr;
*size = dma_buf.size;
set_status(status, XRP_STATUS_SUCCESS);
}
return;
}
void xrp_release_dma_buf(struct xrp_device *device, int fd,enum xrp_status *status)
{
if(fd < 0)
{
set_status(status, XRP_STATUS_FAILURE);
return;
}
int ret = ioctl(device->impl.fd, XRP_IOCTL_DMABUF_RELEASE,&fd);
if (ret < 0) {
set_status(status, XRP_STATUS_FAILURE);
}
else
{
set_status(status, XRP_STATUS_SUCCESS);
}
return ;
}
void xrp_flush_dma_buf(struct xrp_device *device, int fd,enum xrp_access_flags flag,enum xrp_status *status)
{
struct xrp_dma_buf dma_buf;
dma_buf.fd = fd;
dma_buf.flags = flag;
if(fd < 0)
{
set_status(status, XRP_STATUS_FAILURE);
return;
}
int ret = ioctl(device->impl.fd, XRP_IOCTL_DMABUF_SYNC,&dma_buf);
if (ret < 0) {
set_status(status, XRP_STATUS_FAILURE);
}
else
{
set_status(status, XRP_STATUS_SUCCESS);
}
}

View File

@@ -0,0 +1,24 @@
/*
* Copyright (c) 2018 Cadence Design Systems Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include "xrp_threaded_queue.h"

View File

@@ -0,0 +1,107 @@
/*
* Copyright (c) 2018 Cadence Design Systems Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef _XRP_THREAD_PTHREAD_IMPL_H
#define _XRP_THREAD_PTHREAD_IMPL_H
#include <pthread.h>
typedef pthread_t xrp_thread;
typedef pthread_mutex_t xrp_mutex;
typedef struct xrp_cond {
pthread_mutex_t mutex;
pthread_cond_t cond;
} xrp_cond;
static inline void xrp_mutex_init(xrp_mutex *p)
{
pthread_mutex_init(p, NULL);
}
static inline void xrp_mutex_lock(xrp_mutex *p)
{
pthread_mutex_lock(p);
}
static inline void xrp_mutex_unlock(xrp_mutex *p)
{
pthread_mutex_unlock(p);
}
static inline void xrp_mutex_destroy(xrp_mutex *p)
{
pthread_mutex_destroy(p);
}
static inline void xrp_cond_init(xrp_cond *p)
{
pthread_mutex_init(&p->mutex, NULL);
pthread_cond_init(&p->cond, NULL);
}
static inline void xrp_cond_lock(xrp_cond *p)
{
pthread_mutex_lock(&p->mutex);
}
static inline void xrp_cond_unlock(xrp_cond *p)
{
pthread_mutex_unlock(&p->mutex);
}
static inline void xrp_cond_broadcast(xrp_cond *p)
{
pthread_cond_broadcast(&p->cond);
}
static inline void xrp_cond_wait(xrp_cond *p)
{
pthread_cond_wait(&p->cond, &p->mutex);
}
static inline void xrp_cond_destroy(xrp_cond *p)
{
pthread_mutex_destroy(&p->mutex);
pthread_cond_destroy(&p->cond);
}
static inline int xrp_thread_create(xrp_thread *thread, int priority,
void *(*thread_func)(void *),
void *p)
{
(void)priority;
return pthread_create(thread, NULL, thread_func, p) == 0;
}
static inline int xrp_thread_join(xrp_thread *thread)
{
return pthread_join(*thread, NULL) == 0;
}
static inline int xrp_thread_detach(xrp_thread *thread)
{
return pthread_detach(*thread) == 0;
}
#endif

View File

@@ -0,0 +1,31 @@
/*
* Copyright (c) 2018 Cadence Design Systems Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef _XRP_ATOMIC_H
#define _XRP_ATOMIC_H
#if defined(__STDC_NO_ATOMICS__)
#warning The compiler does not support atomics, reference counting may not be thread safe
#endif
#endif

View File

@@ -0,0 +1,482 @@
/*
* Copyright (c) 2016 - 2018 Cadence Design Systems Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include "xrp_api.h"
#include "xrp_host_common.h"
#include "dsp_common.h"
/* Device API. */
void xrp_retain_device(struct xrp_device *device)
{
DSP_PRINT(DEBUG," ref %d\n",device->ref.count);
retain_refcounted(device);
}
void xrp_release_device(struct xrp_device *device)
{
DSP_PRINT(DEBUG,"ref %d\n",device->ref.count);
if (last_release_refcounted(device)) {
xrp_impl_release_device(device);
free(device);
}
}
/* Buffer API. */
struct xrp_buffer *xrp_create_buffer(struct xrp_device *device,
size_t size, void *host_ptr,
enum xrp_status *status)
{
struct xrp_buffer *buf;
if (!host_ptr && !device) {
set_status(status, XRP_STATUS_FAILURE);
return NULL;
}
buf = alloc_refcounted(sizeof(*buf));
if (!buf) {
set_status(status, XRP_STATUS_FAILURE);
return NULL;
}
if (!host_ptr) {
enum xrp_status s;
buf->type = XRP_BUFFER_TYPE_DEVICE;
xrp_impl_create_device_buffer(device, buf, size, &s);
if (s != XRP_STATUS_SUCCESS) {
free(buf);
buf = NULL;
}
set_status(status, s);
} else {
buf->type = XRP_BUFFER_TYPE_HOST;
buf->ptr = host_ptr;
buf->size = size;
set_status(status, XRP_STATUS_SUCCESS);
}
// printf("%s,Debug V:%llx,P:%llx\n",__FUNCTION__,buf->ptr,buf->phy_addr);
return buf;
}
void xrp_retain_buffer(struct xrp_buffer *buffer)
{
retain_refcounted(buffer);
}
void xrp_release_buffer(struct xrp_buffer *buffer)
{
DSP_PRINT(DEBUG,"ref:%d\n",buffer->ref.count);
if (last_release_refcounted(buffer)) {
// printf("%s,ref:%d\n",__FUNCTION__,buffer->ref.count);
if (buffer->type == XRP_BUFFER_TYPE_DEVICE)
xrp_impl_release_device_buffer(buffer);
free(buffer);
}
}
void *xrp_map_buffer(struct xrp_buffer *buffer, size_t offset, size_t size,
enum xrp_access_flags map_flags, enum xrp_status *status)
{
if (offset <= buffer->size &&
size <= buffer->size - offset) {
retain_refcounted(buffer);
(void)++buffer->map_count;
buffer->map_flags |= map_flags;
set_status(status, XRP_STATUS_SUCCESS);
return (char *)buffer->ptr + offset;
}
set_status(status, XRP_STATUS_FAILURE);
return NULL;
}
void xrp_unmap_buffer(struct xrp_buffer *buffer, void *p,
enum xrp_status *status)
{
if (p >= buffer->ptr &&
(size_t)((char *)p - (char *)buffer->ptr) <= buffer->size) {
(void)--buffer->map_count;
xrp_release_buffer(buffer);
set_status(status, XRP_STATUS_SUCCESS);
} else {
set_status(status, XRP_STATUS_FAILURE);
}
}
void xrp_buffer_get_info(struct xrp_buffer *buffer, enum xrp_buffer_info info,
void *out, size_t out_sz, enum xrp_status *status)
{
enum xrp_status s = XRP_STATUS_FAILURE;
size_t sz;
void *ptr;
switch (info) {
case XRP_BUFFER_SIZE_SIZE_T:
sz = sizeof(buffer->size);
ptr = &buffer->size;
break;
case XRP_BUFFER_HOST_POINTER_PTR:
if (buffer->type != XRP_BUFFER_TYPE_HOST) {
static void *p = NULL;
ptr = &p;
} else {
ptr = &buffer->ptr;
}
sz = sizeof(void *);
break;
case XRP_BUFFER_PHY_ADDR:
ptr = &buffer->phy_addr;
sz = sizeof(void *);
break;
case XRP_BUFFER_USER_ADDR:
ptr = &buffer->ptr;
sz = sizeof(void *);
break;
default:
goto out;
}
if (sz == out_sz) {
memcpy(out, ptr, sz);
s = XRP_STATUS_SUCCESS;
}
out:
set_status(status, s);
}
/* Buffer group API. */
struct xrp_buffer_group *xrp_create_buffer_group(enum xrp_status *status)
{
struct xrp_buffer_group *group = alloc_refcounted(sizeof(*group));
if (group) {
xrp_mutex_init(&group->mutex);
set_status(status, XRP_STATUS_SUCCESS);
} else {
set_status(status, XRP_STATUS_FAILURE);
}
return group;
}
void xrp_retain_buffer_group(struct xrp_buffer_group *group)
{
retain_refcounted(group);
}
void xrp_release_buffer_group(struct xrp_buffer_group *group)
{
if (last_release_refcounted(group)) {
size_t i;
xrp_mutex_lock(&group->mutex);
for (i = 0; i < group->n_buffers; ++i)
xrp_release_buffer(group->buffer[i].buffer);
xrp_mutex_unlock(&group->mutex);
xrp_mutex_destroy(&group->mutex);
free(group->buffer);
free(group);
}
}
size_t xrp_add_buffer_to_group(struct xrp_buffer_group *group,
struct xrp_buffer *buffer,
enum xrp_access_flags access_flags,
enum xrp_status *status)
{
size_t n_buffers;
xrp_mutex_lock(&group->mutex);
if (group->n_buffers == group->capacity) {
struct xrp_buffer_group_record *r =
realloc(group->buffer,
sizeof(struct xrp_buffer_group_record) *
((group->capacity + 2) * 2));
if (r == NULL) {
xrp_mutex_unlock(&group->mutex);
set_status(status, XRP_STATUS_FAILURE);
return -1;
}
group->buffer = r;
group->capacity = (group->capacity + 2) * 2;
}
xrp_retain_buffer(buffer);
group->buffer[group->n_buffers].buffer = buffer;
group->buffer[group->n_buffers].access_flags = access_flags;
n_buffers = group->n_buffers++;
xrp_mutex_unlock(&group->mutex);
set_status(status, XRP_STATUS_SUCCESS);
return n_buffers;
}
void xrp_set_buffer_in_group(struct xrp_buffer_group *group,
size_t index,
struct xrp_buffer *buffer,
enum xrp_access_flags access_flags,
enum xrp_status *status)
{
struct xrp_buffer *old_buffer;
xrp_retain_buffer(buffer);
xrp_mutex_lock(&group->mutex);
if (index < group->n_buffers) {
old_buffer = group->buffer[index].buffer;
group->buffer[index].buffer = buffer;
group->buffer[index].access_flags = access_flags;
set_status(status, XRP_STATUS_SUCCESS);
} else {
old_buffer = buffer;
set_status(status, XRP_STATUS_FAILURE);
}
xrp_mutex_unlock(&group->mutex);
xrp_release_buffer(old_buffer);
}
struct xrp_buffer *xrp_get_buffer_from_group(struct xrp_buffer_group *group,
size_t idx,
enum xrp_status *status)
{
struct xrp_buffer *buffer = NULL;
xrp_mutex_lock(&group->mutex);
if (idx < group->n_buffers) {
buffer = group->buffer[idx].buffer;
// xrp_retain_buffer(buffer); temp fix for buffer ref;
set_status(status, XRP_STATUS_SUCCESS);
} else {
set_status(status, XRP_STATUS_FAILURE);
}
xrp_mutex_unlock(&group->mutex);
return buffer;
}
void xrp_buffer_group_get_info(struct xrp_buffer_group *group,
enum xrp_buffer_group_info info, size_t idx,
void *out, size_t out_sz,
enum xrp_status *status)
{
enum xrp_status s = XRP_STATUS_FAILURE;
size_t sz;
void *ptr;
xrp_mutex_lock(&group->mutex);
switch (info) {
case XRP_BUFFER_GROUP_BUFFER_FLAGS_ENUM:
if (idx >= group->n_buffers)
goto out;
sz = sizeof(group->buffer[idx].access_flags);
ptr = &group->buffer[idx].access_flags;
break;
case XRP_BUFFER_GROUP_SIZE_SIZE_T:
sz = sizeof(group->n_buffers);
ptr = &group->n_buffers;
break;
default:
goto out;
}
if (sz == out_sz) {
memcpy(out, ptr, sz);
s = XRP_STATUS_SUCCESS;
}
out:
xrp_mutex_unlock(&group->mutex);
set_status(status, s);
}
/* Queue API. */
struct xrp_queue *xrp_create_queue(struct xrp_device *device,
enum xrp_status *status)
{
return xrp_create_ns_queue(device, NULL, status);
}
struct xrp_queue *xrp_create_ns_queue(struct xrp_device *device,
const void *nsid,
enum xrp_status *status)
{
return xrp_create_nsp_queue(device, nsid, 0, status);
}
struct xrp_queue *xrp_create_nsp_queue(struct xrp_device *device,
const void *nsid,
int priority,
enum xrp_status *status)
{
struct xrp_queue *queue;
xrp_retain_device(device);
queue = alloc_refcounted(sizeof(*queue));
if (!queue) {
xrp_release_device(device);
set_status(status, XRP_STATUS_FAILURE);
return NULL;
}
queue->device = device;
if (nsid) {
queue->use_nsid = 1;
memcpy(queue->nsid, nsid, XRP_NAMESPACE_ID_SIZE);
}
queue->priority = priority;
xrp_impl_create_queue(queue, status);
return queue;
}
void xrp_retain_queue(struct xrp_queue *queue)
{
retain_refcounted(queue);
}
void xrp_release_queue(struct xrp_queue *queue)
{
DSP_PRINT(DEBUG," ref %d\n",queue->ref.count);
if (last_release_refcounted(queue)) {
xrp_impl_release_queue(queue);
xrp_release_device(queue->device);
free(queue);
}
}
/* Event API. */
void xrp_retain_event(struct xrp_event *event)
{
retain_refcounted(event);
}
void xrp_release_event(struct xrp_event *event)
{
DSP_PRINT(TRACE,"event %p ref:%d\n",event,event->ref.count);
if (last_release_refcounted(event)) {
xrp_impl_release_event(event);
xrp_release_queue(event->queue);
free(event);
}
}
void xrp_event_status(struct xrp_event *event, enum xrp_status *status)
{
set_status(status, event->status);
}
/* Communication API */
void xrp_run_command_sync(struct xrp_queue *queue,
const void *in_data, size_t in_data_size,
void *out_data, size_t out_data_size,
struct xrp_buffer_group *buffer_group,
enum xrp_status *status)
{
struct xrp_event *evt;
enum xrp_status s;
xrp_enqueue_command(queue, in_data, in_data_size,
out_data, out_data_size,
buffer_group, &evt, &s);
if (s != XRP_STATUS_SUCCESS) {
set_status(status, s);
return;
}
xrp_wait(evt, NULL);
xrp_event_status(evt, status);
xrp_release_event(evt);
}
/*reproter 机制的buffer 需要从用户态去allocated 通知DSP 并且需要pingpong*/
struct xrp_report *xrp_create_reporter(struct xrp_device *device,size_t size)
{
struct xrp_report *report;
enum xrp_status status;
report = alloc_refcounted(sizeof(*report));
if (!report) {
// set_status(status, XRP_STATUS_FAILURE);
return NULL;
}
xrp_impl_create_report(device,report,size,&status);
if(XRP_STATUS_FAILURE ==status)
{
free(report);
return NULL;
}
return report;
}
int xrp_release_reporter(struct xrp_device *device,struct xrp_report *report)
{
enum xrp_status status;
if (!report) {
// set_status(status, XRP_STATUS_FAILURE);
return 0;
}
if(last_release_refcounted(report))
{
xrp_impl_release_report(device,report,&status);
}
if(XRP_STATUS_FAILURE ==status)
{
DSP_PRINT(WARNING,"release report fail\n");
return -1;
}
free(report);
return 0;
}
// struct xrp_report *xrp_add_report_itme(struct xrp_report *report,size_t size,enum xrp_status *status)
// {
// void xrp_impl_add_report_item(struct xrp_report *report,
// int (*cb)(void*context,void*data),
// void* context,
// size_t data_size,
// enum xrp_status *status)
// }

View File

@@ -0,0 +1,138 @@
/*
* Copyright (c) 2016 - 2018 Cadence Design Systems Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef _XRP_HOST_COMMON_H
#define _XRP_HOST_COMMON_H
#include <stdlib.h>
#include <stdint.h>
#include "xrp_atomic.h"
#include "xrp_thread_impl.h"
#include "xrp_host_impl.h"
#include "xrp_report.h"
struct xrp_refcounted {
_Atomic unsigned long count;
};
struct xrp_device {
struct xrp_refcounted ref;
struct xrp_device_impl impl;
};
struct xrp_buffer {
struct xrp_refcounted ref;
struct xrp_device *device;
enum {
XRP_BUFFER_TYPE_HOST,
XRP_BUFFER_TYPE_DEVICE,
} type;
void *ptr;
uint64_t phy_addr;
size_t size;
_Atomic unsigned long map_count;
enum xrp_access_flags map_flags;
struct xrp_buffer_impl impl;
};
struct xrp_buffer_group_record {
struct xrp_buffer *buffer;
enum xrp_access_flags access_flags;
};
struct xrp_buffer_group {
struct xrp_refcounted ref;
xrp_mutex mutex;
size_t n_buffers;
size_t capacity;
struct xrp_buffer_group_record *buffer;
};
struct xrp_queue {
struct xrp_refcounted ref;
struct xrp_device *device;
int use_nsid;
int priority;
char nsid[XRP_NAMESPACE_ID_SIZE];
struct xrp_queue_impl impl;
};
struct xrp_event_link {
struct xrp_event *group;
struct xrp_event_link *next, *prev;
};
struct xrp_event {
struct xrp_refcounted ref;
struct xrp_queue *queue;
_Atomic enum xrp_status status;
struct xrp_event_impl impl;
struct xrp_event *group;
struct xrp_event_link *link;
};
struct xrp_report{
struct xrp_refcounted ref;
struct xrp_device *device;
struct xrp_report_list list;
void *report_buf;
int buf_size;
};
/* Helpers */
static inline void set_status(enum xrp_status *status, enum xrp_status v)
{
if (status)
*status = v;
}
static inline void *alloc_refcounted(size_t sz)
{
void *buf = calloc(1, sz);
struct xrp_refcounted *ref = buf;
if (ref)
ref->count = 1;
return buf;
}
static inline void retain_refcounted(void *buf)
{
struct xrp_refcounted *ref = buf;
(void)++ref->count;
}
static inline int last_release_refcounted(void *buf)
{
struct xrp_refcounted *ref = buf;
return --ref->count == 0;
}
#endif

View File

@@ -0,0 +1,139 @@
/*
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <signal.h>
#include "xrp_debug.h"
#include "xrp_report.h"
#include "xrp_thread_impl.h"
#include "dsp_common.h"
// void xrp_reporter_init(struct xrp_report_list *list)
// {
// g_list=list;
// g_list->queue.head=NULL;
// }
struct xrp_report_item* xrp_get_report_entry(struct xrp_report_list *list,int id)
{
struct xrp_report_entry *cur_entry=list->queue.head;
for(;cur_entry!=NULL;cur_entry=cur_entry->next)
{
if(((struct xrp_report_item *)cur_entry)->report_id == id)
{
return (struct xrp_report_item*)cur_entry;
}
}
return NULL;
}
void xrp_process_report(struct xrp_report_list *list,void* data,unsigned int id)
{
struct xrp_report_item* report_item= xrp_get_report_entry(list,id);
if(!report_item)
{
DSP_PRINT(WARNING,"No valid report item by id (%d)\n",id);
return;
}
if(!report_item->fn ||
(report_item->size&&!report_item->buf)){
return;
}
memcpy(report_item->buf,data,report_item->size);
int *ptr=report_item->buf;
report_item->fn(report_item->context,report_item->buf);
}
int xrp_add_report(struct xrp_report_list *list,
struct xrp_report_item *item)
{
// xrp_cond_lock(&queue->request_queue_cond);
struct xrp_report_entry *entry_head=list->queue.head;
struct xrp_report_entry *entry_cur=NULL;
struct xrp_report_item *new_item;
new_item = malloc(sizeof(struct xrp_report_item));
if(!new_item)
{
return -1;
}
memcpy(new_item,item,sizeof(struct xrp_report_item));
new_item->entry.next=NULL;
if(NULL==entry_head)
{
list->queue.head= &new_item->entry;
return 0;
}
for(;entry_head!=NULL;entry_head=entry_head->next)
{
entry_cur = entry_head;
if(((struct xrp_report_item *)entry_head)->report_id == new_item->report_id)
{
DSP_PRINT(WARNING,"the report is already exist\n");
return -1;
}
}
entry_cur->next=&new_item->entry;
DSP_PRINT(INFO,"add new report item %d\n",new_item->report_id);
return 0;
// xrp_cond_unlock(&queue->request_queue_cond);
}
int xrp_remove_report(struct xrp_report_list *list,int id)
{
struct xrp_report_entry *pre_entry=NULL;
struct xrp_report_entry *cur_entry=list->queue.head;
for(;cur_entry!=NULL;pre_entry=cur_entry,cur_entry=cur_entry->next)
{
if(((struct xrp_report_item *)cur_entry)->report_id == id)
{
if(pre_entry==NULL)
{
list->queue.head = cur_entry->next;
}
else{
pre_entry->next=cur_entry->next;
}
free(cur_entry);
return 0;
}
}
return -1;
}
int xrp_alloc_report_id(struct xrp_report_list *list)
{
int new_id;
int retry=0;
while(1)
{
new_id= rand()&0x7fffffff;
struct xrp_report_entry *cur_entry=list->queue.head;
for(;cur_entry!=NULL;cur_entry=cur_entry->next)
{
if(((struct xrp_report_item *)cur_entry)->report_id == new_id)
{
retry++;
if(retry>10)
{
DSP_PRINT(WARNING,"alloc report id fail");
return -1;
}
break;
}
}
return new_id;
}
}

View File

@@ -0,0 +1,61 @@
/*
* Copyright (c) 2018 Cadence Design Systems Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef _XRP_REPORT_H
#define _XRP_REPORT_H
struct xrp_report_entry {
struct xrp_report_entry * next;
};
struct xrp_report_item {
struct xrp_report_entry entry;
int report_id;
void *buf;
int size;
void (*fn)( void *context,void * data);
void * context;
};
struct xrp_report_list{
struct {
struct xrp_report_entry *head;
} queue;
};
extern void xrp_process_report(struct xrp_report_list *list,void* data,unsigned int id);
extern int xrp_add_report(struct xrp_report_list *list,
struct xrp_report_item *item);
extern int xrp_remove_report(struct xrp_report_list *list,int id);
extern int xrp_alloc_report_id(struct xrp_report_list *list);
extern struct xrp_report_item* xrp_get_report_entry(struct xrp_report_list *list,int id);
#endif

View File

@@ -0,0 +1,84 @@
/*
* Copyright (c) 2016 - 2018 Cadence Design Systems Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <stdio.h>
#include "xrp_host_common.h"
#include "xrp_sync_queue.h"
void xrp_queue_init(struct xrp_request_queue *queue, int priority,
void *context,
void (*fn)(struct xrp_queue_item *rq, void *context))
{
(void)priority;
queue->context = context;
queue->fn = fn;
}
void xrp_queue_destroy(struct xrp_request_queue *queue)
{
(void)queue;
}
void xrp_queue_push(struct xrp_request_queue *queue,
struct xrp_queue_item *rq)
{
queue->fn(rq, queue->context);
}
struct xrp_event *xrp_event_create(void)
{
struct xrp_event *event = alloc_refcounted(sizeof(*event));
if (!event)
return NULL;
event->status = XRP_STATUS_PENDING;
return event;
}
void xrp_wait(struct xrp_event *event, enum xrp_status *status)
{
if (event->status == XRP_STATUS_PENDING)
set_status(status, XRP_STATUS_FAILURE);
else
set_status(status, XRP_STATUS_SUCCESS);
}
size_t xrp_wait_any(struct xrp_event **event, size_t n_events,
enum xrp_status *status)
{
if (n_events && event[0]->status != XRP_STATUS_PENDING)
set_status(status, XRP_STATUS_SUCCESS);
else
set_status(status, XRP_STATUS_FAILURE);
return 0;
}
void xrp_impl_broadcast_event(struct xrp_event *event, enum xrp_status status)
{
event->status = status;
}
void xrp_impl_release_event(struct xrp_event *event)
{
(void)event;
}

View File

@@ -0,0 +1,52 @@
/*
* Copyright (c) 2018 Cadence Design Systems Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef _XRP_SYNC_QUEUE_IMPL_H
#define _XRP_SYNC_QUEUE_IMPL_H
#include "xrp_thread_impl.h"
struct xrp_queue_item {
};
struct xrp_request_queue {
void *context;
void (*fn)(struct xrp_queue_item *rq, void *context);
};
struct xrp_event_impl {
xrp_cond cond;
};
void xrp_queue_init(struct xrp_request_queue *queue, int priority,
void *context,
void (*fn)(struct xrp_queue_item *rq, void *context));
void xrp_queue_destroy(struct xrp_request_queue *queue);
void xrp_queue_push(struct xrp_request_queue *queue,
struct xrp_queue_item *rq);
struct xrp_event *xrp_event_create(void);
void xrp_impl_broadcast_event(struct xrp_event *event, enum xrp_status status);
void xrp_impl_release_event(struct xrp_event *event);
#endif

View File

@@ -0,0 +1,242 @@
/*
* Copyright (c) 2016 - 2018 Cadence Design Systems Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <stdio.h>
#include "xrp_debug.h"
#include "xrp_host_common.h"
#include "xrp_threaded_queue.h"
#include "dsp_common.h"
static struct xrp_queue_item *_xrp_dequeue_request(struct xrp_request_queue *queue)
{
struct xrp_queue_item *rq = queue->request_queue.head;
if (!rq)
return NULL;
if (rq == queue->request_queue.tail)
queue->request_queue.tail = NULL;
queue->request_queue.head = rq->next;
return rq;
}
static int xrp_queue_process(struct xrp_request_queue *queue)
{
struct xrp_queue_item *rq;
int exit = 0;
queue->sync_exit = &exit;
xrp_cond_lock(&queue->request_queue_cond);
for (;;) {
rq = _xrp_dequeue_request(queue);
if (rq || queue->exit)
break;
xrp_cond_wait(&queue->request_queue_cond);
}
xrp_cond_unlock(&queue->request_queue_cond);
if (!rq)
return 0;
// printf("%s,queue:%p get item\n",__FUNCTION__,queue);
queue->fn(rq, queue->context);
// printf("%s,queue:%p done item\n",__FUNCTION__,queue);
return !exit;
}
static void *xrp_queue_thread(void *p)
{
struct xrp_request_queue *queue = p;
DSP_PRINT(DEBUG,"queue:%p runing....\n",queue);
while (xrp_queue_process(queue)) {
}
DSP_PRINT(DEBUG,"queue:%p exit\n",queue);
return NULL;
}
void xrp_queue_init(struct xrp_request_queue *queue, int priority,
void *context,
void (*fn)(struct xrp_queue_item *rq, void *context))
{
xrp_cond_init(&queue->request_queue_cond);
queue->context = context;
queue->fn = fn;
xrp_thread_create(&queue->thread, priority, xrp_queue_thread, queue);
}
void xrp_queue_destroy(struct xrp_request_queue *queue)
{
xrp_cond_lock(&queue->request_queue_cond);
queue->exit = 1;
xrp_cond_broadcast(&queue->request_queue_cond);
xrp_cond_unlock(&queue->request_queue_cond);
if (!xrp_thread_join(&queue->thread)) {
*queue->sync_exit = 1;
xrp_thread_detach(&queue->thread);
DSP_PRINT(DEBUG,"queue thread release\n");
}
xrp_cond_lock(&queue->request_queue_cond);
if (queue->request_queue.head != NULL)
DSP_PRINT(DEBUG,"releasing non-empty queue\n");
xrp_cond_unlock(&queue->request_queue_cond);
xrp_cond_destroy(&queue->request_queue_cond);
}
void xrp_queue_push(struct xrp_request_queue *queue,
struct xrp_queue_item *rq)
{
xrp_cond_lock(&queue->request_queue_cond);
rq->next = NULL;
if (queue->request_queue.tail) {
queue->request_queue.tail->next = rq;
} else {
queue->request_queue.head = rq;
xrp_cond_broadcast(&queue->request_queue_cond);
}
queue->request_queue.tail = rq;
xrp_cond_unlock(&queue->request_queue_cond);
}
static void xrp_impl_event_init(struct xrp_event *event)
{
xrp_cond_init(&event->impl.cond);
event->status = XRP_STATUS_PENDING;
}
struct xrp_event *xrp_event_create(void)
{
struct xrp_event *event = alloc_refcounted(sizeof(*event));
if (!event)
return NULL;
xrp_impl_event_init(event);
return event;
}
void xrp_wait(struct xrp_event *event, enum xrp_status *status)
{
xrp_cond_lock(&event->impl.cond);
while (event->status == XRP_STATUS_PENDING)
xrp_cond_wait(&event->impl.cond);
xrp_cond_unlock(&event->impl.cond);
set_status(status, XRP_STATUS_SUCCESS);
// printf("%s,get event %p\n",__FUNCTION__,event);
}
size_t xrp_wait_any(struct xrp_event **event, size_t n_events,
enum xrp_status *status)
{
size_t i, rv;
struct xrp_event group;
struct xrp_event_link *link;
if (!n_events) {
set_status(status, XRP_STATUS_FAILURE);
return 0;
}
link = calloc(n_events, sizeof(struct xrp_event_link));
xrp_impl_event_init(&group);
for (i = 0; i < n_events; ++i) {
xrp_cond_lock(&event[i]->impl.cond);
if (event[i]->status == XRP_STATUS_PENDING) {
link[i].group = event[i]->group;
link[i].next = event[i]->link;
if (event[i]->link)
event[i]->link->prev = link + i;
event[i]->group = &group;
event[i]->link = link + i;
} else {
xrp_cond_unlock(&event[i]->impl.cond);
break;
}
xrp_cond_unlock(&event[i]->impl.cond);
}
rv = i;
if (i == n_events)
xrp_wait(&group, NULL);
else
n_events = i;
for (i = 0; i < n_events; ++i) {
xrp_cond_lock(&event[i]->impl.cond);
if (event[i]->group == &group) {
event[i]->group = link[i].group;
event[i]->link = link[i].next;
}
if (link[i].next) {
link[i].next->prev = link[i].prev;
}
if (link[i].prev) {
if (link[i].prev->group == &group) {
link[i].prev->group = link[i].group;
link[i].prev->next = link[i].next;
} else {
pr_debug("%s: inconsistent link state\n");
}
}
if (event[i]->status != XRP_STATUS_PENDING)
rv = i;
xrp_cond_unlock(&event[i]->impl.cond);
}
xrp_impl_release_event(&group);
free(link);
set_status(status, XRP_STATUS_SUCCESS);
return rv;
}
void xrp_impl_broadcast_event(struct xrp_event *event, enum xrp_status status)
{
struct xrp_event *group;
struct xrp_event_link *link;
// printf("%s, event %p! entry\n",__func__,event);
xrp_cond_lock(&event->impl.cond);
event->status = status;
xrp_cond_broadcast(&event->impl.cond);
group = event->group;
link = event->link;
while (link) {
xrp_cond_lock(&group->impl.cond);
group->status = status;
xrp_cond_broadcast(&group->impl.cond);
xrp_cond_unlock(&group->impl.cond);
group = link->group;
link = link->next;
}
xrp_cond_unlock(&event->impl.cond);
// printf("%s, event %p! exit\n",__func__,event);
}
void xrp_impl_release_event(struct xrp_event *event)
{
xrp_cond_destroy(&event->impl.cond);
}

View File

@@ -0,0 +1,62 @@
/*
* Copyright (c) 2016 - 2018 Cadence Design Systems Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef _XRP_THREADED_QUEUE_IMPL_H
#define _XRP_THREADED_QUEUE_IMPL_H
#include "xrp_thread_impl.h"
struct xrp_queue_item {
struct xrp_queue_item *next;
};
struct xrp_request_queue {
xrp_thread thread;
xrp_cond request_queue_cond;
struct {
struct xrp_queue_item *head;
struct xrp_queue_item *tail;
} request_queue;
int exit;
int *sync_exit;
void *context;
void (*fn)(struct xrp_queue_item *rq, void *context);
};
struct xrp_event_impl {
xrp_cond cond;
};
void xrp_queue_init(struct xrp_request_queue *queue, int priority,
void *context,
void (*fn)(struct xrp_queue_item *rq, void *context));
void xrp_queue_destroy(struct xrp_request_queue *queue);
void xrp_queue_push(struct xrp_request_queue *queue,
struct xrp_queue_item *rq);
struct xrp_event *xrp_event_create(void);
void xrp_impl_broadcast_event(struct xrp_event *event, enum xrp_status status);
void xrp_impl_release_event(struct xrp_event *event);
#endif

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More